mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-09-09 22:38:04 +02:00
Make some minor adjustments
This commit is contained in:
parent
b20a0d4b4b
commit
b0f7fb4348
@ -283,24 +283,27 @@ public class EventListen implements Listener {
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Player player = event.getPlayer();
|
||||
final Player player = event.getPlayer();
|
||||
if (player == null || !player.isValid())
|
||||
return;
|
||||
for (Entity entity : player.getNearbyEntities(72, 72, 72)) {
|
||||
if (entity instanceof Player && npcRegistry.isNPC(entity)) {
|
||||
final EntityPlayer entityplayer = ((CraftPlayer) player).getHandle();
|
||||
final EntityPlayer entitynpc = ((CraftPlayer) entity).getHandle();
|
||||
entityplayer.playerConnection.sendPacket(new PacketPlayOutPlayerInfo(
|
||||
NMS.sendPacket(player, new PacketPlayOutPlayerInfo(
|
||||
PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER, entitynpc));
|
||||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
entityplayer.playerConnection.sendPacket(new PacketPlayOutPlayerInfo(
|
||||
if (!player.isValid())
|
||||
return;
|
||||
NMS.sendPacket(player, new PacketPlayOutPlayerInfo(
|
||||
PacketPlayOutPlayerInfo.EnumPlayerInfoAction.REMOVE_PLAYER, entitynpc));
|
||||
}
|
||||
}.runTaskLater(CitizensAPI.getPlugin(), 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}.runTaskLater(CitizensAPI.getPlugin(), 30);
|
||||
}.runTaskLater(CitizensAPI.getPlugin(), 40);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
|
Loading…
Reference in New Issue
Block a user