fix: jei transfer in the pattern grid wrongly choosing processing mode

This commit is contained in:
raoulvdberge
2024-02-16 15:03:32 +01:00
parent 3e687f441e
commit 6959fbc040
2 changed files with 7 additions and 5 deletions

View File

@@ -7,6 +7,10 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased] ## [Unreleased]
### Fixed
- Fixed JEI transfer in the Pattern Grid wrongly choosing "Processing" mode.
## [1.13.0-beta.1] - 2024-02-12 ## [1.13.0-beta.1] - 2024-02-12
### Added ### Added

View File

@@ -19,7 +19,7 @@ import net.minecraft.client.gui.screens.Screen;
import net.minecraft.world.entity.player.Player; import net.minecraft.world.entity.player.Player;
import net.minecraft.world.inventory.MenuType; import net.minecraft.world.inventory.MenuType;
import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.crafting.Recipe; import net.minecraft.world.item.crafting.RecipeHolder;
import net.neoforged.neoforge.fluids.FluidStack; import net.neoforged.neoforge.fluids.FluidStack;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
@@ -128,9 +128,8 @@ public class GridRecipeTransferHandler implements IRecipeTransferHandler<GridCon
this.lastTransferTimeMs = System.currentTimeMillis(); this.lastTransferTimeMs = System.currentTimeMillis();
boolean isCraftingRecipe = false; boolean isCraftingRecipe = false;
if(recipe instanceof Recipe<?> castRecipe) if (recipe instanceof RecipeHolder<?> castRecipe) {
{ isCraftingRecipe = castRecipe.value().getType() == net.minecraft.world.item.crafting.RecipeType.CRAFTING;
isCraftingRecipe = castRecipe.getType() == net.minecraft.world.item.crafting.RecipeType.CRAFTING;
} }
if (gridContainer.getGrid().getGridType() == GridType.PATTERN && !isCraftingRecipe) { if (gridContainer.getGrid().getGridType() == GridType.PATTERN && !isCraftingRecipe) {
@@ -142,7 +141,6 @@ public class GridRecipeTransferHandler implements IRecipeTransferHandler<GridCon
private void move(IRecipeSlotsView recipeSlotsView) { private void move(IRecipeSlotsView recipeSlotsView) {
List<List<ItemStack>> inputs = recipeSlotsView.getSlotViews(RecipeIngredientRole.INPUT).stream().map(view -> { List<List<ItemStack>> inputs = recipeSlotsView.getSlotViews(RecipeIngredientRole.INPUT).stream().map(view -> {
//Creating a mutable list //Creating a mutable list
List<ItemStack> stacks = view.getItemStacks().collect(Collectors.toCollection(ArrayList::new)); List<ItemStack> stacks = view.getItemStacks().collect(Collectors.toCollection(ArrayList::new));