Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-18 04:20:08 +01:00
SPIGOT-3381: Save older serialized enchants
Dieser Commit ist enthalten in:
Ursprung
d7cd7275f2
Commit
477fb2bb72
@ -431,8 +431,13 @@ class CraftMetaItem implements ItemMeta, Repairable {
|
|||||||
|
|
||||||
Map<Enchantment, Integer> enchantments = new HashMap<Enchantment, Integer>(ench.size());
|
Map<Enchantment, Integer> enchantments = new HashMap<Enchantment, Integer>(ench.size());
|
||||||
for (Map.Entry<?, ?> entry : ench.entrySet()) {
|
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)) {
|
if ((enchantment != null) && (entry.getValue() instanceof Integer)) {
|
||||||
enchantments.put(enchantment, (Integer) entry.getValue());
|
enchantments.put(enchantment, (Integer) entry.getValue());
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren