mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-02 08:39:49 +01:00
Remove our workaround for NBT tag issues since Bukkit fixed it.
This commit is contained in:
parent
aee4bcd65e
commit
b99d261084
@ -108,7 +108,6 @@ public class Repair {
|
||||
is.removeEnchantment(x);
|
||||
}
|
||||
player.sendMessage(LocaleLoader.getString("Repair.Arcane.Lost"));
|
||||
clearEnchantTag(is);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -142,7 +141,6 @@ public class Repair {
|
||||
|
||||
if (newEnchants.isEmpty()) {
|
||||
player.sendMessage(LocaleLoader.getString("Repair.Arcane.Fail"));
|
||||
clearEnchantTag(is);
|
||||
}
|
||||
else if (downgraded || newEnchants.size() < enchants.size()) {
|
||||
player.sendMessage(LocaleLoader.getString("Repair.Arcane.Downgrade"));
|
||||
@ -152,33 +150,6 @@ public class Repair {
|
||||
}
|
||||
}
|
||||
|
||||
private static void clearEnchantTag(ItemStack is) {
|
||||
Object o;
|
||||
Class c;
|
||||
Field f;
|
||||
|
||||
o = is;
|
||||
c = o.getClass();
|
||||
|
||||
try {
|
||||
f = c.getDeclaredField("handle");
|
||||
f.setAccessible(true);
|
||||
o = f.get(o);
|
||||
|
||||
c = o.getClass();
|
||||
f = c.getDeclaredField("tag");
|
||||
o = f.get(o);
|
||||
|
||||
c = o.getClass();
|
||||
f = c.getDeclaredField("map");
|
||||
f.setAccessible(true);
|
||||
Map tagMap = (Map) f.get(o);
|
||||
|
||||
tagMap.remove("ench");
|
||||
}
|
||||
catch(Exception e) {}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets chance of keeping enchantment during repair.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user