use of server.life.MapleNPC in project HeavenMS by ronancpl.
the class MapleMap method toggleHiddenNPC.
public void toggleHiddenNPC(int id) {
chrRLock.lock();
objectRLock.lock();
try {
for (MapleMapObject obj : mapobjects.values()) {
if (obj.getType() == MapleMapObjectType.NPC) {
MapleNPC npc = (MapleNPC) obj;
if (npc.getId() == id) {
npc.setHide(!npc.isHidden());
if (// Should only be hidden upon changing maps
!npc.isHidden()) {
broadcastMessage(MaplePacketCreator.spawnNPC(npc));
}
}
}
}
} finally {
objectRLock.unlock();
chrRLock.unlock();
}
}
Aggregations