Package pneumaticCraft.common.tileentity

Examples of pneumaticCraft.common.tileentity.TileEntityElevatorBase


    }

    @Override
    public void renderDynamic(float size, TileEntity te, float partialTicks){
        if(te instanceof TileEntityElevatorBase) {
            TileEntityElevatorBase tile = (TileEntityElevatorBase)te;
            renderModel(1 / 16F, tile.oldExtension + (tile.extension - tile.oldExtension) * partialTicks, tile.sidesConnected);
        } else {
            renderModel(1 / 16F, 0, new boolean[]{false, false, false, false, false, false});
        }
    }
View Full Code Here


    }

    private void setSurroundingElevators(World world, int x, int y, int z, int floor){
        for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
            if(dir != ForgeDirection.UP && dir != ForgeDirection.DOWN) {
                TileEntityElevatorBase elevator = getElevatorBase(world, x + dir.offsetX, y - 2, z + dir.offsetZ);
                if(elevator != null) {
                    elevator.goToFloor(floor);
                }
            }
        }
    }
View Full Code Here

    }

    private void updateElevatorButtons(World world, int x, int y, int z){
        for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
            if(dir != ForgeDirection.UP && dir != ForgeDirection.DOWN) {
                TileEntityElevatorBase elevator = getElevatorBase(world, x + dir.offsetX, y - 2, z + dir.offsetZ);
                if(elevator != null) {
                    elevator.updateFloors();
                }
            }
        }
    }
View Full Code Here

        }
    }

    private TileEntityElevatorBase getElevatorBase(World world, int x, int y, int z){
        Block block = world.getBlock(x, y, z);
        TileEntityElevatorBase elevator = null;
        if(block == Blockss.elevatorFrame) {
            elevator = ((BlockElevatorFrame)Blockss.elevatorFrame).getElevatorTE(world, x, y, z);
        }
        if(block == Blockss.elevatorBase) {
            TileEntity te = world.getTileEntity(x, y, z);
View Full Code Here

    }

    @Override
    public void onBlockAdded(World world, int x, int y, int z){
        super.onBlockAdded(world, x, y, z);
        TileEntityElevatorBase elevatorBase = getElevatorTE(world, x, y, z);
        if(elevatorBase != null) {
            elevatorBase.updateMaxElevatorHeight();
        }
    }
View Full Code Here

    @Override
    public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity){
        // if(world.getBlockMetadata(x, y, z) > 0) return;

        TileEntityElevatorBase te = getElevatorTE(world, x, y, z);
        if(te != null && te.extension - te.oldExtension > 0F) {// when the
                                                               // block's
                                                               // attached to an
                                                               // elevator and
                                                               // the elevator
View Full Code Here

        }
        return (TileEntityElevatorBase)world.getTileEntity(x, y + i, z);
    }

    private float getElevatorBlockHeight(World world, int x, int y, int z){
        TileEntityElevatorBase te = getElevatorTE(world, x, y, z);
        if(te == null) return 0F;
        float blockHeight = te.extension - (y - te.yCoord) + 1;
        // System.out.println("blockHeight (" + x + ", " + y + ", " + z + "): " + blockHeight);
        // + blockHeight);
        if(blockHeight < 0F) return 0F;
View Full Code Here

        }
    }

    @Override
    public void breakBlock(World world, int x, int y, int z, Block block, int meta){
        TileEntityElevatorBase elevatorBase = getElevatorTE(world, x, y, z);
        if(elevatorBase != null) {
            elevatorBase.updateMaxElevatorHeight();
        }
        super.breakBlock(world, x, y, z, block, meta);
    }
View Full Code Here

    }

    @Override
    public void onBlockAdded(World world, int x, int y, int z){
        super.onBlockAdded(world, x, y, z);
        TileEntityElevatorBase elevatorBase = getCoreTileEntity(world, x, y, z);
        if(elevatorBase != null) {
            elevatorBase.updateMaxElevatorHeight();
        }
    }
View Full Code Here

    @Override
    public void onNeighborBlockChange(World world, int x, int y, int z, Block block){
        super.onNeighborBlockChange(world, x, y, z, block);
        TileEntity te = world.getTileEntity(x, y, z);
        if(te instanceof TileEntityElevatorBase) {
            TileEntityElevatorBase thisTe = (TileEntityElevatorBase)te;
            if(thisTe.isCoreElevator()) {
                TileEntityElevatorBase teAbove = getCoreTileEntity(world, x, y, z);
                if(teAbove != null && teAbove != thisTe) {
                    for(int i = 0; i < thisTe.getSizeInventory(); i++) {
                        ItemStack item = thisTe.getStackInSlot(i);
                        if(item != null) {
                            ItemStack leftover = TileEntityHopper.func_145889_a(teAbove, item, 0);
                            thisTe.setInventorySlotContents(i, null);
                            if(leftover != null) {
                                EntityItem entity = new EntityItem(world, teAbove.xCoord + 0.5, teAbove.yCoord + 1.5, teAbove.zCoord + 0.5, leftover);
                                world.spawnEntityInWorld(entity);
                            }
                        }
                    }
                }
            }
            thisTe.updateConnections();
        }
        TileEntityElevatorBase elevatorBase = getCoreTileEntity(world, x, y, z);
        if(elevatorBase != null) elevatorBase.updateRedstoneInputLevel();
    }
View Full Code Here

TOP

Related Classes of pneumaticCraft.common.tileentity.TileEntityElevatorBase

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.