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.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