Skip to content

Commit

Permalink
Add calls to addOrRemoveFromPlayerList
Browse files Browse the repository at this point in the history
  • Loading branch information
fullwall committed Sep 11, 2015
1 parent 172249c commit 72ba146
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/main/java/net/citizensnpcs/commands/NPCCommands.java
Original file line number Diff line number Diff line change
Expand Up @@ -995,6 +995,7 @@ public void playerlist(CommandContext args, CommandSender sender, NPC npc) {
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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ private void updatePackets(boolean navigating) {
for (int i = 0; i < 5; i++) {
packets[i] = new PacketPlayOutEntityEquipment(getId(), i, getEquipment(i));
}

NMS.addOrRemoveFromPlayerList(getBukkitEntity(), removeFromPlayerList);
NMS.sendPacketsNearby(getBukkitEntity(), current, packets);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,12 @@ protected Entity createEntity(final Location at, final NPC npc) {
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);
Expand Down

0 comments on commit 72ba146

Please sign in to comment.