From 3a89b0446c9ebe377717a53b7af1d2c7ca758f78 Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Sat, 16 May 2015 22:30:45 +0100 Subject: [PATCH] Added on texture to implosion compressor --- .../machine/BlockImplosionCompressor.java | 22 +++++++++++++------ .../techreborn/tiles/TileMachineBase.java | 4 +++- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/src/main/java/techreborn/blocks/machine/BlockImplosionCompressor.java b/src/main/java/techreborn/blocks/machine/BlockImplosionCompressor.java index 332b69843..4bb78c68a 100644 --- a/src/main/java/techreborn/blocks/machine/BlockImplosionCompressor.java +++ b/src/main/java/techreborn/blocks/machine/BlockImplosionCompressor.java @@ -2,10 +2,12 @@ package techreborn.blocks.machine; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import net.minecraft.world.IBlockAccess; import techreborn.Core; import techreborn.blocks.BlockMachineBase; import techreborn.client.GuiHandler; import techreborn.client.TechRebornCreativeTab; +import techreborn.tiles.TileAlloyFurnace; import techreborn.tiles.TileImplosionCompressor; import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; @@ -24,6 +26,9 @@ public class BlockImplosionCompressor extends BlockMachineBase{ @SideOnly(Side.CLIENT) private IIcon iconFront; + @SideOnly(Side.CLIENT) + private IIcon iconFrontOn; + @SideOnly(Side.CLIENT) private IIcon iconTop; @@ -58,19 +63,22 @@ public class BlockImplosionCompressor extends BlockMachineBase{ { this.blockIcon = icon.registerIcon("techreborn:machine/machine_side"); this.iconFront = icon.registerIcon("techreborn:machine/implosion_compressor_front_off"); + this.iconFrontOn = icon.registerIcon("techreborn:machine/implosion_compressor_front_on"); this.iconTop = icon.registerIcon("techreborn:machine/advanced_machine_side"); this.iconBottom = icon.registerIcon("techreborn:machine/implosion_compressor_bottom"); } - @SideOnly(Side.CLIENT) - public IIcon getIcon(int side, int metadata) - { + @Override + public IIcon getIcon(IBlockAccess blockAccess, int x, int y, int z, int side) { + int metadata = blockAccess.getBlockMetadata(x, y, z); + TileImplosionCompressor tileImplosionCompressor = (TileImplosionCompressor) blockAccess.getTileEntity(x, y, z); + if(side == metadata && tileImplosionCompressor.crafter.currentRecipe != null){ + return this.iconFrontOn; + } return metadata == 0 && side == 3 ? this.iconFront - : side == 1 ? this.iconTop : - side == 0 ? this.iconBottom: (side == 0 ? this.iconTop + : side == 1 ? this.iconTop : + side == 0 ? this.iconBottom: (side == 0 ? this.iconTop : (side == metadata ? this.iconFront : this.blockIcon)); - } - } diff --git a/src/main/java/techreborn/tiles/TileMachineBase.java b/src/main/java/techreborn/tiles/TileMachineBase.java index f5a1bed19..8035bf5d4 100644 --- a/src/main/java/techreborn/tiles/TileMachineBase.java +++ b/src/main/java/techreborn/tiles/TileMachineBase.java @@ -30,7 +30,9 @@ public class TileMachineBase extends TileEntity { if (!worldObj.isRemote) { PacketHandler.sendPacketToAllPlayers(getDescriptionPacket(), worldObj); - } + } else { + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + } } public Packet getDescriptionPacket() {