mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-22 10:36:10 +01:00
Update tablist display logic
This commit is contained in:
parent
b12732d805
commit
e8eadbfa36
@ -22,6 +22,7 @@ import net.citizensnpcs.api.CitizensAPI;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.api.npc.NPC.NPCUpdate;
|
||||
import net.citizensnpcs.api.trait.trait.Inventory;
|
||||
import net.citizensnpcs.api.util.Messaging;
|
||||
import net.citizensnpcs.api.util.SpigotUtil;
|
||||
import net.citizensnpcs.nms.v1_11_R1.network.EmptyNetHandler;
|
||||
import net.citizensnpcs.nms.v1_11_R1.network.EmptyNetworkManager;
|
||||
@ -225,7 +226,8 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
||||
public IChatBaseComponent getPlayerListName() {
|
||||
if (npc != null && npc.shouldRemoveFromTabList())
|
||||
return new ChatComponentText("");
|
||||
return super.getPlayerListName();
|
||||
return npc != null ? (IChatBaseComponent) Messaging.minecraftComponentFromRawMessage(npc.getRawName())
|
||||
: super.getPlayerListName();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -23,6 +23,7 @@ import net.citizensnpcs.api.CitizensAPI;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.api.npc.NPC.NPCUpdate;
|
||||
import net.citizensnpcs.api.trait.trait.Inventory;
|
||||
import net.citizensnpcs.api.util.Messaging;
|
||||
import net.citizensnpcs.api.util.SpigotUtil;
|
||||
import net.citizensnpcs.nms.v1_12_R1.network.EmptyNetHandler;
|
||||
import net.citizensnpcs.nms.v1_12_R1.network.EmptyNetworkManager;
|
||||
@ -228,7 +229,8 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
||||
public IChatBaseComponent getPlayerListName() {
|
||||
if (npc != null && npc.shouldRemoveFromTabList())
|
||||
return new ChatComponentText("");
|
||||
return super.getPlayerListName();
|
||||
return npc != null ? (IChatBaseComponent) Messaging.minecraftComponentFromRawMessage(npc.getRawName())
|
||||
: super.getPlayerListName();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -23,6 +23,7 @@ import net.citizensnpcs.api.CitizensAPI;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.api.npc.NPC.NPCUpdate;
|
||||
import net.citizensnpcs.api.trait.trait.Inventory;
|
||||
import net.citizensnpcs.api.util.Messaging;
|
||||
import net.citizensnpcs.api.util.SpigotUtil;
|
||||
import net.citizensnpcs.nms.v1_13_R2.network.EmptyNetHandler;
|
||||
import net.citizensnpcs.nms.v1_13_R2.network.EmptyNetworkManager;
|
||||
@ -219,7 +220,8 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
||||
public IChatBaseComponent getPlayerListName() {
|
||||
if (npc != null && npc.shouldRemoveFromTabList())
|
||||
return new ChatComponentText("");
|
||||
return super.getPlayerListName();
|
||||
return npc != null ? (IChatBaseComponent) Messaging.minecraftComponentFromRawMessage(npc.getRawName())
|
||||
: super.getPlayerListName();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -22,6 +22,7 @@ import net.citizensnpcs.api.CitizensAPI;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.api.npc.NPC.NPCUpdate;
|
||||
import net.citizensnpcs.api.trait.trait.Inventory;
|
||||
import net.citizensnpcs.api.util.Messaging;
|
||||
import net.citizensnpcs.api.util.SpigotUtil;
|
||||
import net.citizensnpcs.nms.v1_14_R1.network.EmptyNetHandler;
|
||||
import net.citizensnpcs.nms.v1_14_R1.network.EmptyNetworkManager;
|
||||
@ -210,7 +211,8 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
||||
public IChatBaseComponent getPlayerListName() {
|
||||
if (npc != null && npc.shouldRemoveFromTabList())
|
||||
return new ChatComponentText("");
|
||||
return super.getPlayerListName();
|
||||
return npc != null ? (IChatBaseComponent) Messaging.minecraftComponentFromRawMessage(npc.getRawName())
|
||||
: super.getPlayerListName();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -21,6 +21,7 @@ import net.citizensnpcs.api.CitizensAPI;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.api.npc.NPC.NPCUpdate;
|
||||
import net.citizensnpcs.api.trait.trait.Inventory;
|
||||
import net.citizensnpcs.api.util.Messaging;
|
||||
import net.citizensnpcs.api.util.SpigotUtil;
|
||||
import net.citizensnpcs.nms.v1_15_R1.network.EmptyNetHandler;
|
||||
import net.citizensnpcs.nms.v1_15_R1.network.EmptyNetworkManager;
|
||||
@ -202,7 +203,8 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
||||
public IChatBaseComponent getPlayerListName() {
|
||||
if (npc != null && npc.shouldRemoveFromTabList())
|
||||
return new ChatComponentText("");
|
||||
return super.getPlayerListName();
|
||||
return npc != null ? (IChatBaseComponent) Messaging.minecraftComponentFromRawMessage(npc.getRawName())
|
||||
: super.getPlayerListName();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -22,6 +22,7 @@ import net.citizensnpcs.api.CitizensAPI;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.api.npc.NPC.NPCUpdate;
|
||||
import net.citizensnpcs.api.trait.trait.Inventory;
|
||||
import net.citizensnpcs.api.util.Messaging;
|
||||
import net.citizensnpcs.api.util.SpigotUtil;
|
||||
import net.citizensnpcs.nms.v1_16_R3.network.EmptyNetHandler;
|
||||
import net.citizensnpcs.nms.v1_16_R3.network.EmptyNetworkManager;
|
||||
@ -182,7 +183,8 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
||||
public IChatBaseComponent getPlayerListName() {
|
||||
if (npc != null && npc.shouldRemoveFromTabList())
|
||||
return new ChatComponentText("");
|
||||
return super.getPlayerListName();
|
||||
return npc != null ? (IChatBaseComponent) Messaging.minecraftComponentFromRawMessage(npc.getRawName())
|
||||
: super.getPlayerListName();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -19,6 +19,7 @@ import net.citizensnpcs.api.CitizensAPI;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.api.npc.NPC.NPCUpdate;
|
||||
import net.citizensnpcs.api.trait.trait.Inventory;
|
||||
import net.citizensnpcs.api.util.Messaging;
|
||||
import net.citizensnpcs.api.util.SpigotUtil;
|
||||
import net.citizensnpcs.nms.v1_17_R1.network.EmptyNetHandler;
|
||||
import net.citizensnpcs.nms.v1_17_R1.network.EmptyNetworkManager;
|
||||
@ -223,7 +224,8 @@ public class EntityHumanNPC extends ServerPlayer implements NPCHolder, Skinnable
|
||||
public Component getTabListDisplayName() {
|
||||
if (npc != null && npc.shouldRemoveFromTabList())
|
||||
return new TextComponent("");
|
||||
return super.getTabListDisplayName();
|
||||
return npc != null ? (Component) Messaging.minecraftComponentFromRawMessage(npc.getRawName())
|
||||
: super.getTabListDisplayName();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -20,6 +20,7 @@ import net.citizensnpcs.api.CitizensAPI;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.api.npc.NPC.NPCUpdate;
|
||||
import net.citizensnpcs.api.trait.trait.Inventory;
|
||||
import net.citizensnpcs.api.util.Messaging;
|
||||
import net.citizensnpcs.api.util.SpigotUtil;
|
||||
import net.citizensnpcs.nms.v1_18_R2.network.EmptyNetHandler;
|
||||
import net.citizensnpcs.nms.v1_18_R2.network.EmptyNetworkManager;
|
||||
@ -224,7 +225,8 @@ public class EntityHumanNPC extends ServerPlayer implements NPCHolder, Skinnable
|
||||
public Component getTabListDisplayName() {
|
||||
if (npc != null && npc.shouldRemoveFromTabList())
|
||||
return new TextComponent("");
|
||||
return super.getTabListDisplayName();
|
||||
return npc != null ? (Component) Messaging.minecraftComponentFromRawMessage(npc.getRawName())
|
||||
: super.getTabListDisplayName();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -19,6 +19,7 @@ import net.citizensnpcs.api.CitizensAPI;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.api.npc.NPC.NPCUpdate;
|
||||
import net.citizensnpcs.api.trait.trait.Inventory;
|
||||
import net.citizensnpcs.api.util.Messaging;
|
||||
import net.citizensnpcs.api.util.SpigotUtil;
|
||||
import net.citizensnpcs.nms.v1_19_R3.network.EmptyNetHandler;
|
||||
import net.citizensnpcs.nms.v1_19_R3.network.EmptyNetworkManager;
|
||||
@ -218,7 +219,8 @@ public class EntityHumanNPC extends ServerPlayer implements NPCHolder, Skinnable
|
||||
public Component getTabListDisplayName() {
|
||||
if (npc != null && npc.shouldRemoveFromTabList())
|
||||
return MutableComponent.create(new LiteralContents(""));
|
||||
return super.getTabListDisplayName();
|
||||
return npc != null ? (Component) Messaging.minecraftComponentFromRawMessage(npc.getRawName())
|
||||
: super.getTabListDisplayName();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -17,6 +17,7 @@ import net.citizensnpcs.api.CitizensAPI;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.api.npc.NPC.NPCUpdate;
|
||||
import net.citizensnpcs.api.trait.trait.Inventory;
|
||||
import net.citizensnpcs.api.util.Messaging;
|
||||
import net.citizensnpcs.api.util.SpigotUtil;
|
||||
import net.citizensnpcs.nms.v1_20_R4.network.EmptyConnection;
|
||||
import net.citizensnpcs.nms.v1_20_R4.network.EmptyPacketListener;
|
||||
@ -220,7 +221,8 @@ public class EntityHumanNPC extends ServerPlayer implements NPCHolder, Skinnable
|
||||
public Component getTabListDisplayName() {
|
||||
if (npc != null && npc.shouldRemoveFromTabList())
|
||||
return MutableComponent.create(new LiteralContents(""));
|
||||
return super.getTabListDisplayName();
|
||||
return npc != null ? (Component) Messaging.minecraftComponentFromRawMessage(npc.getRawName())
|
||||
: super.getTabListDisplayName();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user