PaperMC/paper-server/patches/sources/net/minecraft/world/item/MapItem.java.patch
2024-12-14 12:50:23 -08:00

22 lines
1.5 KiB
Diff

--- a/net/minecraft/world/item/MapItem.java
+++ b/net/minecraft/world/item/MapItem.java
@@ -99,8 +_,8 @@
int i9 = (i1 / i + i6 - 64) * i;
int i10 = (i2 / i + i7 - 64) * i;
Multiset<MapColor> multiset = LinkedHashMultiset.create();
- LevelChunk chunk = level.getChunk(SectionPos.blockToSectionCoord(i9), SectionPos.blockToSectionCoord(i10));
- if (!chunk.isEmpty()) {
+ LevelChunk chunk = level.getChunkIfLoaded(SectionPos.blockToSectionCoord(i9), SectionPos.blockToSectionCoord(i10)); // Paper - Maps shouldn't load chunks
+ if (chunk != null && !chunk.isEmpty()) { // Paper - Maps shouldn't load chunks
int i11 = 0;
double d1 = 0.0;
if (level.dimensionType().hasCeiling()) {
@@ -207,7 +_,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
flags[i5 * 128 + i6] = biome.is(BiomeTags.WATER_ON_MAP_OUTLINES);
}
}