Search in sources :

Example 1 with ItemMapLocation

use of buildcraft.core.ItemMapLocation in project LogisticsPipes by RS485.

the class BuildCraftProxy method handleBCClickOnPipe.

@Override
public IBCClickResult handleBCClickOnPipe(World world, int x, int y, int z, EntityPlayer player, int side, float xOffset, float yOffset, float zOffset, CoreUnroutedPipe pipe) {
    boolean result = BuildCraftTransport.genericPipeBlock.onBlockActivated(world, x, y, z, player, side, xOffset, yOffset, zOffset);
    //Again because not all changes have been applied before the call inside the BC method is made.
    world.notifyBlocksOfNeighborChange(x, y, z, LogisticsPipes.LogisticsPipeBlock);
    boolean block = false;
    if (!result) {
        ItemStack currentItem = player.getCurrentEquippedItem();
        if (currentItem != null) {
            if (currentItem.getItem() == Items.sign) {
                block = true;
            } else if (currentItem.getItem() instanceof ItemPipe) {
                block = true;
            } else if (currentItem.getItem() instanceof ItemGateCopier) {
                block = true;
            } else if (currentItem.getItem() instanceof ItemMapLocation) {
                block = true;
            } else if (currentItem.getItem() instanceof ItemRobot) {
                result = checkRobot(world, x, y, z, player, currentItem);
            }
        }
    }
    final boolean fResult = result;
    final boolean fBlock = block;
    return new IBCClickResult() {

        @Override
        public boolean handled() {
            return fResult;
        }

        @Override
        public boolean blocked() {
            return fBlock;
        }
    };
}
Also used : ItemGateCopier(buildcraft.transport.ItemGateCopier) ItemMapLocation(buildcraft.core.ItemMapLocation) IBCClickResult(logisticspipes.proxy.buildcraft.subproxies.IBCClickResult) ItemPipe(buildcraft.transport.ItemPipe) ItemStack(net.minecraft.item.ItemStack) ItemRobot(buildcraft.robotics.ItemRobot)

Aggregations

ItemMapLocation (buildcraft.core.ItemMapLocation)1 ItemRobot (buildcraft.robotics.ItemRobot)1 ItemGateCopier (buildcraft.transport.ItemGateCopier)1 ItemPipe (buildcraft.transport.ItemPipe)1 IBCClickResult (logisticspipes.proxy.buildcraft.subproxies.IBCClickResult)1 ItemStack (net.minecraft.item.ItemStack)1