From my own profiling (which unfortunately I don't have a copy of) of a
situation which involved a single chicken on a hopper attached to a
diamond chest, I noticed that there was a significant slowdown related
to IronChests's item handler.
Specifically (and perhaps exacerbated by the hopper's functionality)
every time an item was "inserted", capability events would be fired and
responded to by a number of mods, resulting in slowdown. This was
compounded as it happened continuously every time it tried to insert the
egg for every single slot.
This seems to be caused by the ItemStack copy in both of the main
inventory handlers.
Looking at their Vanilla equivalents, there doesn't appear to be any
canonical reason for this (as Vanilla does not copy), and it appears as
though it is to be expected that `insertItem` will modify your itemstack
in some way.
When inserting into a full slot, the inventory is not actually modified
but markDirty() is still called. This in turn sends a block update to
all neighbours. When a diamond chest is full, attempting to insert into
it will send 100+ block updates (one for each slot). This can cause mild
performance issues.
The only extra bit of NBT the client needs here is facing. If we send
everything, then the client will know about the loot table when there is one,
which will result in this crash:
java.lang.NullPointerException: Rendering screen
at net.minecraft.tileentity.TileEntityLockableLoot.fillWithLoot(TileEntityLockableLoot.java:59)
at cpw.mods.ironchest.common.tileentity.chest.TileEntityIronChest.getStackInSlot(TileEntityIronChest.java:138)
at net.minecraft.inventory.Slot.getStack(Slot.java:81)
at net.minecraft.client.gui.inventory.GuiContainer.drawSlot(GuiContainer.java:234)
at net.minecraft.client.gui.inventory.GuiContainer.drawScreen(GuiContainer.java:116)
at cpw.mods.ironchest.client.gui.chest.GUIChest.drawScreen(GUIChest.java:100)
at net.minecraftforge.client.ForgeHooksClient.drawScreen(ForgeHooksClient.java:368)
at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1177)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1207)
at net.minecraft.client.Minecraft.run(Minecraft.java:441)
at net.minecraft.client.main.Main.main(Main.java:118)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
at GradleStart.main(GradleStart.java:25)