From 81d769db5b7c5a4f7924df66366be4c54442b625 Mon Sep 17 00:00:00 2001 From: samczsun Date: Sat, 24 Dec 2016 14:18:33 -0500 Subject: [PATCH] Fix issues regarding disguising --- .../gadget/gadgets/morph/MorphDinnerbone.java | 29 +++++++++++-------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphDinnerbone.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphDinnerbone.java index b0e54ba6a..e67e33474 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphDinnerbone.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphDinnerbone.java @@ -26,6 +26,8 @@ import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; +import com.mojang.authlib.GameProfile; + import mineplex.core.Managers; import mineplex.core.account.CoreClientManager; import mineplex.core.common.DummyEntity; @@ -76,19 +78,22 @@ public class MorphDinnerbone extends MorphGadget implements IPacketHandler { applyArmor(player, message); - UtilGameProfile.getProfileByName(NAME, true, requestedProfile -> - UtilGameProfile.getProfileByName(player.getName(), true, requestedProfileSkin -> - { - SkinData skinData = SkinData.constructFromGameProfile(requestedProfileSkin, true, true); - requestedProfile.getProperties().clear(); - requestedProfile.getProperties().put("textures", skinData.getProperty()); + GameProfile profile = UtilGameProfile.getGameProfile(player); + try + { + UtilGameProfile.changeName(profile, "Dinnerbone"); + } + catch (ReflectiveOperationException e) + { + // Literally should never happen + e.printStackTrace(); + } - DisguisePlayer disguisePlayer = new DisguisePlayer(player, requestedProfile); - disguisePlayer.setSendSkinDataToSelf(false); - disguisePlayer.setReplaceOriginalName(false, 500); - disguisePlayer.showInTabList(true, 0); - UtilMorph.disguise(player, disguisePlayer, Manager); - })); + DisguisePlayer disguisePlayer = new DisguisePlayer(player, profile); + disguisePlayer.setSendSkinDataToSelf(false); + disguisePlayer.setReplaceOriginalName(false, 10); + disguisePlayer.showInTabList(true, 0); + UtilMorph.disguise(player, disguisePlayer, Manager); } @Override