From 40b2002c0a20e917be8e0fc4870e65670d064749 Mon Sep 17 00:00:00 2001 From: bruberu <80226372+bruberu@users.noreply.github.com> Date: Sun, 14 Apr 2024 13:09:16 -0500 Subject: [PATCH] Fix blocks not being able to choose preferred meta values in previews (#2446) --- .../jei/multiblock/MultiblockInfoRecipeWrapper.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/gregtech/integration/jei/multiblock/MultiblockInfoRecipeWrapper.java b/src/main/java/gregtech/integration/jei/multiblock/MultiblockInfoRecipeWrapper.java index d0074db661c..b746f67a2cd 100644 --- a/src/main/java/gregtech/integration/jei/multiblock/MultiblockInfoRecipeWrapper.java +++ b/src/main/java/gregtech/integration/jei/multiblock/MultiblockInfoRecipeWrapper.java @@ -527,7 +527,12 @@ private static Collection gatherStructureBlocks(World world, @NotNull stack = ((IGregTechTileEntity) tileEntity).getMetaTileEntity().getStackForm(); } if (stack.isEmpty()) { - // try the itemstack constructor if we're not a GT machine + // first, see what the block has to say for itself before forcing it to use a particular meta value + stack = block.getPickBlock(state, new RayTraceResult(Vec3d.ZERO, EnumFacing.UP, pos), world, pos, + new GregFakePlayer(world)); + } + if (stack.isEmpty()) { + // try the default itemstack constructor if we're not a GT machine stack = GTUtility.toItem(state); } if (stack.isEmpty()) { @@ -541,11 +546,6 @@ private static Collection gatherStructureBlocks(World world, @NotNull } } } - if (stack.isEmpty()) { - // if everything else doesn't work, try the not great getPickBlock() with some dummy values - stack = block.getPickBlock(state, new RayTraceResult(Vec3d.ZERO, EnumFacing.UP, pos), world, pos, - new GregFakePlayer(world)); - } // if we got a stack, add it to the set and map if (!stack.isEmpty()) {