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 MapItem incorectly fetching water biomes on treasure maps #11936

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Owen1212055
Copy link
Member

@Owen1212055 Owen1212055 commented Jan 9, 2025

This fixes a slight deviation from vanilla in that we incorrectly use the x/y/z coordinates rather than passing section coords.
This is because the old method (getBiome) uses block coords, while uncached noise uses the section positions.

This whole "optimization" creates a big enough deviation in that it probably isn't noticeable. So maybe in future, this should be made configurable?

Note: This is an old issue, not hardfork issue.

This fixes a slight deviation from vanilla in that we incorrectly use the x/y/z coordinates rather than passing section coords.

This is because the old method (getBiome) uses block coords, while uncached noise uses the section positions.
@Owen1212055 Owen1212055 requested a review from a team as a code owner January 9, 2025 19:27
@@ -16,7 +16,7 @@
for (int i5 = 0; i5 < 128; i5++) {
for (int i6 = 0; i6 < 128; i6++) {
- Holder<Biome> biome = serverLevel.getBiome(mutableBlockPos.set((i3 + i6) * i, 0, (i4 + i5) * i));
+ Holder<Biome> biome = serverLevel.getUncachedNoiseBiome((i3 + i6) * i, 0, (i4 + i5) * i); // Paper - Perf: Use seed based lookup for treasure maps
+ Holder<Biome> biome = serverLevel.getUncachedNoiseBiome(net.minecraft.core.QuartPos.fromBlock((i3 + i6) * i), net.minecraft.core.QuartPos.fromBlock(0), net.minecraft.core.QuartPos.fromBlock((i4 + i5) * i)); // Paper - Perf: Use seed based lookup for treasure maps
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fromBlock(0) could just be left as 0

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did that for just logic consistency-- it shouldn't really matter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Awaiting review
Development

Successfully merging this pull request may close these issues.

2 participants