Skip to content

Commit

Permalink
Threading, NPE fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Robert Xu <robxu9@gmail.com>
  • Loading branch information
robxu9 committed May 2, 2012
1 parent 5c1170c commit 06f6921
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
Expand Up @@ -176,13 +176,15 @@ public void rmEventListener(QEvent e){
}

public void checkAllEvents(){
for (final QEvent e : activeevents){
new Thread(new Runnable(){
@Override
public void run() {
e.check();
}
}).start();
synchronized(classlistlock){
for (final QEvent e : activeevents){
new Thread(new Runnable(){
@Override
public void run() {
e.check();
}
}).start();
}
}
}

Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/theminequest/MineQuest/Group/Team.java
Expand Up @@ -126,6 +126,8 @@ public synchronized void startQuest(String q) throws GroupException {
abandonQuest();
throw new GroupException(GroupReason.BADCAPACITY);
}
if (!quest.details.loadworld)
quest.startQuest();
QuestStartedEvent event = new QuestStartedEvent(quest);
Bukkit.getPluginManager().callEvent(event);
}
Expand Down
Expand Up @@ -150,8 +150,6 @@ public long startQuest(String id){
throw new RuntimeException(e);
}
quests.put(questid,new Quest(questid,d));
if (!quests.get(questid).details.loadworld)
quests.get(questid).startQuest();
long thisquestid = questid;
questid++;
return thisquestid;
Expand Down

0 comments on commit 06f6921

Please sign in to comment.