PaperMC/patches/server-remapped/Chunk-registration-fixes.patch
MiniDigger | Martin 95d25d98e8 Move patches around
2021-06-11 14:02:28 +02:00

22 lines
1.2 KiB
Diff

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
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -0,0 +0,0 @@ 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) {