From 68a4f125e948456a7bf9c24fdf1f439e906b93d7 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Wed, 3 Jan 2018 15:32:29 +1300 Subject: [PATCH] Change getDisplayName() to getPlayerListName() --- .../disguise/disguisetypes/Disguise.java | 2 +- .../disguisetypes/TargetedDisguise.java | 29 +++++++++---------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/src/me/libraryaddict/disguise/disguisetypes/Disguise.java b/src/me/libraryaddict/disguise/disguisetypes/Disguise.java index 91b47f3b..a6006158 100644 --- a/src/me/libraryaddict/disguise/disguisetypes/Disguise.java +++ b/src/me/libraryaddict/disguise/disguisetypes/Disguise.java @@ -530,7 +530,7 @@ public abstract class Disguise { deleteTab.getPlayerInfoDataLists().write(0, Arrays.asList( new PlayerInfoData(ReflectionManager.getGameProfile((Player) getEntity()), 0, NativeGameMode.SURVIVAL, - WrappedChatComponent.fromText(((Player) getEntity()).getDisplayName())))); + WrappedChatComponent.fromText(((Player) getEntity()).getPlayerListName())))); try { for (Player player : Bukkit.getOnlinePlayers()) { diff --git a/src/me/libraryaddict/disguise/disguisetypes/TargetedDisguise.java b/src/me/libraryaddict/disguise/disguisetypes/TargetedDisguise.java index 7e6166ba..b52be5f1 100644 --- a/src/me/libraryaddict/disguise/disguisetypes/TargetedDisguise.java +++ b/src/me/libraryaddict/disguise/disguisetypes/TargetedDisguise.java @@ -1,14 +1,5 @@ package me.libraryaddict.disguise.disguisetypes; -import java.lang.reflect.InvocationTargetException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; - -import org.bukkit.Bukkit; -import org.bukkit.entity.Player; - import com.comphenix.protocol.PacketType; import com.comphenix.protocol.ProtocolLibrary; import com.comphenix.protocol.events.PacketContainer; @@ -16,10 +7,17 @@ import com.comphenix.protocol.wrappers.EnumWrappers.NativeGameMode; import com.comphenix.protocol.wrappers.EnumWrappers.PlayerInfoAction; import com.comphenix.protocol.wrappers.PlayerInfoData; import com.comphenix.protocol.wrappers.WrappedChatComponent; - import me.libraryaddict.disguise.DisguiseAPI; import me.libraryaddict.disguise.utilities.DisguiseUtilities; import me.libraryaddict.disguise.utilities.ReflectionManager; +import org.bukkit.Bukkit; +import org.bukkit.entity.Player; + +import java.lang.reflect.InvocationTargetException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; public abstract class TargetedDisguise extends Disguise { @@ -28,7 +26,8 @@ public abstract class TargetedDisguise extends Disguise { } public enum TargetType { - HIDE_DISGUISE_TO_EVERYONE_BUT_THESE_PLAYERS, SHOW_TO_EVERYONE_BUT_THESE_PLAYERS + HIDE_DISGUISE_TO_EVERYONE_BUT_THESE_PLAYERS, + SHOW_TO_EVERYONE_BUT_THESE_PLAYERS } private ArrayList disguiseViewers = new ArrayList<>(); @@ -59,8 +58,8 @@ public abstract class TargetedDisguise extends Disguise { canSee(player) ? PlayerInfoAction.REMOVE_PLAYER : PlayerInfoAction.ADD_PLAYER); deleteTab.getPlayerInfoDataLists().write(0, Arrays.asList( new PlayerInfoData(ReflectionManager.getGameProfile((Player) getEntity()), 0, - NativeGameMode.SURVIVAL, - WrappedChatComponent.fromText(((Player) getEntity()).getDisplayName())))); + NativeGameMode.SURVIVAL, WrappedChatComponent + .fromText(((Player) getEntity()).getPlayerListName())))); ProtocolLibrary.getProtocolManager().sendServerPacket(player, deleteTab); } @@ -122,8 +121,8 @@ public abstract class TargetedDisguise extends Disguise { canSee(player) ? PlayerInfoAction.ADD_PLAYER : PlayerInfoAction.REMOVE_PLAYER); deleteTab.getPlayerInfoDataLists().write(0, Arrays.asList( new PlayerInfoData(ReflectionManager.getGameProfile((Player) getEntity()), 0, - NativeGameMode.SURVIVAL, - WrappedChatComponent.fromText(((Player) getEntity()).getDisplayName())))); + NativeGameMode.SURVIVAL, WrappedChatComponent + .fromText(((Player) getEntity()).getPlayerListName())))); ProtocolLibrary.getProtocolManager().sendServerPacket(player, deleteTab); }