36 lines
2.0 KiB
Diff
36 lines
2.0 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Aikar <aikar@aikar.co>
|
|
Date: Sun, 7 Jun 2020 19:25:13 -0400
|
|
Subject: [PATCH] Use seed based lookup for Treasure Maps - Fixes lag from
|
|
carto/sunken maps
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
|
index bf4e50cd1d561456c033cda2d5c5487c5e3fe1eb..61aee2c109614a014149ae5a15ad2a28c796cb9d 100644
|
|
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
|
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
|
@@ -415,8 +415,8 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl
|
|
this.worldDataServer.setThundering(thundering);
|
|
}
|
|
|
|
- @Override
|
|
- public Biome getUncachedNoiseBiome(int biomeX, int biomeY, int biomeZ) {
|
|
+ public Biome getBiomeBySeed(int i, int j, int k) { return getUncachedNoiseBiome(i, j, k); } // Paper - OBFHELPER
|
|
+ @Override public Biome getUncachedNoiseBiome(int biomeX, int biomeY, int biomeZ) {
|
|
return this.getChunkSource().getGenerator().getBiomeSource().getNoiseBiome(biomeX, biomeY, biomeZ);
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/item/MapItem.java b/src/main/java/net/minecraft/world/item/MapItem.java
|
|
index 05759dc6edaa790a5e3f2ca2e0ae27e53cfa4397..550892bc769a58991583b16295a72a162ceea788 100644
|
|
--- a/src/main/java/net/minecraft/world/item/MapItem.java
|
|
+++ b/src/main/java/net/minecraft/world/item/MapItem.java
|
|
@@ -252,7 +252,7 @@ public class MapItem extends ComplexItem {
|
|
|
|
for (l = 0; l < 128 * i; ++l) {
|
|
for (i1 = 0; i1 < 128 * i; ++i1) {
|
|
- abiomebase[l * 128 * i + i1] = worldserver.getBiome(new BlockPos((j / i - 64) * i + i1, 0, (k / i - 64) * i + l));
|
|
+ abiomebase[l * 128 * i + i1] = worldserver.getBiomeBySeed((j / i - 64) * i + i1, 0, (k / i - 64) * i + l); // Paper
|
|
}
|
|
}
|
|
|