geforkt von Mirrors/Paper
SPIGOT-6961: Actually return a copy of the ItemMeta
By: DerFrZocker <derrieple@gmail.com>
Dieser Commit ist enthalten in:
Ursprung
5abfb14c7f
Commit
cac50e9c55
@ -29,7 +29,7 @@ public class CraftMetaArmorStand extends CraftMetaItem {
|
|||||||
super(tag);
|
super(tag);
|
||||||
|
|
||||||
if (tag.contains(ENTITY_TAG.NBT)) {
|
if (tag.contains(ENTITY_TAG.NBT)) {
|
||||||
entityTag = tag.getCompound(ENTITY_TAG.NBT);
|
entityTag = tag.getCompound(ENTITY_TAG.NBT).copy();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ public class CraftMetaAxolotlBucket extends CraftMetaItem implements AxolotlBuck
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (tag.contains(ENTITY_TAG.NBT)) {
|
if (tag.contains(ENTITY_TAG.NBT)) {
|
||||||
entityTag = tag.getCompound(ENTITY_TAG.NBT);
|
entityTag = tag.getCompound(ENTITY_TAG.NBT).copy();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ public class CraftMetaBlockState extends CraftMetaItem implements BlockStateMeta
|
|||||||
this.material = material;
|
this.material = material;
|
||||||
|
|
||||||
if (tag.contains(BLOCK_ENTITY_TAG.NBT, CraftMagicNumbers.NBT.TAG_COMPOUND)) {
|
if (tag.contains(BLOCK_ENTITY_TAG.NBT, CraftMagicNumbers.NBT.TAG_COMPOUND)) {
|
||||||
blockEntityTag = tag.getCompound(BLOCK_ENTITY_TAG.NBT);
|
blockEntityTag = tag.getCompound(BLOCK_ENTITY_TAG.NBT).copy();
|
||||||
} else {
|
} else {
|
||||||
blockEntityTag = null;
|
blockEntityTag = null;
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,7 @@ public class CraftMetaEntityTag extends CraftMetaItem {
|
|||||||
super(tag);
|
super(tag);
|
||||||
|
|
||||||
if (tag.contains(ENTITY_TAG.NBT)) {
|
if (tag.contains(ENTITY_TAG.NBT)) {
|
||||||
entityTag = tag.getCompound(ENTITY_TAG.NBT);
|
entityTag = tag.getCompound(ENTITY_TAG.NBT).copy();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -349,7 +349,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
|||||||
customModelData = tag.getInt(CUSTOM_MODEL_DATA.NBT);
|
customModelData = tag.getInt(CUSTOM_MODEL_DATA.NBT);
|
||||||
}
|
}
|
||||||
if (tag.contains(BLOCK_DATA.NBT, CraftMagicNumbers.NBT.TAG_COMPOUND)) {
|
if (tag.contains(BLOCK_DATA.NBT, CraftMagicNumbers.NBT.TAG_COMPOUND)) {
|
||||||
blockData = tag.getCompound(BLOCK_DATA.NBT);
|
blockData = tag.getCompound(BLOCK_DATA.NBT).copy();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.enchantments = buildEnchantments(tag, ENCHANTMENTS);
|
this.enchantments = buildEnchantments(tag, ENCHANTMENTS);
|
||||||
@ -372,14 +372,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
|||||||
NBTTagCompound compound = tag.getCompound(BUKKIT_CUSTOM_TAG.NBT);
|
NBTTagCompound compound = tag.getCompound(BUKKIT_CUSTOM_TAG.NBT);
|
||||||
Set<String> keys = compound.getAllKeys();
|
Set<String> keys = compound.getAllKeys();
|
||||||
for (String key : keys) {
|
for (String key : keys) {
|
||||||
persistentDataContainer.put(key, compound.get(key));
|
persistentDataContainer.put(key, compound.get(key).copy());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Set<String> keys = tag.getAllKeys();
|
Set<String> keys = tag.getAllKeys();
|
||||||
for (String key : keys) {
|
for (String key : keys) {
|
||||||
if (!getHandledTags().contains(key)) {
|
if (!getHandledTags().contains(key)) {
|
||||||
unhandledTags.put(key, tag.get(key));
|
unhandledTags.put(key, tag.get(key).copy());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,7 @@ public class CraftMetaSpawnEgg extends CraftMetaItem implements SpawnEggMeta {
|
|||||||
super(tag);
|
super(tag);
|
||||||
|
|
||||||
if (tag.contains(ENTITY_TAG.NBT)) {
|
if (tag.contains(ENTITY_TAG.NBT)) {
|
||||||
entityTag = tag.getCompound(ENTITY_TAG.NBT);
|
entityTag = tag.getCompound(ENTITY_TAG.NBT).copy();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ class CraftMetaTropicalFishBucket extends CraftMetaItem implements TropicalFishB
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (tag.contains(ENTITY_TAG.NBT)) {
|
if (tag.contains(ENTITY_TAG.NBT)) {
|
||||||
entityTag = tag.getCompound(ENTITY_TAG.NBT);
|
entityTag = tag.getCompound(ENTITY_TAG.NBT).copy();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren