2015-05-03 19:00:09 +02:00
|
|
|
package techreborn.blocks;
|
|
|
|
|
2015-07-02 20:51:24 +02:00
|
|
|
import cpw.mods.fml.relauncher.Side;
|
|
|
|
import cpw.mods.fml.relauncher.SideOnly;
|
2015-05-03 19:00:09 +02:00
|
|
|
import net.minecraft.block.material.Material;
|
|
|
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
|
|
|
import net.minecraft.util.IIcon;
|
2015-09-05 10:17:58 +02:00
|
|
|
import net.minecraft.world.IBlockAccess;
|
2015-05-03 19:00:09 +02:00
|
|
|
|
2015-08-09 12:05:32 +02:00
|
|
|
public class BlockHighlyAdvancedMachine extends BlockMachineBase {
|
|
|
|
|
|
|
|
@SideOnly(Side.CLIENT)
|
|
|
|
private IIcon iconFront;
|
|
|
|
|
|
|
|
@SideOnly(Side.CLIENT)
|
|
|
|
private IIcon iconTop;
|
|
|
|
|
|
|
|
@SideOnly(Side.CLIENT)
|
|
|
|
private IIcon iconBottom;
|
|
|
|
|
|
|
|
public BlockHighlyAdvancedMachine(Material material) {
|
|
|
|
super(material);
|
|
|
|
setBlockName("techreborn.highlyAdvancedMachine");
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@SideOnly(Side.CLIENT)
|
|
|
|
public void registerBlockIcons(IIconRegister icon) {
|
|
|
|
this.blockIcon = icon.registerIcon("techreborn:machine/highlyadvancedmachine");
|
|
|
|
this.iconFront = icon.registerIcon("techreborn:machine/highlyadvancedmachine");
|
|
|
|
this.iconTop = icon.registerIcon("techreborn:machine/highlyadvancedmachine");
|
|
|
|
this.iconBottom = icon.registerIcon("techreborn:machine/highlyadvancedmachine");
|
|
|
|
}
|
|
|
|
|
2015-09-05 10:17:58 +02:00
|
|
|
@Override
|
2015-09-05 12:44:41 +02:00
|
|
|
@SideOnly(Side.CLIENT)
|
2015-09-05 10:17:58 +02:00
|
|
|
public IIcon getIcon(IBlockAccess blockAccess, int x, int y, int z, int side) {
|
2015-09-19 10:31:24 +02:00
|
|
|
int metadata = getTileRotation(blockAccess, x, y, z);
|
2015-09-05 12:44:41 +02:00
|
|
|
if (side == metadata && blockAccess.getBlockMetadata(x, y, z) == 1) {
|
|
|
|
return this.iconFront;
|
|
|
|
}
|
2015-08-09 12:05:32 +02:00
|
|
|
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));
|
|
|
|
}
|
2015-05-03 19:00:09 +02:00
|
|
|
|
|
|
|
}
|