aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0009-MC-Utils.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/server/0009-MC-Utils.patch')
-rw-r--r--patches/server/0009-MC-Utils.patch18
1 files changed, 9 insertions, 9 deletions
diff --git a/patches/server/0009-MC-Utils.patch b/patches/server/0009-MC-Utils.patch
index 98b049b563..9958d9735c 100644
--- a/patches/server/0009-MC-Utils.patch
+++ b/patches/server/0009-MC-Utils.patch
@@ -2599,7 +2599,7 @@ index 0000000000000000000000000000000000000000..c2d917c2eac55b8a4411a6e159f177f9
+}
diff --git a/src/main/java/ca/spottedleaf/moonrise/common/misc/NearbyPlayers.java b/src/main/java/ca/spottedleaf/moonrise/common/misc/NearbyPlayers.java
new file mode 100644
-index 0000000000000000000000000000000000000000..bb44de17a37082e57f2292a4f470740be1d09b11
+index 0000000000000000000000000000000000000000..7e440b4a46b040365df7317035e577d93e7d855d
--- /dev/null
+++ b/src/main/java/ca/spottedleaf/moonrise/common/misc/NearbyPlayers.java
@@ -0,0 +1,273 @@
@@ -2727,7 +2727,7 @@ index 0000000000000000000000000000000000000000..bb44de17a37082e57f2292a4f470740b
+ players[NearbyMapType.GENERAL_SMALL.ordinal()].update(chunk.x, chunk.z, GENERAL_SMALL_VIEW_DISTANCE);
+ players[NearbyMapType.GENERAL_REALLY_SMALL.ordinal()].update(chunk.x, chunk.z, GENERAL_REALLY_SMALL_VIEW_DISTANCE);
+ players[NearbyMapType.TICK_VIEW_DISTANCE.ordinal()].update(chunk.x, chunk.z, ChunkSystem.getTickViewDistance(player));
-+ players[NearbyMapType.VIEW_DISTANCE.ordinal()].update(chunk.x, chunk.z, ChunkSystem.getLoadViewDistance(player));
++ players[NearbyMapType.VIEW_DISTANCE.ordinal()].update(chunk.x, chunk.z, ChunkSystem.getViewDistance(player));
+ players[NearbyMapType.SPAWN_RANGE.ordinal()].update(chunk.x, chunk.z, ChunkTickConstants.PLAYER_SPAWN_TRACK_RANGE); // Moonrise - chunk tick iteration
+ }
+
@@ -3311,7 +3311,7 @@ index 0000000000000000000000000000000000000000..4123edddc556c47f3f8d83523c125fd2
+}
diff --git a/src/main/java/ca/spottedleaf/moonrise/common/util/ChunkSystem.java b/src/main/java/ca/spottedleaf/moonrise/common/util/ChunkSystem.java
new file mode 100644
-index 0000000000000000000000000000000000000000..f7cd0aa43d0b9249d0a317fab41fefa0d951bca0
+index 0000000000000000000000000000000000000000..58a99bc38e137431f10af36fa9e2d04fe61694aa
--- /dev/null
+++ b/src/main/java/ca/spottedleaf/moonrise/common/util/ChunkSystem.java
@@ -0,0 +1,288 @@
@@ -3582,15 +3582,15 @@ index 0000000000000000000000000000000000000000..f7cd0aa43d0b9249d0a317fab41fefa0
+ }
+
+ public static int getSendViewDistance(final ServerPlayer player) {
-+ return getLoadViewDistance(player) - 1;
++ return getViewDistance(player);
+ }
+
-+ public static int getLoadViewDistance(final ServerPlayer player) {
++ public static int getViewDistance(final ServerPlayer player) {
+ final ServerLevel level = player.serverLevel();
+ if (level == null) {
-+ return org.bukkit.Bukkit.getViewDistance() + 1;
++ return org.bukkit.Bukkit.getViewDistance();
+ }
-+ return level.chunkSource.chunkMap.serverViewDistance + 1;
++ return level.chunkSource.chunkMap.serverViewDistance;
+ }
+
+ public static int getTickViewDistance(final ServerPlayer player) {
@@ -6415,7 +6415,7 @@ index 799444e4101283c972a160742a9e2548e604173f..fb8c641604473a3853b2f8b9cd5c8a65
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index 031eed24638659f2633bef0ad2e178832ca058e9..a3550d84c273c9720491484382a4bc50dc3246a6 100644
+index 031eed24638659f2633bef0ad2e178832ca058e9..2e4e6fee48d0f6be3b23a109a7c661b27179ccaa 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -2447,4 +2447,34 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@@ -6425,7 +6425,7 @@ index 031eed24638659f2633bef0ad2e178832ca058e9..a3550d84c273c9720491484382a4bc50
+
+ @Override
+ public int getViewDistance() {
-+ return ca.spottedleaf.moonrise.common.util.ChunkSystem.getLoadViewDistance(this.getHandle()) - 1;
++ return ca.spottedleaf.moonrise.common.util.ChunkSystem.getViewDistance(this.getHandle());
+ }
+
+ @Override