mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-22 04:52:25 +00:00
Actually obey the update cache param, and use the more advanced helper method in Container as well
This commit is contained in:
2 files changed
+6
-18
No files matched your search
@@ -438,7 +438,7 @@ public class TileEntityFactory extends TileEntityMachine implements IComputerInt
|
||||
* @param updateCache True to make the cached recipe get updated if it is out of date.
|
||||
* @return True if the recipe produces the given output.
|
||||
*/
|
||||
private boolean inputProducesOutput(int slotID, ItemStack fallbackInput, ItemStack output, boolean updateCache) {
|
||||
public boolean inputProducesOutput(int slotID, ItemStack fallbackInput, ItemStack output, boolean updateCache) {
|
||||
if (output.isEmpty()) {
|
||||
return true;
|
||||
}
|
||||
@@ -447,8 +447,7 @@ public class TileEntityFactory extends TileEntityMachine implements IComputerInt
|
||||
MachineRecipe cached = cachedRecipe[process];
|
||||
ItemStack extra = inventory.get(4);
|
||||
if (cached == null) {
|
||||
cached = recipeType
|
||||
.getAnyRecipe(fallbackInput, extra, gasTank.getGasType(), infuseStored);
|
||||
cached = recipeType.getAnyRecipe(fallbackInput, extra, gasTank.getGasType(), infuseStored);
|
||||
if (updateCache) {
|
||||
cachedRecipe[process] = cached;
|
||||
}
|
||||
@@ -480,8 +479,7 @@ public class TileEntityFactory extends TileEntityMachine implements IComputerInt
|
||||
// then it is an out of date cache so we compare against the new one
|
||||
// and update the cache while we are at it
|
||||
if (recipeInput.isEmpty() || !secondaryMatch || !ItemStack.areItemsEqual(recipeInput, fallbackInput)) {
|
||||
cached = cachedRecipe[process] = recipeType
|
||||
.getAnyRecipe(fallbackInput, extra, gasTank.getGasType(), infuseStored);
|
||||
cached = recipeType.getAnyRecipe(fallbackInput, extra, gasTank.getGasType(), infuseStored);
|
||||
if (updateCache) {
|
||||
cachedRecipe[process] = cached;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user