From 0d44fec1fb68fe6efd1425c2c61ff26490fc290e Mon Sep 17 00:00:00 2001 From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Date: Sun, 21 Nov 2021 21:21:37 -0800 Subject: [PATCH] Update API patches --- patches/api/Add-view-distance-API.patch | 56 ---------------- patches/api/Adventure.patch | 72 ++++----------------- patches/api/Build-system-changes.patch | 10 +-- patches/api/Convert-project-to-Gradle.patch | 20 +++--- 4 files changed, 25 insertions(+), 133 deletions(-) diff --git a/patches/api/Add-view-distance-API.patch b/patches/api/Add-view-distance-API.patch index 5ca99cef8a..c45c2c0a48 100644 --- a/patches/api/Add-view-distance-API.patch +++ b/patches/api/Add-view-distance-API.patch @@ -7,62 +7,6 @@ Add per player no-tick, tick, and send view distances. Also add send/no-tick view distance to World. -diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/org/bukkit/World.java -+++ b/src/main/java/org/bukkit/World.java -@@ -0,0 +0,0 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient - int getViewDistance(); - // Spigot end - -+ // Paper 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); -+ -+ /** -+ * Gets the sending view distance for this world. -+ *

-+ * Sending view distance is the view distance where chunks will load in for players in this world. -+ *

-+ * @return The sending view distance for this world. -+ */ -+ public int getSendViewDistance(); -+ -+ /** -+ * Sets the sending view distance for this world. -+ *

-+ * Sending view distance is the view distance where chunks will load in for players in this world. -+ *

-+ * @param viewDistance view distance in [2, 32] or -1 -+ */ -+ public void setSendViewDistance(int viewDistance); -+ // Paper 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/entity/Player.java diff --git a/patches/api/Adventure.patch b/patches/api/Adventure.patch index eb36f17c40..193fac3d49 100644 --- a/patches/api/Adventure.patch +++ b/patches/api/Adventure.patch @@ -42,32 +42,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 compileOnly("org.apache.maven:maven-resolver-provider:3.8.1") compileOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.7.0") -@@ -0,0 +0,0 @@ tasks.jar { - } - - tasks.withType { -+ inputs.files(apiAndDocs) -+ .ignoreEmptyDirectories() -+ .withPropertyName(apiAndDocs.name + "-configuration") -+ doFirst { -+ (options as CoreJavadocOptions).addStringOption( -+ "sourcepath", -+ apiAndDocs.resolvedConfiguration.files.joinToString(separator = File.pathSeparator, transform = File::getPath) -+ ) -+ } - (options as StandardJavadocDocletOptions).links( - "https://guava.dev/releases/21.0/api/docs/", - "https://javadoc.io/doc/org.yaml/snakeyaml/1.28/", - "https://javadoc.io/doc/org.jetbrains/annotations/21.0.1/", // Paper - we don't want Java 5 annotations - "https://javadoc.io/doc/net.md-5/bungeecord-chat/1.16-R0.4/", -+ // Paper start -+ "https://jd.adventure.kyori.net/api/$adventureVersion/", -+ "https://jd.adventure.kyori.net/text-serializer-gson/$adventureVersion/", -+ "https://jd.adventure.kyori.net/text-serializer-legacy/$adventureVersion/", -+ "https://jd.adventure.kyori.net/text-serializer-plain/$adventureVersion/", -+ // Paper end - ) - } diff --git a/src/main/java/co/aikar/timings/TimingsReportListener.java b/src/main/java/co/aikar/timings/TimingsReportListener.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/co/aikar/timings/TimingsReportListener.java @@ -1721,10 +1695,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 * Says a message (or runs a command). * @@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM - @Deprecated - public boolean sendChunkChange(@NotNull Location loc, int sx, int sy, int sz, @NotNull byte[] data); + */ + public void sendEquipmentChange(@NotNull LivingEntity entity, @NotNull EquipmentSlot slot, @NotNull ItemStack item); -+ // Paper start + /** + * Send a sign change. This fakes a sign change packet for a user at + * a certain location. This will not actually change the world in any way. @@ -1737,25 +1710,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + * + * @param loc the location of the sign + * @param lines the new text on the sign or null to clear it ++ * @param dyeColor the color of the sign + * @throws IllegalArgumentException if location is null ++ * @throws IllegalArgumentException if dyeColor is null + * @throws IllegalArgumentException if lines is non-null and has a length less than 4 + */ -+ default void sendSignChange(@NotNull Location loc, @Nullable java.util.List lines) throws IllegalArgumentException { -+ this.sendSignChange(loc, lines, DyeColor.BLACK); -+ } -+ - /** - * Send a sign change. This fakes a sign change packet for a user at - * a certain location. This will not actually change the world in any way. -@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM - * - * @param loc the location of the sign - * @param lines the new text on the sign or null to clear it -+ * @param dyeColor the color of the sign - * @throws IllegalArgumentException if location is null -+ * @throws IllegalArgumentException if dyeColor is null - * @throws IllegalArgumentException if lines is non-null and has a length less than 4 - */ + default void sendSignChange(@NotNull Location loc, @Nullable java.util.List lines, @NotNull DyeColor dyeColor) throws IllegalArgumentException { + this.sendSignChange(loc, lines, dyeColor, false); + } @@ -1803,22 +1762,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + throws IllegalArgumentException; + // Paper end + -+ /** -+ * Send a sign change. This fakes a sign change packet for a user at -+ * a certain location. This will not actually change the world in any way. -+ * This method will use a sign at the location's block or a faked sign -+ * sent via -+ * {@link #sendBlockChange(org.bukkit.Location, org.bukkit.Material, byte)}. -+ *

-+ * If the client does not have a sign at the given location it will -+ * display an error message to the user. -+ * -+ * @param loc the location of the sign -+ * @param lines the new text on the sign or null to clear it -+ * @throws IllegalArgumentException if location is null -+ * @throws IllegalArgumentException if lines is non-null and has a length less than 4 + /** + * Send a sign change. This fakes a sign change packet for a user at + * a certain location. This will not actually change the world in any way. +@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM + * @param lines the new text on the sign or null to clear it + * @throws IllegalArgumentException if location is null + * @throws IllegalArgumentException if lines is non-null and has a length less than 4 + * @deprecated in favour of {@link #sendSignChange(org.bukkit.Location, java.util.List)} -+ */ + */ + @Deprecated // Paper public void sendSignChange(@NotNull Location loc, @Nullable String[] lines) throws IllegalArgumentException; diff --git a/patches/api/Build-system-changes.patch b/patches/api/Build-system-changes.patch index 2f8f0e748e..4228bc8577 100644 --- a/patches/api/Build-system-changes.patch +++ b/patches/api/Build-system-changes.patch @@ -9,11 +9,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -0,0 +0,0 @@ dependencies { - // api dependencies are listed transitively to API consumers - api("commons-lang:commons-lang:2.6") - api("com.google.guava:guava:21.0") -- api("com.google.code.gson:gson:2.8.0") -+ api("com.google.code.gson:gson:2.8.8") // Paper - bump + api("com.google.code.gson:gson:2.8.8") api("net.md-5:bungeecord-chat:1.16-R0.4") api("org.yaml:snakeyaml:1.28") + api("com.googlecode.json-simple:json-simple:1.1.1") // Paper @@ -29,7 +25,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 testCompileOnly(annotations) + // Paper start - add checker -+ val checkerAnnotations = "org.checkerframework:checker-qual:3.18.0" ++ val checkerAnnotations = "org.checkerframework:checker-qual:3.19.0" + compileOnlyApi(checkerAnnotations) + testCompileOnly(checkerAnnotations) + // Paper end @@ -39,7 +35,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 testImplementation("org.ow2.asm:asm-tree:9.2") @@ -0,0 +0,0 @@ tasks.withType { (options as StandardJavadocDocletOptions).links( - "https://guava.dev/releases/21.0/api/docs/", + "https://guava.dev/releases/31.0.1-jre/api/docs/", "https://javadoc.io/doc/org.yaml/snakeyaml/1.28/", - "https://javadoc.io/doc/org.jetbrains/annotations-java5/21.0.1/", + "https://javadoc.io/doc/org.jetbrains/annotations/21.0.1/", // Paper - we don't want Java 5 annotations diff --git a/patches/api/Convert-project-to-Gradle.patch b/patches/api/Convert-project-to-Gradle.patch index 70fa1cc004..7e4e1cc23f 100644 --- a/patches/api/Convert-project-to-Gradle.patch +++ b/patches/api/Convert-project-to-Gradle.patch @@ -46,8 +46,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +dependencies { + // api dependencies are listed transitively to API consumers + api("commons-lang:commons-lang:2.6") -+ api("com.google.guava:guava:21.0") -+ api("com.google.code.gson:gson:2.8.0") ++ api("com.google.guava:guava:31.0.1-jre") ++ api("com.google.code.gson:gson:2.8.8") + api("net.md-5:bungeecord-chat:1.16-R0.4") + api("org.yaml:snakeyaml:1.28") + @@ -93,7 +93,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + +tasks.withType { + (options as StandardJavadocDocletOptions).links( -+ "https://guava.dev/releases/21.0/api/docs/", ++ "https://guava.dev/releases/31.0.1-jre/api/docs/", + "https://javadoc.io/doc/org.yaml/snakeyaml/1.28/", + "https://javadoc.io/doc/org.jetbrains/annotations-java5/21.0.1/", + "https://javadoc.io/doc/net.md-5/bungeecord-chat/1.16-R0.4/", @@ -112,7 +112,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - - org.spigotmc - spigot-api -- 1.17.1-R0.1-SNAPSHOT +- 1.18-pre5-R0.1-SNAPSHOT - jar - - Spigot-API @@ -148,14 +148,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - - com.google.guava - guava -- 21.0 +- 31.0.1-jre - compile - - - - com.google.code.gson - gson -- 2.8.0 +- 2.8.8 - compile - - @@ -250,7 +250,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - - org.eclipse.jdt - ecj -- 3.26.0 +- 3.27.0 - - - @@ -297,10 +297,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - - org.apache.maven.plugins - maven-javadoc-plugin -- 3.3.0 +- 3.3.1 - - -- https://guava.dev/releases/21.0/api/docs/ +- https://guava.dev/releases/31.0.1-jre/api/docs/ - https://javadoc.io/doc/org.yaml/snakeyaml/1.28/ - https://javadoc.io/doc/org.jetbrains/annotations-java5/21.0.1/ - https://javadoc.io/doc/net.md-5/bungeecord-chat/1.16-R0.4/ @@ -338,7 +338,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - - com.puppycrawl.tools - checkstyle -- 8.44 +- 8.45.1 - - -