Start working on 1.20

This commit is contained in:
Nassim Jahnke 2023-06-07 18:24:39 +02:00
parent bc4a6647c9
commit 965cf53cd5
No known key found for this signature in database
GPG key ID: 6BE3B555EBC5982B
1075 changed files with 509 additions and 562 deletions

View file

@ -7,10 +7,10 @@ Co-authored-by: zml <zml@stellardrift.ca>
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
diff --git a/build.gradle.kts b/build.gradle.kts
index 5fccd83117c2c153951d102756acfd4862b8c51b..acf12dfbecb9360c0921f70ed31650feecd33f12 100644
index 77078078c16671b65a604afe17eaf66042afcae2..a346f0d360bacf245a8905e3ff3c4f370960e051 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -8,11 +8,24 @@ java {
@@ -8,13 +8,26 @@ java {
withJavadocJar()
}
@ -27,6 +27,8 @@ index 5fccd83117c2c153951d102756acfd4862b8c51b..acf12dfbecb9360c0921f70ed31650fe
+ extendsFrom(apiAndDocs)
+}
+
val annotationsVersion = "24.0.1"
dependencies {
// api dependencies are listed transitively to API consumers
api("com.google.guava:guava:31.1-jre")
@ -36,7 +38,7 @@ index 5fccd83117c2c153951d102756acfd4862b8c51b..acf12dfbecb9360c0921f70ed31650fe
api("org.yaml:snakeyaml:1.33")
api("org.joml:joml:1.10.5")
// Paper start
@@ -20,6 +33,13 @@ dependencies {
@@ -22,6 +35,13 @@ dependencies {
isTransitive = false // includes junit
}
api("it.unimi.dsi:fastutil:8.5.6")
@ -49,11 +51,11 @@ index 5fccd83117c2c153951d102756acfd4862b8c51b..acf12dfbecb9360c0921f70ed31650fe
+ apiAndDocs("net.kyori:adventure-text-logger-slf4j")
// Paper end
compileOnly("org.apache.maven:maven-resolver-provider:3.8.5")
@@ -80,10 +100,25 @@ tasks.withType<Javadoc> {
compileOnly("org.apache.maven:maven-resolver-provider:3.9.2")
@@ -82,10 +102,25 @@ tasks.withType<Javadoc> {
"https://guava.dev/releases/31.1-jre/api/docs/",
"https://javadoc.io/doc/org.yaml/snakeyaml/1.33/",
"https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/", // Paper - we don't want Java 5 annotations
"https://javadoc.io/doc/org.jetbrains/annotations/$annotationsVersion/", // Paper - we don't want Java 5 annotations
- "https://javadoc.io/doc/net.md-5/bungeecord-chat/1.16-R0.4/",
+ // Paper start
+ //"https://javadoc.io/doc/net.md-5/bungeecord-chat/1.16-R0.4/", // don't link to bungee chat
@ -1366,10 +1368,10 @@ index 6f97c680535fabf88509a49ec21704eb527b2add..b516021b6772d8266ed72b73170510ca
throw new UnsupportedOperationException("Not supported yet.");
}
diff --git a/src/main/java/org/bukkit/Sound.java b/src/main/java/org/bukkit/Sound.java
index 4dda5091739ece442a66d983670ad432b6042867..762b0d9ba22a1012ebe5ea77b6aef909fddc0403 100644
index 4cbc963f268753316327e38b6e1e42cffb486b54..6e8d2b35d8f33827396dbcfa817cd9c2f8ad83a6 100644
--- a/src/main/java/org/bukkit/Sound.java
+++ b/src/main/java/org/bukkit/Sound.java
@@ -11,7 +11,7 @@ import org.jetbrains.annotations.NotNull;
@@ -10,7 +10,7 @@ import org.jetbrains.annotations.NotNull;
* guarantee values will not be removed from this Enum. As such, you should not
* depend on the ordinal values of this class.
*/
@ -1378,7 +1380,7 @@ index 4dda5091739ece442a66d983670ad432b6042867..762b0d9ba22a1012ebe5ea77b6aef909
AMBIENT_BASALT_DELTAS_ADDITIONS("ambient.basalt_deltas.additions"),
AMBIENT_BASALT_DELTAS_LOOP("ambient.basalt_deltas.loop"),
@@ -1640,4 +1640,11 @@ public enum Sound implements Keyed {
@@ -1498,4 +1498,11 @@ public enum Sound implements Keyed {
public NamespacedKey getKey() {
return key;
}
@ -1530,10 +1532,10 @@ index 372c0bd5a4d7800a11c24c95e39fe376a96232bf..9c88be68b4f403d0500cb607394b3a16
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/block/Sign.java b/src/main/java/org/bukkit/block/Sign.java
index 1844b7136ddcc1aa267b8fb2159244d04900da36..9a9f4af69fc8adbd0a05e2e7574f83ff9befad85 100644
index 80f6b718dba4a48130449388f147b4f12510d9f9..abefc7a96528c52434bd7d4eef3be63c5e31e770 100644
--- a/src/main/java/org/bukkit/block/Sign.java
+++ b/src/main/java/org/bukkit/block/Sign.java
@@ -11,6 +11,42 @@ import org.jetbrains.annotations.NotNull;
@@ -10,12 +10,50 @@ import org.jetbrains.annotations.NotNull;
* Represents a captured state of either a SignPost or a WallSign.
*/
public interface Sign extends TileState, Colorable {
@ -1542,7 +1544,7 @@ index 1844b7136ddcc1aa267b8fb2159244d04900da36..9a9f4af69fc8adbd0a05e2e7574f83ff
+ * Gets all the lines of text currently on the {@link Side#FRONT} of this sign.
+ *
+ * @return List of components containing each line of text
+ * @see #getSide(Side)
+ * @deprecated A sign may have multiple writable sides now. Use {@link Sign#getSide(Side)} and {@link SignSide#lines()}.
+ */
+ @NotNull
+ public java.util.List<net.kyori.adventure.text.Component> lines();
@ -1555,9 +1557,10 @@ index 1844b7136ddcc1aa267b8fb2159244d04900da36..9a9f4af69fc8adbd0a05e2e7574f83ff
+ * @param index Line number to get the text from, starting at 0
+ * @throws IndexOutOfBoundsException Thrown when the line does not exist
+ * @return Text on the given line
+ * @see #getSide(Side)
+ * @deprecated A sign may have multiple writable sides now. Use {@link #getSide(Side)} and {@link SignSide#line(int)}.
+ */
+ @NotNull
+ @Deprecated
+ public net.kyori.adventure.text.Component line(int index) throws IndexOutOfBoundsException;
+
+ /**
@ -1569,49 +1572,46 @@ index 1844b7136ddcc1aa267b8fb2159244d04900da36..9a9f4af69fc8adbd0a05e2e7574f83ff
+ * @param index Line number to set the text at, starting from 0
+ * @param line New text to set at the specified index
+ * @throws IndexOutOfBoundsException If the index is out of the range 0..3
+ * @see #getSide(Side)
+ * @deprecated A sign may have multiple writable sides now. Use {@link #getSide(Side)} and {@link SignSide#line(int, net.kyori.adventure.text.Component)}.
+ */
+ @Deprecated
+ public void line(int index, net.kyori.adventure.text.@NotNull Component line) throws IndexOutOfBoundsException;
+ // Paper end
/**
* Gets all the lines of text currently on the {@link Side#FRONT} of this sign.
@@ -19,6 +55,7 @@ public interface Sign extends TileState, Colorable {
* @see #getSide(Side)
*
* @return Array of Strings containing each line of text
- * @deprecated A sign may have multiple writable sides now. Use {@link Sign#getSide(Side)} and {@link SignSide#getLines()}.
+ * @deprecated A sign may have multiple writable sides now. Use {@link Sign#getSide(Side)} and {@link SignSide#lines()}.
*/
@Deprecated
@NotNull
+ @Deprecated // Paper
public String[] getLines();
/**
@@ -30,8 +67,10 @@ public interface Sign extends TileState, Colorable {
@@ -29,7 +67,7 @@ public interface Sign extends TileState, Colorable {
* @param index Line number to get the text from, starting at 0
* @return Text on the given line
* @throws IndexOutOfBoundsException Thrown when the line does not exist
* @see #getSide(Side)
+ * @deprecated in favour of {@link #line(int)}
- * @deprecated A sign may have multiple writable sides now. Use {@link #getSide(Side)} and {@link SignSide#getLine(int)}.
+ * @deprecated A sign may have multiple writable sides now. Use {@link #getSide(Side)} and {@link SignSide#line(int)}.
*/
@Deprecated
@NotNull
+ @Deprecated // Paper
public String getLine(int index) throws IndexOutOfBoundsException;
/**
@@ -44,7 +83,9 @@ public interface Sign extends TileState, Colorable {
@@ -44,7 +82,7 @@ public interface Sign extends TileState, Colorable {
* @param index Line number to set the text at, starting from 0
* @param line New text to set at the specified index
* @throws IndexOutOfBoundsException If the index is out of the range 0..3
* @see #getSide(Side)
+ * @deprecated in favour of {@link #line(int, net.kyori.adventure.text.Component)}
- * @deprecated A sign may have multiple writable sides now. Use {@link #getSide(Side)} and {@link SignSide#setLine(int, String)}.
+ * @deprecated A sign may have multiple writable sides now. Use {@link #getSide(Side)} and {@link SignSide#line(int, net.kyori.adventure.text.Component)}.
*/
+ @Deprecated // Paper
@Deprecated
public void setLine(int index, @NotNull String line) throws IndexOutOfBoundsException;
/**
diff --git a/src/main/java/org/bukkit/block/sign/SignSide.java b/src/main/java/org/bukkit/block/sign/SignSide.java
index 85be6cfa9ed074073656cd0678600780eb03b47b..e6b9a1b0dbf7cdffafe4a9bb5dd1c3e8afb846e5 100644
index 0f4ae7bd2ad379b5edb40f49f93de9e18c38f415..22bfe971920b526bd1bd52cb58d6acbf0a7ef5be 100644
--- a/src/main/java/org/bukkit/block/sign/SignSide.java
+++ b/src/main/java/org/bukkit/block/sign/SignSide.java
@@ -9,6 +9,39 @@ import org.jetbrains.annotations.NotNull;
@@ -7,6 +7,39 @@ import org.jetbrains.annotations.NotNull;
* Represents a side of a sign.
*/
@Experimental
public interface SignSide extends Colorable {
+ // Paper start
+ /**
@ -2043,7 +2043,7 @@ index f3afe67f0832cb828d25be3654518ff73a80b0e1..598abaa82c634178043a29f6caa6ac52
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 7fffb5cdac7a0fe9baeb7ef09a4615221dca8322..4190d5b3b3d3eb9525ed342179cb827cc5590e3b 100644
index ee60f96ab70f5c650b05673ad193dd912f543dec..44be86a9315d45dcbaabbbfcf2c7451ea4967173 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -42,7 +42,28 @@ import org.jetbrains.annotations.Nullable;
@ -2221,7 +2221,7 @@ index 7fffb5cdac7a0fe9baeb7ef09a4615221dca8322..4190d5b3b3d3eb9525ed342179cb827c
/**
* Says a message (or runs a command).
*
@@ -609,6 +695,90 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -632,6 +718,90 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*/
public void sendEquipmentChange(@NotNull LivingEntity entity, @NotNull Map<EquipmentSlot, ItemStack> items);
@ -2312,7 +2312,7 @@ index 7fffb5cdac7a0fe9baeb7ef09a4615221dca8322..4190d5b3b3d3eb9525ed342179cb827c
/**
* 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.
@@ -623,7 +793,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -646,7 +816,9 @@ 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
@ -2322,7 +2322,7 @@ index 7fffb5cdac7a0fe9baeb7ef09a4615221dca8322..4190d5b3b3d3eb9525ed342179cb827c
public void sendSignChange(@NotNull Location loc, @Nullable String[] lines) throws IllegalArgumentException;
/**
@@ -642,7 +814,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -665,7 +837,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @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
@ -2332,7 +2332,7 @@ index 7fffb5cdac7a0fe9baeb7ef09a4615221dca8322..4190d5b3b3d3eb9525ed342179cb827c
public void sendSignChange(@NotNull Location loc, @Nullable String[] lines, @NotNull DyeColor dyeColor) throws IllegalArgumentException;
/**
@@ -662,7 +836,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -685,7 +859,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @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
@ -2342,7 +2342,7 @@ index 7fffb5cdac7a0fe9baeb7ef09a4615221dca8322..4190d5b3b3d3eb9525ed342179cb827c
public void sendSignChange(@NotNull Location loc, @Nullable String[] lines, @NotNull DyeColor dyeColor, boolean hasGlowingText) throws IllegalArgumentException;
/**
@@ -1156,6 +1332,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1179,6 +1355,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* pack correctly.
* </ul>
*
@ -2350,7 +2350,7 @@ index 7fffb5cdac7a0fe9baeb7ef09a4615221dca8322..4190d5b3b3d3eb9525ed342179cb827c
* @param url The URL from which the client will download the resource
* pack. The string must contain only US-ASCII characters and should
* be encoded as per RFC 1738.
@@ -1212,8 +1389,10 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1235,8 +1412,10 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @throws IllegalArgumentException Thrown if the hash is not 20 bytes
* long.
*/
@ -2361,7 +2361,7 @@ index 7fffb5cdac7a0fe9baeb7ef09a4615221dca8322..4190d5b3b3d3eb9525ed342179cb827c
/**
* Request that the player's client download and switch resource packs.
* <p>
@@ -1249,6 +1428,54 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1272,6 +1451,54 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @param hash The sha1 hash sum of the resource pack file which is used
* to apply a cached version of the pack directly without downloading
* if it is available. Hast to be 20 bytes long!
@ -2416,7 +2416,7 @@ index 7fffb5cdac7a0fe9baeb7ef09a4615221dca8322..4190d5b3b3d3eb9525ed342179cb827c
* @param force If true, the client will be disconnected from the server
* when it declines to use the resource pack.
* @throws IllegalArgumentException Thrown if the URL is null.
@@ -1303,8 +1530,57 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1326,8 +1553,57 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @throws IllegalArgumentException Thrown if the hash is not 20 bytes
* long.
*/
@ -2474,7 +2474,7 @@ index 7fffb5cdac7a0fe9baeb7ef09a4615221dca8322..4190d5b3b3d3eb9525ed342179cb827c
/**
* Gets the Scoreboard displayed to this player
*
@@ -1420,7 +1696,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1443,7 +1719,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*
* @param title Title text
* @param subtitle Subtitle text
@ -2483,7 +2483,7 @@ index 7fffb5cdac7a0fe9baeb7ef09a4615221dca8322..4190d5b3b3d3eb9525ed342179cb827c
*/
@Deprecated
public void sendTitle(@Nullable String title, @Nullable String subtitle);
@@ -1439,7 +1715,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1462,7 +1738,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @param fadeIn time in ticks for titles to fade in. Defaults to 10.
* @param stay time in ticks for titles to stay. Defaults to 70.
* @param fadeOut time in ticks for titles to fade out. Defaults to 20.
@ -2493,7 +2493,7 @@ index 7fffb5cdac7a0fe9baeb7ef09a4615221dca8322..4190d5b3b3d3eb9525ed342179cb827c
public void sendTitle(@Nullable String title, @Nullable String subtitle, int fadeIn, int stay, int fadeOut);
/**
@@ -1666,6 +1944,14 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1689,6 +1967,14 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*/
public int getClientViewDistance();
@ -2508,7 +2508,7 @@ index 7fffb5cdac7a0fe9baeb7ef09a4615221dca8322..4190d5b3b3d3eb9525ed342179cb827c
/**
* Gets the player's estimated ping in milliseconds.
*
@@ -1691,8 +1977,10 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1714,8 +2000,10 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* they wish.
*
* @return the player's locale
@ -2519,7 +2519,7 @@ index 7fffb5cdac7a0fe9baeb7ef09a4615221dca8322..4190d5b3b3d3eb9525ed342179cb827c
public String getLocale();
/**
@@ -1744,6 +2032,14 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1767,6 +2055,14 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*/
public boolean isAllowingServerListings();
@ -2534,7 +2534,7 @@ index 7fffb5cdac7a0fe9baeb7ef09a4615221dca8322..4190d5b3b3d3eb9525ed342179cb827c
// Spigot start
public class Spigot extends Entity.Spigot {
@@ -1798,11 +2094,13 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1821,11 +2117,13 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
throw new UnsupportedOperationException("Not supported yet.");
}
@ -2548,7 +2548,7 @@ index 7fffb5cdac7a0fe9baeb7ef09a4615221dca8322..4190d5b3b3d3eb9525ed342179cb827c
@Override
public void sendMessage(@NotNull net.md_5.bungee.api.chat.BaseComponent... components) {
throw new UnsupportedOperationException("Not supported yet.");
@@ -1813,7 +2111,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1836,7 +2134,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*
* @param position the screen position
* @param component the components to send
@ -2558,7 +2558,7 @@ index 7fffb5cdac7a0fe9baeb7ef09a4615221dca8322..4190d5b3b3d3eb9525ed342179cb827c
public void sendMessage(@NotNull net.md_5.bungee.api.ChatMessageType position, @NotNull net.md_5.bungee.api.chat.BaseComponent component) {
throw new UnsupportedOperationException("Not supported yet.");
}
@@ -1823,7 +2123,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1846,7 +2146,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*
* @param position the screen position
* @param components the components to send
@ -2568,7 +2568,7 @@ index 7fffb5cdac7a0fe9baeb7ef09a4615221dca8322..4190d5b3b3d3eb9525ed342179cb827c
public void sendMessage(@NotNull net.md_5.bungee.api.ChatMessageType position, @NotNull net.md_5.bungee.api.chat.BaseComponent... components) {
throw new UnsupportedOperationException("Not supported yet.");
}
@@ -1834,7 +2136,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1857,7 +2159,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @param position the screen position
* @param sender the sender of the message
* @param component the components to send
@ -2578,7 +2578,7 @@ index 7fffb5cdac7a0fe9baeb7ef09a4615221dca8322..4190d5b3b3d3eb9525ed342179cb827c
public void sendMessage(@NotNull net.md_5.bungee.api.ChatMessageType position, @Nullable java.util.UUID sender, @NotNull net.md_5.bungee.api.chat.BaseComponent component) {
throw new UnsupportedOperationException("Not supported yet.");
}
@@ -1845,7 +2149,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1868,7 +2172,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @param position the screen position
* @param sender the sender of the message
* @param components the components to send