use of gregtech.api.metatileentity.MetaTileEntityHolder in project GregTech by GregTechCE.
the class WrenchBehaviour method onItemUseFirst.
@Override
public EnumActionResult onItemUseFirst(EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ, EnumHand hand) {
if (!world.isRemote && !world.isAirBlock(pos)) {
ItemStack stack = player.getHeldItem(hand);
TileEntity tileEntity = world.getTileEntity(pos);
if (tileEntity instanceof MetaTileEntityHolder)
// machines handle wrench click manually
return EnumActionResult.PASS;
if (world.getBlockState(pos).getBlock().rotateBlock(world, pos, side)) {
GTUtility.doDamageItem(stack, this.cost, false);
return EnumActionResult.SUCCESS;
}
}
return EnumActionResult.PASS;
}
Aggregations