Read FlatItem correctly & fix incoming Item type

This commit is contained in:
Matsv 2018-01-04 15:41:10 +01:00
parent 444eabcebf
commit 9dfbe3b263
3 changed files with 3 additions and 6 deletions

View File

@ -17,6 +17,7 @@ public class FlatItemType extends BaseItemType {
} else {
Item item = new Item();
item.setId(id);
item.setAmount(buffer.readByte());
item.setTag(Type.NBT.read(buffer));
return item;
}

View File

@ -55,9 +55,5 @@ public class MetadataRewriter {
}
}
}
for (Metadata metadata : metadatas) {
System.out.println(metadata.getMetaType() instanceof MetaType1_13);
}
}
}

View File

@ -137,7 +137,7 @@ public class InventoryPackets {
handler(new PacketHandler() {
@Override
public void handle(PacketWrapper wrapper) throws Exception {
Item item = wrapper.get(Type.FLAT_ITEM, 0);
Item item = wrapper.get(Type.ITEM, 0);
toServer(item);
}
});
@ -155,7 +155,7 @@ public class InventoryPackets {
handler(new PacketHandler() {
@Override
public void handle(PacketWrapper wrapper) throws Exception {
Item item = wrapper.get(Type.FLAT_ITEM, 0);
Item item = wrapper.get(Type.ITEM, 0);
toServer(item);
}
});