package com.vanhal.progressiveautomation.blocks; import com.vanhal.progressiveautomation.entities.chopper.TileChopper; import com.vanhal.progressiveautomation.entities.chopper.TileChopperDiamond; import com.vanhal.progressiveautomation.entities.chopper.TileChopperIron; import com.vanhal.progressiveautomation.entities.chopper.TileChopperStone; import com.vanhal.progressiveautomation.ref.ToolHelper; import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import net.minecraftforge.fml.common.registry.GameRegistry; import net.minecraftforge.oredict.ShapedOreRecipe; public class BlockChopper extends BaseBlock { public BlockChopper(int level) { super("Chopper", level); this.rangeCount = 1; } public TileEntity createNewTileEntity(World world, int var2) { if (blockLevel >= ToolHelper.LEVEL_DIAMOND) return new TileChopperDiamond(); else if (blockLevel == ToolHelper.LEVEL_IRON) return new TileChopperIron(); else if (blockLevel == ToolHelper.LEVEL_STONE) return new TileChopperStone(); else return new TileChopper(); } public static final Block firstTier = Blocks.FURNACE; public void addRecipe(Block previousTier) { ShapedOreRecipe recipe = null; if (blockLevel == ToolHelper.LEVEL_STONE) { recipe = new ShapedOreRecipe(new ItemStack(this), new Object[]{ "sss", "scs", "sps", 's', Blocks.STONE, 'c', previousTier, 'p', Items.STONE_AXE}); } else if (blockLevel == ToolHelper.LEVEL_IRON) { recipe = new ShapedOreRecipe(new ItemStack(this), new Object[]{ "sbs", "scs", "sps", 's', Items.IRON_INGOT, 'c', previousTier, 'p', Items.IRON_AXE, 'b', Blocks.IRON_BLOCK}); } else if (blockLevel == ToolHelper.LEVEL_DIAMOND) { recipe = new ShapedOreRecipe(new ItemStack(this), new Object[]{ "sss", "scs", "sps", 's', Items.DIAMOND, 'c', previousTier, 'p', Items.DIAMOND_AXE}); } else { recipe = new ShapedOreRecipe(new ItemStack(this), new Object[]{ "scs", "srs", "sps", 's', "logWood", 'r', previousTier, 'c', "chestWood", 'p', Items.WOODEN_AXE}); } GameRegistry.addRecipe(recipe); } }