From 96c461b3a528611ab4d4e22d71c63e10f9a1d034 Mon Sep 17 00:00:00 2001 From: md_5 Date: Fri, 2 Nov 2018 21:24:14 +1100 Subject: API to get client side view distance. --- src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') 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 @@ -1614,6 +1614,11 @@ public class CraftPlayer extends CraftHumanEntity implements Player { return new CraftAdvancementProgress(craft, data, progress); } + @Override + public int getClientViewDistance() { + return (getHandle().clientViewDistance == null) ? Bukkit.getViewDistance() : getHandle().clientViewDistance; + } + @Override public String getLocale() { return getHandle().locale; -- cgit v1.2.3