From c6605ce587dc904e9dc2935a9c942b5443071ba6 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Wed, 23 May 2018 16:16:09 +1000 Subject: [PATCH] Fixes #1010 --- bukkit/src/main/java/com/boydti/fawe/bukkit/FaweBukkit.java | 2 +- .../java/com/boydti/fawe/bukkit/listener/RenderListener.java | 5 +++-- core/src/main/java/com/boydti/fawe/config/Settings.java | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/bukkit/src/main/java/com/boydti/fawe/bukkit/FaweBukkit.java b/bukkit/src/main/java/com/boydti/fawe/bukkit/FaweBukkit.java index 59805957..653384e4 100644 --- a/bukkit/src/main/java/com/boydti/fawe/bukkit/FaweBukkit.java +++ b/bukkit/src/main/java/com/boydti/fawe/bukkit/FaweBukkit.java @@ -120,7 +120,7 @@ public class FaweBukkit implements IFawe, Listener { debug(" - This is only a recommendation"); debug("=============================="); } - if (Bukkit.getVersion().contains("git-Paper") && Settings.IMP.EXPERIMENTAL.DYNAMIC_CHUNK_RENDERING) { + if (Bukkit.getVersion().contains("git-Paper") && Settings.IMP.EXPERIMENTAL.DYNAMIC_CHUNK_RENDERING > 1) { new RenderListener(plugin); } try { diff --git a/bukkit/src/main/java/com/boydti/fawe/bukkit/listener/RenderListener.java b/bukkit/src/main/java/com/boydti/fawe/bukkit/listener/RenderListener.java index 7de44adc..8824f369 100644 --- a/bukkit/src/main/java/com/boydti/fawe/bukkit/listener/RenderListener.java +++ b/bukkit/src/main/java/com/boydti/fawe/bukkit/listener/RenderListener.java @@ -1,6 +1,7 @@ package com.boydti.fawe.bukkit.listener; import com.boydti.fawe.Fawe; +import com.boydti.fawe.config.Settings; import com.boydti.fawe.object.FawePlayer; import com.boydti.fawe.util.TaskManager; import java.util.Iterator; @@ -76,7 +77,7 @@ public class RenderListener implements Listener { public void setViewDistance(Player player, int value) { UUID uuid = player.getUniqueId(); - if (value == 10) { + if (value == Settings.IMP.EXPERIMENTAL.DYNAMIC_CHUNK_RENDERING) { views.remove(uuid); } else { int[] val = views.get(uuid); @@ -100,7 +101,7 @@ public class RenderListener implements Listener { public int getViewDistance(Player player) { int[] value = views.get(player.getUniqueId()); - return value == null ? 10 : value[0]; + return value == null ? Settings.IMP.EXPERIMENTAL.DYNAMIC_CHUNK_RENDERING : value[0]; } @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) diff --git a/core/src/main/java/com/boydti/fawe/config/Settings.java b/core/src/main/java/com/boydti/fawe/config/Settings.java index 8eacd932..03683d48 100644 --- a/core/src/main/java/com/boydti/fawe/config/Settings.java +++ b/core/src/main/java/com/boydti/fawe/config/Settings.java @@ -313,7 +313,7 @@ public class Settings extends Config { " - Based on tps and player movement", " - Please provide feedback", }) - public boolean DYNAMIC_CHUNK_RENDERING = false; + public int DYNAMIC_CHUNK_RENDERING = -1; @Comment({ "[SAFE] Allows brushes to be persistent", })