for (Area a : areasCopy) { // run area onenter events
if (a.event == null) {
continue;
}
Event e = server.eventhost.findEvent(a.event);
if (e != null) {
ArrayList<String> args = new ArrayList<String>();
args.add("enter");
args.add(a.name);
server.eventhost.execute(e, this, true, args);
} else {
System.out.println("Error in area " + a.name + "/event: Event " + a.event + " not found!");
}
}
for (Area a : oldAreas) { // run area onleave events
if (a.event == null) {
continue;
}
Event e = server.eventhost.findEvent(a.event);
if (e != null) {
ArrayList<String> args = new ArrayList<String>();
args.add("leave");
args.add(a.name);
server.eventhost.execute(e, this, true, args);