Search in sources :

Example 1 with RenderBlockTarget

use of pneumaticCraft.client.render.pneumaticArmor.RenderBlockTarget in project PneumaticCraft by MineMaarten.

the class HackableHandler method isInDisplayCooldown.

private static boolean isInDisplayCooldown(IHackableBlock hackableBlock, IBlockAccess world, int x, int y, int z, EntityPlayer player) {
    if (player.worldObj.isRemote) {
        RenderBlockTarget target = HUDHandler.instance().getSpecificRenderer(BlockTrackUpgradeHandler.class).getTargetForCoord(x, y, z);
        int requiredHackTime = hackableBlock.getHackTime(world, x, y, z, player);
        return target != null && target.getHackTime() >= requiredHackTime && target.getHackTime() <= requiredHackTime + 20;
    } else {
        return false;
    }
}
Also used : RenderBlockTarget(pneumaticCraft.client.render.pneumaticArmor.RenderBlockTarget) BlockTrackUpgradeHandler(pneumaticCraft.client.render.pneumaticArmor.BlockTrackUpgradeHandler)

Example 2 with RenderBlockTarget

use of pneumaticCraft.client.render.pneumaticArmor.RenderBlockTarget in project PneumaticCraft by MineMaarten.

the class PacketHackingBlockStart method handleClientSide.

@Override
public void handleClientSide(PacketHackingBlockStart message, EntityPlayer player) {
    CommonHUDHandler.getHandlerForPlayer(player).setHackedBlock(new WorldAndCoord(player.worldObj, message.x, message.y, message.z));
    RenderBlockTarget target = HUDHandler.instance().getSpecificRenderer(BlockTrackUpgradeHandler.class).getTargetForCoord(message.x, message.y, message.z);
    if (target != null)
        target.onHackConfirmServer();
}
Also used : RenderBlockTarget(pneumaticCraft.client.render.pneumaticArmor.RenderBlockTarget) BlockTrackUpgradeHandler(pneumaticCraft.client.render.pneumaticArmor.BlockTrackUpgradeHandler) WorldAndCoord(pneumaticCraft.common.util.WorldAndCoord)

Aggregations

BlockTrackUpgradeHandler (pneumaticCraft.client.render.pneumaticArmor.BlockTrackUpgradeHandler)2 RenderBlockTarget (pneumaticCraft.client.render.pneumaticArmor.RenderBlockTarget)2 WorldAndCoord (pneumaticCraft.common.util.WorldAndCoord)1