Fix #960, Use itemDamage for wood items instead of NBT

This commit is contained in:
mezz committed 2015-11-11 00:09:17 -08:00
1 parent 90c9050e80
commit d4cd0aaf7e
26 files changed
+185 -343

No files matched your search

@@ -277,35 +277,92 @@ public class PluginArboriculture extends ForestryPlugin {
RecipeUtil.addSmelting(ForestryBlock.logs.getWildcard(), new ItemStack(Items.coal, 1, 1), 0.15F);
ShapelessRecipeCustom.buildRecipe(ForestryBlock.planks.getItemStack(4), ForestryBlock.logs.getWildcard()).setPreserveNBT();
ShapelessRecipeCustom.buildRecipe(ForestryBlock.planksFireproof.getItemStack(4), ForestryBlock.logsFireproof.getWildcard()).setPreserveNBT();
for (EnumWoodType woodType : EnumWoodType.VALUES) {
// Fabricator recipes
if (PluginManager.Module.FACTORY.isEnabled() && PluginManager.Module.APICULTURE.isEnabled()) {
ItemStack planks = TreeManager.woodItemAccess.getPlanks(woodType, false);
ItemStack logs = TreeManager.woodItemAccess.getLog(woodType, false);
ItemStack slabs = TreeManager.woodItemAccess.getSlab(woodType, false);
ItemStack fences = TreeManager.woodItemAccess.getFence(woodType, false);
ItemStack stairs = TreeManager.woodItemAccess.getStairs(woodType, false);
// Fireproof log recipe
RecipeManagers.fabricatorManager.addRecipe(new FabricatorRecipe(null, Fluids.GLASS.getFluid(500), ForestryBlock.logsFireproof.getItemStack(), new Object[]{
" # ",
ItemStack fireproofPlanks = TreeManager.woodItemAccess.getPlanks(woodType, true);
ItemStack fireproofLogs = TreeManager.woodItemAccess.getLog(woodType, true);
ItemStack fireproofSlabs = TreeManager.woodItemAccess.getSlab(woodType, true);
ItemStack fireproofFences = TreeManager.woodItemAccess.getFence(woodType, true);
ItemStack fireproofStairs = TreeManager.woodItemAccess.getStairs(woodType, true);
planks.stackSize = 4;
logs.stackSize = 1;
ShapelessRecipeCustom.buildRecipe(planks.copy(), logs.copy());
fireproofPlanks.stackSize = 4;
fireproofLogs.stackSize = 1;
ShapelessRecipeCustom.buildRecipe(fireproofPlanks.copy(), fireproofLogs.copy());
slabs.stackSize = 6;
planks.stackSize = 1;
ShapedRecipeCustom.buildPriorityRecipe(slabs.copy(),
"###",
'#', planks.copy());
fireproofSlabs.stackSize = 6;
fireproofPlanks.stackSize = 1;
ShapedRecipeCustom.buildPriorityRecipe(fireproofSlabs.copy(),
"###",
'#', fireproofPlanks.copy());
fences.stackSize = 3;
planks.stackSize = 1;
ShapedRecipeCustom.buildRecipe(fences.copy(),
"#X#",
" # ",
'#', ForestryItem.refractoryWax,
'X', ForestryBlock.logs.getWildcard()}).setPreserveNBT());
// Fireproof plank recipe
RecipeManagers.fabricatorManager.addRecipe(new FabricatorRecipe(null, Fluids.GLASS.getFluid(500), ForestryBlock.planksFireproof.getItemStack(5), new Object[]{
"X#X",
"#X#",
"X#X",
'#', ForestryItem.refractoryWax,
'X', ForestryBlock.planks.getWildcard()}).setPreserveNBT());
'#', planks.copy(), 'X', "stickWood");
fireproofFences.stackSize = 3;
fireproofPlanks.stackSize = 1;
ShapedRecipeCustom.buildRecipe(fireproofFences.copy(),
"#X#",
"#X#",
'#', fireproofPlanks.copy(), 'X', "stickWood");
stairs.stackSize = 4;
planks.stackSize = 1;
ShapedRecipeCustom.buildPriorityRecipe(stairs.copy(),
"# ",
"## ",
"###",
'#', planks.copy());
fireproofStairs.stackSize = 4;
fireproofPlanks.stackSize = 1;
ShapedRecipeCustom.buildPriorityRecipe(fireproofStairs.copy(),
"# ",
"## ",
"###",
'#', fireproofPlanks.copy());
// Fabricator recipes
if (PluginManager.Module.FACTORY.isEnabled() && PluginManager.Module.APICULTURE.isEnabled()) {
logs.stackSize = 1;
fireproofLogs.stackSize = 1;
RecipeManagers.fabricatorManager.addRecipe(new FabricatorRecipe(null, Fluids.GLASS.getFluid(500), fireproofLogs.copy(), new Object[]{
" # ",
"#X#",
" # ",
'#', ForestryItem.refractoryWax,
'X', logs.copy()}));
planks.stackSize = 1;
fireproofPlanks.stackSize = 5;
RecipeManagers.fabricatorManager.addRecipe(new FabricatorRecipe(null, Fluids.GLASS.getFluid(500), fireproofPlanks.copy(), new Object[]{
"X#X",
"#X#",
"X#X",
'#', ForestryItem.refractoryWax,
'X', planks.copy()}));
}
}
ShapedRecipeCustom.buildPriorityRecipe(ForestryBlock.slabs.getItemStack(6), "###", '#', ForestryBlock.planks.getWildcard()).setPreserveNBT();
ShapedRecipeCustom.buildPriorityRecipe(ForestryBlock.slabsFireproof.getItemStack(6), "###", '#', ForestryBlock.planksFireproof.getWildcard()).setPreserveNBT();
ShapedRecipeCustom.buildRecipe(ForestryBlock.fences.getItemStack(3), "#X#", "#X#", '#', ForestryBlock.planks.getWildcard(), 'X', "stickWood").setPreserveNBT();
ShapedRecipeCustom.buildRecipe(ForestryBlock.fencesFireproof.getItemStack(3), "#X#", "#X#", '#', ForestryBlock.planksFireproof.getWildcard(), 'X', "stickWood").setPreserveNBT();
if (PluginManager.Module.FACTORY.isEnabled()) {
// Treealyzer
RecipeManagers.carpenterManager.addRecipe(100, Fluids.WATER.getFluid(2000), null, ForestryItem.treealyzer.getItemStack(), "X#X", "X#X", "RDR",
@@ -329,19 +386,6 @@ public class PluginArboriculture extends ForestryPlugin {
RecipeUtil.addFermenterRecipes(ForestryItem.sapling.getItemStack(), ForestryAPI.activeMode.getIntegerSetting("fermenter.yield.sapling"), Fluids.BIOMASS);
}
// Stairs
ShapedRecipeCustom.buildPriorityRecipe(ForestryBlock.stairs.getItemStack(4),
"# ",
"## ",
"###",
'#', ForestryBlock.planks.getWildcard()).setPreserveNBT();
ShapedRecipeCustom.buildPriorityRecipe(ForestryBlock.stairsFireproof.getItemStack(4),
"# ",
"## ",
"###",
'#', ForestryBlock.planksFireproof.getWildcard()).setPreserveNBT();
// Grafter
RecipeUtil.addRecipe(ForestryItem.grafter.getItemStack(),
" B",
@@ -292,29 +292,24 @@ public class PluginFarming extends ForestryPlugin {
protected void registerRecipes() {
ItemStack basic = ForestryBlock.farm.getItemStack(1, 0);
ItemStack gearbox = ForestryBlock.farm.getItemStack(1, 2);
ItemStack hatch = ForestryBlock.farm.getItemStack(1, 3);
ItemStack valve = ForestryBlock.farm.getItemStack(1, 4);
ItemStack control = ForestryBlock.farm.getItemStack(1, 5);
for (EnumFarmBlockTexture block : EnumFarmBlockTexture.values()) {
NBTTagCompound compound = new NBTTagCompound();
block.saveToCompound(compound);
basic.setTagCompound((NBTTagCompound) compound.copy());
ShapedRecipeCustom.buildRecipe(basic.copy(), "I#I", "WCW", '#', block.getBase(), 'W', "slabWood", 'C', ForestryItem.tubes.getItemStack(1, 1), 'I', "ingotCopper");
ShapedRecipeCustom.buildRecipe(gearbox, " # ", "TTT", '#', basic, 'T', "gearTin");
ShapedRecipeCustom.buildRecipe(hatch, " # ", "TDT", '#', basic, 'T', "gearTin", 'D', Blocks.trapdoor);
ShapedRecipeCustom.buildRecipe(valve, " # ", "XTX", '#', basic, 'T', "gearTin", 'X', "blockGlass");
ShapedRecipeCustom.buildRecipe(control, " # ", "XTX", '#', basic, 'T', ForestryItem.tubes.getItemStack(1, 4), 'X', "dustRedstone");
}
// use wildcard (null) NBT for the basic ingredient so that any basic type can be used
ItemStack basicWildcard = ForestryBlock.farm.getItemStack(1, 0);
ItemStack gearbox = ForestryBlock.farm.getItemStack(1, 2);
ShapedRecipeCustom.buildRecipe(gearbox, " # ", "TTT", '#', basicWildcard, 'T', "gearTin").setPreserveNBT();
ItemStack hatch = ForestryBlock.farm.getItemStack(1, 3);
ShapedRecipeCustom.buildRecipe(hatch, " # ", "TDT", '#', basicWildcard, 'T', "gearTin", 'D', Blocks.trapdoor).setPreserveNBT();
ItemStack valve = ForestryBlock.farm.getItemStack(1, 4);
ShapedRecipeCustom.buildRecipe(valve, " # ", "XTX", '#', basicWildcard, 'T', "gearTin", 'X', "blockGlass").setPreserveNBT();
ItemStack control = ForestryBlock.farm.getItemStack(1, 5);
ShapedRecipeCustom.buildRecipe(control, " # ", "XTX", '#', basicWildcard, 'T', ForestryItem.tubes.getItemStack(1, 4), 'X', "dustRedstone").setPreserveNBT();
// Circuits
ICircuitLayout layoutManaged = ChipsetManager.circuitRegistry.getLayout("forestry.farms.managed");
ICircuitLayout layoutManual = ChipsetManager.circuitRegistry.getLayout("forestry.farms.manual");