diff options
author | Chris Ward <chris@chrisgward.com> | 2013-01-10 04:57:10 +1100 |
---|---|---|
committer | Chris Ward <chris@chrisgward.com> | 2013-01-10 04:57:10 +1100 |
commit | 79004c7098f96247f798d9f04d26cb0d9594d65d (patch) | |
tree | 427858cc3e03dc749d2c04dc745c695691a72815 /EssentialsGroupManager/src/org/anjocaido/groupmanager/events/GMSystemEvent.java | |
parent | 2988db08cabac2848c85dec26aa53dcb033b41fb (diff) | |
parent | f25693026905df423b8e92f9cb252a292c50fcab (diff) | |
download | Essentials-79004c7098f96247f798d9f04d26cb0d9594d65d.tar Essentials-79004c7098f96247f798d9f04d26cb0d9594d65d.tar.gz Essentials-79004c7098f96247f798d9f04d26cb0d9594d65d.tar.lz Essentials-79004c7098f96247f798d9f04d26cb0d9594d65d.tar.xz Essentials-79004c7098f96247f798d9f04d26cb0d9594d65d.zip |
Merge branch 'groupmanager' into 2.9
Diffstat (limited to 'EssentialsGroupManager/src/org/anjocaido/groupmanager/events/GMSystemEvent.java')
-rw-r--r-- | EssentialsGroupManager/src/org/anjocaido/groupmanager/events/GMSystemEvent.java | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/events/GMSystemEvent.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/events/GMSystemEvent.java index d11581356..b89db6147 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/events/GMSystemEvent.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/events/GMSystemEvent.java @@ -1,7 +1,7 @@ package org.anjocaido.groupmanager.events;
import org.anjocaido.groupmanager.GroupManager;
-import org.bukkit.Bukkit;
+import org.bukkit.Server;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
@@ -30,11 +30,12 @@ public class GMSystemEvent extends Event { //////////////////////////////
protected Action action;
+ protected Server server;
public GMSystemEvent(Action action) {
super();
-
+
this.action = action;
}
@@ -49,14 +50,16 @@ public class GMSystemEvent extends Event { public void schedule(final GMSystemEvent event) {
- if (Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(Bukkit.getPluginManager().getPlugin("GroupManager"), new Runnable() {
-
- @Override
- public void run() {
-
- Bukkit.getServer().getPluginManager().callEvent(event);
- }
- }, 1) == -1)
- GroupManager.logger.warning("Could not schedule GM Event.");
+ synchronized (GroupManager.getGMEventHandler().getServer()) {
+ if (server.getScheduler().scheduleSyncDelayedTask(server.getPluginManager().getPlugin("GroupManager"), new Runnable() {
+
+ @Override
+ public void run() {
+
+ server.getPluginManager().callEvent(event);
+ }
+ }, 1) == -1)
+ GroupManager.logger.warning("Could not schedule GM Event.");
+ }
}
}
\ No newline at end of file |