Check for more correct profile validation (#10730)

This commit is contained in:
Jake Potrebic 2024-05-19 17:45:43 -07:00 committed by GitHub
parent b3b340617e
commit 591521e697
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 71 additions and 60 deletions

View file

@ -330,7 +330,7 @@ diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Buk
index 53f56d95bdf484caed9effbedfe507f6745bb8c0..5aa1aafddd28a5aa52274f37c09bf0fda75f7ea3 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -2385,6 +2385,83 @@ public final class Bukkit {
@@ -2385,6 +2385,89 @@ public final class Bukkit {
public static boolean suggestPlayerNamesWhenNullTabCompletions() {
return server.suggestPlayerNamesWhenNullTabCompletions();
}
@ -362,6 +362,8 @@ index 53f56d95bdf484caed9effbedfe507f6745bb8c0..5aa1aafddd28a5aa52274f37c09bf0fd
+ *
+ * @param name Name to create profile for
+ * @return A PlayerProfile object
+ * @throws IllegalArgumentException if the name is longer than 16 characters
+ * @throws IllegalArgumentException if the name contains invalid characters
+ */
+ @NotNull
+ public static com.destroystokyo.paper.profile.PlayerProfile createProfile(@NotNull String name) {
@ -386,6 +388,8 @@ index 53f56d95bdf484caed9effbedfe507f6745bb8c0..5aa1aafddd28a5aa52274f37c09bf0fd
+ * @param uuid UUID to create profile for
+ * @param name Name to create profile for
+ * @return A PlayerProfile object
+ * @throws IllegalArgumentException if the name is longer than 16 characters
+ * @throws IllegalArgumentException if the name contains invalid characters
+ */
+ @NotNull
+ public static com.destroystokyo.paper.profile.PlayerProfile createProfile(@Nullable UUID uuid, @Nullable String name) {
@ -406,6 +410,8 @@ index 53f56d95bdf484caed9effbedfe507f6745bb8c0..5aa1aafddd28a5aa52274f37c09bf0fd
+ * @param uuid UUID to create profile for
+ * @param name Name to create profile for
+ * @return A PlayerProfile object
+ * @throws IllegalArgumentException if the name is longer than 16 characters
+ * @throws IllegalArgumentException if the name contains invalid characters
+ */
+ @NotNull
+ public static com.destroystokyo.paper.profile.PlayerProfile createProfileExact(@Nullable UUID uuid, @Nullable String name) {
@ -418,7 +424,7 @@ diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Ser
index b0734f8253ed540916db7bc75cd7dd24e86031c7..c2cf0e547137b8a023ea009c7a5d0080def5f5f8 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -2077,5 +2077,76 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -2077,5 +2077,80 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
* @return true if player names should be suggested
*/
boolean suggestPlayerNamesWhenNullTabCompletions();
@ -448,6 +454,8 @@ index b0734f8253ed540916db7bc75cd7dd24e86031c7..c2cf0e547137b8a023ea009c7a5d0080
+ *
+ * @param name Name to create profile for
+ * @return A PlayerProfile object
+ * @throws IllegalArgumentException if the name is longer than 16 characters
+ * @throws IllegalArgumentException if the name contains invalid characters
+ */
+ @NotNull
+ com.destroystokyo.paper.profile.PlayerProfile createProfile(@NotNull String name);
@ -471,6 +479,7 @@ index b0734f8253ed540916db7bc75cd7dd24e86031c7..c2cf0e547137b8a023ea009c7a5d0080
+ * @param name Name to create profile for
+ * @return A PlayerProfile object
+ * @throws IllegalArgumentException if the name is longer than 16 characters
+ * @throws IllegalArgumentException if the name contains invalid characters
+ */
+ @NotNull
+ com.destroystokyo.paper.profile.PlayerProfile createProfile(@Nullable UUID uuid, @Nullable String name);
@ -490,6 +499,7 @@ index b0734f8253ed540916db7bc75cd7dd24e86031c7..c2cf0e547137b8a023ea009c7a5d0080
+ * @param name Name to create profile for
+ * @return A PlayerProfile object
+ * @throws IllegalArgumentException if the name is longer than 16 characters
+ * @throws IllegalArgumentException if the name contains invalid characters
+ */
+ @NotNull
+ com.destroystokyo.paper.profile.PlayerProfile createProfileExact(@Nullable UUID uuid, @Nullable String name);