Don't not shuffle visible chunks (#6283)

This commit is contained in:
Nassim Jahnke 2021-08-02 10:00:31 +02:00 committed by GitHub
parent a44f486694
commit 8c28a33d4e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 51 additions and 65 deletions

View file

@ -3079,7 +3079,7 @@ index e9d2034f0753670c2ce69cc93c7e98e89af65c87..2b62f4664f439808661d559dc99762bf
@Override
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
index 9591f50922343283597bad6d9ac17c175d8ae230..8639ffa2347e3d5c44ab30de0aa98623f95d1fe7 100644
index 9591f50922343283597bad6d9ac17c175d8ae230..8513490230f5fae0042f536b69b401efca995293 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
@@ -44,6 +44,7 @@ import net.minecraft.world.level.levelgen.structure.templatesystem.StructureMana
@ -3299,21 +3299,7 @@ index 9591f50922343283597bad6d9ac17c175d8ae230..8639ffa2347e3d5c44ab30de0aa98623
@Nullable
@Override
public ChunkAccess getChunk(int x, int z, ChunkStatus leastStatus, boolean create) {
@@ -425,10 +621,9 @@ public class ServerChunkCache extends ChunkSource {
this.lastSpawnState = spawnercreature_d;
this.level.getProfiler().pop();
- List<ChunkHolder> list = Lists.newArrayList(this.chunkMap.getChunks());
-
- Collections.shuffle(list);
- list.forEach((playerchunk) -> {
+ //List<PlayerChunk> list = Lists.newArrayList(this.playerChunkMap.f()); // Paper
+ //Collections.shuffle(list); // Paper
+ this.chunkMap.getChunks().forEach((playerchunk) -> { // Paper - no... just no...
Optional<LevelChunk> optional = ((Either) playerchunk.getTickingChunkFuture().getNow(ChunkHolder.UNLOADED_LEVEL_CHUNK)).left();
if (optional.isPresent()) {
@@ -453,7 +648,7 @@ public class ServerChunkCache extends ChunkSource {
@@ -453,7 +649,7 @@ public class ServerChunkCache extends ChunkSource {
}
this.level.getProfiler().popPush("broadcast");
@ -3447,7 +3433,7 @@ index e6d003701426a823768966d944384c69b9701967..3b09f76805053802bb779e227749d814
@Override
public float getBukkitYaw() {
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
index 3a830166b65e81b970b0e9930bd79cb3e4eafc74..9d9d7990c49fd37c660efcb2c87a6c3495d648a6 100644
index deac6d08082b3291e748af6394235b3d18790ff2..d0047fc5156f13c831ab4f23a429d567ed6a39ac 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -235,6 +235,7 @@ public abstract class Mob extends LivingEntity {