Alex-hawks / Electric-Expansion

Electric Expansion, Universal Electricity expanded! Adds more cables, energy storage and more!
10 stars 7 forks source link

Description: Fixes issues that arise from trying to deserialize an ItemStack from a TileEntity NBT compound tag #45

Closed shartte closed 11 years ago

shartte commented 11 years ago

Fixes issues that arise from trying to deserialize an ItemStack from a TileEntity NBT compound tag.

TileEntities write their own id as "id" to the tag, while ItemStack expects "id" to be a short. This causes a crash report internally, which causes certain servers (mcpc+/bukkit) to create a costly stack trace, greatly reducing performance on chunk load. This change tries to fix that issue by moving the item stack properties over to their own compound nbt tag (as a child of the tile entities one). Compatibility with older worlds is kept by checking whether the "id" property is a short or not.