aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/removed/1.17/No longer needed/0114-Chunk-registration-fixes.patch
blob: 295d9a4664b09012ca3dba52f5ced7b3cc6f9685 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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

No longer relevant in 1.17

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) {