Skip to content

Commit

Permalink
Fix cribs in fluid shaper (#3862)
Browse files Browse the repository at this point in the history
Co-authored-by: Maya <10861407+serenibyss@users.noreply.github.com>
  • Loading branch information
lordIcocain and serenibyss authored Jan 25, 2025
1 parent d8786c1 commit 8f18cb0
Showing 1 changed file with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;

import javax.annotation.Nonnull;

Expand Down Expand Up @@ -53,6 +55,7 @@
import gregtech.api.metatileentity.implementations.MTEExtendedPowerMultiBlockBase;
import gregtech.api.metatileentity.implementations.MTEHatchEnergy;
import gregtech.api.metatileentity.implementations.MTEHatchInput;
import gregtech.api.objects.GTDualInputs;
import gregtech.api.recipe.RecipeMap;
import gregtech.api.recipe.RecipeMaps;
import gregtech.api.recipe.check.CheckRecipeResult;
Expand All @@ -62,6 +65,7 @@
import gregtech.api.util.GTUtility;
import gregtech.api.util.MultiblockTooltipBuilder;
import gregtech.common.blocks.BlockCasings10;
import gregtech.common.tileentities.machines.IDualInputInventory;
import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.MTEHatchSolidifier;
import mcp.mobius.waila.api.IWailaConfigHandler;
import mcp.mobius.waila.api.IWailaDataAccessor;
Expand Down Expand Up @@ -307,6 +311,28 @@ public CheckRecipeResult process() {
return super.process();
}

@Override
public boolean craftingPatternHandler(IDualInputInventory slot) {
if (craftingPatternRecipeCache.containsKey(slot)) {
craftingPattern = slot;
return true;
}

GTDualInputs inputs = slot.getPatternInputs();
setInputItems(inputs.inputItems);
setInputFluids(inputs.inputFluid);
Set<GTRecipe> recipes = findRecipeMatches(RecipeMaps.fluidSolidifierRecipes)
.collect(Collectors.toSet());
if (recipes.isEmpty())
recipes = findRecipeMatches(GGFabRecipeMaps.toolCastRecipes).collect(Collectors.toSet());
if (!recipes.isEmpty()) {
craftingPatternRecipeCache.put(slot, recipes);
craftingPattern = slot;
return true;
}
return false;
}

@NotNull
@Override
protected CheckRecipeResult validateRecipe(@NotNull GTRecipe recipe) {
Expand Down

0 comments on commit 8f18cb0

Please sign in to comment.