Added on texture to implosion compressor
This commit is contained in:
parent
1726d4c7a3
commit
3a89b0446c
2 changed files with 18 additions and 8 deletions
|
@ -2,10 +2,12 @@ package techreborn.blocks.machine;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import net.minecraft.world.IBlockAccess;
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.blocks.BlockMachineBase;
|
import techreborn.blocks.BlockMachineBase;
|
||||||
import techreborn.client.GuiHandler;
|
import techreborn.client.GuiHandler;
|
||||||
import techreborn.client.TechRebornCreativeTab;
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
|
import techreborn.tiles.TileAlloyFurnace;
|
||||||
import techreborn.tiles.TileImplosionCompressor;
|
import techreborn.tiles.TileImplosionCompressor;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.BlockContainer;
|
import net.minecraft.block.BlockContainer;
|
||||||
|
@ -24,6 +26,9 @@ public class BlockImplosionCompressor extends BlockMachineBase{
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
private IIcon iconFront;
|
private IIcon iconFront;
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
private IIcon iconFrontOn;
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
private IIcon iconTop;
|
private IIcon iconTop;
|
||||||
|
|
||||||
|
@ -58,19 +63,22 @@ public class BlockImplosionCompressor extends BlockMachineBase{
|
||||||
{
|
{
|
||||||
this.blockIcon = icon.registerIcon("techreborn:machine/machine_side");
|
this.blockIcon = icon.registerIcon("techreborn:machine/machine_side");
|
||||||
this.iconFront = icon.registerIcon("techreborn:machine/implosion_compressor_front_off");
|
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.iconTop = icon.registerIcon("techreborn:machine/advanced_machine_side");
|
||||||
this.iconBottom = icon.registerIcon("techreborn:machine/implosion_compressor_bottom");
|
this.iconBottom = icon.registerIcon("techreborn:machine/implosion_compressor_bottom");
|
||||||
}
|
}
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@Override
|
||||||
public IIcon getIcon(int side, int metadata)
|
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
|
return metadata == 0 && side == 3 ? this.iconFront
|
||||||
: side == 1 ? this.iconTop :
|
: side == 1 ? this.iconTop :
|
||||||
side == 0 ? this.iconBottom: (side == 0 ? this.iconTop
|
side == 0 ? this.iconBottom: (side == 0 ? this.iconTop
|
||||||
: (side == metadata ? this.iconFront : this.blockIcon));
|
: (side == metadata ? this.iconFront : this.blockIcon));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,6 +30,8 @@ public class TileMachineBase extends TileEntity {
|
||||||
if (!worldObj.isRemote) {
|
if (!worldObj.isRemote) {
|
||||||
PacketHandler.sendPacketToAllPlayers(getDescriptionPacket(),
|
PacketHandler.sendPacketToAllPlayers(getDescriptionPacket(),
|
||||||
worldObj);
|
worldObj);
|
||||||
|
} else {
|
||||||
|
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue