Fix ItemProxy leak
This commit is contained in:
parent
cc5d4281a2
commit
52d42e99f2
|
@ -115,11 +115,12 @@ public class ItemBlockBasic extends ItemBlock
|
|||
{
|
||||
if(stack.getItemDamage() != 6 || stack.stackTagCompound == null || !stack.stackTagCompound.hasKey("newCount"))
|
||||
{
|
||||
return new ItemStack(Mekanism.ItemProxy);
|
||||
return ItemProxy.getDead();
|
||||
}
|
||||
|
||||
ItemStack ret = stack.copy();
|
||||
ret.stackTagCompound.setInteger("itemCount", stack.stackTagCompound.getInteger("newCount"));
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -11,12 +11,13 @@ public class ItemProxy extends Item
|
|||
public ItemProxy(int id)
|
||||
{
|
||||
super(id);
|
||||
setMaxDamage(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getContainerItemStack(ItemStack stack)
|
||||
{
|
||||
return getSavedItem(stack) != null ? getSavedItem(stack) : new ItemStack(Mekanism.ItemProxy);
|
||||
return getSavedItem(stack) != null ? getSavedItem(stack) : getDead();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -64,6 +65,15 @@ public class ItemProxy extends Item
|
|||
return null;
|
||||
}
|
||||
|
||||
public static ItemStack getDead()
|
||||
{
|
||||
ItemStack stack = new ItemStack(Mekanism.ItemProxy);
|
||||
stack.stackSize = 0;
|
||||
stack.setItemDamage(2);
|
||||
|
||||
return stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIcons(IconRegister register) {}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue