3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-12-27 08:30:09 +01:00

Merge pull request #312 from Matsv/dev

Fix custom NBT for potions / spawneggs
Dieser Commit ist enthalten in:
Myles 2016-04-02 14:09:00 +01:00
Commit 233a2ba5df

Datei anzeigen

@ -147,8 +147,9 @@ public class ItemRewriter {
if (ENTTIY_NAME_TO_ID.containsKey(id.getValue())) if (ENTTIY_NAME_TO_ID.containsKey(id.getValue()))
data = ENTTIY_NAME_TO_ID.get(id.getValue()); data = ENTTIY_NAME_TO_ID.get(id.getValue());
} }
tag.remove("EntityTag");
} }
item.setTag(null); item.setTag(tag);
item.setData((short) data); item.setData((short) data);
} }
if (item.getId() == Material.POTION.getId()) { if (item.getId() == Material.POTION.getId()) {
@ -160,10 +161,12 @@ public class ItemRewriter {
if (POTION_NAME_TO_ID.containsKey(potionName)) { if (POTION_NAME_TO_ID.containsKey(potionName)) {
data = POTION_NAME_TO_ID.get(potionName); data = POTION_NAME_TO_ID.get(potionName);
} }
tag.remove("Potion");
} }
item.setTag(null); item.setTag(tag);
item.setData((short) data); item.setData((short) data);
} }
//Splash potion
if (item.getId() == 438) { if (item.getId() == 438) {
CompoundTag tag = item.getTag(); CompoundTag tag = item.getTag();
int data = 0; int data = 0;
@ -174,8 +177,9 @@ public class ItemRewriter {
if (POTION_NAME_TO_ID.containsKey(potionName)) { if (POTION_NAME_TO_ID.containsKey(potionName)) {
data = POTION_NAME_TO_ID.get(potionName) + 8192; data = POTION_NAME_TO_ID.get(potionName) + 8192;
} }
tag.remove("Potion");
} }
item.setTag(null); item.setTag(tag);
item.setData((short) data); item.setData((short) data);
} }
} }