diff --git a/src/dark/farmtech/machines/BlockBasicFarmMachine.java b/src/dark/farmtech/machines/BlockBasicFarmMachine.java new file mode 100644 index 00000000..d0417d08 --- /dev/null +++ b/src/dark/farmtech/machines/BlockBasicFarmMachine.java @@ -0,0 +1,76 @@ +package dark.farmtech.machines; + +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.Icon; +import net.minecraft.world.World; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class BlockBasicFarmMachine extends BlockFT +{ + Icon generic_side, wood_side, box_Top; + + enum basicMachine + { + COMP_BOX("compostBox", TileEntityCompBox.class); + String name; + Class tile; + + private basicMachine(String name, Class tile) + { + this.name = name; + this.tile = tile; + } + + } + + public BlockBasicFarmMachine(String name, int blockID, Material material) + { + super(BlockBasicFarmMachine.class, name, material); + } + + @SideOnly(Side.CLIENT) + @Override + public void registerIcons(IconRegister iconReg) + { + super.registerIcons(iconReg); + //this.source = iconReg.registerIcon(DarkMain.getInstance().PREFIX + "infSource"); + } + + @Override + @SideOnly(Side.CLIENT) + public Icon getIcon(int side, int meta) + { + switch (meta) + { + default: + return this.blockIcon; + } + } + + @Override + public TileEntity createTileEntity(World world, int metadata) + { + if (metadata < basicMachine.values().length) + { + try + { + return basicMachine.values()[metadata].tile.newInstance(); + } + catch (Exception e) + { + e.printStackTrace(); + } + } + return super.createTileEntity(world, metadata); + } + + @Override + public TileEntity createNewTileEntity(World world) + { + return null; + } + +}