On Icons for a load of machines
This commit is contained in:
parent
a1ccb7202e
commit
70cd363656
7 changed files with 79 additions and 7 deletions
|
@ -45,7 +45,7 @@ public class BlockAssemblingMachine extends BlockMachineBase {
|
|||
{
|
||||
this.blockIcon = icon.registerIcon("techreborn:machine/machine_side");
|
||||
this.iconFront = icon.registerIcon("techreborn:machine/assembling_machine_front_off");
|
||||
this.iconFrontOn = icon.registerIcon("techreborn:machine/assembling_machine_front_off");
|
||||
this.iconFrontOn = icon.registerIcon("techreborn:machine/assembling_machine_front_on");
|
||||
this.iconTop = icon.registerIcon("techreborn:machine/assembling_machine_top");
|
||||
this.iconBottom = icon.registerIcon("techreborn:machine/machine_bottom");
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||
import net.minecraft.item.Item;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import techreborn.Core;
|
||||
import techreborn.blocks.BlockMachineBase;
|
||||
|
@ -22,9 +23,15 @@ public class BlockCentrifuge extends BlockMachineBase {
|
|||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon iconFront;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon iconFrontOn;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon iconTop;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon iconTopOn;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon iconBottom;
|
||||
|
@ -55,20 +62,40 @@ public class BlockCentrifuge extends BlockMachineBase {
|
|||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister icon)
|
||||
{
|
||||
this.blockIcon = icon.registerIcon("techreborn:machine/industrial_centrifuge_side_off");
|
||||
this.iconFront = icon.registerIcon("techreborn:machine/industrial_centrifuge_side_off");
|
||||
this.iconFrontOn = icon.registerIcon("techreborn:machine/industrial_centrifuge_side_on");
|
||||
this.iconTop = icon.registerIcon("techreborn:machine/industrial_centrifuge_top_off");
|
||||
this.iconTopOn = icon.registerIcon("techreborn:machine/industrial_centrifuge_top_on");
|
||||
this.iconBottom = icon.registerIcon("techreborn:machine/industrial_centrifuge_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);
|
||||
TileCentrifuge tileCentrifuge = (TileCentrifuge) blockAccess.getTileEntity(x, y, z);
|
||||
if(side >= 2 && tileCentrifuge.crafter.isActive()){
|
||||
return this.iconFrontOn;
|
||||
}
|
||||
|
||||
if(side == 1 && tileCentrifuge.crafter.isActive()){
|
||||
return this.iconTopOn;
|
||||
}
|
||||
|
||||
|
||||
return metadata == 0 && side == 3 ? this.iconFront
|
||||
: side == 1 ? this.iconTop :
|
||||
side == 0 ? this.iconBottom: (side == 0 ? this.iconTop
|
||||
: (side == metadata ? this.iconFront : this.blockIcon));
|
||||
: (side == metadata ? this.iconFront : this.iconFront));
|
||||
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int metadata)
|
||||
{
|
||||
return metadata == 0 && side == 3 ? this.iconFront
|
||||
: side == 1 ? this.iconTop :
|
||||
side == 0 ? this.iconBottom: (side == 0 ? this.iconTop
|
||||
: (side == metadata ? this.iconFront : this.iconFront));
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||
import net.minecraft.item.Item;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import techreborn.Core;
|
||||
import techreborn.blocks.BlockMachineBase;
|
||||
|
@ -22,6 +23,9 @@ public class BlockIndustrialElectrolyzer extends BlockMachineBase {
|
|||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon iconFront;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon iconFrontOn;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon iconTop;
|
||||
|
@ -58,9 +62,25 @@ public class BlockIndustrialElectrolyzer extends BlockMachineBase {
|
|||
{
|
||||
this.blockIcon = icon.registerIcon("techreborn:machine/industrial_electrolyzer_front_off");
|
||||
this.iconFront = icon.registerIcon("techreborn:machine/industrial_electrolyzer_front_off");
|
||||
this.iconFrontOn= icon.registerIcon("techreborn:machine/industrial_electrolyzer_front_on");
|
||||
this.iconTop = icon.registerIcon("techreborn:machine/machine_top");
|
||||
this.iconBottom = icon.registerIcon("techreborn:machine/machine_bottom");
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(IBlockAccess blockAccess, int x, int y, int z, int side) {
|
||||
int metadata = blockAccess.getBlockMetadata(x, y, z);
|
||||
TileIndustrialElectrolyzer tileIndustrialElectrolyzer = (TileIndustrialElectrolyzer) blockAccess.getTileEntity(x, y, z);
|
||||
if(side == metadata && tileIndustrialElectrolyzer.crafter.isActive()){
|
||||
return this.iconFrontOn;
|
||||
}
|
||||
|
||||
return metadata == 0 && side == 3 ? this.iconFront
|
||||
: side == 1 ? this.iconTop :
|
||||
side == 0 ? this.iconBottom: (side == 0 ? this.iconTop
|
||||
: (side == metadata ? this.iconFront : this.blockIcon));
|
||||
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int metadata)
|
||||
|
|
|
@ -10,10 +10,12 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||
import net.minecraft.item.Item;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import techreborn.Core;
|
||||
import techreborn.blocks.BlockMachineBase;
|
||||
import techreborn.client.GuiHandler;
|
||||
import techreborn.tiles.TileIndustrialElectrolyzer;
|
||||
import techreborn.tiles.TileIndustrialSawmill;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
@ -22,6 +24,9 @@ public class BlockIndustrialSawmill extends BlockMachineBase {
|
|||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon iconFront;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon iconFrontOn;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon iconTop;
|
||||
|
@ -56,10 +61,26 @@ public class BlockIndustrialSawmill extends BlockMachineBase {
|
|||
public void registerBlockIcons(IIconRegister icon)
|
||||
{
|
||||
this.blockIcon = icon.registerIcon("techreborn:machine/machine_side");
|
||||
this.iconFront = icon.registerIcon("techreborn:machine/electric_industrial_sawmill");
|
||||
this.iconFront = icon.registerIcon("techreborn:machine/industrial_sawmill_off");
|
||||
this.iconFront = icon.registerIcon("techreborn:machine/industrial_sawmill_on");
|
||||
this.iconTop = icon.registerIcon("techreborn:machine/machine_top");
|
||||
this.iconBottom = icon.registerIcon("techreborn:machine/machine_bottom");
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(IBlockAccess blockAccess, int x, int y, int z, int side) {
|
||||
int metadata = blockAccess.getBlockMetadata(x, y, z);
|
||||
TileIndustrialSawmill tileIndustrialSawmill = (TileIndustrialSawmill) blockAccess.getTileEntity(x, y, z);
|
||||
if(side == metadata && tileIndustrialSawmill.crafter.isActive()){
|
||||
return this.iconFrontOn;
|
||||
}
|
||||
|
||||
return metadata == 0 && side == 3 ? this.iconFront
|
||||
: side == 1 ? this.iconTop :
|
||||
side == 0 ? this.iconBottom: (side == 0 ? this.iconTop
|
||||
: (side == metadata ? this.iconFront : this.blockIcon));
|
||||
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int metadata)
|
||||
|
|
|
@ -22,6 +22,9 @@ public class BlockMatterFabricator extends BlockMachineBase{
|
|||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon iconFront;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon iconFrontOn;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon iconTop;
|
||||
|
@ -57,6 +60,7 @@ public class BlockMatterFabricator extends BlockMachineBase{
|
|||
{
|
||||
this.blockIcon = icon.registerIcon("techreborn:machine/matterfab_off");
|
||||
this.iconFront = icon.registerIcon("techreborn:machine/matterfab_off");
|
||||
this.iconFrontOn = icon.registerIcon("techreborn:machine/matterfab_on");
|
||||
this.iconTop = icon.registerIcon("techreborn:machine/matterfab_off");
|
||||
this.iconBottom = icon.registerIcon("techreborn:machine/matterfab_off");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue