NMS changes for 1.12

This commit is contained in:
Tuke-Nuke 2017-06-09 06:15:24 -03:00
parent 4172d9329a
commit e173314428

View File

@ -211,7 +211,7 @@ public class NMS_v1_12_R1 implements NMSInterface {
@Override @Override
public Object getIndex(Object nbtList, int index) { public Object getIndex(Object nbtList, int index) {
if (nbtList instanceof NBTTagList && index >= 0 && index < ((NBTTagList) nbtList).size()) { if (nbtList instanceof NBTTagList && index >= 0 && index < ((NBTTagList) nbtList).size()) {
NBTBase value = ((NBTTagList) nbtList).h(index); NBTBase value = ((NBTTagList) nbtList).i(index);
if (value instanceof NBTTagByte) { if (value instanceof NBTTagByte) {
return ((NBTTagByte) value).g(); //Byte stored inside a NBTNumber return ((NBTTagByte) value).g(); //Byte stored inside a NBTNumber
} else if (value instanceof NBTTagShort) { } else if (value instanceof NBTTagShort) {
@ -485,7 +485,7 @@ public class NMS_v1_12_R1 implements NMSInterface {
public NBTTagCompound getEntityNBT(Entity entity) { public NBTTagCompound getEntityNBT(Entity entity) {
net.minecraft.server.v1_12_R1.Entity nmsEntity = ((CraftEntity) entity).getHandle(); net.minecraft.server.v1_12_R1.Entity nmsEntity = ((CraftEntity) entity).getHandle();
NBTTagCompound NBT = new NBTTagCompound(); NBTTagCompound NBT = new NBTTagCompound();
nmsEntity.e(NBT); nmsEntity.save(NBT);
return NBT; return NBT;
} }