mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-27 23:33:08 +00:00
Assemblicator Fixes for Transforming recipes (#5542)
* properly use IRecipe.getRemainingItems * Fix formulaic assemblicator gui, not properly comparing itemstacks against ingredient * Change some things to using variables to make it a bit easier to keep track of what is going on * use constants for Assemblicator inventory slot numbers * Check if it is a valid recipe when block gets loaded, so that it sends the proper information to the client
This commit is contained in:
1 parent
0557a8bd23
commit
05166ee916
5 files changed
+173
-98
No files matched your search
@@ -902,14 +902,14 @@ public final class MekanismUtils {
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds the output of a defined InventoryCrafting grid.
|
||||
* Finds the output of a brute forced repairing action
|
||||
*
|
||||
* @param inv - InventoryCrafting to check
|
||||
* @param world - world reference
|
||||
*
|
||||
* @return output ItemStack
|
||||
*/
|
||||
public static ItemStack findMatchingRecipe(InventoryCrafting inv, World world) {
|
||||
public static ItemStack findRepairRecipe(InventoryCrafting inv, World world) {
|
||||
NonNullList<ItemStack> dmgItems = NonNullList.withSize(2, ItemStack.EMPTY);
|
||||
for (int i = 0; i < inv.getSizeInventory(); i++) {
|
||||
if (!inv.getStackInSlot(i).isEmpty()) {
|
||||
@@ -935,8 +935,7 @@ public final class MekanismUtils {
|
||||
int solve = Math.max(0, theItem.getMaxDamage() - value);
|
||||
return new ItemStack(dmgItems.get(0).getItem(), 1, solve);
|
||||
}
|
||||
IRecipe potentialResult = CraftingManager.findMatchingRecipe(inv, world);
|
||||
return potentialResult != null ? potentialResult.getRecipeOutput() : ItemStack.EMPTY;
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user