Skip to content

Commit

Permalink
add script event lookup map
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Mar 9, 2019
1 parent 973cefd commit 4f421c5
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/main/java/net/aufdemrand/denizencore/events/ScriptEvent.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,15 @@ public static void registerCoreEvents() {
public static void registerScriptEvent(ScriptEvent event) {
event.reset();
events.add(event);
eventLookup.put(CoreUtilities.toLowerCase(event.getName()), event);
}

public static ArrayList<ScriptContainer> worldContainers = new ArrayList<>();

public static ArrayList<ScriptEvent> events = new ArrayList<>();

public static HashMap<String, ScriptEvent> eventLookup = new HashMap<>();

public static class StatData {
public long fires = 0;
public long scriptFires = 0;
Expand Down Expand Up @@ -107,10 +114,6 @@ public ScriptPath(ScriptContainer container, String event) {
}
}

public static ArrayList<ScriptContainer> worldContainers = new ArrayList<>();

public static ArrayList<ScriptEvent> events = new ArrayList<>();

public static void reload() {
dB.log("Reloading script events...");
for (ScriptContainer container : worldContainers) {
Expand Down

0 comments on commit 4f421c5

Please sign in to comment.