fix: player skin when only changing name

This commit is contained in:
aro 2022-12-14 15:58:02 +01:00
parent 262622332a
commit 95453f24d1
4 changed files with 5 additions and 4 deletions

View file

@ -93,7 +93,7 @@ public class v1_17_R1 implements Internals {
final PacketPlayOutPlayerInfo add = new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.a);
final GameProfile gameProfile = new GameProfile(player.getUniqueId(), profile.getName());
if (skinChange) {
if (skinChange || !profile.getSkin().equalsIgnoreCase(player.getName())) {
try {
final Optional<String> uuid = NickoBukkit.getInstance().getMojangAPI().getUUID(profile.getSkin());
if (uuid.isPresent()) {

View file

@ -95,7 +95,7 @@ public class v1_18_R1 implements Internals {
final PacketPlayOutPlayerInfo add = new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.a);
final GameProfile gameProfile = new GameProfile(player.getUniqueId(), profile.getName());
if (skinChange) {
if (skinChange || !profile.getSkin().equalsIgnoreCase(player.getName())) {
try {
final Optional<String> uuid = NickoBukkit.getInstance().getMojangAPI().getUUID(profile.getSkin());
if (uuid.isPresent()) {

View file

@ -95,7 +95,7 @@ public class v1_18_R2 implements Internals {
final PacketPlayOutPlayerInfo add = new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.a);
final GameProfile gameProfile = new GameProfile(player.getUniqueId(), profile.getName());
if (skinChange) {
if (skinChange || !profile.getSkin().equalsIgnoreCase(player.getName())) {
try {
final Optional<String> uuid = NickoBukkit.getInstance().getMojangAPI().getUUID(profile.getSkin());
if (uuid.isPresent()) {

View file

@ -99,7 +99,7 @@ public class v1_19_R1 implements Internals {
final ProfilePublicKey.a key = remove.b().get(0).e();
final GameProfile gameProfile = new GameProfile(player.getUniqueId(), profile.getName());
if (skinChange) {
if (skinChange || !profile.getSkin().equalsIgnoreCase(player.getName())) {
try {
final Optional<String> uuid = NickoBukkit.getInstance().getMojangAPI().getUUID(profile.getSkin());
if (uuid.isPresent()) {
@ -121,6 +121,7 @@ public class v1_19_R1 implements Internals {
}
}
add.b().clear();
add.b().add(new PacketPlayOutPlayerInfo.PlayerInfoData(gameProfile,
player.getPing(),