geforkt von Mirrors/Paper
SPIGOT-7857: Improve ItemMeta block data deserialization
By: blablubbabc <lukas@wirsindwir.de>
Dieser Commit ist enthalten in:
Ursprung
8c7a0e888f
Commit
59b86b9837
@ -519,10 +519,17 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
if (blockData != null) {
|
||||
Map<String, String> mapBlockData = new HashMap<>();
|
||||
|
||||
if (blockData instanceof Map) {
|
||||
for (Entry<?, ?> entry : ((Map<?, ?>) blockData).entrySet()) {
|
||||
mapBlockData.put(entry.getKey().toString(), entry.getValue().toString());
|
||||
}
|
||||
} else {
|
||||
// Legacy pre 1.20.5:
|
||||
NBTTagCompound nbtBlockData = (NBTTagCompound) CraftNBTTagConfigSerializer.deserialize(blockData);
|
||||
for (String key : nbtBlockData.getAllKeys()) {
|
||||
mapBlockData.put(key, nbtBlockData.getString(key));
|
||||
}
|
||||
}
|
||||
|
||||
this.blockData = mapBlockData;
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren