Package electricexpansion.common.tile

Examples of electricexpansion.common.tile.TileEntityTransformer


    }
   
    @Override
    public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float var5)
    {
        TileEntityTransformer te = (TileEntityTransformer) tileEntity;
        int metadata = tileEntity.worldObj.getBlockMetadata(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord);
        String status = StatCollector.translateToLocal(te.stepUp ? "function.transformer.stepUp" : "function.transformer.stepDown");
        String name = StatCollector.translateToLocal(ElectricExpansionItems.blockTransformer.getUnlocalizedName() + "." + (int) Math.pow(2, metadata +1) + "x.name");
       
        EntityPlayer player = Minecraft.getMinecraft().thePlayer;
        MovingObjectPosition movingPosition = player.rayTrace(5, 1f);
       
       
       
        if (movingPosition != null)
        {
            if (new Vector3(tileEntity).equals(new Vector3(movingPosition)))
            {
                RenderFloatingText.renderFloatingText(status, (float) ((float) x + .5), (float) y - 1, (float) ((float) z + .5));
                RenderFloatingText.renderFloatingText(name, (float) ((float) x + .5), (float) y - .70F, (float) ((float) z + .5));
            }
        }
       
        GL11.glPushMatrix();
        GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F);
        GL11.glScalef(1.0F, -1F, -1F);
        GL11.glRotatef(90, 0.0F, 1.0F, 0.0F);
       
        switch (metadata)
        {
            case 0:
                this.textureToUse = TextureLocations.MODEL_TRANSFORMER_1;
                break;
            case 1:
                this.textureToUse = TextureLocations.MODEL_TRANSFORMER_2;
                break;
            case 2:
                this.textureToUse = TextureLocations.MODEL_TRANSFORMER_3;
                break;
        }

        this.bindTexture(this.textureToUse);
        this.model.render(null, 0, 0, 0, 0, 0, 0.0625F);
        this.model.renderCores(te.getInput(), te.getOutput(), 0.0625F);
       
        this.bindTexture(TextureLocations.MODEL_TRANSFORMER_INPUT);
        this.model.renderIO(te.getInput(), 0.0625F);
       
        this.bindTexture(TextureLocations.MODEL_TRANSFORMER_OUTPUT);
        this.model.renderIO(te.getOutput(), 0.0625F);
       
        GL11.glPopMatrix();
    }
View Full Code Here


        this.setUnlocalizedName("transformer");
    }
       
    public TileEntity createTileEntity(World world, int metadata)
    {
        return new TileEntityTransformer(metadata);
    }
View Full Code Here

    @Override
    public boolean onUseWrench(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ)
    {
        if (!world.isRemote && world.getBlockTileEntity(x, y, z) instanceof TileEntityTransformer)
        {
            TileEntityTransformer te = (TileEntityTransformer) world.getBlockTileEntity(x, y, z);
            if (side > 1)
                if (hitY > 0.5)
                    te.setOutput(ForgeDirection.getOrientation(side));
                else
                    te.setInput(ForgeDirection.getOrientation(side));
            else
                if (hitZ > 0.5)
                    te.setOutput(ForgeDirection.getOrientation(side));
                else
                    te.setInput(ForgeDirection.getOrientation(side));
        }
        return true;
    }
View Full Code Here

    @Override
    public boolean onSneakUseWrench(World par1World, int x, int y, int z, EntityPlayer par5EntityPlayer, int side, float hitX, float hitY, float hitZ)
    {
        if (!par1World.isRemote)
        {
            TileEntityTransformer tileEntity = (TileEntityTransformer) par1World.getBlockTileEntity(x, y, z);
           
            tileEntity.stepUp = !tileEntity.stepUp;
        }
       
        return true;
View Full Code Here

TOP

Related Classes of electricexpansion.common.tile.TileEntityTransformer

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.