aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/api/0091-Player.setPlayerProfile-API.patch
blob: 0ce8b444b6ccc76a907f8087dbf459a8ece90667 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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.

diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 4485542bcf3014364c2920026a07da6194d6ba29..1c3b5b1950b8b2cb660e160e455384780f2d4e75 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -4,6 +4,7 @@ import java.net.InetSocketAddress;
 import java.util.UUID;
 import com.destroystokyo.paper.Title; // Paper
 import net.kyori.adventure.text.Component;
+import com.destroystokyo.paper.profile.PlayerProfile; // Paper
 import org.bukkit.DyeColor;
 import org.bukkit.Effect;
 import org.bukkit.GameMode;
@@ -2106,6 +2107,20 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
      *         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
+    PlayerProfile getPlayerProfile();
+
+    /**
+     * 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
+     */
+    void setPlayerProfile(@NotNull PlayerProfile profile);
     // Paper end
 
     // Spigot start