-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix mm gasstack can't be transferred from jei
- Loading branch information
Showing
5 changed files
with
98 additions
and
3 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
src/main/java/com/glodblock/github/integration/jei/ExtraGasExtractors.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.glodblock.github.integration.jei; | ||
|
||
import com.glodblock.github.integration.jei.interfaces.IngredientExtractor; | ||
import mekanism.api.gas.GasStack; | ||
import mezz.jei.api.gui.IRecipeLayout; | ||
|
||
import javax.annotation.Nullable; | ||
import java.util.stream.Stream; | ||
|
||
public class ExtraGasExtractors { | ||
|
||
@Nullable | ||
private final IngredientExtractor<GasStack> extModMach; | ||
|
||
public ExtraGasExtractors(@Nullable IngredientExtractor<GasStack> extModMach) { | ||
this.extModMach = extModMach; | ||
} | ||
|
||
public Stream<WrappedIngredient<GasStack>> extractGases(IRecipeLayout recipeLayout) { | ||
return extModMach != null ? extModMach.extract(recipeLayout) : Stream.empty(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/main/java/com/glodblock/github/integration/jei/ModMachHybridGasStackExtractor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package com.glodblock.github.integration.jei; | ||
|
||
import com.glodblock.github.integration.jei.interfaces.IngredientExtractor; | ||
import hellfirepvp.modularmachinery.common.integration.ingredient.HybridFluidGas; | ||
import mekanism.api.gas.GasStack; | ||
import mezz.jei.api.IModRegistry; | ||
import mezz.jei.api.gui.IRecipeLayout; | ||
import mezz.jei.api.recipe.IIngredientType; | ||
|
||
import java.util.Objects; | ||
import java.util.stream.Stream; | ||
|
||
public class ModMachHybridGasStackExtractor implements IngredientExtractor<GasStack> { | ||
|
||
private final IIngredientType<HybridFluidGas> ingTypeHybridFluid; | ||
|
||
ModMachHybridGasStackExtractor(IModRegistry registry) { | ||
ingTypeHybridFluid = Objects.requireNonNull(registry.getIngredientRegistry().getIngredientType(HybridFluidGas.class)); | ||
} | ||
|
||
public Stream<WrappedIngredient<GasStack>> extract(IRecipeLayout recipeLayout) { | ||
return recipeLayout.getIngredientsGroup(ingTypeHybridFluid).getGuiIngredients().values().stream() | ||
.map(ing -> { | ||
HybridFluidGas hf = ing.getDisplayedIngredient(); | ||
return new WrappedIngredient<>(hf != null ? hf.asGasStack() : null, ing.isInput()); | ||
}); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters