Fix #526 Carpenter NPE when storage is disabled

This commit is contained in:
mezz committed 2015-02-28 20:56:23 -08:00
1 parent 4b355a6c4a
commit 46b24745a4
3 files changed
+6 -3

No files matched your search

@@ -376,7 +376,7 @@ public class MachineCarpenter extends TilePowered implements ISidedInventory, IL
packageTime--;
// Check whether we have become invalid and need to abort production
if (currentRecipe == null || !currentProduct.isItemEqual(currentRecipe.getCraftingResult()) || !validateResources()) {
if (currentRecipe == null || currentProduct == null || !currentProduct.isItemEqual(currentRecipe.getCraftingResult()) || !validateResources()) {
currentProduct = null;
packageTime = totalTime = 0;
return false;
@@ -422,8 +422,6 @@ public class PluginFactory extends ForestryPlugin {
// Boxes
RecipeManagers.carpenterManager.addRecipe(5, Fluids.WATER.getFluid(1000), null, ForestryItem.carton.getItemStack(2),
" # ", "# #", " # ", '#', "pulpWood");
RecipeManagers.carpenterManager.addRecipe(20, Fluids.WATER.getFluid(1000), null, ForestryItem.crate.getItemStack(24),
" # ", "# #", " # ", '#', "logWood");
// Assembly Kits
RecipeManagers.carpenterManager.addRecipe(20, null, ForestryItem.carton.getItemStack(), ForestryItem.kitPickaxe.getItemStack(), new Object[]{
@@ -537,6 +537,11 @@ public class PluginStorage extends ForestryPlugin implements IOreDictionaryHandl
if (PluginManager.Module.FACTORY.isEnabled()) {
// / CARPENTER
// / CRATES
RecipeManagers.carpenterManager.addRecipe(20, Fluids.WATER.getFluid(1000), null, ForestryItem.crate.getItemStack(24),
" # ", "# #", " # ", '#', "logWood");
// / BACKPACKS T2
RecipeManagers.carpenterManager.addRecipe(200, Fluids.WATER.getFluid(1000), null, ForestryItem.minerBackpackT2.getItemStack(),
"WXW", "WTW", "WWW", 'X', Items.diamond, 'W',