More compile fixes

- Re-removes Bukkit#getServerName - This was (hopefully?) only added back
  for Timings v2. It should be kept in that scope.

- Intend to let PlayerViewDistance API slip. Given the scope of the
  changes in this area it seems best to let this slip past initial
  release. It can be re-added when there is additional time to focus on it
  and the changed systems it relies on. If it is fixed prior to release
  this is implemented as a single shim patch that can be dropped.
This commit is contained in:
Zach Brown
2019-05-06 03:20:16 -04:00
parent 6281fc8f11
commit 1fa1246a1e
56 changed files with 464 additions and 203 deletions

View File

@@ -1682,7 +1682,7 @@ index 00000000..c0d8f201
+}
diff --git a/src/main/java/co/aikar/timings/TimingsExport.java b/src/main/java/co/aikar/timings/TimingsExport.java
new file mode 100644
index 00000000..65d312b0
index 00000000..ea8734c4
--- /dev/null
+++ b/src/main/java/co/aikar/timings/TimingsExport.java
@@ -0,0 +0,0 @@
@@ -1799,7 +1799,7 @@ index 00000000..65d312b0
+ );
+ if (!TimingsManager.privacy) {
+ appendObjectData(parent,
+ pair("server", Bukkit.getServerName()),
+ pair("server", Bukkit.getUnsafe().getTimingsServerName()),
+ pair("motd", Bukkit.getServer().getMotd()),
+ pair("online-mode", Bukkit.getServer().getOnlineMode()),
+ pair("icon", Bukkit.getServer().getServerIcon().getData())
@@ -1976,8 +1976,8 @@ index 00000000..65d312b0
+ String hostName = "BrokenHost";
+ try {
+ hostName = InetAddress.getLocalHost().getHostName();
+ } catch(Exception ignored) {}
+ con.setRequestProperty("User-Agent", "Paper/" + Bukkit.getServerName() + "/" + hostName);
+ } catch (Exception ignored) {}
+ con.setRequestProperty("User-Agent", "Paper/" + Bukkit.getUnsafe().getTimingsServerName() + "/" + hostName);
+ con.setRequestMethod("POST");
+ con.setInstanceFollowRedirects(false);
+
@@ -3139,27 +3139,9 @@ index 00000000..5989ee21
+ }
+}
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 1c1f650d..d2e47a35 100644
index 1c1f650d..8f46899f 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -0,0 +0,0 @@ public final class Bukkit {
return server.getIp();
}
+ // Paper start - bring back server name
+ /**
+ * Get the name of this server
+ * @return the name of the server
+ */
+ @NotNull
+ public static String getServerName() {
+ return server.getServerName();
+ }
+ // Paper
+
/**
* Get world type (level-type setting) for default world.
*
@@ -0,0 +0,0 @@ public final class Bukkit {
*/
public static void reload() {
@@ -3169,25 +3151,9 @@ index 1c1f650d..d2e47a35 100644
/**
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 2a55a954..77d993ad 100644
index 2a55a954..0f9e5ba7 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -0,0 +0,0 @@ public interface Server extends PluginMessageRecipient {
@NotNull
public String getIp();
+ // Paper start - bring back server name
+ /**
+ * Get the name of this server
+ * @return the name of the server
+ */
+ @NotNull
+ public String getServerName();
+ // Paper
+
/**
* Get world type (level-type setting) for default world.
*
@@ -0,0 +0,0 @@ public interface Server extends PluginMessageRecipient {
throw new UnsupportedOperationException( "Not supported yet." );
}
@@ -3215,6 +3181,23 @@ index 2a55a954..77d993ad 100644
/**
* Sends the component to the player
*
diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
index 247d194f..72c5501e 100644
--- a/src/main/java/org/bukkit/UnsafeValues.java
+++ b/src/main/java/org/bukkit/UnsafeValues.java
@@ -0,0 +0,0 @@ public interface UnsafeValues {
* @return true if a file matching this key was found and deleted
*/
boolean removeAdvancement(NamespacedKey key);
+
+ // Paper start
+ /**
+ * Server name to report to timings v2
+ * @return name
+ */
+ String getTimingsServerName();
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/command/BufferedCommandSender.java b/src/main/java/org/bukkit/command/BufferedCommandSender.java
new file mode 100644
index 00000000..f9a00aec