Skip to content

Commit

Permalink
Fix blocks not being able to choose preferred meta values in previews (
Browse files Browse the repository at this point in the history
  • Loading branch information
bruberu authored Apr 14, 2024
1 parent e927e2d commit 40b2002
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,12 @@ private static Collection<PartInfo> 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()) {
Expand All @@ -541,11 +546,6 @@ private static Collection<PartInfo> 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()) {
Expand Down

0 comments on commit 40b2002

Please sign in to comment.