Fix issues regarding disguising

This commit is contained in:
samczsun 2016-12-24 14:18:33 -05:00
parent eacbdfdb02
commit 81d769db5b

View File

@ -26,6 +26,8 @@ import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer;
import org.bukkit.entity.EntityType; import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import com.mojang.authlib.GameProfile;
import mineplex.core.Managers; import mineplex.core.Managers;
import mineplex.core.account.CoreClientManager; import mineplex.core.account.CoreClientManager;
import mineplex.core.common.DummyEntity; import mineplex.core.common.DummyEntity;
@ -76,19 +78,22 @@ public class MorphDinnerbone extends MorphGadget implements IPacketHandler
{ {
applyArmor(player, message); applyArmor(player, message);
UtilGameProfile.getProfileByName(NAME, true, requestedProfile -> GameProfile profile = UtilGameProfile.getGameProfile(player);
UtilGameProfile.getProfileByName(player.getName(), true, requestedProfileSkin -> try
{ {
SkinData skinData = SkinData.constructFromGameProfile(requestedProfileSkin, true, true); UtilGameProfile.changeName(profile, "Dinnerbone");
requestedProfile.getProperties().clear(); }
requestedProfile.getProperties().put("textures", skinData.getProperty()); catch (ReflectiveOperationException e)
{
// Literally should never happen
e.printStackTrace();
}
DisguisePlayer disguisePlayer = new DisguisePlayer(player, requestedProfile); DisguisePlayer disguisePlayer = new DisguisePlayer(player, profile);
disguisePlayer.setSendSkinDataToSelf(false); disguisePlayer.setSendSkinDataToSelf(false);
disguisePlayer.setReplaceOriginalName(false, 500); disguisePlayer.setReplaceOriginalName(false, 10);
disguisePlayer.showInTabList(true, 0); disguisePlayer.showInTabList(true, 0);
UtilMorph.disguise(player, disguisePlayer, Manager); UtilMorph.disguise(player, disguisePlayer, Manager);
}));
} }
@Override @Override