Update API patches

This commit is contained in:
Jason Penilla 2021-11-21 21:21:37 -08:00
parent 255b304ff0
commit 0d44fec1fb
4 changed files with 25 additions and 133 deletions

View file

@ -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.
+ * <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);
+
+ /**
+ * Gets the sending view distance for this world.
+ * <p>
+ * Sending view distance is the view distance where chunks will load in for players in this world.
+ * </p>
+ * @return The sending view distance for this world.
+ */
+ public int getSendViewDistance();
+
+ /**
+ * Sets the sending view distance for this world.
+ * <p>
+ * Sending view distance is the view distance where chunks will load in for players in this world.
+ * </p>
+ * @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

View file

@ -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<Javadoc> {
+ 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<net.kyori.adventure.text.Component> 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<net.kyori.adventure.text.Component> 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)}.
+ * <p>
+ * 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;

View file

@ -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<Javadoc> {
(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

View file

@ -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<Javadoc> {
+ (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
-
- <groupId>org.spigotmc</groupId>
- <artifactId>spigot-api</artifactId>
- <version>1.17.1-R0.1-SNAPSHOT</version>
- <version>1.18-pre5-R0.1-SNAPSHOT</version>
- <packaging>jar</packaging>
-
- <name>Spigot-API</name>
@ -148,14 +148,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- <dependency>
- <groupId>com.google.guava</groupId>
- <artifactId>guava</artifactId>
- <version>21.0</version>
- <version>31.0.1-jre</version>
- <scope>compile</scope>
- </dependency>
- <!-- bundled with Minecraft, should be kept in sync -->
- <dependency>
- <groupId>com.google.code.gson</groupId>
- <artifactId>gson</artifactId>
- <version>2.8.0</version>
- <version>2.8.8</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
@ -250,7 +250,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- <dependency>
- <groupId>org.eclipse.jdt</groupId>
- <artifactId>ecj</artifactId>
- <version>3.26.0</version>
- <version>3.27.0</version>
- </dependency>
- </dependencies>
- </plugin>
@ -297,10 +297,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <version>3.3.0</version>
- <version>3.3.1</version>
- <configuration>
- <links>
- <link>https://guava.dev/releases/21.0/api/docs/</link>
- <link>https://guava.dev/releases/31.0.1-jre/api/docs/</link>
- <link>https://javadoc.io/doc/org.yaml/snakeyaml/1.28/</link>
- <link>https://javadoc.io/doc/org.jetbrains/annotations-java5/21.0.1/</link>
- <link>https://javadoc.io/doc/net.md-5/bungeecord-chat/1.16-R0.4/</link>
@ -338,7 +338,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- <dependency>
- <groupId>com.puppycrawl.tools</groupId>
- <artifactId>checkstyle</artifactId>
- <version>8.44</version>
- <version>8.45.1</version>
- </dependency>
- </dependencies>
- </plugin>