Fixed Crate item import into crate block
My check to prevent crates from entering crates also keep them from imputing into each other.
This commit is contained in:
parent
87cd116996
commit
613a072a3b
1 changed files with 4 additions and 9 deletions
|
@ -89,8 +89,8 @@ public class BlockCrate extends BlockALMachine
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float hitX, float hitY, float hitZ)
|
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float hitX, float hitY, float hitZ)
|
||||||
{
|
{
|
||||||
if (super.onBlockActivated(world, x, y, z, entityPlayer, side, hitX, hitY, hitZ))
|
if (super.onBlockActivated(world, x, y, z, entityPlayer, side, hitX, hitY, hitZ)){
|
||||||
return true;
|
return true;}
|
||||||
|
|
||||||
if (!world.isRemote)
|
if (!world.isRemote)
|
||||||
{
|
{
|
||||||
|
@ -101,12 +101,7 @@ public class BlockCrate extends BlockALMachine
|
||||||
/**
|
/**
|
||||||
* Make double clicking input all stacks.
|
* Make double clicking input all stacks.
|
||||||
*/
|
*/
|
||||||
boolean allMode = false;
|
boolean allMode = (world.getWorldTime() - tileEntity.prevClickTime < 10);
|
||||||
|
|
||||||
if (world.getWorldTime() - tileEntity.prevClickTime < 10)
|
|
||||||
{
|
|
||||||
allMode = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
tileEntity.prevClickTime = world.getWorldTime();
|
tileEntity.prevClickTime = world.getWorldTime();
|
||||||
ItemStack current = entityPlayer.inventory.getCurrentItem();
|
ItemStack current = entityPlayer.inventory.getCurrentItem();
|
||||||
|
@ -114,7 +109,7 @@ public class BlockCrate extends BlockALMachine
|
||||||
// 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)
|
if (current != null && (current.getMaxStackSize() > 1 || current.itemID == this.blockID))
|
||||||
{
|
{
|
||||||
this.tryInsert(tileEntity, entityPlayer, allMode);
|
this.tryInsert(tileEntity, entityPlayer, allMode);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue