Fixed #179 - Right clicking engineering table with item
This commit is contained in:
parent
62ce220dae
commit
a298d8eedb
2 changed files with 9 additions and 10 deletions
|
@ -111,7 +111,7 @@ public class BlockEngineeringTable extends BlockRIRotatable
|
||||||
@Override
|
@Override
|
||||||
public boolean onMachineActivated(World world, int x, int y, int z, EntityPlayer player, int hitSide, float hitX, float hitY, float hitZ)
|
public boolean onMachineActivated(World world, int x, int y, int z, EntityPlayer player, int hitSide, float hitX, float hitY, float hitZ)
|
||||||
{
|
{
|
||||||
if(player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() instanceof ItemHammer)
|
if (player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() instanceof ItemHammer)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -163,7 +163,7 @@ public class BlockEngineeringTable extends BlockRIRotatable
|
||||||
/**
|
/**
|
||||||
* Take out of engineering table.
|
* Take out of engineering table.
|
||||||
*/
|
*/
|
||||||
if (!world.isRemote && player.inventory.getCurrentItem() == null)
|
if (!world.isRemote)
|
||||||
{
|
{
|
||||||
tile.setPlayerInventory(player.inventory);
|
tile.setPlayerInventory(player.inventory);
|
||||||
|
|
||||||
|
@ -188,6 +188,8 @@ public class BlockEngineeringTable extends BlockRIRotatable
|
||||||
|
|
||||||
tile.setPlayerInventory(null);
|
tile.setPlayerInventory(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,14 +45,11 @@ public abstract class RenderItemOverlayTile extends TileEntitySpecialRenderer
|
||||||
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
||||||
boolean isLooking = false;
|
boolean isLooking = false;
|
||||||
|
|
||||||
if (player.isSneaking())
|
MovingObjectPosition objectPosition = player.rayTrace(8, 1);
|
||||||
{
|
|
||||||
MovingObjectPosition objectPosition = player.rayTrace(8, 1);
|
|
||||||
|
|
||||||
if (objectPosition != null)
|
if (objectPosition != null)
|
||||||
{
|
{
|
||||||
isLooking = objectPosition.blockX == tileEntity.xCoord && objectPosition.blockY == tileEntity.yCoord && objectPosition.blockZ == tileEntity.zCoord;
|
isLooking = objectPosition.blockX == tileEntity.xCoord && objectPosition.blockY == tileEntity.yCoord && objectPosition.blockZ == tileEntity.zCoord;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < (matrixX * matrixZ); i++)
|
for (int i = 0; i < (matrixX * matrixZ); i++)
|
||||||
|
|
Loading…
Reference in a new issue