testserver/patches/removed/1.17/0114-Chunk-registration-fix...

25 lines
1.3 KiB
Diff
Raw Normal View History

2021-06-11 12:02:28 +00:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Wed, 21 Sep 2016 22:54:28 -0400
Subject: [PATCH] Chunk registration fixes
World checks and the Chunk Add logic are inconsistent on how Y > 256, < 0, is treated
Keep them consistent
2021-06-12 06:02:49 +00:00
No longer relevant in 1.17
2021-06-11 12:02:28 +00:00
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 335928d60dbfc07644ffeab366900c5e77e99d56..20650bfd10abfa010e71cfeede06c461d50d19a3 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -841,7 +841,7 @@ public class ServerLevel extends net.minecraft.world.level.Level implements Worl
if (entity.checkAndResetUpdateChunkPos()) {
this.getProfiler().push("chunkCheck");
int i = Mth.floor(entity.getX() / 16.0D);
- int j = Mth.floor(entity.getY() / 16.0D);
+ int j = Math.min(15, Math.max(0, Mth.floor(entity.getY() / 16.0D))); // Paper - stay consistent with chunk add/remove behavior
int k = Mth.floor(entity.getZ() / 16.0D);
if (!entity.inChunk || entity.xChunk != i || entity.yChunk != j || entity.zChunk != k) {