Add calls to addOrRemoveFromPlayerList

This commit is contained in:
fullwall 2015-09-11 20:18:31 +08:00
parent 44e1ea4af6
commit a61479f669
3 changed files with 5 additions and 5 deletions

View File

@ -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());

View File

@ -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);
}
}

View File

@ -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);