@@ -38,12 +38,14 @@ final class AESharedItemStack implements Comparable<AESharedItemStack>
|
|||||||
private final ItemStack itemStack;
|
private final ItemStack itemStack;
|
||||||
private final int itemId;
|
private final int itemId;
|
||||||
private final int itemDamage;
|
private final int itemDamage;
|
||||||
|
private final int hashCode;
|
||||||
|
|
||||||
public AESharedItemStack( final ItemStack itemStack )
|
public AESharedItemStack( final ItemStack itemStack )
|
||||||
{
|
{
|
||||||
this.itemStack = itemStack;
|
this.itemStack = itemStack;
|
||||||
this.itemId = Item.getIdFromItem( itemStack.getItem() );
|
this.itemId = Item.getIdFromItem( itemStack.getItem() );
|
||||||
this.itemDamage = itemStack.getItemDamage();
|
this.itemDamage = itemStack.getItemDamage();
|
||||||
|
this.hashCode = this.makeHashCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
Bounds getBounds( final FuzzyMode fuzzy, final boolean ignoreMeta )
|
Bounds getBounds( final FuzzyMode fuzzy, final boolean ignoreMeta )
|
||||||
@@ -69,7 +71,7 @@ final class AESharedItemStack implements Comparable<AESharedItemStack>
|
|||||||
@Override
|
@Override
|
||||||
public int hashCode()
|
public int hashCode()
|
||||||
{
|
{
|
||||||
return Objects.hash( this.itemId, this.itemDamage, this.itemStack.hasTagCompound() ? this.itemStack.getTagCompound() : 0 );
|
return this.hashCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -144,6 +146,11 @@ final class AESharedItemStack implements Comparable<AESharedItemStack>
|
|||||||
return System.identityHashCode( this.itemStack.getTagCompound() ) - System.identityHashCode( b.getTagCompound() );
|
return System.identityHashCode( this.itemStack.getTagCompound() ) - System.identityHashCode( b.getTagCompound() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private int makeHashCode()
|
||||||
|
{
|
||||||
|
return Objects.hash( this.itemId, this.itemDamage, this.itemStack.hasTagCompound() ? this.itemStack.getTagCompound() : 0 );
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates the lower and upper bounds for a specific shared itemstack.
|
* Creates the lower and upper bounds for a specific shared itemstack.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user