Speed boost for NBT / AE Items.
This commit is contained in:
parent
d278f04a8c
commit
ef86454c44
3 changed files with 7 additions and 10 deletions
|
@ -77,7 +77,9 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
|
||||||
def.dspDamage = is.getItemDamageForDisplay();
|
def.dspDamage = is.getItemDamageForDisplay();
|
||||||
def.maxDamage = is.getMaxDamage();
|
def.maxDamage = is.getMaxDamage();
|
||||||
|
|
||||||
def.tagCompound = (IAETagCompound) AESharedNBT.getSharedTagCompound( is );
|
NBTTagCompound tagCompound = is.getTagCompound();
|
||||||
|
if ( tagCompound != null )
|
||||||
|
def.tagCompound = (IAETagCompound) AESharedNBT.getSharedTagCompound( tagCompound, is );
|
||||||
|
|
||||||
stackSize = is.stackSize;
|
stackSize = is.stackSize;
|
||||||
setCraftable( false );
|
setCraftable( false );
|
||||||
|
@ -88,12 +90,10 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
|
||||||
|
|
||||||
public static AEItemStack create(Object a)
|
public static AEItemStack create(Object a)
|
||||||
{
|
{
|
||||||
if ( a == null )
|
|
||||||
return null;
|
|
||||||
if ( a instanceof IAEItemStack )
|
|
||||||
((IAEItemStack) a).copy();
|
|
||||||
if ( a instanceof ItemStack )
|
if ( a instanceof ItemStack )
|
||||||
return new AEItemStack( (ItemStack) a );
|
return new AEItemStack( (ItemStack) a );
|
||||||
|
if ( a instanceof IAEItemStack )
|
||||||
|
((IAEItemStack) a).copy();
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -129,11 +129,8 @@ public class AESharedNBT extends NBTTagCompound implements IAETagCompound
|
||||||
/*
|
/*
|
||||||
* Returns an NBT Compound that is used for accelerating comparisons.
|
* Returns an NBT Compound that is used for accelerating comparisons.
|
||||||
*/
|
*/
|
||||||
synchronized public static NBTTagCompound getSharedTagCompound(ItemStack s)
|
synchronized public static NBTTagCompound getSharedTagCompound(NBTTagCompound tagCompound, ItemStack s)
|
||||||
{
|
{
|
||||||
NBTTagCompound tagCompound = s.getTagCompound();
|
|
||||||
if ( tagCompound == null )
|
|
||||||
return null;
|
|
||||||
if ( tagCompound.hasNoTags() )
|
if ( tagCompound.hasNoTags() )
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package appeng.util.item;
|
package appeng.util.item;
|
||||||
|
|
||||||
import appeng.util.Platform;
|
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
import appeng.util.Platform;
|
||||||
|
|
||||||
public class SharedSearchObject
|
public class SharedSearchObject
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue