mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-25 14:24:42 +00:00
Fix #752 Fabricator Inventory only accepts items that is used in a recipe.
This commit is contained in:
1 parent
c106c1826f
commit
124aba3ede
1 file changed
+16
-1
@@ -169,6 +169,19 @@ public class MachineFabricator extends TilePowered implements ICrafter, ILiquidT
|
||||
return null;
|
||||
}
|
||||
|
||||
public static boolean isInventoryResource(ItemStack resource)
|
||||
{
|
||||
if(resource == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (Recipe recipe: recipes) {
|
||||
if (recipe.internal.isIngredient(resource)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public static boolean isPlan(ItemStack plan) {
|
||||
for (Recipe recipe : recipes) {
|
||||
if (StackUtils.isIdenticalItem(recipe.getPlan(), plan)) {
|
||||
@@ -577,8 +590,10 @@ public class MachineFabricator extends TilePowered implements ICrafter, ILiquidT
|
||||
return RecipeManager.findMatchingSmelting(itemStack) != null;
|
||||
} else if (slotIndex == SLOT_PLAN) {
|
||||
return RecipeManager.isPlan(itemStack);
|
||||
} else if (GuiUtil.isIndexInRange(slotIndex, SLOT_INVENTORY_1, SLOT_INVENTORY_COUNT)) {
|
||||
return RecipeManager.isInventoryResource(itemStack);
|
||||
}
|
||||
return GuiUtil.isIndexInRange(slotIndex, SLOT_INVENTORY_1, SLOT_INVENTORY_COUNT);
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user