From d9cf998d168c0430ce394f7d872e169ea42676fd Mon Sep 17 00:00:00 2001 From: Gig Date: Sun, 3 May 2015 23:30:44 +0100 Subject: [PATCH] Added chemicalreactor --- .../blocks/BlockChemicalReactor.java | 62 +++++++++++++++++++ src/main/java/techreborn/init/ModBlocks.java | 5 ++ 2 files changed, 67 insertions(+) create mode 100644 src/main/java/techreborn/blocks/BlockChemicalReactor.java diff --git a/src/main/java/techreborn/blocks/BlockChemicalReactor.java b/src/main/java/techreborn/blocks/BlockChemicalReactor.java new file mode 100644 index 000000000..a902df1df --- /dev/null +++ b/src/main/java/techreborn/blocks/BlockChemicalReactor.java @@ -0,0 +1,62 @@ +package techreborn.blocks; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import techreborn.Core; +import techreborn.client.GuiHandler; +import techreborn.client.TechRebornCreativeTab; +import techreborn.tiles.TileAlloySmelter; +import techreborn.tiles.TileBlastFurnace; +import techreborn.tiles.TileMachineCasing; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BlockChemicalReactor extends BlockMachineBase { + + @SideOnly(Side.CLIENT) + private IIcon iconFront; + + @SideOnly(Side.CLIENT) + private IIcon iconTop; + + @SideOnly(Side.CLIENT) + private IIcon iconBottom; + + public BlockChemicalReactor(Material material) + { + super(material); + setBlockName("techreborn.chemicalreactor"); + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister icon) + { + this.blockIcon = icon.registerIcon("techreborn:machine/machine_side"); + this.iconFront = icon.registerIcon("techreborn:machine/chemical_reactor_side_off"); + this.iconTop = icon.registerIcon("techreborn:machine/machine_top"); + this.iconBottom = icon.registerIcon("techreborn:machine/machine_bottom"); + } + + @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.blockIcon)); + + } + +} diff --git a/src/main/java/techreborn/init/ModBlocks.java b/src/main/java/techreborn/init/ModBlocks.java index 73068542e..9d36ec44a 100644 --- a/src/main/java/techreborn/init/ModBlocks.java +++ b/src/main/java/techreborn/init/ModBlocks.java @@ -9,6 +9,7 @@ import techreborn.blocks.BlockAlloySmelter; import techreborn.blocks.BlockAssemblingMachine; import techreborn.blocks.BlockBlastFurnace; import techreborn.blocks.BlockCentrifuge; +import techreborn.blocks.BlockChemicalReactor; import techreborn.blocks.BlockChunkLoader; import techreborn.blocks.BlockDieselGenerator; import techreborn.blocks.BlockDragonEggSiphoner; @@ -71,6 +72,7 @@ public class ModBlocks { public static Block MagicalAbsorber; public static Block Semifluidgenerator; public static Block AlloyFurnace; + public static Block ChemicalReactor; public static Block ore; public static Block storage; @@ -172,6 +174,9 @@ public class ModBlocks { AlloyFurnace = new BlockAlloyFurnace(Material.rock); GameRegistry.registerBlock(AlloyFurnace, "alloyfurnace"); + + ChemicalReactor = new BlockChemicalReactor(Material.rock); + GameRegistry.registerBlock(ChemicalReactor, "chemicalreactor"); registerOreDict(); }