instead of itemid use the Item system hash. for hash generation purposes should improve lookup type stuff.

This commit is contained in:
AlgorithmX2 2014-07-02 00:06:44 -05:00
parent a0c15025b7
commit 98f83ad5e4
2 changed files with 7 additions and 5 deletions

View file

@ -37,17 +37,20 @@ public class AEItemDef
static AESharedNBT lowTag = new AESharedNBT( Integer.MIN_VALUE ); static AESharedNBT lowTag = new AESharedNBT( Integer.MIN_VALUE );
static AESharedNBT highTag = new AESharedNBT( Integer.MAX_VALUE ); static AESharedNBT highTag = new AESharedNBT( Integer.MAX_VALUE );
public AEItemDef(Item it) {
item = it;
itemID = System.identityHashCode( item );
}
public AEItemDef copy() public AEItemDef copy()
{ {
AEItemDef t = new AEItemDef(); AEItemDef t = new AEItemDef( item );
t.def = def; t.def = def;
t.item = item;
t.damageValue = damageValue; t.damageValue = damageValue;
t.dspDamage = dspDamage; t.dspDamage = dspDamage;
t.maxDamage = maxDamage; t.maxDamage = maxDamage;
t.tagCompound = tagCompound; t.tagCompound = tagCompound;
t.isOre = isOre; t.isOre = isOre;
t.itemID = itemID;
return t; return t;
} }

View file

@ -57,8 +57,7 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
if ( is == null ) if ( is == null )
throw new RuntimeException( "Invalid Itemstack." ); throw new RuntimeException( "Invalid Itemstack." );
def = new AEItemDef(); def = new AEItemDef( is.getItem() );
def.item = is.getItem();
if ( def.item == null ) if ( def.item == null )
throw new RuntimeException( "This ItemStack is bad, it has a null item." ); throw new RuntimeException( "This ItemStack is bad, it has a null item." );