From ce4697f70408ce58cc0d73b784c84aa55f8ef89c Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Mon, 22 Nov 2021 10:24:13 +0100 Subject: [PATCH] Fix view distance api patch --- patches/api/Add-view-distance-API.patch | 57 +++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/patches/api/Add-view-distance-API.patch b/patches/api/Add-view-distance-API.patch index c45c2c0a48..35fbf40515 100644 --- a/patches/api/Add-view-distance-API.patch +++ b/patches/api/Add-view-distance-API.patch @@ -7,6 +7,63 @@ Add per player no-tick, tick, and send view distances. Also add send/no-tick view distance to World. +diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/World.java ++++ b/src/main/java/org/bukkit/World.java +@@ -0,0 +0,0 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient + int getSimulationDistance(); + // Spigot end + ++ // Paper start - view distance api ++ /** ++ * Sets the view distance for this world. ++ * @param viewDistance view distance in [2, 32] ++ */ ++ void setViewDistance(int viewDistance); ++ ++ /** ++ * Returns the no-tick view distance for this world. ++ *

++ * No-tick view distance is the view distance where chunks will load, however the chunks and their entities will not ++ * be set to tick. ++ *

++ * @return The no-tick view distance for this world. ++ */ ++ int getNoTickViewDistance(); ++ ++ /** ++ * Sets the no-tick view distance for this world. ++ *

++ * No-tick view distance is the view distance where chunks will load, however the chunks and their entities will not ++ * be set to tick. ++ *

++ * @param viewDistance view distance in [2, 32] ++ */ ++ void setNoTickViewDistance(int viewDistance); ++ ++ /** ++ * Gets the sending view distance for this world. ++ *

++ * Sending view distance is the view distance where chunks will load in for players in this world. ++ *

++ * @return The sending view distance for this world. ++ */ ++ public int getSendViewDistance(); ++ ++ /** ++ * Sets the sending view distance for this world. ++ *

++ * Sending view distance is the view distance where chunks will load in for players in this world. ++ *

++ * @param viewDistance view distance in [2, 32] or -1 ++ */ ++ public void setSendViewDistance(int viewDistance); ++ // Paper end - view distance api ++ + // Spigot start + public class Spigot { + diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/entity/Player.java