Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix blocks not being able to choose preferred meta values in previews #2446

Merged
merged 1 commit into from
Apr 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading