mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-29 07:48:53 +01:00
Use seed based lookup for Treasure Maps - Fixes lag from carto/sunken maps
This commit is contained in:
parent
74dcb3c923
commit
dfd3848ee6
1 changed files with 36 additions and 0 deletions
|
@ -0,0 +1,36 @@
|
|||
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/ItemWorldMap.java b/src/main/java/net/minecraft/server/ItemWorldMap.java
|
||||
index 134468da1a8fad6fdd48f64bf9ea885794e86bdf..b09de92ee56f491f7b4c526105f8d306b365a275 100644
|
||||
--- a/src/main/java/net/minecraft/server/ItemWorldMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/ItemWorldMap.java
|
||||
@@ -229,7 +229,7 @@ public class ItemWorldMap extends ItemWorldMapBase {
|
||||
|
||||
for (l = 0; l < 128 * i; ++l) {
|
||||
for (i1 = 0; i1 < 128 * i; ++i1) {
|
||||
- abiomebase[l * 128 * i + i1] = worldserver.getBiome(new BlockPosition((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
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
index 854c97bddb711ed252c2ae8398247641fdfb10be..17289cf3776a5db2f17b493e39fea83d4d0c4abd 100644
|
||||
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
||||
@@ -283,8 +283,9 @@ public class WorldServer extends World {
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
- @Override
|
||||
- public BiomeBase a(int i, int j, int k) {
|
||||
+
|
||||
+ public BiomeBase getBiomeBySeed(int i, int j, int k) { return a(i, j, k); } // Paper - OBFHELPER
|
||||
+ @Override public BiomeBase a(int i, int j, int k) {
|
||||
return this.getChunkProvider().getChunkGenerator().getWorldChunkManager().getBiome(i, j, k);
|
||||
}
|
||||
|
Loading…
Reference in a new issue