papermc/Spigot-API-Patches/0009-Add-player-view-distance-API.patch

35 lines
1,018 B
Diff
Raw Normal View History

From f55af4cd8b293ae009697b6891b00c8dcf9d648f Mon Sep 17 00:00:00 2001
2016-02-29 23:09:49 +00:00
From: Byteflux <byte@byteflux.net>
Date: Mon, 29 Feb 2016 18:05:37 -0600
Subject: [PATCH] Add player view distance API
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 4412f6ee..d5b904e6 100644
2016-02-29 23:09:49 +00:00
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
2018-07-29 16:42:07 +00:00
@@ -1497,6 +1497,20 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
2016-02-29 23:09:49 +00:00
*/
public void setAffectsSpawning(boolean affects);
+ /**
+ * Gets the view distance for this player
+ *
+ * @return the player's view distance
+ */
+ public int getViewDistance();
+
+ /**
+ * Sets the view distance for this player
+ *
+ * @param viewDistance the player's view distance
+ */
+ public void setViewDistance(int viewDistance);
+
// Spigot start
public class Spigot extends Entity.Spigot
{
--
2018-07-29 16:42:07 +00:00
2.18.0
2016-02-29 23:09:49 +00:00