Skip to content

Commit bdce375

Browse files
committed
fix(premium): Use non-deprecated createProfile
1 parent e4b68dd commit bdce375

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

authme-paper-common/src/main/java/fr/xephi/authme/platform/AbstractPaperPlatformAdapter.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
package fr.xephi.authme.platform;
22

3+
import com.destroystokyo.paper.profile.PlayerProfile;
34
import fr.xephi.authme.AuthMe;
45
import fr.xephi.authme.command.CommandDescription;
56
import fr.xephi.authme.command.CommandHandler;
67
import fr.xephi.authme.process.register.RegisterSecondaryArgument;
78
import fr.xephi.authme.process.register.RegistrationType;
89
import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer;
10+
import org.bukkit.Bukkit;
911
import org.bukkit.Location;
1012
import org.bukkit.entity.Player;
1113
import org.bukkit.event.Listener;
@@ -80,7 +82,9 @@ public List<Class<? extends Listener>> getListeners() {
8082
public void normalizePreLoginUuid(AsyncPlayerPreLoginEvent event, UUID offlineUuid) {
8183
com.destroystokyo.paper.profile.PlayerProfile profile = event.getPlayerProfile();
8284
if (profile != null) {
83-
profile.setId(offlineUuid);
85+
PlayerProfile newProfile = Bukkit.createProfile(offlineUuid, profile.getName());
86+
newProfile.setProperties(profile.getProperties());
87+
event.setPlayerProfile(newProfile);
8488
}
8589
}
8690

0 commit comments

Comments
 (0)