|
|
|
@ -358,10 +358,10 @@ index 0000000000000000000000000000000000000000..eb179aae1e1d2ce842442e49fe275827
|
|
|
|
|
+}
|
|
|
|
|
diff --git a/src/main/java/io/papermc/paper/text/PaperComponents.java b/src/main/java/io/papermc/paper/text/PaperComponents.java
|
|
|
|
|
new file mode 100644
|
|
|
|
|
index 0000000000000000000000000000000000000000..15ecb12fd2fefcac96edbaef7cdd487a1d2c5641
|
|
|
|
|
index 0000000000000000000000000000000000000000..bff9a6295db367c6b89d69fb55459a40828265ea
|
|
|
|
|
--- /dev/null
|
|
|
|
|
+++ b/src/main/java/io/papermc/paper/text/PaperComponents.java
|
|
|
|
|
@@ -0,0 +1,104 @@
|
|
|
|
|
@@ -0,0 +1,112 @@
|
|
|
|
|
+package io.papermc.paper.text;
|
|
|
|
|
+
|
|
|
|
|
+import net.kyori.adventure.text.Component;
|
|
|
|
@ -398,10 +398,10 @@ index 0000000000000000000000000000000000000000..15ecb12fd2fefcac96edbaef7cdd487a
|
|
|
|
|
+ * <p>Implementations may provide a serializer capable of processing any
|
|
|
|
|
+ * information that requires access to implementation details.</p>
|
|
|
|
|
+ *
|
|
|
|
|
+ * @deprecated will be removed in adventure 5.0.0, use {@link #plainTextSerializer()}
|
|
|
|
|
+ * @return a serializer to plain text
|
|
|
|
|
+ * @deprecated will be removed in adventure 5.0.0, use {@link PlainTextComponentSerializer#plainText()}
|
|
|
|
|
+ */
|
|
|
|
|
+ @Deprecated
|
|
|
|
|
+ @Deprecated(forRemoval = true)
|
|
|
|
|
+ public static @NotNull PlainComponentSerializer plainSerializer() {
|
|
|
|
|
+ return Bukkit.getUnsafe().plainComponentSerializer();
|
|
|
|
|
+ }
|
|
|
|
@ -414,7 +414,9 @@ index 0000000000000000000000000000000000000000..15ecb12fd2fefcac96edbaef7cdd487a
|
|
|
|
|
+ * information that requires access to implementation details.</p>
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return a serializer to plain text
|
|
|
|
|
+ * @deprecated use {@link PlainTextComponentSerializer#plainText()}
|
|
|
|
|
+ */
|
|
|
|
|
+ @Deprecated(forRemoval = true)
|
|
|
|
|
+ public static @NotNull PlainTextComponentSerializer plainTextSerializer() {
|
|
|
|
|
+ return Bukkit.getUnsafe().plainTextSerializer();
|
|
|
|
|
+ }
|
|
|
|
@ -428,7 +430,9 @@ index 0000000000000000000000000000000000000000..15ecb12fd2fefcac96edbaef7cdd487a
|
|
|
|
|
+ * (pre-1.16) hover events.</p>
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return a json component serializer
|
|
|
|
|
+ * @deprecated use {@link GsonComponentSerializer#gson()}
|
|
|
|
|
+ */
|
|
|
|
|
+ @Deprecated(forRemoval = true)
|
|
|
|
|
+ public static @NotNull GsonComponentSerializer gsonSerializer() {
|
|
|
|
|
+ return Bukkit.getUnsafe().gsonComponentSerializer();
|
|
|
|
|
+ }
|
|
|
|
@ -443,7 +447,9 @@ index 0000000000000000000000000000000000000000..15ecb12fd2fefcac96edbaef7cdd487a
|
|
|
|
|
+ * (pre-1.16) hover events.</p>
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return a json component serializer
|
|
|
|
|
+ * @deprecated use {@link GsonComponentSerializer#colorDownsamplingGson()}
|
|
|
|
|
+ */
|
|
|
|
|
+ @Deprecated(forRemoval = true)
|
|
|
|
|
+ public static @NotNull GsonComponentSerializer colorDownsamplingGsonSerializer() {
|
|
|
|
|
+ return Bukkit.getUnsafe().colorDownsamplingGsonComponentSerializer();
|
|
|
|
|
+ }
|
|
|
|
@ -461,7 +467,9 @@ index 0000000000000000000000000000000000000000..15ecb12fd2fefcac96edbaef7cdd487a
|
|
|
|
|
+ * information that requires access to implementation details.</p>
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return a section serializer
|
|
|
|
|
+ * @deprecated use {@link LegacyComponentSerializer#legacySection()}
|
|
|
|
|
+ */
|
|
|
|
|
+ @Deprecated(forRemoval = true)
|
|
|
|
|
+ public static @NotNull LegacyComponentSerializer legacySectionSerializer() {
|
|
|
|
|
+ return Bukkit.getUnsafe().legacyComponentSerializer();
|
|
|
|
|
+ }
|
|
|
|
@ -1100,7 +1108,7 @@ index ac5e263d737973af077e3406a84a84baca4370db..2d91924b7f5ef16a91d40cdc1bfc3d68
|
|
|
|
|
+ // Paper end
|
|
|
|
|
}
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
|
|
|
|
|
index 01e11f882abb6c631f810584aa23646042688435..f43ad19a44f3b7368a1a110cc55247277f4d3751 100644
|
|
|
|
|
index 01e11f882abb6c631f810584aa23646042688435..fa28b5bb0efd9d400277cd8969f38e039e6ea8ac 100644
|
|
|
|
|
--- a/src/main/java/org/bukkit/UnsafeValues.java
|
|
|
|
|
+++ b/src/main/java/org/bukkit/UnsafeValues.java
|
|
|
|
|
@@ -22,6 +22,14 @@ import org.bukkit.plugin.PluginDescriptionFile;
|
|
|
|
@ -1109,11 +1117,11 @@ index 01e11f882abb6c631f810584aa23646042688435..f43ad19a44f3b7368a1a110cc5524727
|
|
|
|
|
public interface UnsafeValues {
|
|
|
|
|
+ // Paper start
|
|
|
|
|
+ net.kyori.adventure.text.flattener.ComponentFlattener componentFlattener();
|
|
|
|
|
+ @Deprecated net.kyori.adventure.text.serializer.plain.PlainComponentSerializer plainComponentSerializer();
|
|
|
|
|
+ net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer plainTextSerializer();
|
|
|
|
|
+ net.kyori.adventure.text.serializer.gson.GsonComponentSerializer gsonComponentSerializer();
|
|
|
|
|
+ net.kyori.adventure.text.serializer.gson.GsonComponentSerializer colorDownsamplingGsonComponentSerializer();
|
|
|
|
|
+ net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer legacyComponentSerializer();
|
|
|
|
|
+ @Deprecated(forRemoval = true) net.kyori.adventure.text.serializer.plain.PlainComponentSerializer plainComponentSerializer();
|
|
|
|
|
+ @Deprecated(forRemoval = true) net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer plainTextSerializer();
|
|
|
|
|
+ @Deprecated(forRemoval = true) net.kyori.adventure.text.serializer.gson.GsonComponentSerializer gsonComponentSerializer();
|
|
|
|
|
+ @Deprecated(forRemoval = true) net.kyori.adventure.text.serializer.gson.GsonComponentSerializer colorDownsamplingGsonComponentSerializer();
|
|
|
|
|
+ @Deprecated(forRemoval = true) net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer legacyComponentSerializer();
|
|
|
|
|
+ // Paper end
|
|
|
|
|
|
|
|
|
|
Material toLegacy(Material material);
|
|
|
|
@ -1276,7 +1284,7 @@ index ab6b0ec328e94bf65a0dafd0403e5ee3b870296c..c8d37184d8e882a4084a1bfef85faa33
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/command/Command.java b/src/main/java/org/bukkit/command/Command.java
|
|
|
|
|
index 4bfc214685164a38ba4261b2bae7faa8a3bd297e..50e6d45ec9349b56d20e2ffc664eca15ba936cc6 100644
|
|
|
|
|
index 4bfc214685164a38ba4261b2bae7faa8a3bd297e..8edd78adb042013bf702027f59455045d3b3e14f 100644
|
|
|
|
|
--- a/src/main/java/org/bukkit/command/Command.java
|
|
|
|
|
+++ b/src/main/java/org/bukkit/command/Command.java
|
|
|
|
|
@@ -32,8 +32,7 @@ public abstract class Command {
|
|
|
|
@ -1314,7 +1322,7 @@ index 4bfc214685164a38ba4261b2bae7faa8a3bd297e..50e6d45ec9349b56d20e2ffc664eca15
|
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
|
public String getPermissionMessage() {
|
|
|
|
|
- return permissionMessage;
|
|
|
|
|
+ return io.papermc.paper.text.PaperComponents.legacySectionSerializer().serializeOrNull(permissionMessage); // Paper
|
|
|
|
|
+ return net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().serializeOrNull(permissionMessage); // Paper
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -1328,7 +1336,7 @@ index 4bfc214685164a38ba4261b2bae7faa8a3bd297e..50e6d45ec9349b56d20e2ffc664eca15
|
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
|
public Command setPermissionMessage(@Nullable String permissionMessage) {
|
|
|
|
|
- this.permissionMessage = permissionMessage;
|
|
|
|
|
+ this.permissionMessage = io.papermc.paper.text.PaperComponents.legacySectionSerializer().deserializeOrNull(permissionMessage); // Paper
|
|
|
|
|
+ this.permissionMessage = net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserializeOrNull(permissionMessage); // Paper
|
|
|
|
|
return this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1359,7 +1367,7 @@ index 4bfc214685164a38ba4261b2bae7faa8a3bd297e..50e6d45ec9349b56d20e2ffc664eca15
|
|
|
|
|
public static void broadcastCommandMessage(@NotNull CommandSender source, @NotNull String message) {
|
|
|
|
|
broadcastCommandMessage(source, message, true);
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/command/CommandSender.java b/src/main/java/org/bukkit/command/CommandSender.java
|
|
|
|
|
index 284be63a125624a8ae43d2c164aede810ce6bfe5..f98d46fa45bb7c842d791b09f082a0968ae537fb 100644
|
|
|
|
|
index 284be63a125624a8ae43d2c164aede810ce6bfe5..22b654efdcc49d6dc6d52c9d6afa1c9dc7978e35 100644
|
|
|
|
|
--- a/src/main/java/org/bukkit/command/CommandSender.java
|
|
|
|
|
+++ b/src/main/java/org/bukkit/command/CommandSender.java
|
|
|
|
|
@@ -6,12 +6,13 @@ import org.bukkit.permissions.Permissible;
|
|
|
|
@ -1456,12 +1464,12 @@ index 284be63a125624a8ae43d2c164aede810ce6bfe5..f98d46fa45bb7c842d791b09f082a096
|
|
|
|
|
+
|
|
|
|
|
+ @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) {
|
|
|
|
|
+ this.sendMessage(org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().serialize(message));
|
|
|
|
|
+ this.sendMessage(net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().serialize(message));
|
|
|
|
|
+ }
|
|
|
|
|
+ // Paper end
|
|
|
|
|
}
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/command/PluginCommandYamlParser.java b/src/main/java/org/bukkit/command/PluginCommandYamlParser.java
|
|
|
|
|
index a542c4bb3c973bbe4b976642feccde6a4d90cb7b..614cba22c0997dbb45576f800675db4053a9831c 100644
|
|
|
|
|
index a542c4bb3c973bbe4b976642feccde6a4d90cb7b..ef870b864c1e36032b54b31f3f85707edc06d764 100644
|
|
|
|
|
--- a/src/main/java/org/bukkit/command/PluginCommandYamlParser.java
|
|
|
|
|
+++ b/src/main/java/org/bukkit/command/PluginCommandYamlParser.java
|
|
|
|
|
@@ -67,7 +67,7 @@ public class PluginCommandYamlParser {
|
|
|
|
@ -1469,7 +1477,7 @@ index a542c4bb3c973bbe4b976642feccde6a4d90cb7b..614cba22c0997dbb45576f800675db40
|
|
|
|
|
|
|
|
|
|
if (permissionMessage != null) {
|
|
|
|
|
- newCmd.setPermissionMessage(permissionMessage.toString());
|
|
|
|
|
+ newCmd.permissionMessage(io.papermc.paper.text.PaperComponents.legacySectionSerializer().deserialize(permissionMessage.toString())); // Paper
|
|
|
|
|
+ newCmd.permissionMessage(net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(permissionMessage.toString())); // Paper
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pluginCmds.add(newCmd);
|
|
|
|
@ -2133,7 +2141,7 @@ index 63c80b4ee1f7adc8a9efc3b607993104b1991f90..91cab8b13d5bba34007f124838b32a1d
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/event/block/SignChangeEvent.java b/src/main/java/org/bukkit/event/block/SignChangeEvent.java
|
|
|
|
|
index 7190db11eff7d48df8a99f405a9dbaefdfa76e3d..1f79f704abf339150df08900b8ea7da4cefef258 100644
|
|
|
|
|
index 7190db11eff7d48df8a99f405a9dbaefdfa76e3d..1268066e30ddb0cd3792ea4b3de894eb04196669 100644
|
|
|
|
|
--- a/src/main/java/org/bukkit/event/block/SignChangeEvent.java
|
|
|
|
|
+++ b/src/main/java/org/bukkit/event/block/SignChangeEvent.java
|
|
|
|
|
@@ -16,12 +16,25 @@ public class SignChangeEvent extends BlockEvent implements Cancellable {
|
|
|
|
@ -2158,7 +2166,7 @@ index 7190db11eff7d48df8a99f405a9dbaefdfa76e3d..1f79f704abf339150df08900b8ea7da4
|
|
|
|
|
+ // Paper start
|
|
|
|
|
+ this.adventure$lines = new java.util.ArrayList<>();
|
|
|
|
|
+ for (String theLine : theLines) {
|
|
|
|
|
+ this.adventure$lines.add(org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(theLine));
|
|
|
|
|
+ this.adventure$lines.add(net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(theLine));
|
|
|
|
|
+ }
|
|
|
|
|
+ // Paper end
|
|
|
|
|
}
|
|
|
|
@ -2214,7 +2222,7 @@ index 7190db11eff7d48df8a99f405a9dbaefdfa76e3d..1f79f704abf339150df08900b8ea7da4
|
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
|
public String[] getLines() {
|
|
|
|
|
- return lines;
|
|
|
|
|
+ return adventure$lines.stream().map(org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer()::serialize).toArray(String[]::new); // Paper
|
|
|
|
|
+ return adventure$lines.stream().map(net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection()::serialize).toArray(String[]::new); // Paper
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -2228,7 +2236,7 @@ index 7190db11eff7d48df8a99f405a9dbaefdfa76e3d..1f79f704abf339150df08900b8ea7da4
|
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
|
public String getLine(int index) throws IndexOutOfBoundsException {
|
|
|
|
|
- return lines[index];
|
|
|
|
|
+ return org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().serialize(this.adventure$lines.get(index)); // Paper
|
|
|
|
|
+ return net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().serialize(this.adventure$lines.get(index)); // Paper
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -2241,12 +2249,12 @@ index 7190db11eff7d48df8a99f405a9dbaefdfa76e3d..1f79f704abf339150df08900b8ea7da4
|
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
|
public void setLine(int index, @Nullable String line) throws IndexOutOfBoundsException {
|
|
|
|
|
- lines[index] = line;
|
|
|
|
|
+ adventure$lines.set(index, line != null ? org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(line) : null); // Paper
|
|
|
|
|
+ adventure$lines.set(index, line != null ? net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(line) : null); // Paper
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java b/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java
|
|
|
|
|
index 3c2ea8fec3a748cab7f5ad9100d12bd8213ec6c9..a01d4c21bedc7f1a54f5a330bb4c2909ce3a18e4 100644
|
|
|
|
|
index 3c2ea8fec3a748cab7f5ad9100d12bd8213ec6c9..7941c60b0e1840785ba2b250071591bd75bc6e35 100644
|
|
|
|
|
--- a/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java
|
|
|
|
|
+++ b/src/main/java/org/bukkit/event/entity/PlayerDeathEvent.java
|
|
|
|
|
@@ -12,25 +12,48 @@ import org.jetbrains.annotations.Nullable;
|
|
|
|
@ -2294,7 +2302,7 @@ index 3c2ea8fec3a748cab7f5ad9100d12bd8213ec6c9..a01d4c21bedc7f1a54f5a330bb4c2909
|
|
|
|
|
this.newTotalExp = newTotalExp;
|
|
|
|
|
this.newLevel = newLevel;
|
|
|
|
|
this.deathMessage = deathMessage;
|
|
|
|
|
+ this.adventure$deathMessage = deathMessage != null ? org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(deathMessage) : net.kyori.adventure.text.Component.empty(); // Paper
|
|
|
|
|
+ this.adventure$deathMessage = deathMessage != null ? net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(deathMessage) : net.kyori.adventure.text.Component.empty(); // Paper
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@NotNull
|
|
|
|
@ -2332,7 +2340,7 @@ index 3c2ea8fec3a748cab7f5ad9100d12bd8213ec6c9..a01d4c21bedc7f1a54f5a330bb4c2909
|
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
|
public void setDeathMessage(@Nullable String deathMessage) {
|
|
|
|
|
this.deathMessage = deathMessage;
|
|
|
|
|
+ this.adventure$deathMessage = deathMessage != null ? org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(deathMessage) : net.kyori.adventure.text.Component.empty(); // Paper
|
|
|
|
|
+ this.adventure$deathMessage = deathMessage != null ? net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(deathMessage) : net.kyori.adventure.text.Component.empty(); // Paper
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -2350,7 +2358,7 @@ index 3c2ea8fec3a748cab7f5ad9100d12bd8213ec6c9..a01d4c21bedc7f1a54f5a330bb4c2909
|
|
|
|
|
-
|
|
|
|
|
+ // 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) {
|
|
|
|
|
+ return org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().serialize(component);
|
|
|
|
|
+ return net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().serialize(component);
|
|
|
|
|
+ }
|
|
|
|
|
+ // Paper end
|
|
|
|
|
/**
|
|
|
|
@ -2412,7 +2420,7 @@ index 9c68c3f2d61500479f48b80264f625aaae2f3204..399afcd19fcb6acd24857ed6ab48cf0d
|
|
|
|
|
private static final HandlerList handlers = new HandlerList();
|
|
|
|
|
private boolean cancel = false;
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java b/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java
|
|
|
|
|
index 9866c07c999f46cb585709804aaad710c3031d5a..31f6f781a0403bf6388d668f0effaed5aae94468 100644
|
|
|
|
|
index 9866c07c999f46cb585709804aaad710c3031d5a..c7c45e2de8cca1bf8b8e12752e08db62403efa6a 100644
|
|
|
|
|
--- a/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java
|
|
|
|
|
+++ b/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java
|
|
|
|
|
@@ -14,7 +14,7 @@ import org.jetbrains.annotations.NotNull;
|
|
|
|
@ -2495,7 +2503,7 @@ index 9866c07c999f46cb585709804aaad710c3031d5a..31f6f781a0403bf6388d668f0effaed5
|
|
|
|
|
+ @NotNull
|
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
|
+ public String getKickMessage() {
|
|
|
|
|
+ return org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().serialize(this.message); // Paper
|
|
|
|
|
+ return net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().serialize(this.message); // Paper
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
@ -2506,7 +2514,7 @@ index 9866c07c999f46cb585709804aaad710c3031d5a..31f6f781a0403bf6388d668f0effaed5
|
|
|
|
|
+ */
|
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
|
+ public void setKickMessage(@NotNull final String message) {
|
|
|
|
|
+ this.message = org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(message); // Paper
|
|
|
|
|
+ this.message = net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(message); // Paper
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
/**
|
|
|
|
@ -2529,7 +2537,7 @@ index 9866c07c999f46cb585709804aaad710c3031d5a..31f6f781a0403bf6388d668f0effaed5
|
|
|
|
|
public void disallow(@NotNull final Result result, @NotNull final String message) {
|
|
|
|
|
this.result = result;
|
|
|
|
|
- this.message = message;
|
|
|
|
|
+ this.message = org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(message); // Paper
|
|
|
|
|
+ this.message = net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(message); // Paper
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -2538,7 +2546,7 @@ index 9866c07c999f46cb585709804aaad710c3031d5a..31f6f781a0403bf6388d668f0effaed5
|
|
|
|
|
public void disallow(@NotNull final PlayerPreLoginEvent.Result result, @NotNull final String message) {
|
|
|
|
|
this.result = result == null ? null : Result.valueOf(result.name());
|
|
|
|
|
- this.message = message;
|
|
|
|
|
+ this.message = org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(message); // Paper
|
|
|
|
|
+ this.message = net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(message); // Paper
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -2568,7 +2576,7 @@ index 793b661b6d2d05de3d7f4fc26a4c018a2af58e62..f6d3b817de3001f04ea4554c7c39a129
|
|
|
|
|
player = who;
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/event/player/PlayerJoinEvent.java b/src/main/java/org/bukkit/event/player/PlayerJoinEvent.java
|
|
|
|
|
index d06684aba7688ce06777dbd837a46856a9d7767f..851a189d42e271679abc78f95049d8badf7a2b64 100644
|
|
|
|
|
index d06684aba7688ce06777dbd837a46856a9d7767f..4af1d064fcb57773dfa8f6ad40d6482973f8e1a8 100644
|
|
|
|
|
--- a/src/main/java/org/bukkit/event/player/PlayerJoinEvent.java
|
|
|
|
|
+++ b/src/main/java/org/bukkit/event/player/PlayerJoinEvent.java
|
|
|
|
|
@@ -10,30 +10,60 @@ import org.jetbrains.annotations.Nullable;
|
|
|
|
@ -2586,7 +2594,7 @@ index d06684aba7688ce06777dbd837a46856a9d7767f..851a189d42e271679abc78f95049d8ba
|
|
|
|
|
+ @Deprecated // Paper end
|
|
|
|
|
public PlayerJoinEvent(@NotNull final Player playerJoined, @Nullable final String joinMessage) {
|
|
|
|
|
super(playerJoined);
|
|
|
|
|
+ this.joinMessage = joinMessage != null ? org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(joinMessage) : null; // Paper end
|
|
|
|
|
+ this.joinMessage = joinMessage != null ? net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(joinMessage) : null; // Paper end
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // Paper start
|
|
|
|
@ -2619,7 +2627,7 @@ index d06684aba7688ce06777dbd837a46856a9d7767f..851a189d42e271679abc78f95049d8ba
|
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
|
public String getJoinMessage() {
|
|
|
|
|
- return joinMessage;
|
|
|
|
|
+ return this.joinMessage == null ? null : org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().serialize(this.joinMessage); // Paper
|
|
|
|
|
+ return this.joinMessage == null ? null : net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().serialize(this.joinMessage); // Paper
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -2631,12 +2639,12 @@ index d06684aba7688ce06777dbd837a46856a9d7767f..851a189d42e271679abc78f95049d8ba
|
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
|
public void setJoinMessage(@Nullable String joinMessage) {
|
|
|
|
|
- this.joinMessage = joinMessage;
|
|
|
|
|
+ this.joinMessage = joinMessage != null ? org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(joinMessage) : null; // Paper
|
|
|
|
|
+ this.joinMessage = joinMessage != null ? net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(joinMessage) : null; // Paper
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@NotNull
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/event/player/PlayerKickEvent.java b/src/main/java/org/bukkit/event/player/PlayerKickEvent.java
|
|
|
|
|
index 14c337f15fc804f52e52cb0a185aad38d89303a8..5c0efe74237dbe6803ce023fde99682ff70d1a92 100644
|
|
|
|
|
index 14c337f15fc804f52e52cb0a185aad38d89303a8..2b3f57d1a1c79923a2173f52d9cf61da1f75b7fc 100644
|
|
|
|
|
--- a/src/main/java/org/bukkit/event/player/PlayerKickEvent.java
|
|
|
|
|
+++ b/src/main/java/org/bukkit/event/player/PlayerKickEvent.java
|
|
|
|
|
@@ -10,35 +10,84 @@ import org.jetbrains.annotations.NotNull;
|
|
|
|
@ -2652,8 +2660,8 @@ index 14c337f15fc804f52e52cb0a185aad38d89303a8..5c0efe74237dbe6803ce023fde99682f
|
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
|
public PlayerKickEvent(@NotNull final Player playerKicked, @NotNull final String kickReason, @NotNull final String leaveMessage) {
|
|
|
|
|
+ super(playerKicked);
|
|
|
|
|
+ this.kickReason = org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(kickReason); // Paper
|
|
|
|
|
+ this.leaveMessage = org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(leaveMessage); // Paper
|
|
|
|
|
+ this.kickReason = net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(kickReason); // Paper
|
|
|
|
|
+ this.leaveMessage = net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(leaveMessage); // Paper
|
|
|
|
|
+ this.cancel = false;
|
|
|
|
|
+ }
|
|
|
|
|
+ // Paper start
|
|
|
|
@ -2711,7 +2719,7 @@ index 14c337f15fc804f52e52cb0a185aad38d89303a8..5c0efe74237dbe6803ce023fde99682f
|
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
|
public String getReason() {
|
|
|
|
|
- return kickReason;
|
|
|
|
|
+ return org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().serialize(this.kickReason); // Paper
|
|
|
|
|
+ return net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().serialize(this.kickReason); // Paper
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -2724,7 +2732,7 @@ index 14c337f15fc804f52e52cb0a185aad38d89303a8..5c0efe74237dbe6803ce023fde99682f
|
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
|
public String getLeaveMessage() {
|
|
|
|
|
- return leaveMessage;
|
|
|
|
|
+ return org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().serialize(this.leaveMessage); // Paper
|
|
|
|
|
+ return net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().serialize(this.leaveMessage); // Paper
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -2737,7 +2745,7 @@ index 14c337f15fc804f52e52cb0a185aad38d89303a8..5c0efe74237dbe6803ce023fde99682f
|
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
|
public void setReason(@NotNull String kickReason) {
|
|
|
|
|
- this.kickReason = kickReason;
|
|
|
|
|
+ this.kickReason = org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(kickReason); // Paper
|
|
|
|
|
+ this.kickReason = net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(kickReason); // Paper
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -2749,7 +2757,7 @@ index 14c337f15fc804f52e52cb0a185aad38d89303a8..5c0efe74237dbe6803ce023fde99682f
|
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
|
public void setLeaveMessage(@NotNull String leaveMessage) {
|
|
|
|
|
- this.leaveMessage = leaveMessage;
|
|
|
|
|
+ this.leaveMessage = org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(leaveMessage); // Paper
|
|
|
|
|
+ this.leaveMessage = net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(leaveMessage); // Paper
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@NotNull
|
|
|
|
@ -2790,7 +2798,7 @@ index 36b436e145a7215682b692a87ab894df25752c1d..ebd499c1a2d11ea068e8c374edbc3967
|
|
|
|
|
return locale;
|
|
|
|
|
}
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java b/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java
|
|
|
|
|
index 084ca8cfcb7381bfa4fa6280748cf9b81210a9c1..75cc54739ef841cd90568d74927d6002d4cfa7e0 100644
|
|
|
|
|
index 084ca8cfcb7381bfa4fa6280748cf9b81210a9c1..95c53d934f928d25f7b20cfbf2e5faa3df31ddc4 100644
|
|
|
|
|
--- a/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java
|
|
|
|
|
+++ b/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java
|
|
|
|
|
@@ -17,7 +17,7 @@ public class PlayerLoginEvent extends PlayerEvent {
|
|
|
|
@ -2812,7 +2820,7 @@ index 084ca8cfcb7381bfa4fa6280748cf9b81210a9c1..75cc54739ef841cd90568d74927d6002
|
|
|
|
|
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.result = result;
|
|
|
|
|
+ this.message = org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(message); // Paper
|
|
|
|
|
+ this.message = net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(message); // Paper
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // Paper start
|
|
|
|
@ -2865,7 +2873,7 @@ index 084ca8cfcb7381bfa4fa6280748cf9b81210a9c1..75cc54739ef841cd90568d74927d6002
|
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
|
public String getKickMessage() {
|
|
|
|
|
- return message;
|
|
|
|
|
+ return org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().serialize(this.message); // Paper
|
|
|
|
|
+ return net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().serialize(this.message); // Paper
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -2877,7 +2885,7 @@ index 084ca8cfcb7381bfa4fa6280748cf9b81210a9c1..75cc54739ef841cd90568d74927d6002
|
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
|
public void setKickMessage(@NotNull final String message) {
|
|
|
|
|
- this.message = message;
|
|
|
|
|
+ this.message = org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(message); // Paper
|
|
|
|
|
+ this.message = net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(message); // Paper
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -2899,7 +2907,7 @@ index 084ca8cfcb7381bfa4fa6280748cf9b81210a9c1..75cc54739ef841cd90568d74927d6002
|
|
|
|
|
+ @Deprecated // Paper start
|
|
|
|
|
public void disallow(@NotNull final Result result, @NotNull final String message) {
|
|
|
|
|
+ this.result = result;
|
|
|
|
|
+ this.message = org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(message);
|
|
|
|
|
+ this.message = net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(message);
|
|
|
|
|
+ }
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Disallows the player from logging in, with the given reason
|
|
|
|
@ -2913,7 +2921,7 @@ index 084ca8cfcb7381bfa4fa6280748cf9b81210a9c1..75cc54739ef841cd90568d74927d6002
|
|
|
|
|
this.message = message;
|
|
|
|
|
}
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/event/player/PlayerPreLoginEvent.java b/src/main/java/org/bukkit/event/player/PlayerPreLoginEvent.java
|
|
|
|
|
index fb066251f793ec3b41bfc075b9478901b15ee549..123979ed64939d615b061f91c19c630e1e1db8c7 100644
|
|
|
|
|
index fb066251f793ec3b41bfc075b9478901b15ee549..6800132c6288b4588fd02b08d26f016c38f27129 100644
|
|
|
|
|
--- a/src/main/java/org/bukkit/event/player/PlayerPreLoginEvent.java
|
|
|
|
|
+++ b/src/main/java/org/bukkit/event/player/PlayerPreLoginEvent.java
|
|
|
|
|
@@ -19,7 +19,7 @@ import org.jetbrains.annotations.NotNull;
|
|
|
|
@ -2981,7 +2989,7 @@ index fb066251f793ec3b41bfc075b9478901b15ee549..123979ed64939d615b061f91c19c630e
|
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
|
+ @NotNull
|
|
|
|
|
+ public String getKickMessage() {
|
|
|
|
|
+ return org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().serialize(this.message); // Paper
|
|
|
|
|
+ return net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().serialize(this.message); // Paper
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
@ -2992,7 +3000,7 @@ index fb066251f793ec3b41bfc075b9478901b15ee549..123979ed64939d615b061f91c19c630e
|
|
|
|
|
+ */
|
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
|
+ public void setKickMessage(@NotNull final String message) {
|
|
|
|
|
+ this.message = org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(message); // Paper
|
|
|
|
|
+ this.message = net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(message); // Paper
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
/**
|
|
|
|
@ -3015,12 +3023,12 @@ index fb066251f793ec3b41bfc075b9478901b15ee549..123979ed64939d615b061f91c19c630e
|
|
|
|
|
public void disallow(@NotNull final Result result, @NotNull final String message) {
|
|
|
|
|
this.result = result;
|
|
|
|
|
- this.message = message;
|
|
|
|
|
+ this.message = org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(message); // Paper
|
|
|
|
|
+ this.message = net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(message); // Paper
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/event/player/PlayerQuitEvent.java b/src/main/java/org/bukkit/event/player/PlayerQuitEvent.java
|
|
|
|
|
index d70c25f404e994766a9ebce89a917c8d0719777c..849e8f10dd77e9fb46aab17752b8f1ff79e9d42e 100644
|
|
|
|
|
index d70c25f404e994766a9ebce89a917c8d0719777c..0395ca85a466f6356259078d3bad48b2ce6e57b7 100644
|
|
|
|
|
--- a/src/main/java/org/bukkit/event/player/PlayerQuitEvent.java
|
|
|
|
|
+++ b/src/main/java/org/bukkit/event/player/PlayerQuitEvent.java
|
|
|
|
|
@@ -10,30 +10,59 @@ import org.jetbrains.annotations.Nullable;
|
|
|
|
@ -3033,7 +3041,7 @@ index d70c25f404e994766a9ebce89a917c8d0719777c..849e8f10dd77e9fb46aab17752b8f1ff
|
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
|
public PlayerQuitEvent(@NotNull final Player who, @Nullable final String quitMessage) {
|
|
|
|
|
super(who);
|
|
|
|
|
+ this.quitMessage = quitMessage != null ? org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(quitMessage) : null; // Paper
|
|
|
|
|
+ this.quitMessage = quitMessage != null ? net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(quitMessage) : null; // Paper
|
|
|
|
|
+ }
|
|
|
|
|
+ // Paper start
|
|
|
|
|
+ public PlayerQuitEvent(@NotNull final Player who, @Nullable final net.kyori.adventure.text.Component quitMessage) {
|
|
|
|
@ -3070,7 +3078,7 @@ index d70c25f404e994766a9ebce89a917c8d0719777c..849e8f10dd77e9fb46aab17752b8f1ff
|
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
|
public String getQuitMessage() {
|
|
|
|
|
- return quitMessage;
|
|
|
|
|
+ return this.quitMessage == null ? null : org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().serialize(this.quitMessage); // Paper
|
|
|
|
|
+ return this.quitMessage == null ? null : net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().serialize(this.quitMessage); // Paper
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -3082,12 +3090,12 @@ index d70c25f404e994766a9ebce89a917c8d0719777c..849e8f10dd77e9fb46aab17752b8f1ff
|
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
|
public void setQuitMessage(@Nullable String quitMessage) {
|
|
|
|
|
- this.quitMessage = quitMessage;
|
|
|
|
|
+ this.quitMessage = quitMessage != null ? org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(quitMessage) : null; // Paper
|
|
|
|
|
+ this.quitMessage = quitMessage != null ? net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(quitMessage) : null; // Paper
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@NotNull
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/event/server/BroadcastMessageEvent.java b/src/main/java/org/bukkit/event/server/BroadcastMessageEvent.java
|
|
|
|
|
index 03bfca9d368bbe4b7c1353d52c883e756bf69bda..4f8c85222c7bd33217c7db0ff5f47bf397f8f3e5 100644
|
|
|
|
|
index 03bfca9d368bbe4b7c1353d52c883e756bf69bda..943d324435350d3f16fad3e21cb472a01a3ff60b 100644
|
|
|
|
|
--- a/src/main/java/org/bukkit/event/server/BroadcastMessageEvent.java
|
|
|
|
|
+++ b/src/main/java/org/bukkit/event/server/BroadcastMessageEvent.java
|
|
|
|
|
@@ -18,7 +18,7 @@ import org.jetbrains.annotations.NotNull;
|
|
|
|
@ -3107,7 +3115,7 @@ index 03bfca9d368bbe4b7c1353d52c883e756bf69bda..4f8c85222c7bd33217c7db0ff5f47bf3
|
|
|
|
|
public BroadcastMessageEvent(boolean isAsync, @NotNull String message, @NotNull Set<CommandSender> recipients) {
|
|
|
|
|
+ // Paper start
|
|
|
|
|
+ super(isAsync);
|
|
|
|
|
+ this.message = org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(message);
|
|
|
|
|
+ this.message = net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(message);
|
|
|
|
|
+ this.recipients = recipients;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
@ -3152,7 +3160,7 @@ index 03bfca9d368bbe4b7c1353d52c883e756bf69bda..4f8c85222c7bd33217c7db0ff5f47bf3
|
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
|
public String getMessage() {
|
|
|
|
|
- return message;
|
|
|
|
|
+ return org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().serialize(this.message); // Paper
|
|
|
|
|
+ return net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().serialize(this.message); // Paper
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -3164,12 +3172,12 @@ index 03bfca9d368bbe4b7c1353d52c883e756bf69bda..4f8c85222c7bd33217c7db0ff5f47bf3
|
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
|
public void setMessage(@NotNull String message) {
|
|
|
|
|
- this.message = message;
|
|
|
|
|
+ this.message = org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(message); // Paper
|
|
|
|
|
+ this.message = net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(message); // Paper
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/event/server/ServerListPingEvent.java b/src/main/java/org/bukkit/event/server/ServerListPingEvent.java
|
|
|
|
|
index cc5e2fef75736e56420df4cf4f83152fa97926df..fd4db14bef92b893ddaf5424e14ee71da22dcf84 100644
|
|
|
|
|
index cc5e2fef75736e56420df4cf4f83152fa97926df..172697ac5dc0ea3551a61b5589416ac68f372cd1 100644
|
|
|
|
|
--- a/src/main/java/org/bukkit/event/server/ServerListPingEvent.java
|
|
|
|
|
+++ b/src/main/java/org/bukkit/event/server/ServerListPingEvent.java
|
|
|
|
|
@@ -21,15 +21,16 @@ public class ServerListPingEvent extends ServerEvent implements Iterable<Player>
|
|
|
|
@ -3187,7 +3195,7 @@ index cc5e2fef75736e56420df4cf4f83152fa97926df..fd4db14bef92b893ddaf5424e14ee71d
|
|
|
|
|
Validate.isTrue(numPlayers >= 0, "Cannot have negative number of players online", numPlayers);
|
|
|
|
|
this.address = address;
|
|
|
|
|
- this.motd = motd;
|
|
|
|
|
+ this.motd = org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(motd); // Paper
|
|
|
|
|
+ this.motd = net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(motd); // Paper
|
|
|
|
|
this.numPlayers = numPlayers;
|
|
|
|
|
this.maxPlayers = maxPlayers;
|
|
|
|
|
}
|
|
|
|
@ -3202,7 +3210,7 @@ index cc5e2fef75736e56420df4cf4f83152fa97926df..fd4db14bef92b893ddaf5424e14ee71d
|
|
|
|
|
+ super(true);
|
|
|
|
|
+ this.numPlayers = MAGIC_PLAYER_COUNT;
|
|
|
|
|
+ this.address = address;
|
|
|
|
|
+ this.motd = org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(motd); // Paper
|
|
|
|
|
+ this.motd = net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(motd); // Paper
|
|
|
|
|
+ this.maxPlayers = maxPlayers;
|
|
|
|
|
+ }
|
|
|
|
|
+ // Paper start
|
|
|
|
@ -3260,7 +3268,7 @@ index cc5e2fef75736e56420df4cf4f83152fa97926df..fd4db14bef92b893ddaf5424e14ee71d
|
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
|
public String getMotd() {
|
|
|
|
|
- return motd;
|
|
|
|
|
+ return org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().serialize(this.motd); // Paper
|
|
|
|
|
+ return net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().serialize(this.motd); // Paper
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -3272,12 +3280,12 @@ index cc5e2fef75736e56420df4cf4f83152fa97926df..fd4db14bef92b893ddaf5424e14ee71d
|
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
|
public void setMotd(@NotNull String motd) {
|
|
|
|
|
- this.motd = motd;
|
|
|
|
|
+ this.motd = org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(motd); // Paper
|
|
|
|
|
+ this.motd = net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(motd); // Paper
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/inventory/InventoryView.java b/src/main/java/org/bukkit/inventory/InventoryView.java
|
|
|
|
|
index 14346d83bc99581b18e53d19af03708c0bf22cf7..664de64b020cf9090a2fbee0afe2bfaf150adc3c 100644
|
|
|
|
|
index 14346d83bc99581b18e53d19af03708c0bf22cf7..a4e3d526db2d17dc923cbe82e53d3c902d61e1f3 100644
|
|
|
|
|
--- a/src/main/java/org/bukkit/inventory/InventoryView.java
|
|
|
|
|
+++ b/src/main/java/org/bukkit/inventory/InventoryView.java
|
|
|
|
|
@@ -446,11 +446,25 @@ public abstract class InventoryView {
|
|
|
|
@ -3292,7 +3300,7 @@ index 14346d83bc99581b18e53d19af03708c0bf22cf7..664de64b020cf9090a2fbee0afe2bfaf
|
|
|
|
|
*/
|
|
|
|
|
@NotNull
|
|
|
|
|
+ public /*abstract*/ net.kyori.adventure.text.Component title() {
|
|
|
|
|
+ return org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(this.getTitle());
|
|
|
|
|
+ return net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(this.getTitle());
|
|
|
|
|
+ }
|
|
|
|
|
+ // Paper end
|
|
|
|
|
+
|
|
|
|
@ -3720,7 +3728,7 @@ index 91eee1470f0969e9eef0753c0c700ae5354f1acc..69f68ca2d62c2cfe07a193776054c14c
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/map/MapCursor.java b/src/main/java/org/bukkit/map/MapCursor.java
|
|
|
|
|
index 83354b2a38b6261b172b91c1008dcf3313cc4a8f..ed0bc2024a0bb85837e25f75ae89d1fe257b2e60 100644
|
|
|
|
|
index 83354b2a38b6261b172b91c1008dcf3313cc4a8f..ca763b231749f108b6773040a5c6109378b21b31 100644
|
|
|
|
|
--- a/src/main/java/org/bukkit/map/MapCursor.java
|
|
|
|
|
+++ b/src/main/java/org/bukkit/map/MapCursor.java
|
|
|
|
|
@@ -10,7 +10,7 @@ public final class MapCursor {
|
|
|
|
@ -3764,7 +3772,7 @@ index 83354b2a38b6261b172b91c1008dcf3313cc4a8f..ed0bc2024a0bb85837e25f75ae89d1fe
|
|
|
|
|
setRawType(type);
|
|
|
|
|
this.visible = visible;
|
|
|
|
|
- this.caption = caption;
|
|
|
|
|
+ this.caption = caption == null ? null : org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(caption); // Paper
|
|
|
|
|
+ this.caption = caption == null ? null : net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(caption); // Paper
|
|
|
|
|
}
|
|
|
|
|
+ // Paper start
|
|
|
|
|
+ /**
|
|
|
|
@ -3808,7 +3816,7 @@ index 83354b2a38b6261b172b91c1008dcf3313cc4a8f..ed0bc2024a0bb85837e25f75ae89d1fe
|
|
|
|
|
setType(type);
|
|
|
|
|
this.visible = visible;
|
|
|
|
|
- this.caption = caption;
|
|
|
|
|
+ this.caption = caption == null ? null : org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(caption); // Paper
|
|
|
|
|
+ this.caption = caption == null ? null : net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(caption); // Paper
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -3844,7 +3852,7 @@ index 83354b2a38b6261b172b91c1008dcf3313cc4a8f..ed0bc2024a0bb85837e25f75ae89d1fe
|
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
|
public String getCaption() {
|
|
|
|
|
- return caption;
|
|
|
|
|
+ return this.caption == null ? null : org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().serialize(this.caption); // Paper
|
|
|
|
|
+ return this.caption == null ? null : net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().serialize(this.caption); // Paper
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -3856,7 +3864,7 @@ index 83354b2a38b6261b172b91c1008dcf3313cc4a8f..ed0bc2024a0bb85837e25f75ae89d1fe
|
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
|
public void setCaption(@Nullable String caption) {
|
|
|
|
|
- this.caption = caption;
|
|
|
|
|
+ this.caption = caption == null ? null : org.bukkit.Bukkit.getUnsafe().legacyComponentSerializer().deserialize(caption); // Paper
|
|
|
|
|
+ this.caption = caption == null ? null : net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(caption); // Paper
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|