|
|
|
@ -7,7 +7,7 @@ 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 3777d12874ede329410a6bf1c0533deb44924d73..0e8e827b5a05ac9423386eaea4188d132cc7f954 100644
|
|
|
|
|
index 55ee0c6330e4dbba22b4044346d1e1dd39c745ce..80fdd05dd593455ca89b66636ed30f1d9facf4ed 100644
|
|
|
|
|
--- a/build.gradle.kts
|
|
|
|
|
+++ b/build.gradle.kts
|
|
|
|
|
@@ -8,6 +8,19 @@ java {
|
|
|
|
@ -379,7 +379,7 @@ 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..77db592d05b754f879f8d1790642e9d9bbd30a4e
|
|
|
|
|
index 0000000000000000000000000000000000000000..be72827aafc9a689883f936b4db97bdf01d3bb35
|
|
|
|
|
--- /dev/null
|
|
|
|
|
+++ b/src/main/java/io/papermc/paper/text/PaperComponents.java
|
|
|
|
|
@@ -0,0 +1,88 @@
|
|
|
|
@ -390,9 +390,9 @@ index 0000000000000000000000000000000000000000..77db592d05b754f879f8d1790642e9d9
|
|
|
|
|
+import net.kyori.adventure.text.format.NamedTextColor;
|
|
|
|
|
+import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer;
|
|
|
|
|
+import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
|
|
|
|
|
+import net.kyori.adventure.text.serializer.plain.PlainComponentSerializer;
|
|
|
|
|
+import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer;
|
|
|
|
|
+import org.bukkit.Bukkit;
|
|
|
|
|
+import org.checkerframework.checker.nullness.qual.NonNull;
|
|
|
|
|
+import org.jetbrains.annotations.NotNull;
|
|
|
|
|
+
|
|
|
|
|
+/**
|
|
|
|
|
+ * Paper API-specific methods for working with {@link Component}s and related.
|
|
|
|
@ -407,7 +407,7 @@ index 0000000000000000000000000000000000000000..77db592d05b754f879f8d1790642e9d9
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return a component flattener
|
|
|
|
|
+ */
|
|
|
|
|
+ public static @NonNull ComponentFlattener flattener() {
|
|
|
|
|
+ public static @NotNull ComponentFlattener flattener() {
|
|
|
|
|
+ return Bukkit.getUnsafe().componentFlattener();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
@ -420,7 +420,7 @@ index 0000000000000000000000000000000000000000..77db592d05b754f879f8d1790642e9d9
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return a serializer to plain text
|
|
|
|
|
+ */
|
|
|
|
|
+ public static @NonNull PlainComponentSerializer plainSerializer() {
|
|
|
|
|
+ public static @NotNull PlainTextComponentSerializer plainSerializer() {
|
|
|
|
|
+ return Bukkit.getUnsafe().plainComponentSerializer();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
@ -434,7 +434,7 @@ index 0000000000000000000000000000000000000000..77db592d05b754f879f8d1790642e9d9
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return a json component serializer
|
|
|
|
|
+ */
|
|
|
|
|
+ public static @NonNull GsonComponentSerializer gsonSerializer() {
|
|
|
|
|
+ public static @NotNull GsonComponentSerializer gsonSerializer() {
|
|
|
|
|
+ return Bukkit.getUnsafe().gsonComponentSerializer();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
@ -449,7 +449,7 @@ index 0000000000000000000000000000000000000000..77db592d05b754f879f8d1790642e9d9
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return a json component serializer
|
|
|
|
|
+ */
|
|
|
|
|
+ public static @NonNull GsonComponentSerializer colorDownsamplingGsonSerializer() {
|
|
|
|
|
+ public static @NotNull GsonComponentSerializer colorDownsamplingGsonSerializer() {
|
|
|
|
|
+ return Bukkit.getUnsafe().colorDownsamplingGsonComponentSerializer();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
@ -467,7 +467,7 @@ index 0000000000000000000000000000000000000000..77db592d05b754f879f8d1790642e9d9
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return a section serializer
|
|
|
|
|
+ */
|
|
|
|
|
+ public static @NonNull LegacyComponentSerializer legacySectionSerializer() {
|
|
|
|
|
+ public static @NotNull LegacyComponentSerializer legacySectionSerializer() {
|
|
|
|
|
+ return Bukkit.getUnsafe().legacyComponentSerializer();
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
@ -1086,7 +1086,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 945b8b030d1b2a13afc0c4efad76997eb7bf00ba..207c656c0a11a3a630bc70491efcf433b2681e18 100644
|
|
|
|
|
index 945b8b030d1b2a13afc0c4efad76997eb7bf00ba..3b10d6387606a6efbed059ce54d565bdc756e13e 100644
|
|
|
|
|
--- a/src/main/java/org/bukkit/UnsafeValues.java
|
|
|
|
|
+++ b/src/main/java/org/bukkit/UnsafeValues.java
|
|
|
|
|
@@ -17,6 +17,13 @@ import org.bukkit.plugin.PluginDescriptionFile;
|
|
|
|
@ -1095,7 +1095,7 @@ index 945b8b030d1b2a13afc0c4efad76997eb7bf00ba..207c656c0a11a3a630bc70491efcf433
|
|
|
|
|
public interface UnsafeValues {
|
|
|
|
|
+ // Paper start
|
|
|
|
|
+ net.kyori.adventure.text.flattener.ComponentFlattener componentFlattener();
|
|
|
|
|
+ net.kyori.adventure.text.serializer.plain.PlainComponentSerializer plainComponentSerializer();
|
|
|
|
|
+ net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer plainComponentSerializer();
|
|
|
|
|
+ net.kyori.adventure.text.serializer.gson.GsonComponentSerializer gsonComponentSerializer();
|
|
|
|
|
+ net.kyori.adventure.text.serializer.gson.GsonComponentSerializer colorDownsamplingGsonComponentSerializer();
|
|
|
|
|
+ net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer legacyComponentSerializer();
|
|
|
|
@ -1579,7 +1579,7 @@ index 25a6f9313a1953def7470e411b53016f2ca14bef..10cb6088c4618f228c757f4e592b44ed
|
|
|
|
|
+ // Paper end
|
|
|
|
|
}
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
|
|
|
|
index c36e4ceb1094aa9469f976e0952e2725358ff761..32850ac21d59f962de10125e1b528856bc561d70 100644
|
|
|
|
|
index c36e4ceb1094aa9469f976e0952e2725358ff761..e3cc40a54b48e8a90ccc93c272c1a2dca1da9595 100644
|
|
|
|
|
--- a/src/main/java/org/bukkit/entity/Player.java
|
|
|
|
|
+++ b/src/main/java/org/bukkit/entity/Player.java
|
|
|
|
|
@@ -35,7 +35,28 @@ import org.jetbrains.annotations.Nullable;
|
|
|
|
@ -1752,7 +1752,7 @@ index c36e4ceb1094aa9469f976e0952e2725358ff761..32850ac21d59f962de10125e1b528856
|
|
|
|
|
/**
|
|
|
|
|
* Says a message (or runs a command).
|
|
|
|
|
*
|
|
|
|
|
@@ -473,6 +554,26 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
|
|
|
|
@@ -473,6 +554,90 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
|
|
|
|
*/
|
|
|
|
|
public void sendEquipmentChange(@NotNull LivingEntity entity, @NotNull EquipmentSlot slot, @NotNull ItemStack item);
|
|
|
|
|
|
|
|
|
@ -1776,18 +1776,23 @@ index c36e4ceb1094aa9469f976e0952e2725358ff761..32850ac21d59f962de10125e1b528856
|
|
|
|
|
+ this.sendSignChange(loc, lines, DyeColor.BLACK);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
/**
|
|
|
|
|
* Send a sign change. This fakes a sign change packet for a user at
|
|
|
|
|
* a certain location. This will not actually change the world in any way.
|
|
|
|
|
@@ -485,9 +586,75 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
|
|
|
|
*
|
|
|
|
|
* @param loc the location of the sign
|
|
|
|
|
* @param lines the new text on the sign or null to clear it
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Send a sign change. This fakes a sign change packet for a user at
|
|
|
|
|
+ * a certain location. This will not actually change the world in any way.
|
|
|
|
|
+ * This method will use a sign at the location's block or a faked sign
|
|
|
|
|
+ * sent via
|
|
|
|
|
+ * {@link #sendBlockChange(org.bukkit.Location, org.bukkit.Material, byte)}.
|
|
|
|
|
+ * <p>
|
|
|
|
|
+ * If the client does not have a sign at the given location it will
|
|
|
|
|
+ * display an error message to the user.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param loc the location of the sign
|
|
|
|
|
+ * @param lines the new text on the sign or null to clear it
|
|
|
|
|
+ * @param dyeColor the color of the sign
|
|
|
|
|
* @throws IllegalArgumentException if location is null
|
|
|
|
|
+ * @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
|
|
|
|
|
*/
|
|
|
|
|
+ * @throws IllegalArgumentException if lines is non-null and has a length less than 4
|
|
|
|
|
+ */
|
|
|
|
|
+ default void sendSignChange(@NotNull Location loc, @Nullable java.util.List<net.kyori.adventure.text.Component> lines, @NotNull DyeColor dyeColor) throws IllegalArgumentException {
|
|
|
|
|
+ this.sendSignChange(loc, lines, dyeColor, false);
|
|
|
|
|
+ }
|
|
|
|
@ -1835,22 +1840,15 @@ index c36e4ceb1094aa9469f976e0952e2725358ff761..32850ac21d59f962de10125e1b528856
|
|
|
|
|
+ throws IllegalArgumentException;
|
|
|
|
|
+ // Paper end
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Send a sign change. This fakes a sign change packet for a user at
|
|
|
|
|
+ * a certain location. This will not actually change the world in any way.
|
|
|
|
|
+ * This method will use a sign at the location's block or a faked sign
|
|
|
|
|
+ * sent via
|
|
|
|
|
+ * {@link #sendBlockChange(org.bukkit.Location, org.bukkit.Material, byte)}.
|
|
|
|
|
+ * <p>
|
|
|
|
|
+ * If the client does not have a sign at the given location it will
|
|
|
|
|
+ * display an error message to the user.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param loc the location of the sign
|
|
|
|
|
+ * @param lines the new text on the sign or null to clear it
|
|
|
|
|
+ * @throws IllegalArgumentException if location is null
|
|
|
|
|
+ * @throws IllegalArgumentException if lines is non-null and has a length less than 4
|
|
|
|
|
/**
|
|
|
|
|
* Send a sign change. This fakes a sign change packet for a user at
|
|
|
|
|
* a certain location. This will not actually change the world in any way.
|
|
|
|
|
@@ -487,7 +652,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
|
|
|
|
|
+ * @deprecated in favour of {@link #sendSignChange(org.bukkit.Location, java.util.List)}
|
|
|
|
|
+ */
|
|
|
|
|
*/
|
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
|
public void sendSignChange(@NotNull Location loc, @Nullable String[] lines) throws IllegalArgumentException;
|
|
|
|
|
|
|
|
|
@ -1875,7 +1873,117 @@ index c36e4ceb1094aa9469f976e0952e2725358ff761..32850ac21d59f962de10125e1b528856
|
|
|
|
|
public void sendSignChange(@NotNull Location loc, @Nullable String[] lines, @NotNull DyeColor dyeColor, boolean hasGlowingText) throws IllegalArgumentException;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@@ -1192,7 +1363,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
|
|
|
|
@@ -1008,6 +1179,54 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
|
|
|
|
*/
|
|
|
|
|
public void setResourcePack(@NotNull String url, @Nullable byte[] hash, @Nullable String prompt);
|
|
|
|
|
|
|
|
|
|
+ // Paper start
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Request that the player's client download and switch resource packs.
|
|
|
|
|
+ * <p>
|
|
|
|
|
+ * The player's client will download the new resource pack asynchronously
|
|
|
|
|
+ * in the background, and will automatically switch to it once the
|
|
|
|
|
+ * download is complete. If the client has downloaded and cached a
|
|
|
|
|
+ * resource pack with the same hash in the past it will not download but
|
|
|
|
|
+ * directly apply the cached pack. If the hash is null and the client has
|
|
|
|
|
+ * downloaded and cached the same resource pack in the past, it will
|
|
|
|
|
+ * perform a file size check against the response content to determine if
|
|
|
|
|
+ * the resource pack has changed and needs to be downloaded again. When
|
|
|
|
|
+ * this request is sent for the very first time from a given server, the
|
|
|
|
|
+ * client will first display a confirmation GUI to the player before
|
|
|
|
|
+ * proceeding with the download.
|
|
|
|
|
+ * <p>
|
|
|
|
|
+ * Notes:
|
|
|
|
|
+ * <ul>
|
|
|
|
|
+ * <li>Players can disable server resources on their client, in which
|
|
|
|
|
+ * case this method will have no affect on them. Use the
|
|
|
|
|
+ * {@link PlayerResourcePackStatusEvent} to figure out whether or not
|
|
|
|
|
+ * the player loaded the pack!
|
|
|
|
|
+ * <li>There is no concept of resetting resource packs back to default
|
|
|
|
|
+ * within Minecraft, so players will have to relog to do so or you
|
|
|
|
|
+ * have to send an empty pack.
|
|
|
|
|
+ * <li>The request is sent with empty string as the hash when the hash is
|
|
|
|
|
+ * not provided. This might result in newer versions not loading the
|
|
|
|
|
+ * pack correctly.
|
|
|
|
|
+ * </ul>
|
|
|
|
|
+ *
|
|
|
|
|
+ * @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.
|
|
|
|
|
+ * @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!
|
|
|
|
|
+ * @param prompt The optional custom prompt message to be shown to client.
|
|
|
|
|
+ * @throws IllegalArgumentException Thrown if the URL is null.
|
|
|
|
|
+ * @throws IllegalArgumentException Thrown if the URL is too long. The
|
|
|
|
|
+ * length restriction is an implementation specific arbitrary value.
|
|
|
|
|
+ * @throws IllegalArgumentException Thrown if the hash is not 20 bytes
|
|
|
|
|
+ * long.
|
|
|
|
|
+ */
|
|
|
|
|
+ default void setResourcePack(@NotNull String url, byte @Nullable [] hash, net.kyori.adventure.text.@Nullable Component prompt) {
|
|
|
|
|
+ this.setResourcePack(url, hash, prompt, false);
|
|
|
|
|
+ }
|
|
|
|
|
+ // Paper end
|
|
|
|
|
+
|
|
|
|
|
/**
|
|
|
|
|
* Request that the player's client download and switch resource packs.
|
|
|
|
|
* <p>
|
|
|
|
|
@@ -1099,6 +1318,54 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
|
|
|
|
*/
|
|
|
|
|
public void setResourcePack(@NotNull String url, @Nullable byte[] hash, @Nullable String prompt, boolean force);
|
|
|
|
|
|
|
|
|
|
+ // Paper end
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Request that the player's client download and switch resource packs.
|
|
|
|
|
+ * <p>
|
|
|
|
|
+ * The player's client will download the new resource pack asynchronously
|
|
|
|
|
+ * in the background, and will automatically switch to it once the
|
|
|
|
|
+ * download is complete. If the client has downloaded and cached a
|
|
|
|
|
+ * resource pack with the same hash in the past it will not download but
|
|
|
|
|
+ * directly apply the cached pack. If the hash is null and the client has
|
|
|
|
|
+ * downloaded and cached the same resource pack in the past, it will
|
|
|
|
|
+ * perform a file size check against the response content to determine if
|
|
|
|
|
+ * the resource pack has changed and needs to be downloaded again. When
|
|
|
|
|
+ * this request is sent for the very first time from a given server, the
|
|
|
|
|
+ * client will first display a confirmation GUI to the player before
|
|
|
|
|
+ * proceeding with the download.
|
|
|
|
|
+ * <p>
|
|
|
|
|
+ * Notes:
|
|
|
|
|
+ * <ul>
|
|
|
|
|
+ * <li>Players can disable server resources on their client, in which
|
|
|
|
|
+ * case this method will have no affect on them. Use the
|
|
|
|
|
+ * {@link PlayerResourcePackStatusEvent} to figure out whether or not
|
|
|
|
|
+ * the player loaded the pack!
|
|
|
|
|
+ * <li>There is no concept of resetting resource packs back to default
|
|
|
|
|
+ * within Minecraft, so players will have to relog to do so or you
|
|
|
|
|
+ * have to send an empty pack.
|
|
|
|
|
+ * <li>The request is sent with empty string as the hash when the hash is
|
|
|
|
|
+ * not provided. This might result in newer versions not loading the
|
|
|
|
|
+ * pack correctly.
|
|
|
|
|
+ * </ul>
|
|
|
|
|
+ *
|
|
|
|
|
+ * @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.
|
|
|
|
|
+ * @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!
|
|
|
|
|
+ * @param prompt The optional custom prompt message to be shown to client.
|
|
|
|
|
+ * @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.
|
|
|
|
|
+ * @throws IllegalArgumentException Thrown if the URL is too long. The
|
|
|
|
|
+ * length restriction is an implementation specific arbitrary value.
|
|
|
|
|
+ * @throws IllegalArgumentException Thrown if the hash is not 20 bytes
|
|
|
|
|
+ * long.
|
|
|
|
|
+ */
|
|
|
|
|
+ public void setResourcePack(@NotNull String url, byte @Nullable [] hash, net.kyori.adventure.text.@Nullable Component prompt, boolean force);
|
|
|
|
|
+ // Paper end
|
|
|
|
|
+
|
|
|
|
|
/**
|
|
|
|
|
* Gets the Scoreboard displayed to this player
|
|
|
|
|
*
|
|
|
|
|
@@ -1192,7 +1459,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
|
|
|
|
*
|
|
|
|
|
* @param title Title text
|
|
|
|
|
* @param subtitle Subtitle text
|
|
|
|
@ -1884,7 +1992,7 @@ index c36e4ceb1094aa9469f976e0952e2725358ff761..32850ac21d59f962de10125e1b528856
|
|
|
|
|
*/
|
|
|
|
|
@Deprecated
|
|
|
|
|
public void sendTitle(@Nullable String title, @Nullable String subtitle);
|
|
|
|
|
@@ -1211,7 +1382,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
|
|
|
|
@@ -1211,7 +1478,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.
|
|
|
|
@ -1894,7 +2002,7 @@ index c36e4ceb1094aa9469f976e0952e2725358ff761..32850ac21d59f962de10125e1b528856
|
|
|
|
|
public void sendTitle(@Nullable String title, @Nullable String subtitle, int fadeIn, int stay, int fadeOut);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@@ -1438,6 +1611,14 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
|
|
|
|
@@ -1438,6 +1707,14 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
|
|
|
|
*/
|
|
|
|
|
public int getClientViewDistance();
|
|
|
|
|
|
|
|
|
@ -1909,7 +2017,7 @@ index c36e4ceb1094aa9469f976e0952e2725358ff761..32850ac21d59f962de10125e1b528856
|
|
|
|
|
/**
|
|
|
|
|
* Gets the player's estimated ping in milliseconds.
|
|
|
|
|
*
|
|
|
|
|
@@ -1463,8 +1644,10 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
|
|
|
|
@@ -1463,8 +1740,10 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
|
|
|
|
* they wish.
|
|
|
|
|
*
|
|
|
|
|
* @return the player's locale
|
|
|
|
@ -1920,7 +2028,7 @@ index c36e4ceb1094aa9469f976e0952e2725358ff761..32850ac21d59f962de10125e1b528856
|
|
|
|
|
public String getLocale();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@@ -1506,6 +1689,14 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
|
|
|
|
@@ -1506,6 +1785,14 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
|
|
|
|
*/
|
|
|
|
|
public boolean isAllowingServerListings();
|
|
|
|
|
|
|
|
|
@ -1935,7 +2043,7 @@ index c36e4ceb1094aa9469f976e0952e2725358ff761..32850ac21d59f962de10125e1b528856
|
|
|
|
|
// Spigot start
|
|
|
|
|
public class Spigot extends Entity.Spigot {
|
|
|
|
|
|
|
|
|
|
@@ -1560,11 +1751,13 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
|
|
|
|
@@ -1560,11 +1847,13 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
|
|
|
|
throw new UnsupportedOperationException("Not supported yet.");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1949,7 +2057,7 @@ index c36e4ceb1094aa9469f976e0952e2725358ff761..32850ac21d59f962de10125e1b528856
|
|
|
|
|
@Override
|
|
|
|
|
public void sendMessage(@NotNull net.md_5.bungee.api.chat.BaseComponent... components) {
|
|
|
|
|
throw new UnsupportedOperationException("Not supported yet.");
|
|
|
|
|
@@ -1575,7 +1768,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
|
|
|
|
@@ -1575,7 +1864,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
|
|
|
|
*
|
|
|
|
|
* @param position the screen position
|
|
|
|
|
* @param component the components to send
|
|
|
|
@ -1959,7 +2067,7 @@ index c36e4ceb1094aa9469f976e0952e2725358ff761..32850ac21d59f962de10125e1b528856
|
|
|
|
|
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.");
|
|
|
|
|
}
|
|
|
|
|
@@ -1585,7 +1780,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
|
|
|
|
@@ -1585,7 +1876,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
|
|
|
|
*
|
|
|
|
|
* @param position the screen position
|
|
|
|
|
* @param components the components to send
|
|
|
|
@ -1969,7 +2077,7 @@ index c36e4ceb1094aa9469f976e0952e2725358ff761..32850ac21d59f962de10125e1b528856
|
|
|
|
|
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.");
|
|
|
|
|
}
|
|
|
|
|
@@ -1596,7 +1793,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
|
|
|
|
@@ -1596,7 +1889,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
|
|
|
|
@ -1979,7 +2087,7 @@ index c36e4ceb1094aa9469f976e0952e2725358ff761..32850ac21d59f962de10125e1b528856
|
|
|
|
|
public void sendMessage(@NotNull net.md_5.bungee.api.ChatMessageType position, @Nullable UUID sender, @NotNull net.md_5.bungee.api.chat.BaseComponent component) {
|
|
|
|
|
throw new UnsupportedOperationException("Not supported yet.");
|
|
|
|
|
}
|
|
|
|
|
@@ -1607,7 +1806,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
|
|
|
|
@@ -1607,7 +1902,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
|
|
|
|
@ -4106,7 +4214,7 @@ index 0db7fe1b9fe5621ceed3f4f046691e359f5949dd..d5b39fb4fc16a342b5661e08df150685
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
diff --git a/src/test/java/org/bukkit/AnnotationTest.java b/src/test/java/org/bukkit/AnnotationTest.java
|
|
|
|
|
index c6a8a37a933cfc5a5885602a8a70fdda8fb6aa10..61441e56da69ee8cb92a2b1239f5406425a8344d 100644
|
|
|
|
|
index c6a8a37a933cfc5a5885602a8a70fdda8fb6aa10..7f57b95727d0336f1f1548055574e0c129fe9643 100644
|
|
|
|
|
--- a/src/test/java/org/bukkit/AnnotationTest.java
|
|
|
|
|
+++ b/src/test/java/org/bukkit/AnnotationTest.java
|
|
|
|
|
@@ -26,6 +26,12 @@ import org.objectweb.asm.tree.ParameterNode;
|
|
|
|
@ -4122,3 +4230,12 @@ index c6a8a37a933cfc5a5885602a8a70fdda8fb6aa10..61441e56da69ee8cb92a2b1239f54064
|
|
|
|
|
"Lorg/jetbrains/annotations/Nullable;",
|
|
|
|
|
"Lorg/jetbrains/annotations/NotNull;",
|
|
|
|
|
"Lorg/jetbrains/annotations/Contract;",
|
|
|
|
|
@@ -105,7 +111,7 @@ public class AnnotationTest {
|
|
|
|
|
if (method.invisibleTypeAnnotations != null) {
|
|
|
|
|
for (final org.objectweb.asm.tree.TypeAnnotationNode invisibleTypeAnnotation : method.invisibleTypeAnnotations) {
|
|
|
|
|
final org.objectweb.asm.TypeReference ref = new org.objectweb.asm.TypeReference(invisibleTypeAnnotation.typeRef);
|
|
|
|
|
- if (ref.getSort() == org.objectweb.asm.TypeReference.METHOD_FORMAL_PARAMETER && ref.getTypeParameterIndex() == i && java.util.Arrays.binarySearch(ACCEPTED_ANNOTATIONS, invisibleTypeAnnotation.desc) >= 0) {
|
|
|
|
|
+ if (ref.getSort() == org.objectweb.asm.TypeReference.METHOD_FORMAL_PARAMETER && ref.getTypeParameterIndex() == i && org.apache.commons.lang.ArrayUtils.contains(ACCEPTED_ANNOTATIONS, invisibleTypeAnnotation.desc)) {
|
|
|
|
|
continue dancing;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|