Chiseling

This commit is contained in:
mDiyo 2013-04-30 23:01:28 -07:00
parent 318534091d
commit fc36d966c9
8 changed files with 300 additions and 145 deletions

View File

@ -3,6 +3,7 @@ package mods.tinker.tconstruct;
import mods.tinker.tconstruct.common.TContent;
import mods.tinker.tconstruct.common.TProxyCommon;
import mods.tinker.tconstruct.library.TConstructRegistry;
import mods.tinker.tconstruct.library.crafting.Detailing;
import mods.tinker.tconstruct.library.crafting.LiquidCasting;
import mods.tinker.tconstruct.library.util.TabTools;
import mods.tinker.tconstruct.util.PHConstruct;
@ -34,7 +35,7 @@ import cpw.mods.fml.common.registry.VillagerRegistry;
* @dependencies: IC2 API, EBXL API
*/
@Mod(modid = "TConstruct", name = "TConstruct", version = "1.5.1_1.3.2.dev30", dependencies = "required-after:Forge@[7.7.1.675,)")
@Mod(modid = "TConstruct", name = "TConstruct", version = "1.5.1_1.3.2.dev31", dependencies = "required-after:Forge@[7.7.1.675,)")
@NetworkMod(serverSideRequired = false, clientSideRequired = true, channels = { "TConstruct" }, packetHandler = mods.tinker.tconstruct.util.network.TPacketHandler.class)
public class TConstruct
{
@ -59,6 +60,8 @@ public class TConstruct
tableCasting = new LiquidCasting();
basinCasting = new LiquidCasting();
chiselDetailing = new Detailing();
content = new TContent();
events = new TEventHandler();
@ -115,9 +118,15 @@ public class TConstruct
return basinCasting;
}
public static Detailing getChiselDetailing()
{
return chiselDetailing;
}
public static TEventHandler events;
public static TPlayerHandler playerTracker;
public static TContent content;
public static LiquidCasting tableCasting;
public static LiquidCasting basinCasting;
public static Detailing chiselDetailing;
}

View File

@ -498,7 +498,7 @@ public class TProxyClient extends TProxyCommon
"The Frying is a heavy weapon that uses sheer weight to stun foes.\n\nSpecial Ability: Block\nNatural Ability: Heavy\nShift+rClick: Place Frying Pan\nDamage: Low\nDurability: High\n\nRequired parts:\n- Pan\n- Handle",
//"The Battlesign is an advance in weapon technology worthy of Zombie Pigmen everywhere.\n\nSpecial Ability: Block\nShift-rClick: Place sign\nDamage: Low\nDurability: Average\n\nRequired parts:\n- Board\n- Handle"
"The Battlesign is an advance in weapon technology worthy of Zombie Pigmen everywhere.\n\nSpecial Ability: Block\nDamage: Low\nDurability: Average\n\nRequired parts:\n- Sign Board\n- Handle",
"The Chisel is a utility tool that carves shapes into blocks.\n\nSpecial Ability: Chisel\nDurability: Average\n\nRequired parts:\n- Chisel Head\n- Handle"};
"The Chisel is a utility tool that carves shapes into blocks.\n\nCrafting Grid:\n- Shape Items\nSpecial Ability: Chisel\nDurability: Average\n\nRequired parts:\n- Chisel Head\n- Handle"};
void addToolButtons ()
{

View File

@ -69,6 +69,7 @@ import mods.tinker.tconstruct.items.tools.Rapier;
import mods.tinker.tconstruct.items.tools.Shovel;
import mods.tinker.tconstruct.library.TConstructRegistry;
import mods.tinker.tconstruct.library.client.TConstructClientRegistry;
import mods.tinker.tconstruct.library.crafting.Detailing;
import mods.tinker.tconstruct.library.crafting.LiquidCasting;
import mods.tinker.tconstruct.library.crafting.PatternBuilder;
import mods.tinker.tconstruct.library.crafting.Smeltery;
@ -530,51 +531,8 @@ public class TContent implements IFuelHandler
void addCraftingRecipes ()
{
/*List<ItemStack> removeTools = new ArrayList<ItemStack>();
if (PHConstruct.disableWoodTools)
{
removeTools.add(new ItemStack(Item.pickaxeWood));
removeTools.add(new ItemStack(Item.axeWood));
removeTools.add(new ItemStack(Item.shovelWood));
removeTools.add(new ItemStack(Item.swordWood));
removeTools.add(new ItemStack(Item.hoeWood));
}
if (PHConstruct.disableStoneTools)
{
removeTools.add(new ItemStack(Item.pickaxeStone));
removeTools.add(new ItemStack(Item.axeStone));
removeTools.add(new ItemStack(Item.shovelStone));
removeTools.add(new ItemStack(Item.swordStone));
removeTools.add(new ItemStack(Item.hoeStone));
}
if (PHConstruct.disableIronTools)
{
removeTools.add(new ItemStack(Item.pickaxeSteel));
removeTools.add(new ItemStack(Item.axeSteel));
removeTools.add(new ItemStack(Item.shovelSteel));
removeTools.add(new ItemStack(Item.swordSteel));
removeTools.add(new ItemStack(Item.hoeSteel));
}
if (PHConstruct.disableDiamondTools)
{
removeTools.add(new ItemStack(Item.pickaxeDiamond));
removeTools.add(new ItemStack(Item.axeDiamond));
removeTools.add(new ItemStack(Item.shovelDiamond));
removeTools.add(new ItemStack(Item.swordDiamond));
removeTools.add(new ItemStack(Item.hoeDiamond));
}
if (PHConstruct.disableGoldTools)
{
removeTools.add(new ItemStack(Item.pickaxeGold));
removeTools.add(new ItemStack(Item.axeGold));
removeTools.add(new ItemStack(Item.shovelGold));
removeTools.add(new ItemStack(Item.swordGold));
removeTools.add(new ItemStack(Item.hoeGold));
}
RecipeRemover.removeShapedRecipes(removeTools);*/
patternOutputs = new Item[] { toolRod, pickaxeHead, shovelHead, axeHead, swordBlade, wideGuard, handGuard, crossbar, binding, frypanHead, signHead, knifeBlade };
/* Tools */
patternOutputs = new Item[] { toolRod, pickaxeHead, shovelHead, axeHead, swordBlade, wideGuard, handGuard, crossbar, binding, frypanHead, signHead, knifeBlade, chiselHead };
ToolBuilder tb = ToolBuilder.instance;
tb.addToolRecipe(pickaxe, pickaxeHead, binding);
@ -634,7 +592,7 @@ public class TContent implements IFuelHandler
tb.registerToolMod(new ModExtraModifier(new ItemStack[] { diamond, new ItemStack(Block.blockGold) }, "Tier1Free"));
tb.registerToolMod(new ModExtraModifier(new ItemStack[] { new ItemStack(Item.netherStar) }, "Tier2Free"));
//Smeltery
/* Smeltery */
ItemStack ingotcast = new ItemStack(metalPattern, 1, 0);
LiquidCasting tableCasting = TConstructRegistry.instance.getTableCasting();
@ -707,13 +665,13 @@ public class TContent implements IFuelHandler
//Ore
Smeltery.addMelting(Block.oreIron, 0, 600, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 2, 0));
Smeltery.addMelting(Block.oreGold, 0, 550, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 2, 1));
Smeltery.addMelting(Block.oreGold, 0, 400, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 2, 1));
Smeltery.addMelting(oreGravel, 0, 600, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 2, 0));
Smeltery.addMelting(oreGravel, 1, 550, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 2, 1));
Smeltery.addMelting(oreGravel, 1, 400, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 2, 1));
//Items
Smeltery.addMelting(new ItemStack(Item.ingotIron, 4), Block.blockIron.blockID, 0, 500, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 0));
Smeltery.addMelting(new ItemStack(Item.ingotGold, 4), Block.blockGold.blockID, 0, 450, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 1));
Smeltery.addMelting(new ItemStack(Item.ingotGold, 4), Block.blockGold.blockID, 0, 300, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 1));
Smeltery.addMelting(new ItemStack(Item.goldNugget, 4), Block.blockGold.blockID, 0, 150, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue / 9, 1));
Smeltery.addMelting(new ItemStack(Item.bucketEmpty), Block.blockIron.blockID, 0, 600, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 3, 0));
@ -721,7 +679,7 @@ public class TContent implements IFuelHandler
//Blocks
Smeltery.addMelting(Block.blockIron, 0, 600, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 0));
Smeltery.addMelting(Block.blockGold, 0, 550, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 1));
Smeltery.addMelting(Block.blockGold, 0, 400, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 1));
Smeltery.addMelting(Block.obsidian, 0, 800, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 2, 11));
Smeltery.addMelting(Block.ice, 0, 75, new LiquidStack(Block.waterStill.blockID, 1000, 0));
@ -739,7 +697,16 @@ public class TContent implements IFuelHandler
Smeltery.addMelting(new ItemStack(oreBerries, 4, 3), metalBlock.blockID, 5, 100, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue / 9, 3)); //Tin
Smeltery.addMelting(new ItemStack(oreBerries, 4, 4), metalBlock.blockID, 6, 100, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue / 9, 4)); //Aluminum
//Crafting
/* Detailing */
Detailing chiseling = TConstructRegistry.getChiselDetailing();
chiseling.addDetailing(Block.stone, 0, Block.stoneBrick, 0, chisel);
chiseling.addDetailing(speedBlock, 0, speedBlock, 1, chisel);
chiseling.addDetailing(speedBlock, 2, speedBlock, 3, chisel);
chiseling.addDetailing(speedBlock, 3, speedBlock, 4, chisel);
chiseling.addDetailing(speedBlock, 4, speedBlock, 5, chisel);
chiseling.addDetailing(speedBlock, 5, speedBlock, 6, chisel);
/* Crafting */
GameRegistry.addRecipe(new ItemStack(toolStationWood, 1, 0), "p", "w", 'p', new ItemStack(blankPattern, 1, 0), 'w', Block.workbench);
GameRegistry.addRecipe(new ItemStack(toolStationWood, 1, 1), "p", "w", 'p', new ItemStack(blankPattern, 1, 0), 'w', new ItemStack(Block.wood, 1, 0));
GameRegistry.addRecipe(new ItemStack(toolStationWood, 1, 2), "p", "w", 'p', new ItemStack(blankPattern, 1, 0), 'w', new ItemStack(Block.wood, 1, 1));
@ -798,6 +765,8 @@ public class TContent implements IFuelHandler
FurnaceRecipes.smelting().addSmelting(oreGravel.blockID, 3, new ItemStack(materials, 1, 10), 0.2f);
FurnaceRecipes.smelting().addSmelting(oreGravel.blockID, 4, new ItemStack(materials, 1, 12), 0.2f);
FurnaceRecipes.smelting().addSmelting(speedBlock.blockID, 0, new ItemStack(speedBlock, 1, 2), 0.2f);
//Metal conversion
GameRegistry.addRecipe(new ItemStack(materials, 9, 9), "m", 'm', new ItemStack(metalBlock, 1, 3)); //Copper
GameRegistry.addRecipe(new ItemStack(materials, 9, 10), "m", 'm', new ItemStack(metalBlock, 1, 5)); //Tin
@ -815,21 +784,6 @@ public class TContent implements IFuelHandler
GameRegistry.addRecipe(new ItemStack(materials, 1, 10), "mmm", "mmm", "mmm", 'm', new ItemStack(materials, 1, 21)); //Tin
GameRegistry.addRecipe(new ItemStack(materials, 1, 12), "mmm", "mmm", "mmm", 'm', new ItemStack(materials, 1, 22)); //Aluminum
/*LiquidBlockCasting lbc = LiquidBlockCasting.instance;
lbc.addBlockCastingRecipe(new ItemStack(Block.blockIron), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 0), null, true, 100); //Iron
lbc.addBlockCastingRecipe(new ItemStack(Block.blockGold), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 1), null, true, 100); //gold
lbc.addBlockCastingRecipe(new ItemStack(metalBlock, 1, 3), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 2), null, true, 100); //copper
lbc.addBlockCastingRecipe(new ItemStack(metalBlock, 1, 5), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 3), null, true, 100); //tin
lbc.addBlockCastingRecipe(new ItemStack(metalBlock, 1, 6), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 4), null, true, 100); //aluminum
lbc.addBlockCastingRecipe(new ItemStack(metalBlock, 1, 0), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 5), null, true, 100); //cobalt
lbc.addBlockCastingRecipe(new ItemStack(metalBlock, 1, 1), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 6), null, true, 100); //ardite
lbc.addBlockCastingRecipe(new ItemStack(metalBlock, 1, 4), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 7), null, true, 100); //bronze
lbc.addBlockCastingRecipe(new ItemStack(metalBlock, 1, 7), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 8), null, true, 100); //albrass
lbc.addBlockCastingRecipe(new ItemStack(metalBlock, 1, 2), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 9), null, true, 100); //manyullyn
lbc.addBlockCastingRecipe(new ItemStack(metalBlock, 1, 8), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 10), null, true, 100); //alumite
lbc.addBlockCastingRecipe(new ItemStack(Block.obsidian), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 2, 11), null, true, 100);// obsidian
lbc.addBlockCastingRecipe(new ItemStack(metalBlock, 1, 9), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue * 9, 12), null, true, 100); //steel*/
//Smeltery
ItemStack searedBrick = new ItemStack(materials, 1, 2);
GameRegistry.addRecipe(new ItemStack(smeltery, 1, 0), "bbb", "b b", "bbb", 'b', searedBrick); //Controller

View File

@ -140,6 +140,8 @@ public class TProxyCommon implements IGuiHandler
LanguageRegistry.addName(TContent.battlesign, "Battlesign");
LanguageRegistry.addName(TContent.mattock, "Mattock");
LanguageRegistry.addName(TContent.potionLauncher, "Potion Launcher");
LanguageRegistry.addName(TContent.dagger, "Dagger");
LanguageRegistry.addName(TContent.chisel, "Chisel");
//LanguageRegistry.addName(TContent.lumberaxe, "Lumber Axe");
}
@ -172,13 +174,13 @@ public class TProxyCommon implements IGuiHandler
"Copper", "Bronze", "Alumite", "Steel", "Blue Slime" };
public static final String[] materialTypes = new String[] { "ToolRod", "PickaxeHead", "ShovelHead", "AxeHead", "SwordBlade", "LargeGuard", "MediumGuard", "Crossbar", "Binding", "FrypanHead",
"SignHead", "LumberHead", "KnifeBlade" };
"SignHead", "LumberHead", "KnifeBlade", "ChiselHead" };
public static final String[] materialNames = new String[] { " Rod", " Pickaxe Head", " Shovel Head", " Axe Head", " Sword Blade", " Wide Guard", " Hand Guard", " Crossbar", " Binding", " Pan",
" Board", " Broad Axe Head", " Knife Blade" };
" Board", " Broad Axe Head", " Knife Blade", " Chisel Head" };
public static final String[] patterns = new String[] { "ingot", "rod", "pickaxe", "shovel", "axe", "swordblade", "largeguard", "mediumguard", "crossbar", "binding", "frypan", "sign", "knifeblade" };
public static final String[] patterns = new String[] { "ingot", "rod", "pickaxe", "shovel", "axe", "swordblade", "largeguard", "mediumguard", "crossbar", "binding", "frypan", "sign", "knifeblade", "chisel" };
public static final String[] patternNames = new String[] { "Ingot", "Tool Rod", "Pickaxe Head", "Shovel Head", "Axe Head", "Sword Blade", "Wide Guard", "Hand Guard", "Crossbar", "Tool Binding",
"Pan", "Board", "Knife Blade" };
"Pan", "Board", "Knife Blade", "Chisel Head" };
}

View File

@ -36,7 +36,7 @@ public class Pattern extends CraftingItem
}
public static final String[] patternName = new String[] {
"ingot", "rod", "pickaxe", "shovel", "axe", "swordblade", "largeguard", "mediumguard", "crossbar", "binding", "frypan", "sign", "knifeblade" };
"ingot", "rod", "pickaxe", "shovel", "axe", "swordblade", "largeguard", "mediumguard", "crossbar", "binding", "frypan", "sign", "knifeblade", "chisel" };
/*@SideOnly(Side.CLIENT)
public void updateIcons(IconRegister iconRegister)

View File

@ -1,10 +1,19 @@
package mods.tinker.tconstruct.items.tools;
import mods.tinker.tconstruct.TConstruct;
import mods.tinker.tconstruct.common.TContent;
import mods.tinker.tconstruct.library.crafting.Detailing.DetailInput;
import mods.tinker.tconstruct.library.tools.AbilityHelper;
import mods.tinker.tconstruct.library.tools.ToolCore;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumAction;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumMovingObjectType;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import mods.tinker.tconstruct.common.TContent;
import mods.tinker.tconstruct.library.tools.ToolCore;
import net.minecraft.item.Item;
public class Chisel extends ToolCore
{
@ -12,6 +21,84 @@ public class Chisel extends ToolCore
{
super(id, 0);
this.setUnlocalizedName("InfiTool.Chisel");
this.setContainerItem(this);
}
@Override
public ItemStack getContainerItemStack (ItemStack itemStack)
{
return itemStack;
}
@Override
public boolean doesContainerItemLeaveCraftingGrid (ItemStack par1ItemStack)
{
return false;
}
boolean performDetailing (World world, int x, int y, int z, int blockID, int blockMeta)
{
boolean detailed = false;
return detailed;
}
@Override
public ItemStack onItemRightClick (ItemStack itemstack, World world, EntityPlayer entityplayer)
{
if (entityplayer.capabilities.isCreativeMode)
{
onEaten(itemstack, world, entityplayer);
}
else
{
entityplayer.setItemInUse(itemstack, getMaxItemUseDuration(itemstack));
}
return itemstack;
}
@Override
public ItemStack onEaten (ItemStack itemstack, World world, EntityPlayer entityplayer)
{
if (!world.isRemote)
{
MovingObjectPosition movingobjectposition = getMovingObjectPositionFromPlayer(world, entityplayer, true);
if (movingobjectposition == null)
{
return itemstack;
}
if (movingobjectposition.typeOfHit == EnumMovingObjectType.TILE)
{
int x = movingobjectposition.blockX;
int y = movingobjectposition.blockY;
int z = movingobjectposition.blockZ;
int blockID = world.getBlockId(x, y, z);
int meta = world.getBlockMetadata(x, y, z);
DetailInput details = TConstruct.chiselDetailing.getDetailing(blockID, meta);
if (details != null && details.outputID < 4096)
{
world.setBlock(x, y, z, details.outputID, details.outputMeta, 3);
if (!(entityplayer.capabilities.isCreativeMode))
AbilityHelper.damageTool(itemstack, 1, entityplayer, false);
world.playAuxSFX(2001, x, y, z, blockID + (meta << 12));
entityplayer.swingItem();
}
}
}
return itemstack;
}
@Override
public int getMaxItemUseDuration (ItemStack itemstack)
{
return 15;
}
@Override
public EnumAction getItemUseAction (ItemStack itemstack)
{
return EnumAction.eat;
}
@Override

View File

@ -4,12 +4,11 @@ import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.HashMap;
import mods.tinker.tconstruct.TConstruct;
import mods.tinker.tconstruct.library.crafting.Detailing;
import mods.tinker.tconstruct.library.crafting.LiquidCasting;
import mods.tinker.tconstruct.library.tools.ToolCore;
import mods.tinker.tconstruct.library.tools.ToolMaterial;
import mods.tinker.tconstruct.library.util.TabTools;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
/** A registry to store any relevant API work
@ -41,12 +40,14 @@ public class TConstructRegistry
}
//Materials
public static void addToolMaterial (int materialID, String materialName, int craftingTier, int harvestLevel, int durability, int miningspeed, int attack, float handleModifier, int reinforced, float shoddy)
public static void addToolMaterial (int materialID, String materialName, int craftingTier, int harvestLevel, int durability, int miningspeed, int attack, float handleModifier, int reinforced,
float shoddy)
{
addToolMaterial(materialID, materialName, craftingTier, harvestLevel, durability, miningspeed, attack, handleModifier, reinforced, shoddy, "", "");
}
public static void addToolMaterial (int materialID, String materialName, int craftingTier, int harvestLevel, int durability, int miningspeed, int attack, float handleModifier, int reinforced, float shoddy, String style, String ability)
public static void addToolMaterial (int materialID, String materialName, int craftingTier, int harvestLevel, int durability, int miningspeed, int attack, float handleModifier, int reinforced,
float shoddy, String style, String ability)
{
ToolMaterial mat = toolMaterials.get(materialID);
if (mat == null)
@ -110,4 +111,25 @@ public class TConstructRegistry
return null;
}
}
public static Detailing getChiselDetailing ()
{
return instance.chiselDetailing();
}
Detailing chiselDetailing ()
{
try
{
Class clazz = Class.forName("mods.tinker.tconstruct.TConstruct");
Method method = clazz.getMethod("getChiselDetailing");
Detailing lc = (Detailing) method.invoke(this);
return lc;
}
catch (Exception e)
{
System.out.println("[TCon API] Could not find chisel detailing recipes.");
return null;
}
}
}

View File

@ -0,0 +1,81 @@
package mods.tinker.tconstruct.library.crafting;
import java.util.ArrayList;
import java.util.List;
import mods.tinker.tconstruct.library.tools.ToolCore;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import cpw.mods.fml.common.registry.GameRegistry;
public class Detailing
{
public List<DetailInput> detailing = new ArrayList<DetailInput>();
public void addDetailing(Object input, int inputMeta, Object output, int outputMeta, ToolCore tool)
{
int iID, iMeta = inputMeta, oID, oMeta = outputMeta;
if (input instanceof Block)
iID = ((Block)input).blockID;
else if (input instanceof Item)
iID = ((Item)input).itemID;
else if (input instanceof Integer)
iID = (Integer) input;
else
throw new RuntimeException("Invalid detail input!");
if (output instanceof Block)
oID = ((Block)output).blockID;
else if (output instanceof Item)
oID = ((Item)output).itemID;
else if (output instanceof Integer)
oID = (Integer) output;
else
throw new RuntimeException("Invalid detail output!");
this.addDetailing(new DetailInput(iID, iMeta, oID, oMeta), tool);
}
public void addDetailing(DetailInput details, ToolCore tool)
{
detailing.add(details);
GameRegistry.addShapelessRecipe(new ItemStack(details.outputID, 1, details.outputMeta), new ItemStack(tool, 1, Short.MAX_VALUE), new ItemStack(details.inputID, 1, details.inputMeta));
}
public DetailInput getDetailing(int inputID, int inputMeta)
{
for (int i = 0; i < detailing.size(); i++)
{
DetailInput detail = (DetailInput) detailing.get(i);
if (inputID == detail.inputID && inputMeta == detail.inputMeta)
{
return detail;
}
}
return null;
}
public class DetailInput
{
public int inputID;
public int inputMeta;
public int outputID;
public int outputMeta;
public DetailInput (int inputID, int inputMeta, int outputID, int outputMeta)
{
this.inputID = inputID;
this.inputMeta = inputMeta;
this.outputID = outputID;
this.outputMeta = outputMeta;
}
}
}