Rework AEItemStack (#3091)

* Use itemstack as itemdef
* HIGH_TAG/LOW_TAG should be compared both directions
* Remove getTagCompound
* Make Itemlist implementation independent
* Cache item id for performance reasons
* Add preconditions to saveguard against external meddling
* Chache itemDamage
* Remove IAEStackSearchKey for now, rename getDisplayStack
This commit is contained in:
fscan
2017-09-30 17:18:30 +02:00
committed by yueh
parent 2ed7a5598a
commit 1e15b23506
75 changed files with 559 additions and 1512 deletions
@@ -141,10 +141,7 @@ public class PacketInventoryAction extends AppEngPacket
if( baseContainer.getTargetStack() != null )
{
// Force to stack size 1 to fix a client-side display problem...
ItemStack displayIs = baseContainer.getTargetStack().getItemStack();
displayIs.setCount( 1 );
cca.getCraftingItem().putStack( displayIs );
cca.getCraftingItem().putStack( baseContainer.getTargetStack().asItemStackRepresentation() );
// This is the *actual* item that matters, not the display item above
cca.setItemToCraft( baseContainer.getTargetStack() );
}
@@ -171,7 +168,7 @@ public class PacketInventoryAction extends AppEngPacket
}
else
{
AppEng.proxy.getPlayers().get( 0 ).inventory.setItemStack( this.slotItem.getItemStack() );
AppEng.proxy.getPlayers().get( 0 ).inventory.setItemStack( this.slotItem.createItemStack() );
}
}
}
@@ -155,7 +155,7 @@ public class PacketJEIRecipe extends AppEngPacket
final IAEItemStack out = cct.useRealItems() ? Platform.poweredInsert( energy, storage, in, cct.getActionSource() ) : null;
if( out != null )
{
currentItem = out.getItemStack();
currentItem = out.createItemStack();
}
else
{
@@ -188,7 +188,7 @@ public class PacketJEIRecipe extends AppEngPacket
if( out != null )
{
currentItem = out.getItemStack();
currentItem = out.createItemStack();
}
}