mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2025-02-17 04:41:31 +01:00
Add calls to addOrRemoveFromPlayerList
This commit is contained in:
parent
44e1ea4af6
commit
a61479f669
@ -995,6 +995,7 @@ public class NPCCommands {
|
||||
if (npc.isSpawned()) {
|
||||
npc.despawn(DespawnReason.PENDING_RESPAWN);
|
||||
npc.spawn(npc.getTrait(CurrentLocation.class).getLocation());
|
||||
NMS.addOrRemoveFromPlayerList(npc.getEntity(), remove);
|
||||
}
|
||||
Messaging.sendTr(sender, remove ? Messages.REMOVED_FROM_PLAYERLIST : Messages.ADDED_TO_PLAYERLIST,
|
||||
npc.getName());
|
||||
|
@ -352,7 +352,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
||||
for (int i = 0; i < 5; i++) {
|
||||
packets[i] = new PacketPlayOutEntityEquipment(getId(), i, getEquipment(i));
|
||||
}
|
||||
|
||||
NMS.addOrRemoveFromPlayerList(getBukkitEntity(), removeFromPlayerList);
|
||||
NMS.sendPacketsNearby(getBukkitEntity(), current, packets);
|
||||
}
|
||||
}
|
||||
|
@ -89,13 +89,12 @@ public class HumanController extends AbstractEntityController {
|
||||
handle.setPositionRotation(at.getX(), at.getY(), at.getZ(), at.getYaw(), at.getPitch());
|
||||
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(CitizensAPI.getPlugin(), new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
if (getBukkitEntity() == null || !getBukkitEntity().isValid())
|
||||
return;
|
||||
|
||||
return;
|
||||
boolean removeFromPlayerList = npc.data().get("removefromplayerlist", Setting.REMOVE_PLAYERS_FROM_PLAYER_LIST.asBoolean());
|
||||
NMS.addOrRemoveFromPlayerList(getBukkitEntity(), npc.data().get("removefromplayerlist", removeFromPlayerList));
|
||||
if (prefixCapture != null) {
|
||||
Scoreboard scoreboard = Bukkit.getScoreboardManager().getMainScoreboard();
|
||||
String teamName = UUID.randomUUID().toString().substring(0, 16);
|
||||
|
Loading…
Reference in New Issue
Block a user