Package pneumaticCraft.common.tileentity

Examples of pneumaticCraft.common.tileentity.TileEntityOmnidirectionalHopper


    }

    @Override
    public void renderStatic(float size, TileEntity tile){
        GL11.glPushMatrix();
        TileEntityOmnidirectionalHopper te = null;

        if(tile instanceof TileEntityOmnidirectionalHopper) {
            te = (TileEntityOmnidirectionalHopper)tile;
            PneumaticCraftUtils.rotateMatrixByMetadata(te.getDirection().getOpposite().ordinal());
        } else {
            PneumaticCraftUtils.rotateMatrixByMetadata(ForgeDirection.DOWN.ordinal());
        }

        Wall1.render(size);
        Wall2.render(size);
        Wall3.render(size);
        Wall4.render(size);
        Funnel.render(size);
        Funnel2.render(size);
        GL11.glPopMatrix();

        if(te != null) {
            PneumaticCraftUtils.rotateMatrixByMetadata(te.getBlockMetadata());
        } else {
            PneumaticCraftUtils.rotateMatrixByMetadata(ForgeDirection.DOWN.ordinal());
        }
        InserterBottom.render(size);
    }
View Full Code Here


    @Override
    public boolean rotateBlock(World world, EntityPlayer player, int x, int y, int z, ForgeDirection face){
        TileEntity te = world.getTileEntity(x, y, z);
        if(te instanceof TileEntityOmnidirectionalHopper) {
            TileEntityOmnidirectionalHopper teOh = (TileEntityOmnidirectionalHopper)te;
            if(player != null && player.isSneaking()) {
                int newMeta = (world.getBlockMetadata(x, y, z) + 1) % 6;
                if(newMeta == teOh.getDirection().ordinal()) newMeta = (newMeta + 1) % 6;
                world.setBlockMetadataWithNotify(x, y, z, newMeta, 3);
            } else {
                int newRotation = (teOh.getDirection().ordinal() + 1) % 6;
                if(newRotation == world.getBlockMetadata(x, y, z)) newRotation = (newRotation + 1) % 6;
                teOh.setDirection(ForgeDirection.getOrientation(newRotation));
                teOh.sendDescriptionPacket();
            }
            return true;
        }
        return false;
    }
View Full Code Here

TOP

Related Classes of pneumaticCraft.common.tileentity.TileEntityOmnidirectionalHopper

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.