mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-09 19:49:35 +01:00
SPIGOT-3381: Save older serialized enchants
By: md_5 <git@md-5.net>
This commit is contained in:
parent
71404da149
commit
1396c4c1ec
1 changed files with 6 additions and 1 deletions
|
@ -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());
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue