Use setting more consistently

This commit is contained in:
fullwall 2012-10-26 16:07:06 +08:00
parent bb36e8ea27
commit 0ba4270a40
2 changed files with 4 additions and 3 deletions

View File

@ -39,7 +39,7 @@ public class CitizensHumanNPC extends CitizensNPC implements Equipable {
// minecraft will not update it. // minecraft will not update it.
boolean removeFromPlayerList = Setting.REMOVE_PLAYERS_FROM_PLAYER_LIST.asBoolean(); boolean removeFromPlayerList = Setting.REMOVE_PLAYERS_FROM_PLAYER_LIST.asBoolean();
NMS.addOrRemoveFromPlayerList(getBukkitEntity(), NMS.addOrRemoveFromPlayerList(getBukkitEntity(),
removeFromPlayerList || data().get("removefromplayerlist", removeFromPlayerList)); data().get("removefromplayerlist", removeFromPlayerList));
} }
}, 5); }, 5);
handle.getBukkitEntity().setSleepingIgnored(true); handle.getBukkitEntity().setSleepingIgnored(true);

View File

@ -51,10 +51,11 @@ public class NMS {
EntityLiving handle = ((CraftLivingEntity) bukkitEntity).getHandle(); EntityLiving handle = ((CraftLivingEntity) bukkitEntity).getHandle();
if (handle.world == null) if (handle.world == null)
return; return;
if (remove) if (remove) {
handle.world.players.remove(handle); handle.world.players.remove(handle);
else } else {
handle.world.players.add(handle); handle.world.players.add(handle);
}
} }
public static void attack(EntityLiving handle, EntityLiving target) { public static void attack(EntityLiving handle, EntityLiving target) {