Skip to content

Commit

Permalink
fix: jei transfer in the pattern grid wrongly choosing processing mode
Browse files Browse the repository at this point in the history
  • Loading branch information
raoulvdberge committed Feb 16, 2024
1 parent 3e687f4 commit 6959fbc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Fixed

- Fixed JEI transfer in the Pattern Grid wrongly choosing "Processing" mode.

## [1.13.0-beta.1] - 2024-02-12

### Added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.inventory.MenuType;
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 org.jetbrains.annotations.Nullable;

Expand Down Expand Up @@ -128,9 +128,8 @@ private void moveItems(GridContainerMenu gridContainer, Object recipe, IRecipeSl
this.lastTransferTimeMs = System.currentTimeMillis();

boolean isCraftingRecipe = false;
if(recipe instanceof Recipe<?> castRecipe)
{
isCraftingRecipe = castRecipe.getType() == net.minecraft.world.item.crafting.RecipeType.CRAFTING;
if (recipe instanceof RecipeHolder<?> castRecipe) {
isCraftingRecipe = castRecipe.value().getType() == net.minecraft.world.item.crafting.RecipeType.CRAFTING;
}

if (gridContainer.getGrid().getGridType() == GridType.PATTERN && !isCraftingRecipe) {
Expand All @@ -142,7 +141,6 @@ private void moveItems(GridContainerMenu gridContainer, Object recipe, IRecipeSl

private void move(IRecipeSlotsView recipeSlotsView) {
List<List<ItemStack>> inputs = recipeSlotsView.getSlotViews(RecipeIngredientRole.INPUT).stream().map(view -> {

//Creating a mutable list
List<ItemStack> stacks = view.getItemStacks().collect(Collectors.toCollection(ArrayList::new));

Expand Down

0 comments on commit 6959fbc

Please sign in to comment.