summaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2018-11-02 21:24:14 +1100
committermd_5 <git@md-5.net>2018-11-02 21:24:14 +1100
commit96c461b3a528611ab4d4e22d71c63e10f9a1d034 (patch)
tree196413e8e07f99e4ecfe0ff2bc6a06798079c83d /src/main/java
parente2785f4eda72c25e4e6144a5b1ed982730bc7923 (diff)
downloadcraftbukkit-96c461b3a528611ab4d4e22d71c63e10f9a1d034.tar
craftbukkit-96c461b3a528611ab4d4e22d71c63e10f9a1d034.tar.gz
craftbukkit-96c461b3a528611ab4d4e22d71c63e10f9a1d034.tar.lz
craftbukkit-96c461b3a528611ab4d4e22d71c63e10f9a1d034.tar.xz
craftbukkit-96c461b3a528611ab4d4e22d71c63e10f9a1d034.zip
API to get client side view distance.
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 82000a35..675d5a4e 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1615,6 +1615,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
@Override
+ public int getClientViewDistance() {
+ return (getHandle().clientViewDistance == null) ? Bukkit.getViewDistance() : getHandle().clientViewDistance;
+ }
+
+ @Override
public String getLocale() {
return getHandle().locale;
}