|
|
@ -809,6 +809,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
+ // Paper end
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
|
|
|
|
|
|
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
|
|
|
|
|
|
--- a/src/main/java/org/bukkit/UnsafeValues.java
|
|
|
|
|
|
|
|
+++ b/src/main/java/org/bukkit/UnsafeValues.java
|
|
|
|
|
|
|
|
@@ -0,0 +0,0 @@ import org.bukkit.plugin.PluginDescriptionFile;
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
@Deprecated
|
|
|
|
|
|
|
|
public interface UnsafeValues {
|
|
|
|
|
|
|
|
+ net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer legacyComponentSerializer(); // Paper
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void reportTimings(); // Paper
|
|
|
|
|
|
|
|
Material toLegacy(Material material);
|
|
|
|
diff --git a/src/main/java/org/bukkit/Warning.java b/src/main/java/org/bukkit/Warning.java
|
|
|
|
diff --git a/src/main/java/org/bukkit/Warning.java b/src/main/java/org/bukkit/Warning.java
|
|
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
|
|
--- a/src/main/java/org/bukkit/Warning.java
|
|
|
|
--- a/src/main/java/org/bukkit/Warning.java
|
|
|
@ -1014,7 +1026,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|
|
|
+ // Paper start
|
|
|
|
+ // Paper start
|
|
|
|
+ @Override
|
|
|
|
+ @Override
|
|
|
|
+ default void sendMessage(final @NotNull net.kyori.adventure.identity.Identity identity, final @NotNull net.kyori.adventure.text.Component message, final @NotNull net.kyori.adventure.audience.MessageType type) {
|
|
|
|
+ default void sendMessage(final @NotNull net.kyori.adventure.identity.Identity identity, final @NotNull net.kyori.adventure.text.Component message, final @NotNull net.kyori.adventure.audience.MessageType type) {
|
|
|
|
+ this.sendMessage(net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().serialize(message));
|
|
|
|
+ this.sendMessage(org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().serialize(message));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
+ // Paper end
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1485,7 +1497,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|
|
|
+ // Paper start
|
|
|
|
+ // Paper start
|
|
|
|
+ this.adventure$lines = new java.util.ArrayList<>();
|
|
|
|
+ this.adventure$lines = new java.util.ArrayList<>();
|
|
|
|
+ for (String theLine : theLines) {
|
|
|
|
+ for (String theLine : theLines) {
|
|
|
|
+ this.adventure$lines.add(net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(theLine));
|
|
|
|
+ this.adventure$lines.add(org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(theLine));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
+ // Paper end
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1541,7 +1553,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
public String[] getLines() {
|
|
|
|
public String[] getLines() {
|
|
|
|
- return lines;
|
|
|
|
- return lines;
|
|
|
|
+ return adventure$lines.stream().map(net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection()::serialize).toArray(String[]::new); // Paper
|
|
|
|
+ return adventure$lines.stream().map(org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer()::serialize).toArray(String[]::new); // Paper
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -1555,7 +1567,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
public String getLine(int index) throws IndexOutOfBoundsException {
|
|
|
|
public String getLine(int index) throws IndexOutOfBoundsException {
|
|
|
|
- return lines[index];
|
|
|
|
- return lines[index];
|
|
|
|
+ return net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().serialize(this.adventure$lines.get(index)); // Paper
|
|
|
|
+ return org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().serialize(this.adventure$lines.get(index)); // Paper
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -1568,7 +1580,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
public void setLine(int index, @Nullable String line) throws IndexOutOfBoundsException {
|
|
|
|
public void setLine(int index, @Nullable String line) throws IndexOutOfBoundsException {
|
|
|
|
- lines[index] = line;
|
|
|
|
- lines[index] = line;
|
|
|
|
+ adventure$lines.set(index, line != null ? net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(line) : null); // Paper
|
|
|
|
+ adventure$lines.set(index, line != null ? org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(line) : null); // Paper
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
@ -1621,7 +1633,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|
|
|
this.newTotalExp = newTotalExp;
|
|
|
|
this.newTotalExp = newTotalExp;
|
|
|
|
this.newLevel = newLevel;
|
|
|
|
this.newLevel = newLevel;
|
|
|
|
this.deathMessage = deathMessage;
|
|
|
|
this.deathMessage = deathMessage;
|
|
|
|
+ this.adventure$deathMessage = deathMessage != null ? net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(deathMessage) : net.kyori.adventure.text.Component.empty(); // Paper
|
|
|
|
+ this.adventure$deathMessage = deathMessage != null ? org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(deathMessage) : net.kyori.adventure.text.Component.empty(); // Paper
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@NotNull
|
|
|
|
@NotNull
|
|
|
@ -1659,7 +1671,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
public void setDeathMessage(@Nullable String deathMessage) {
|
|
|
|
public void setDeathMessage(@Nullable String deathMessage) {
|
|
|
|
this.deathMessage = deathMessage;
|
|
|
|
this.deathMessage = deathMessage;
|
|
|
|
+ this.adventure$deathMessage = deathMessage != null ? net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(deathMessage) : net.kyori.adventure.text.Component.empty(); // Paper
|
|
|
|
+ this.adventure$deathMessage = deathMessage != null ? org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(deathMessage) : net.kyori.adventure.text.Component.empty(); // Paper
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -1677,7 +1689,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|
|
|
-
|
|
|
|
-
|
|
|
|
+ // Paper start //TODO: add translation API to drop String deathMessage in favor of just Adventure
|
|
|
|
+ // Paper start //TODO: add translation API to drop String deathMessage in favor of just Adventure
|
|
|
|
+ private static String getDeathMessageString(net.kyori.adventure.text.Component component) {
|
|
|
|
+ private static String getDeathMessageString(net.kyori.adventure.text.Component component) {
|
|
|
|
+ return net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().serialize(component);
|
|
|
|
+ return org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().serialize(component);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
+ // Paper end
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -1822,7 +1834,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|
|
|
+ @NotNull
|
|
|
|
+ @NotNull
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
+ public String getKickMessage() {
|
|
|
|
+ public String getKickMessage() {
|
|
|
|
+ return net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().serialize(this.message); // Paper
|
|
|
|
+ return org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().serialize(this.message); // Paper
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ /**
|
|
|
@ -1833,7 +1845,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|
|
|
+ */
|
|
|
|
+ */
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
+ public void setKickMessage(@NotNull final String message) {
|
|
|
|
+ public void setKickMessage(@NotNull final String message) {
|
|
|
|
+ this.message = net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(message); // Paper
|
|
|
|
+ this.message = org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(message); // Paper
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -1856,7 +1868,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|
|
|
public void disallow(@NotNull final Result result, @NotNull final String message) {
|
|
|
|
public void disallow(@NotNull final Result result, @NotNull final String message) {
|
|
|
|
this.result = result;
|
|
|
|
this.result = result;
|
|
|
|
- this.message = message;
|
|
|
|
- this.message = message;
|
|
|
|
+ this.message = net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(message); // Paper
|
|
|
|
+ this.message = org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(message); // Paper
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -1865,7 +1877,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|
|
|
public void disallow(@NotNull final PlayerPreLoginEvent.Result result, @NotNull final String message) {
|
|
|
|
public void disallow(@NotNull final PlayerPreLoginEvent.Result result, @NotNull final String message) {
|
|
|
|
this.result = result == null ? null : Result.valueOf(result.name());
|
|
|
|
this.result = result == null ? null : Result.valueOf(result.name());
|
|
|
|
- this.message = message;
|
|
|
|
- this.message = message;
|
|
|
|
+ this.message = net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(message); // Paper
|
|
|
|
+ this.message = org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(message); // Paper
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -1913,7 +1925,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|
|
|
+ @Deprecated // Paper end
|
|
|
|
+ @Deprecated // Paper end
|
|
|
|
public PlayerJoinEvent(@NotNull final Player playerJoined, @Nullable final String joinMessage) {
|
|
|
|
public PlayerJoinEvent(@NotNull final Player playerJoined, @Nullable final String joinMessage) {
|
|
|
|
super(playerJoined);
|
|
|
|
super(playerJoined);
|
|
|
|
+ this.joinMessage = joinMessage != null ? net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(joinMessage) : null; // Paper end
|
|
|
|
+ this.joinMessage = joinMessage != null ? org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(joinMessage) : null; // Paper end
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ // Paper start
|
|
|
|
+ // Paper start
|
|
|
@ -1946,7 +1958,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
public String getJoinMessage() {
|
|
|
|
public String getJoinMessage() {
|
|
|
|
- return joinMessage;
|
|
|
|
- return joinMessage;
|
|
|
|
+ return this.joinMessage == null ? null : net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().serialize(this.joinMessage); // Paper
|
|
|
|
+ return this.joinMessage == null ? null : org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().serialize(this.joinMessage); // Paper
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -1958,7 +1970,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
public void setJoinMessage(@Nullable String joinMessage) {
|
|
|
|
public void setJoinMessage(@Nullable String joinMessage) {
|
|
|
|
- this.joinMessage = joinMessage;
|
|
|
|
- this.joinMessage = joinMessage;
|
|
|
|
+ this.joinMessage = joinMessage != null ? net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(joinMessage) : null; // Paper
|
|
|
|
+ this.joinMessage = joinMessage != null ? org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(joinMessage) : null; // Paper
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@NotNull
|
|
|
|
@NotNull
|
|
|
@ -1979,8 +1991,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
public PlayerKickEvent(@NotNull final Player playerKicked, @NotNull final String kickReason, @NotNull final String leaveMessage) {
|
|
|
|
public PlayerKickEvent(@NotNull final Player playerKicked, @NotNull final String kickReason, @NotNull final String leaveMessage) {
|
|
|
|
+ super(playerKicked);
|
|
|
|
+ super(playerKicked);
|
|
|
|
+ this.kickReason = net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(kickReason); // Paper
|
|
|
|
+ this.kickReason = org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(kickReason); // Paper
|
|
|
|
+ this.leaveMessage = net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(leaveMessage); // Paper
|
|
|
|
+ this.leaveMessage = org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(leaveMessage); // Paper
|
|
|
|
+ this.cancel = false;
|
|
|
|
+ this.cancel = false;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ // Paper start
|
|
|
|
+ // Paper start
|
|
|
@ -2038,7 +2050,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
public String getReason() {
|
|
|
|
public String getReason() {
|
|
|
|
- return kickReason;
|
|
|
|
- return kickReason;
|
|
|
|
+ return net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().serialize(this.kickReason); // Paper
|
|
|
|
+ return org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().serialize(this.kickReason); // Paper
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -2051,7 +2063,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
public String getLeaveMessage() {
|
|
|
|
public String getLeaveMessage() {
|
|
|
|
- return leaveMessage;
|
|
|
|
- return leaveMessage;
|
|
|
|
+ return net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().serialize(this.leaveMessage); // Paper
|
|
|
|
+ return org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().serialize(this.leaveMessage); // Paper
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
@ -2064,7 +2076,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
public void setReason(@NotNull String kickReason) {
|
|
|
|
public void setReason(@NotNull String kickReason) {
|
|
|
|
- this.kickReason = kickReason;
|
|
|
|
- this.kickReason = kickReason;
|
|
|
|
+ this.kickReason = net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(kickReason); // Paper
|
|
|
|
+ this.kickReason = org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(kickReason); // Paper
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -2076,7 +2088,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
public void setLeaveMessage(@NotNull String leaveMessage) {
|
|
|
|
public void setLeaveMessage(@NotNull String leaveMessage) {
|
|
|
|
- this.leaveMessage = leaveMessage;
|
|
|
|
- this.leaveMessage = leaveMessage;
|
|
|
|
+ this.leaveMessage = net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(leaveMessage); // Paper
|
|
|
|
+ this.leaveMessage = org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(leaveMessage); // Paper
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@NotNull
|
|
|
|
@NotNull
|
|
|
@ -2140,7 +2152,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|
|
|
public PlayerLoginEvent(@NotNull final Player player, @NotNull String hostname, @NotNull final InetAddress address, @NotNull final Result result, @NotNull final String message, @NotNull final InetAddress realAddress) { // Spigot
|
|
|
|
public PlayerLoginEvent(@NotNull final Player player, @NotNull String hostname, @NotNull final InetAddress address, @NotNull final Result result, @NotNull final String message, @NotNull final InetAddress realAddress) { // Spigot
|
|
|
|
this(player, hostname, address, realAddress); // Spigot
|
|
|
|
this(player, hostname, address, realAddress); // Spigot
|
|
|
|
this.result = result;
|
|
|
|
this.result = result;
|
|
|
|
+ this.message = net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(message); // Paper
|
|
|
|
+ this.message = org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(message); // Paper
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ // Paper start
|
|
|
|
+ // Paper start
|
|
|
@ -2193,7 +2205,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
public String getKickMessage() {
|
|
|
|
public String getKickMessage() {
|
|
|
|
- return message;
|
|
|
|
- return message;
|
|
|
|
+ return net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().serialize(this.message); // Paper
|
|
|
|
+ return org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().serialize(this.message); // Paper
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -2205,7 +2217,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
public void setKickMessage(@NotNull final String message) {
|
|
|
|
public void setKickMessage(@NotNull final String message) {
|
|
|
|
- this.message = message;
|
|
|
|
- this.message = message;
|
|
|
|
+ this.message = net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(message); // Paper
|
|
|
|
+ this.message = org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(message); // Paper
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -2227,7 +2239,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|
|
|
+ @Deprecated // Paper start
|
|
|
|
+ @Deprecated // Paper start
|
|
|
|
public void disallow(@NotNull final Result result, @NotNull final String message) {
|
|
|
|
public void disallow(@NotNull final Result result, @NotNull final String message) {
|
|
|
|
+ this.result = result;
|
|
|
|
+ this.result = result;
|
|
|
|
+ this.message = net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(message);
|
|
|
|
+ this.message = org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(message);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ /**
|
|
|
|
+ /**
|
|
|
|
+ * Disallows the player from logging in, with the given reason
|
|
|
|
+ * Disallows the player from logging in, with the given reason
|
|
|
@ -2309,7 +2321,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
+ @NotNull
|
|
|
|
+ @NotNull
|
|
|
|
+ public String getKickMessage() {
|
|
|
|
+ public String getKickMessage() {
|
|
|
|
+ return net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().serialize(this.message); // Paper
|
|
|
|
+ return org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().serialize(this.message); // Paper
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ /**
|
|
|
@ -2320,7 +2332,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|
|
|
+ */
|
|
|
|
+ */
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
+ public void setKickMessage(@NotNull final String message) {
|
|
|
|
+ public void setKickMessage(@NotNull final String message) {
|
|
|
|
+ this.message = net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(message); // Paper
|
|
|
|
+ this.message = org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(message); // Paper
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -2343,7 +2355,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|
|
|
public void disallow(@NotNull final Result result, @NotNull final String message) {
|
|
|
|
public void disallow(@NotNull final Result result, @NotNull final String message) {
|
|
|
|
this.result = result;
|
|
|
|
this.result = result;
|
|
|
|
- this.message = message;
|
|
|
|
- this.message = message;
|
|
|
|
+ this.message = net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(message); // Paper
|
|
|
|
+ this.message = org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(message); // Paper
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -2361,7 +2373,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
public PlayerQuitEvent(@NotNull final Player who, @Nullable final String quitMessage) {
|
|
|
|
public PlayerQuitEvent(@NotNull final Player who, @Nullable final String quitMessage) {
|
|
|
|
super(who);
|
|
|
|
super(who);
|
|
|
|
+ this.quitMessage = quitMessage != null ? net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(quitMessage) : null; // Paper
|
|
|
|
+ this.quitMessage = quitMessage != null ? org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(quitMessage) : null; // Paper
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ // Paper start
|
|
|
|
+ // Paper start
|
|
|
|
+ public PlayerQuitEvent(@NotNull final Player who, @Nullable final net.kyori.adventure.text.Component quitMessage) {
|
|
|
|
+ public PlayerQuitEvent(@NotNull final Player who, @Nullable final net.kyori.adventure.text.Component quitMessage) {
|
|
|
@ -2398,7 +2410,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
public String getQuitMessage() {
|
|
|
|
public String getQuitMessage() {
|
|
|
|
- return quitMessage;
|
|
|
|
- return quitMessage;
|
|
|
|
+ return this.quitMessage == null ? null : net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().serialize(this.quitMessage); // Paper
|
|
|
|
+ return this.quitMessage == null ? null : org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().serialize(this.quitMessage); // Paper
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -2410,7 +2422,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
public void setQuitMessage(@Nullable String quitMessage) {
|
|
|
|
public void setQuitMessage(@Nullable String quitMessage) {
|
|
|
|
- this.quitMessage = quitMessage;
|
|
|
|
- this.quitMessage = quitMessage;
|
|
|
|
+ this.quitMessage = quitMessage != null ? net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(quitMessage) : null; // Paper
|
|
|
|
+ this.quitMessage = quitMessage != null ? org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(quitMessage) : null; // Paper
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@NotNull
|
|
|
|
@NotNull
|
|
|
@ -2435,7 +2447,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|
|
|
public BroadcastMessageEvent(boolean isAsync, @NotNull String message, @NotNull Set<CommandSender> recipients) {
|
|
|
|
public BroadcastMessageEvent(boolean isAsync, @NotNull String message, @NotNull Set<CommandSender> recipients) {
|
|
|
|
+ // Paper start
|
|
|
|
+ // Paper start
|
|
|
|
+ super(isAsync);
|
|
|
|
+ super(isAsync);
|
|
|
|
+ this.message = net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(message);
|
|
|
|
+ this.message = org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(message);
|
|
|
|
+ this.recipients = recipients;
|
|
|
|
+ this.recipients = recipients;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
@ -2480,7 +2492,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
public String getMessage() {
|
|
|
|
public String getMessage() {
|
|
|
|
- return message;
|
|
|
|
- return message;
|
|
|
|
+ return net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().serialize(this.message); // Paper
|
|
|
|
+ return org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().serialize(this.message); // Paper
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -2492,7 +2504,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
public void setMessage(@NotNull String message) {
|
|
|
|
public void setMessage(@NotNull String message) {
|
|
|
|
- this.message = message;
|
|
|
|
- this.message = message;
|
|
|
|
+ this.message = net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(message); // Paper
|
|
|
|
+ this.message = org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(message); // Paper
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -2500,11 +2512,7 @@ diff --git a/src/main/java/org/bukkit/event/server/ServerListPingEvent.java b/sr
|
|
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
|
|
--- a/src/main/java/org/bukkit/event/server/ServerListPingEvent.java
|
|
|
|
--- a/src/main/java/org/bukkit/event/server/ServerListPingEvent.java
|
|
|
|
+++ b/src/main/java/org/bukkit/event/server/ServerListPingEvent.java
|
|
|
|
+++ b/src/main/java/org/bukkit/event/server/ServerListPingEvent.java
|
|
|
|
@@ -0,0 +0,0 @@ import org.jetbrains.annotations.NotNull;
|
|
|
|
@@ -0,0 +0,0 @@ public class ServerListPingEvent extends ServerEvent implements Iterable<Player>
|
|
|
|
* checked and removed by {@link #iterator() iterating} over this event.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
public class ServerListPingEvent extends ServerEvent implements Iterable<Player> {
|
|
|
|
|
|
|
|
+ private static final net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer LEGACY_SECTION_SERIALIZER = net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.builder().useUnusualXRepeatedCharacterHexFormat().build(); // Paper
|
|
|
|
|
|
|
|
private static final int MAGIC_PLAYER_COUNT = Integer.MIN_VALUE;
|
|
|
|
private static final int MAGIC_PLAYER_COUNT = Integer.MIN_VALUE;
|
|
|
|
private static final HandlerList handlers = new HandlerList();
|
|
|
|
private static final HandlerList handlers = new HandlerList();
|
|
|
|
private final InetAddress address;
|
|
|
|
private final InetAddress address;
|
|
|
@ -2519,7 +2527,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|
|
|
Validate.isTrue(numPlayers >= 0, "Cannot have negative number of players online", numPlayers);
|
|
|
|
Validate.isTrue(numPlayers >= 0, "Cannot have negative number of players online", numPlayers);
|
|
|
|
this.address = address;
|
|
|
|
this.address = address;
|
|
|
|
- this.motd = motd;
|
|
|
|
- this.motd = motd;
|
|
|
|
+ this.motd = LEGACY_SECTION_SERIALIZER.deserialize(motd); // Paper
|
|
|
|
+ this.motd = org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(motd); // Paper
|
|
|
|
this.numPlayers = numPlayers;
|
|
|
|
this.numPlayers = numPlayers;
|
|
|
|
this.maxPlayers = maxPlayers;
|
|
|
|
this.maxPlayers = maxPlayers;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -2534,7 +2542,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|
|
|
+ super(true);
|
|
|
|
+ super(true);
|
|
|
|
+ this.numPlayers = MAGIC_PLAYER_COUNT;
|
|
|
|
+ this.numPlayers = MAGIC_PLAYER_COUNT;
|
|
|
|
+ this.address = address;
|
|
|
|
+ this.address = address;
|
|
|
|
+ this.motd = LEGACY_SECTION_SERIALIZER.deserialize(motd); // Paper
|
|
|
|
+ this.motd = org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(motd); // Paper
|
|
|
|
+ this.maxPlayers = maxPlayers;
|
|
|
|
+ this.maxPlayers = maxPlayers;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ // Paper start
|
|
|
|
+ // Paper start
|
|
|
@ -2592,7 +2600,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
public String getMotd() {
|
|
|
|
public String getMotd() {
|
|
|
|
- return motd;
|
|
|
|
- return motd;
|
|
|
|
+ return LEGACY_SECTION_SERIALIZER.serialize(this.motd); // Paper
|
|
|
|
+ return org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().serialize(this.motd); // Paper
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -2604,7 +2612,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
public void setMotd(@NotNull String motd) {
|
|
|
|
public void setMotd(@NotNull String motd) {
|
|
|
|
- this.motd = motd;
|
|
|
|
- this.motd = motd;
|
|
|
|
+ this.motd = LEGACY_SECTION_SERIALIZER.deserialize(motd); // Paper
|
|
|
|
+ this.motd = org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(motd); // Paper
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -2624,7 +2632,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@NotNull
|
|
|
|
@NotNull
|
|
|
|
+ public /*abstract*/ net.kyori.adventure.text.Component title() {
|
|
|
|
+ public /*abstract*/ net.kyori.adventure.text.Component title() {
|
|
|
|
+ return net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(this.getTitle());
|
|
|
|
+ return org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(this.getTitle());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
+ // Paper end
|
|
|
|
+
|
|
|
|
+
|
|
|
@ -3071,7 +3079,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|
|
|
setRawType(type);
|
|
|
|
setRawType(type);
|
|
|
|
this.visible = visible;
|
|
|
|
this.visible = visible;
|
|
|
|
- this.caption = caption;
|
|
|
|
- this.caption = caption;
|
|
|
|
+ this.caption = caption == null ? null : net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(caption); // Paper
|
|
|
|
+ this.caption = caption == null ? null : org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(caption); // Paper
|
|
|
|
}
|
|
|
|
}
|
|
|
|
+ // Paper start
|
|
|
|
+ // Paper start
|
|
|
|
+ /**
|
|
|
|
+ /**
|
|
|
@ -3115,7 +3123,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|
|
|
setType(type);
|
|
|
|
setType(type);
|
|
|
|
this.visible = visible;
|
|
|
|
this.visible = visible;
|
|
|
|
- this.caption = caption;
|
|
|
|
- this.caption = caption;
|
|
|
|
+ this.caption = caption == null ? null : net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(caption); // Paper
|
|
|
|
+ this.caption = caption == null ? null : org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(caption); // Paper
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -3151,7 +3159,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
public String getCaption() {
|
|
|
|
public String getCaption() {
|
|
|
|
- return caption;
|
|
|
|
- return caption;
|
|
|
|
+ return this.caption == null ? null : net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().serialize(this.caption); // Paper
|
|
|
|
+ return this.caption == null ? null : org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().serialize(this.caption); // Paper
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -3163,7 +3171,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
public void setCaption(@Nullable String caption) {
|
|
|
|
public void setCaption(@Nullable String caption) {
|
|
|
|
- this.caption = caption;
|
|
|
|
- this.caption = caption;
|
|
|
|
+ this.caption = caption == null ? null : net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(caption); // Paper
|
|
|
|
+ this.caption = caption == null ? null : org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(caption); // Paper
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|