From ee2e3f5670923c7e90dd298163822152ec56296e Mon Sep 17 00:00:00 2001 From: Spottedleaf Date: Fri, 14 Dec 2018 21:52:29 -0800 Subject: [PATCH] Tuinity API Patches --- pom.xml | 8 ++++-- .../java/co/aikar/timings/TimingsExport.java | 3 +- src/main/java/org/bukkit/Server.java | 8 ++++++ src/main/java/org/bukkit/World.java | 28 +++++++++++++++++++ src/main/java/org/bukkit/entity/Player.java | 23 +++++++++++++++ 5 files changed, 67 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 58a1f7d07..19d003fa8 100644 --- a/pom.xml +++ b/pom.xml @@ -18,8 +18,8 @@ - 1.8 - 1.8 + 11 + 11 UTF-8 @@ -154,6 +154,10 @@ org.apache.maven.plugins maven-compiler-plugin 3.8.1 + + + true + diff --git a/src/main/java/co/aikar/timings/TimingsExport.java b/src/main/java/co/aikar/timings/TimingsExport.java index 93d5a3f97..cb92d7b21 100644 --- a/src/main/java/co/aikar/timings/TimingsExport.java +++ b/src/main/java/co/aikar/timings/TimingsExport.java @@ -206,7 +206,8 @@ class TimingsExport extends Thread { parent.put("config", createObject( pair("spigot", mapAsJSON(Bukkit.spigot().getSpigotConfig(), null)), pair("bukkit", mapAsJSON(Bukkit.spigot().getBukkitConfig(), null)), - pair("paper", mapAsJSON(Bukkit.spigot().getPaperConfig(), null)) + pair("paper", mapAsJSON(Bukkit.spigot().getPaperConfig(), null)), // Tuinity - add config to timings report + pair("tuinity", mapAsJSON(Bukkit.spigot().getTuinityConfig(), null)) // Tuinity - add config to timings report )); new TimingsExport(listeners, parent, history).start(); diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java index 80f9abdca..55ec8d2d0 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java @@ -1371,6 +1371,14 @@ public interface Server extends PluginMessageRecipient { } // Paper end + // Tuinity start - add config to timings report + @NotNull + public org.bukkit.configuration.file.YamlConfiguration getTuinityConfig() + { + throw new UnsupportedOperationException("Not supported yet."); + } + // Tuinity end - add config to timings report + /** * Sends the component to the player * diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java index db18f70ec..be92b1a3e 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java @@ -3166,6 +3166,34 @@ public interface World extends PluginMessageRecipient, Metadatable { int getViewDistance(); // Spigot end + // Tuinity 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); + // Tuinity 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 877ea4f32..5367975ac 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java @@ -1969,6 +1969,29 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM void resetCooldown(); // Paper end + // Tuinity start + /** + * Returns the no-tick view distance for this player. + *

+ * 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 player. + */ + int getNoTickViewDistance(); + + /** + * Sets the no-tick view distance for this player. Setting to a value of -1 will default to the world no-tick + * view distance. + *

+ * 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] or -1 + */ + void setNoTickViewDistance(int viewDistance); + // Tuinity end + // Spigot start public class Spigot extends Entity.Spigot { -- 2.24.0