mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-24 03:25:13 +01:00
.
This commit is contained in:
parent
66f3ce1a0e
commit
dc8ff67001
@ -671,8 +671,9 @@ public class NPCCommands {
|
||||
else if (args.hasFlag('r'))
|
||||
remove = true;
|
||||
npc.data().setPersistent("removefromplayerlist", remove);
|
||||
NMS.addOrRemoveFromPlayerList(npc.getBukkitEntity(), remove);
|
||||
Messaging.sendTr(sender, remove ? Messages.ADDED_TO_PLAYERLIST : Messages.REMOVED_FROM_PLAYERLIST,
|
||||
if (npc.isSpawned())
|
||||
NMS.addOrRemoveFromPlayerList(npc.getBukkitEntity(), remove);
|
||||
Messaging.sendTr(sender, remove ? Messages.REMOVED_FROM_PLAYERLIST : Messages.ADDED_TO_PLAYERLIST,
|
||||
npc.getName());
|
||||
}
|
||||
|
||||
|
@ -12,7 +12,6 @@ import net.minecraft.server.DamageSource;
|
||||
import net.minecraft.server.Entity;
|
||||
import net.minecraft.server.EntityLiving;
|
||||
import net.minecraft.server.EntityMonster;
|
||||
import net.minecraft.server.EntityPlayer;
|
||||
import net.minecraft.server.EntityTypes;
|
||||
import net.minecraft.server.MobEffectList;
|
||||
import net.minecraft.server.Navigation;
|
||||
@ -50,7 +49,7 @@ public class NMS {
|
||||
|
||||
public static void addOrRemoveFromPlayerList(LivingEntity bukkitEntity, boolean remove) {
|
||||
EntityLiving handle = ((CraftLivingEntity) bukkitEntity).getHandle();
|
||||
if (handle.world == null || !(handle instanceof EntityPlayer))
|
||||
if (handle.world == null)
|
||||
return;
|
||||
if (remove)
|
||||
handle.world.players.remove(handle);
|
||||
|
Loading…
Reference in New Issue
Block a user