2021-06-11 14:02:28 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Aikar <aikar@aikar.co>
|
|
|
|
Date: Sun, 18 Mar 2018 12:28:55 -0400
|
|
|
|
Subject: [PATCH] Player.setPlayerProfile API
|
|
|
|
|
|
|
|
This can be useful for changing name or skins after a player has logged in.
|
|
|
|
|
2022-02-12 14:20:33 +01:00
|
|
|
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
2022-12-07 17:46:46 +01:00
|
|
|
index a6a792babe69712594c18f49542feb30ff591810..ec1af46667d8590ea218370249286f86652f3ac4 100644
|
2022-02-12 14:20:33 +01:00
|
|
|
--- a/src/main/java/org/bukkit/Bukkit.java
|
|
|
|
+++ b/src/main/java/org/bukkit/Bukkit.java
|
2022-12-07 17:46:46 +01:00
|
|
|
@@ -1199,8 +1199,10 @@ public final class Bukkit {
|
2022-04-23 16:40:37 +02:00
|
|
|
* @return the new PlayerProfile
|
|
|
|
* @throws IllegalArgumentException if both the unique id is
|
2022-02-12 14:20:33 +01:00
|
|
|
* <code>null</code> and the name is <code>null</code> or blank
|
2022-04-23 16:40:37 +02:00
|
|
|
+ * @deprecated use {@link #createProfile(UUID, String)}
|
2022-02-12 14:20:33 +01:00
|
|
|
*/
|
|
|
|
@NotNull
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
public static PlayerProfile createPlayerProfile(@Nullable UUID uniqueId, @Nullable String name) {
|
|
|
|
return server.createPlayerProfile(uniqueId, name);
|
|
|
|
}
|
2022-12-07 17:46:46 +01:00
|
|
|
@@ -1211,8 +1213,10 @@ public final class Bukkit {
|
2022-04-23 16:40:37 +02:00
|
|
|
* @param uniqueId the unique id
|
|
|
|
* @return the new PlayerProfile
|
2022-02-12 14:20:33 +01:00
|
|
|
* @throws IllegalArgumentException if the unique id is <code>null</code>
|
2022-04-23 16:40:37 +02:00
|
|
|
+ * @deprecated use {@link #createProfile(UUID)}
|
2022-02-12 14:20:33 +01:00
|
|
|
*/
|
|
|
|
@NotNull
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
public static PlayerProfile createPlayerProfile(@NotNull UUID uniqueId) {
|
|
|
|
return server.createPlayerProfile(uniqueId);
|
|
|
|
}
|
2022-12-07 17:46:46 +01:00
|
|
|
@@ -1224,8 +1228,10 @@ public final class Bukkit {
|
2022-04-23 16:40:37 +02:00
|
|
|
* @return the new PlayerProfile
|
|
|
|
* @throws IllegalArgumentException if the name is <code>null</code> or
|
2022-02-12 14:20:33 +01:00
|
|
|
* blank
|
2022-04-23 16:40:37 +02:00
|
|
|
+ * @deprecated use {@link #createProfile(String)}
|
2022-02-12 14:20:33 +01:00
|
|
|
*/
|
|
|
|
@NotNull
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
public static PlayerProfile createPlayerProfile(@NotNull String name) {
|
|
|
|
return server.createPlayerProfile(name);
|
|
|
|
}
|
2022-12-22 05:30:21 +01:00
|
|
|
diff --git a/src/main/java/org/bukkit/OfflinePlayer.java b/src/main/java/org/bukkit/OfflinePlayer.java
|
|
|
|
index c5eed3234a8c04bfa9d707685746fc2b40ec8bfc..3ba8ff1a41ac9fd96fd4dec5cbe0f714fef93022 100644
|
|
|
|
--- a/src/main/java/org/bukkit/OfflinePlayer.java
|
|
|
|
+++ b/src/main/java/org/bukkit/OfflinePlayer.java
|
|
|
|
@@ -50,7 +50,7 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio
|
|
|
|
* @return the player's profile
|
|
|
|
*/
|
|
|
|
@NotNull
|
|
|
|
- PlayerProfile getPlayerProfile();
|
|
|
|
+ com.destroystokyo.paper.profile.PlayerProfile getPlayerProfile(); // Paper
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Checks if this player is banned or not
|
2022-02-12 14:20:33 +01:00
|
|
|
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
2022-12-07 17:46:46 +01:00
|
|
|
index bf1102b4481b8c9b9c4f5ba0c561556b75fea077..8539bac19bf9ba1a66689a9af90e088a03f9c152 100644
|
2022-02-12 14:20:33 +01:00
|
|
|
--- a/src/main/java/org/bukkit/Server.java
|
|
|
|
+++ b/src/main/java/org/bukkit/Server.java
|
2022-12-07 17:46:46 +01:00
|
|
|
@@ -1017,8 +1017,10 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
2022-04-23 16:40:37 +02:00
|
|
|
* @return the new PlayerProfile
|
|
|
|
* @throws IllegalArgumentException if both the unique id is
|
2022-02-12 14:20:33 +01:00
|
|
|
* <code>null</code> and the name is <code>null</code> or blank
|
2022-04-23 16:40:37 +02:00
|
|
|
+ * @deprecated use {@link #createProfile(UUID, String)}
|
2022-02-12 14:20:33 +01:00
|
|
|
*/
|
|
|
|
@NotNull
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
PlayerProfile createPlayerProfile(@Nullable UUID uniqueId, @Nullable String name);
|
|
|
|
|
|
|
|
/**
|
2022-12-07 17:46:46 +01:00
|
|
|
@@ -1027,8 +1029,10 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
2022-04-23 16:40:37 +02:00
|
|
|
* @param uniqueId the unique id
|
|
|
|
* @return the new PlayerProfile
|
2022-02-12 14:20:33 +01:00
|
|
|
* @throws IllegalArgumentException if the unique id is <code>null</code>
|
2022-04-23 16:40:37 +02:00
|
|
|
+ * @deprecated use {@link #createProfile(UUID)}
|
2022-02-12 14:20:33 +01:00
|
|
|
*/
|
|
|
|
@NotNull
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
PlayerProfile createPlayerProfile(@NotNull UUID uniqueId);
|
|
|
|
|
|
|
|
/**
|
2022-12-07 17:46:46 +01:00
|
|
|
@@ -1038,8 +1042,10 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
2022-04-23 16:40:37 +02:00
|
|
|
* @return the new PlayerProfile
|
|
|
|
* @throws IllegalArgumentException if the name is <code>null</code> or
|
2022-02-12 14:20:33 +01:00
|
|
|
* blank
|
2022-04-23 16:40:37 +02:00
|
|
|
+ * @deprecated use {@link #createProfile(String)}
|
2022-02-12 14:20:33 +01:00
|
|
|
*/
|
|
|
|
@NotNull
|
|
|
|
+ @Deprecated
|
|
|
|
PlayerProfile createPlayerProfile(@NotNull String name);
|
|
|
|
|
|
|
|
/**
|
2021-06-11 14:02:28 +02:00
|
|
|
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
2023-03-14 18:21:11 +01:00
|
|
|
index af92443e50b66e526d382c820e1b2e27c6e1b461..95163d95b80f245712839af4c03e0df721809117 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/org/bukkit/entity/Player.java
|
|
|
|
+++ b/src/main/java/org/bukkit/entity/Player.java
|
2023-03-14 18:21:11 +01:00
|
|
|
@@ -2386,6 +2386,20 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
2021-06-11 14:02:28 +02:00
|
|
|
* was {@link org.bukkit.event.player.PlayerResourcePackStatusEvent.Status#SUCCESSFULLY_LOADED}
|
|
|
|
*/
|
|
|
|
boolean hasResourcePack();
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Gets a copy of this players profile
|
|
|
|
+ * @return The players profile object
|
|
|
|
+ */
|
|
|
|
+ @NotNull
|
2022-02-12 14:20:33 +01:00
|
|
|
+ com.destroystokyo.paper.profile.PlayerProfile getPlayerProfile();
|
2021-06-11 14:02:28 +02:00
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Changes the PlayerProfile for this player. This will cause this player
|
|
|
|
+ * to be reregistered to all clients that can currently see this player
|
|
|
|
+ * @param profile The new profile to use
|
|
|
|
+ */
|
2022-02-12 14:20:33 +01:00
|
|
|
+ void setPlayerProfile(@NotNull com.destroystokyo.paper.profile.PlayerProfile profile);
|
2021-06-11 14:02:28 +02:00
|
|
|
// Paper end
|
|
|
|
|
|
|
|
// Spigot start
|
2022-02-12 14:20:33 +01:00
|
|
|
diff --git a/src/main/java/org/bukkit/profile/PlayerProfile.java b/src/main/java/org/bukkit/profile/PlayerProfile.java
|
2022-07-22 20:18:00 +02:00
|
|
|
index fc46add38bf59dc1a04ea566fd230dcd8ae2708c..d36b3e3c7e53840132011add365ca2a26d799064 100644
|
2022-02-12 14:20:33 +01:00
|
|
|
--- a/src/main/java/org/bukkit/profile/PlayerProfile.java
|
|
|
|
+++ b/src/main/java/org/bukkit/profile/PlayerProfile.java
|
|
|
|
@@ -16,7 +16,9 @@ import org.jetbrains.annotations.Nullable;
|
|
|
|
* <p>
|
|
|
|
* New profiles can be created via
|
|
|
|
* {@link Server#createPlayerProfile(UUID, String)}.
|
|
|
|
+ * @deprecated see {@link com.destroystokyo.paper.profile.PlayerProfile}
|
|
|
|
*/
|
|
|
|
+@Deprecated // Paper
|
|
|
|
public interface PlayerProfile extends Cloneable, ConfigurationSerializable {
|
|
|
|
|
|
|
|
/**
|
|
|
|
@@ -25,6 +27,7 @@ public interface PlayerProfile extends Cloneable, ConfigurationSerializable {
|
|
|
|
* @return the player's unique id, or <code>null</code> if not available
|
|
|
|
*/
|
|
|
|
@Nullable
|
|
|
|
+ @Deprecated // Paper
|
|
|
|
UUID getUniqueId();
|
|
|
|
|
|
|
|
/**
|