edited crate item interaction behavior
It wasn't really checking if the item it was interacting with was a crate, null, or unstackable before trying to insert or eject.
This commit is contained in:
parent
1b26c2f407
commit
2d27765897
1 changed files with 8 additions and 2 deletions
|
@ -29,6 +29,7 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||||
public class BlockCrate extends BlockALMachine
|
public class BlockCrate extends BlockALMachine
|
||||||
{
|
{
|
||||||
Icon crate_icon;
|
Icon crate_icon;
|
||||||
|
|
||||||
public BlockCrate(int id, int texture)
|
public BlockCrate(int id, int texture)
|
||||||
{
|
{
|
||||||
super(id, UniversalElectricity.machine);
|
super(id, UniversalElectricity.machine);
|
||||||
|
@ -109,17 +110,22 @@ public class BlockCrate extends BlockALMachine
|
||||||
}
|
}
|
||||||
|
|
||||||
tileEntity.prevClickTime = world.getWorldTime();
|
tileEntity.prevClickTime = world.getWorldTime();
|
||||||
|
ItemStack current = entityPlayer.inventory.getCurrentItem();
|
||||||
|
|
||||||
// Add items
|
// Add items
|
||||||
if (side == 1 || (side > 1 && hitY > 0.5) || !entityPlayer.capabilities.isCreativeMode)
|
if (side == 1 || (side > 1 && hitY > 0.5) || !entityPlayer.capabilities.isCreativeMode)
|
||||||
|
{
|
||||||
|
if (current != null && current.getMaxStackSize() > 1 && current.itemID != this.blockID)
|
||||||
{
|
{
|
||||||
this.tryInsert(tileEntity, entityPlayer, allMode);
|
this.tryInsert(tileEntity, entityPlayer, allMode);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// Remove items
|
// Remove items
|
||||||
else if (side == 0 || (side > 1 && hitY <= 0.5))
|
else if (side == 0 || (side > 1 && hitY <= 0.5))
|
||||||
{
|
{
|
||||||
this.tryEject(tileEntity, entityPlayer, allMode);
|
this.tryEject(tileEntity, entityPlayer, allMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue