mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-18 11:19:28 +00:00
Fix #207: Crash on load with IC2 or Factorization (bad smelting recipe)
This commit is contained in:
1 parent
73c4754a17
commit
b5e8d37281
4 files changed
+13
-8
No files matched your search
@@ -116,6 +116,14 @@ public class ProxyCommon {
|
||||
}
|
||||
|
||||
public void addSmelting(ItemStack res, ItemStack prod) {
|
||||
addSmelting(res, prod, 0.0f);
|
||||
}
|
||||
|
||||
public void addSmelting(ItemStack res, ItemStack prod, float xp) {
|
||||
if (res == null || res.getItem() == null)
|
||||
throw new IllegalArgumentException("Tried to register smelting recipe with null input");
|
||||
if (prod == null || prod.getItem() == null)
|
||||
throw new IllegalArgumentException("Tried to register smelting recipe with null output");
|
||||
GameRegistry.addSmelting(res.getItem(), prod, 0.0f); // TODO: use full stack as arg?
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,6 @@ import net.minecraft.command.ICommand;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.WeightedRandomChestContent;
|
||||
import net.minecraftforge.common.ChestGenHooks;
|
||||
@@ -187,7 +186,7 @@ public class PluginArboriculture extends ForestryPlugin {
|
||||
for (ForestryBlock log : logs) {
|
||||
log.block().setHarvestLevel("axe", 0);
|
||||
OreDictionary.registerOre("logWood", log.getWildcard());
|
||||
FurnaceRecipes.smelting().func_151393_a(log.block(), new ItemStack(Items.coal, 1, 1), 0.15F);
|
||||
Proxies.common.addSmelting(log.getItemStack(), new ItemStack(Items.coal, 1, 1), 0.15F);
|
||||
}
|
||||
|
||||
ForestryBlock.planks1.registerBlock(new BlockPlanks(PlankCat.CAT0), ItemWoodBlock.class, "planks");
|
||||
|
||||
@@ -18,7 +18,6 @@ import net.minecraft.command.ICommand;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
|
||||
import cpw.mods.fml.common.IFuelHandler;
|
||||
@@ -123,10 +122,6 @@ public class PluginCore extends ForestryPlugin {
|
||||
OreDictionary.registerOre("oreTin", ForestryBlock.resources.getItemStack(1, 2));
|
||||
|
||||
ForestryBlock.glass.registerBlock(new BlockStainedGlass(), ItemForestryBlock.class, "stained");
|
||||
|
||||
/* SMELTING RECIPES */
|
||||
FurnaceRecipes.smelting().func_151394_a(ForestryBlock.resources.getItemStack(1, 1), ForestryItem.ingotCopper.getItemStack(), 0.5f);
|
||||
FurnaceRecipes.smelting().func_151394_a(ForestryBlock.resources.getItemStack(1, 2), ForestryItem.ingotTin.getItemStack(), 0.5f);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -369,6 +364,10 @@ public class PluginCore extends ForestryPlugin {
|
||||
@Override
|
||||
protected void registerRecipes() {
|
||||
|
||||
/* SMELTING RECIPES */
|
||||
Proxies.common.addSmelting(ForestryBlock.resources.getItemStack(1, 1), ForestryItem.ingotCopper.getItemStack(), 0.5f);
|
||||
Proxies.common.addSmelting(ForestryBlock.resources.getItemStack(1, 2), ForestryItem.ingotTin.getItemStack(), 0.5f);
|
||||
|
||||
/* BRONZE INGOTS */
|
||||
if (Config.getCraftingBronzeEnabled())
|
||||
Proxies.common.addShapelessRecipe(ForestryItem.ingotBronze.getItemStack(4), "ingotTin", "ingotCopper", "ingotCopper", "ingotCopper");
|
||||
|
||||
@@ -58,7 +58,6 @@ public class PluginIC2 extends ForestryPlugin {
|
||||
public static ItemStack silver;
|
||||
public static ItemStack brass;
|
||||
public static ItemStack uuMatter;
|
||||
public static int fuelcanMeta;
|
||||
|
||||
public PluginIC2() {
|
||||
if (PluginIC2.instance == null)
|
||||
|
||||
Reference in new issue
Block a user