Fix handling of ItemStacks using getShareTag or Capabilites (#3171)
Temporary fix, ideally we would have a way to reference the original ItemStack so we don't need to send the full NBT data to the client.
This commit is contained in:
@@ -56,6 +56,11 @@ final class AESharedItemStack implements Comparable<AESharedItemStack>
|
||||
return this.itemDamage;
|
||||
}
|
||||
|
||||
int getItemID()
|
||||
{
|
||||
return this.itemId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
@@ -104,7 +109,17 @@ final class AESharedItemStack implements Comparable<AESharedItemStack>
|
||||
return damageValue;
|
||||
}
|
||||
|
||||
return this.compareNBT( b.getDefinition() );
|
||||
final int nbt = this.compareNBT( b.getDefinition() );
|
||||
if( nbt != 0 )
|
||||
{
|
||||
return nbt;
|
||||
}
|
||||
|
||||
if( !this.itemStack.areCapsCompatible( b.getDefinition() ) )
|
||||
{
|
||||
return System.identityHashCode( this.itemStack ) - System.identityHashCode( b.getDefinition() );
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
private int compareNBT( final ItemStack b )
|
||||
|
||||
Reference in New Issue
Block a user