Files
Purpur/patches/api/0002-Tuinity-API-Patches.patch
William Blake Galbreath 86c5a55f46 Update Tuinity patches
2020-03-25 19:29:47 -05:00

149 lines
5.8 KiB
Diff

From e20cb2d48ea29c7f5330233ade4aa7a5ef2b156b Mon Sep 17 00:00:00 2001
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
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 @@
<properties>
<!-- <skipTests>true</skipTests> Paper - This [was] not going to end well -->
- <maven.compiler.source>1.8</maven.compiler.source>
- <maven.compiler.target>1.8</maven.compiler.target>
+ <maven.compiler.source>11</maven.compiler.source>
+ <maven.compiler.target>11</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
@@ -154,6 +154,10 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
+ <!-- Tuinity - https://issues.apache.org/jira/browse/MCOMPILER-346 -->
+ <configuration>
+ <forceJavacCompilerUse>true</forceJavacCompilerUse>
+ </configuration>
<dependencies>
<!-- we need our custom version as it fixes some bugs on case sensitive file systems -->
<dependency>
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 af0637f76..a3ed3154a 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -3165,6 +3165,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.
+ * <p>
+ * No-tick view distance is the view distance where chunks will load, however the chunks and their entities will not
+ * be set to tick.
+ * </p>
+ * @return The no-tick view distance for this world.
+ */
+ int getNoTickViewDistance();
+
+ /**
+ * Sets the no-tick view distance for this world.
+ * <p>
+ * No-tick view distance is the view distance where chunks will load, however the chunks and their entities will not
+ * be set to tick.
+ * </p>
+ * @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.
+ * <p>
+ * No-tick view distance is the view distance where chunks will load, however the chunks and their entities will not
+ * be set to tick.
+ * </p>
+ * @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.
+ * <p>
+ * No-tick view distance is the view distance where chunks will load, however the chunks and their entities will not
+ * be set to tick.
+ * </p>
+ * @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