Package pneumaticCraft.common.tileentity

Examples of pneumaticCraft.common.tileentity.TileEntityPneumaticDoorBase


    @Override
    public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block b, int modelId, RenderBlocks renderer){
        TileEntity tile = world.getTileEntity(x, y, z);
        if(tile instanceof TileEntityPneumaticDoorBase) {
            TileEntityPneumaticDoorBase door = (TileEntityPneumaticDoorBase)tile;
            ItemStack camoStack = door.getStackInSlot(TileEntityPneumaticDoorBase.CAMO_SLOT);
            if(camoStack != null && camoStack.getItem() instanceof ItemBlock) {
                Block block = Block.getBlockFromItem(camoStack.getItem());
                if(PneumaticCraftUtils.isRenderIDCamo(block.getRenderType())) {
                    renderer.renderBlockAllFaces(block, x, y, z);
                }
View Full Code Here


    }

    @Override
    public void renderDynamic(float size, TileEntity tile, float partialTicks){
        if(tile instanceof TileEntityPneumaticDoorBase) {
            TileEntityPneumaticDoorBase door = (TileEntityPneumaticDoorBase)tile;
            ItemStack camoStack = door.getStackInSlot(TileEntityPneumaticDoorBase.CAMO_SLOT);
            boolean renderBase = true;
            if(camoStack != null && camoStack.getItem() instanceof ItemBlock) {
                Block block = Block.getBlockFromItem(camoStack.getItem());
                renderBase = !PneumaticCraftUtils.isRenderIDCamo(block.getRenderType());
            }
View Full Code Here

        return true;
    }

    @Override
    public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9){
        TileEntityPneumaticDoorBase doorBase = getDoorBase(world, x, y, z);
        if(!world.isRemote && doorBase != null && doorBase.redstoneMode == 2 && doorBase.getPressure(ForgeDirection.UNKNOWN) >= PneumaticValues.MIN_PRESSURE_PNEUMATIC_DOOR) {
            doorBase.setOpening(!doorBase.isOpening());
            return true;
        }
        return false;
    }
View Full Code Here

                powered = world.isBlockIndirectlyGettingPowered(x, y + 1, z);
            } else {
                powered = world.isBlockIndirectlyGettingPowered(x, y - 1, z);
            }
        }
        TileEntityPneumaticDoorBase doorBase = getDoorBase(world, x, y, z);
        if(!world.isRemote && doorBase != null && doorBase.getPressure(ForgeDirection.UNKNOWN) >= PneumaticValues.MIN_PRESSURE_PNEUMATIC_DOOR) {
            if(powered != doorBase.wasPowered) {
                doorBase.wasPowered = powered;
                doorBase.setOpening(powered);
            }
        }
    }
View Full Code Here

            return getDoorBase(world, x, y + 1, z);
        } else {
            ForgeDirection dir = ForgeDirection.getOrientation(meta % 6);
            TileEntity te1 = world.getTileEntity(x + dir.getRotation(ForgeDirection.UP).offsetX, y, z + dir.getRotation(ForgeDirection.UP).offsetZ);
            if(te1 instanceof TileEntityPneumaticDoorBase) {
                TileEntityPneumaticDoorBase door = (TileEntityPneumaticDoorBase)te1;
                if(door.orientation == dir.getRotation(ForgeDirection.DOWN)) {
                    return door;
                }
            }
            TileEntity te2 = world.getTileEntity(x + dir.getRotation(ForgeDirection.DOWN).offsetX, y, z + dir.getRotation(ForgeDirection.DOWN).offsetZ);
            if(te2 instanceof TileEntityPneumaticDoorBase) {
                TileEntityPneumaticDoorBase door = (TileEntityPneumaticDoorBase)te2;
                if(door.orientation == dir.getRotation(ForgeDirection.UP)) {
                    return door;
                }
            }
            return null;
View Full Code Here

    /**
     * Called when the block is placed in the world.
     */
    @Override
    public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase par5EntityLiving, ItemStack par6ItemStack){
        TileEntityPneumaticDoorBase doorBase = (TileEntityPneumaticDoorBase)world.getTileEntity(x, y, z);
        doorBase.orientation = PneumaticCraftUtils.getDirectionFacing(par5EntityLiving, false);
        updateDoorSide(doorBase);
    }
View Full Code Here

    @Override
    public boolean rotateBlock(World world, EntityPlayer player, int x, int y, int z, ForgeDirection side){
        TileEntity te = world.getTileEntity(x, y, z);
        if(te instanceof TileEntityPneumaticDoorBase) {
            TileEntityPneumaticDoorBase teDb = (TileEntityPneumaticDoorBase)te;
            int newMeta = (teDb.orientation.ordinal() + 1) % 6;
            if(newMeta == 0) newMeta = 2;
            teDb.orientation = ForgeDirection.getOrientation(newMeta);
            teDb.sendDescriptionPacket();
            return true;
        }
        return false;
    }
View Full Code Here

TOP

Related Classes of pneumaticCraft.common.tileentity.TileEntityPneumaticDoorBase

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.