API patches

This commit is contained in:
Nassim Jahnke
2022-12-07 17:46:46 +01:00
parent bea0e28dc4
commit b7dd55ce72
962 changed files with 62 additions and 59 deletions

View File

@@ -29,8 +29,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+
dependencies {
// api dependencies are listed transitively to API consumers
api("com.google.guava:guava:31.0.1-jre")
api("com.google.code.gson:gson:2.8.9")
api("com.google.guava:guava:31.1-jre")
api("com.google.code.gson:gson:2.10")
- api("net.md-5:bungeecord-chat:1.16-R0.4")
+ api("net.md-5:bungeecord-chat:1.16-R0.4-deprecated+build.6") // Paper
api("org.yaml:snakeyaml:1.33")
@@ -3505,9 +3505,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/bukkit/event/server/ServerListPingEvent.java
+++ b/src/main/java/org/bukkit/event/server/ServerListPingEvent.java
@@ -0,0 +0,0 @@ public class ServerListPingEvent extends ServerEvent implements Iterable<Player>
private static final HandlerList handlers = new HandlerList();
private final String hostname;
private final InetAddress address;
private final boolean shouldSendChatPreviews;
- private String motd;
+ private net.kyori.adventure.text.Component motd; // Paper
private final int numPlayers;
@@ -3519,37 +3519,35 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
this.address = address;
- this.motd = motd;
+ this.motd = net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(motd); // Paper
this.shouldSendChatPreviews = shouldSendChatPreviews;
this.numPlayers = numPlayers;
this.maxPlayers = maxPlayers;
}
@@ -0,0 +0,0 @@ public class ServerListPingEvent extends ServerEvent implements Iterable<Player>
* @param address the address of the pinger
* @param motd the message of the day
* @param shouldSendChatPreviews if the server should send chat previews
* @param maxPlayers the max number of players
+ * @deprecated in favour of {@link #ServerListPingEvent(String, java.net.InetAddress, net.kyori.adventure.text.Component, boolean, int)}
+ * @deprecated in favour of {@link #ServerListPingEvent(String, java.net.InetAddress, net.kyori.adventure.text.Component, int)}
*/
+ @Deprecated // Paper
protected ServerListPingEvent(@NotNull final String hostname, @NotNull final InetAddress address, @NotNull final String motd, boolean shouldSendChatPreviews, final int maxPlayers) {
protected ServerListPingEvent(@NotNull final String hostname, @NotNull final InetAddress address, @NotNull final String motd, final int maxPlayers) {
super(true);
this.numPlayers = MAGIC_PLAYER_COUNT;
this.hostname = hostname;
this.address = address;
+ this.motd = net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(motd); // Paper
+ this.shouldSendChatPreviews = shouldSendChatPreviews;
+ this.maxPlayers = maxPlayers;
+ }
+ // Paper start
+ @Deprecated
+ public ServerListPingEvent(@NotNull final InetAddress address, @NotNull final net.kyori.adventure.text.Component motd, boolean shouldSendChatPreviews, final int numPlayers, final int maxPlayers) {
+ this("", address, motd, shouldSendChatPreviews, numPlayers, maxPlayers);
+ public ServerListPingEvent(@NotNull final InetAddress address, @NotNull final net.kyori.adventure.text.Component motd, final int numPlayers, final int maxPlayers) {
+ this("", address, motd, numPlayers, maxPlayers);
+ }
+ public ServerListPingEvent(@NotNull final String hostname, @NotNull final InetAddress address, @NotNull final net.kyori.adventure.text.Component motd, boolean shouldSendChatPreviews, final int numPlayers, final int maxPlayers) {
+ public ServerListPingEvent(@NotNull final String hostname, @NotNull final InetAddress address, @NotNull final net.kyori.adventure.text.Component motd, final int numPlayers, final int maxPlayers) {
+ super(true);
+ Preconditions.checkArgument(numPlayers >= 0, "Cannot have negative number of players online (%s)", numPlayers);
+ this.hostname = hostname;
+ this.address = address;
this.motd = motd;
this.shouldSendChatPreviews = shouldSendChatPreviews;
+ this.numPlayers = numPlayers;
this.maxPlayers = maxPlayers;
}
@@ -3561,11 +3559,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ * @param address the address of the pinger
+ * @param motd the message of the day
+ * @param maxPlayers the max number of players
+ * @deprecated in favour of {@link #ServerListPingEvent(String, java.net.InetAddress, net.kyori.adventure.text.Component, boolean, int)}
+ * @deprecated in favour of {@link #ServerListPingEvent(String, java.net.InetAddress, net.kyori.adventure.text.Component, int)}
+ */
+ @Deprecated
+ protected ServerListPingEvent(@NotNull final InetAddress address, @NotNull final net.kyori.adventure.text.Component motd, boolean shouldSendChatPreviews, final int maxPlayers) {
+ this("", address, motd, shouldSendChatPreviews, maxPlayers);
+ protected ServerListPingEvent(@NotNull final InetAddress address, @NotNull final net.kyori.adventure.text.Component motd, final int maxPlayers) {
+ this("", address, motd, maxPlayers);
+ }
+
+ /**
@@ -3578,12 +3576,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ * @param motd the message of the day
+ * @param maxPlayers the max number of players
+ */
+ protected ServerListPingEvent(final @NotNull String hostname, final @NotNull InetAddress address, final @NotNull net.kyori.adventure.text.Component motd, final boolean shouldSendChatPreviews, final int maxPlayers) {
+ protected ServerListPingEvent(final @NotNull String hostname, final @NotNull InetAddress address, final @NotNull net.kyori.adventure.text.Component motd, final int maxPlayers) {
+ this.numPlayers = MAGIC_PLAYER_COUNT;
+ this.hostname = hostname;
+ this.address = address;
+ this.motd = motd;
+ this.shouldSendChatPreviews = shouldSendChatPreviews;
+ this.maxPlayers = maxPlayers;
+ }
+ /**