mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-03 22:15:28 +00:00
Fixed NPE
This commit is contained in:
1 parent
aadce168d4
commit
9f7b476068
2 files changed
+2
-2
No files matched your search
@@ -39,6 +39,8 @@ public class CheckerNPCS {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void clean(Player p) {
|
public void clean(Player p) {
|
||||||
|
if (!p.isOnline())
|
||||||
|
return;
|
||||||
for (NPC npc : NPCS)
|
for (NPC npc : NPCS)
|
||||||
npc.destroy(p);
|
npc.destroy(p);
|
||||||
NPCS.clear();
|
NPCS.clear();
|
||||||
|
|||||||
@@ -51,8 +51,6 @@ public class NPC {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void destroy(Player p) {
|
public void destroy(Player p) {
|
||||||
if (!p.isOnline())
|
|
||||||
return;
|
|
||||||
((CraftPlayer)p).getHandle().playerConnection.sendPacket(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.REMOVE_PLAYER, new EntityPlayer[] { this.npc }));
|
((CraftPlayer)p).getHandle().playerConnection.sendPacket(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.REMOVE_PLAYER, new EntityPlayer[] { this.npc }));
|
||||||
((CraftPlayer)p).getHandle().playerConnection.sendPacket(new PacketPlayOutEntityDestroy(new int[] { this.npc.getId() }));
|
((CraftPlayer)p).getHandle().playerConnection.sendPacket(new PacketPlayOutEntityDestroy(new int[] { this.npc.getId() }));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user