Fix issues regarding disguising
This commit is contained in:
parent
eacbdfdb02
commit
81d769db5b
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user