summaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
index 23f987bb..ec923673 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java
@@ -431,8 +431,13 @@ class CraftMetaItem implements ItemMeta, Repairable {
Map<Enchantment, Integer> enchantments = new HashMap<Enchantment, Integer>(ench.size());
for (Map.Entry<?, ?> entry : ench.entrySet()) {
- Enchantment enchantment = Enchantment.getByName(entry.getKey().toString());
+ // Doctor older enchants
+ String enchantKey = entry.getKey().toString();
+ if (enchantKey.equals("SWEEPING")) {
+ enchantKey = "SWEEPING_EDGE";
+ }
+ Enchantment enchantment = Enchantment.getByName(enchantKey);
if ((enchantment != null) && (entry.getValue() instanceof Integer)) {
enchantments.put(enchantment, (Integer) entry.getValue());
}