Update to CB 1.1 event model (1.1-R5 READY)
This commit is contained in:
parent
5c30f733bb
commit
9651103ba9
4
pom.xml
4
pom.xml
@ -56,13 +56,13 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.dynmap</groupId>
|
<groupId>org.dynmap</groupId>
|
||||||
<artifactId>dynmap-api</artifactId>
|
<artifactId>dynmap-api</artifactId>
|
||||||
<version>[0.29,)</version>
|
<version>[0.32,)</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.bukkit</groupId>
|
<groupId>org.bukkit</groupId>
|
||||||
<artifactId>bukkit</artifactId>
|
<artifactId>bukkit</artifactId>
|
||||||
<version>[1.0.1-R1-SNAPSHOT,)</version>
|
<version>1.1-R5-SNAPSHOT</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -16,10 +16,9 @@ import org.bukkit.ChatColor;
|
|||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.configuration.ConfigurationSection;
|
import org.bukkit.configuration.ConfigurationSection;
|
||||||
import org.bukkit.configuration.file.FileConfiguration;
|
import org.bukkit.configuration.file.FileConfiguration;
|
||||||
import org.bukkit.event.Event.Priority;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.Event.Type;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.server.PluginEnableEvent;
|
import org.bukkit.event.server.PluginEnableEvent;
|
||||||
import org.bukkit.event.server.ServerListener;
|
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
import org.bukkit.plugin.Plugin;
|
import org.bukkit.plugin.Plugin;
|
||||||
import org.bukkit.plugin.PluginManager;
|
import org.bukkit.plugin.PluginManager;
|
||||||
@ -466,8 +465,9 @@ public class DynmapFactionsPlugin extends JavaPlugin {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private class OurServerListener extends ServerListener {
|
private class OurServerListener implements Listener {
|
||||||
@Override
|
@SuppressWarnings("unused")
|
||||||
|
@EventHandler
|
||||||
public void onPluginEnable(PluginEnableEvent event) {
|
public void onPluginEnable(PluginEnableEvent event) {
|
||||||
Plugin p = event.getPlugin();
|
Plugin p = event.getPlugin();
|
||||||
String name = p.getDescription().getName();
|
String name = p.getDescription().getName();
|
||||||
@ -496,11 +496,11 @@ public class DynmapFactionsPlugin extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
factions = p;
|
factions = p;
|
||||||
|
|
||||||
|
getServer().getPluginManager().registerEvents(new OurServerListener(), this);
|
||||||
|
|
||||||
/* If both enabled, activate */
|
/* If both enabled, activate */
|
||||||
if(dynmap.isEnabled() && factions.isEnabled())
|
if(dynmap.isEnabled() && factions.isEnabled())
|
||||||
activate();
|
activate();
|
||||||
else
|
|
||||||
getServer().getPluginManager().registerEvent(Type.PLUGIN_ENABLE, new OurServerListener(), Priority.Monitor, this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void activate() {
|
private void activate() {
|
||||||
@ -548,11 +548,11 @@ public class DynmapFactionsPlugin extends JavaPlugin {
|
|||||||
cusstyle.put(id, new AreaStyle(cfg, "custstyle." + id, defstyle));
|
cusstyle.put(id, new AreaStyle(cfg, "custstyle." + id, defstyle));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
List vis = cfg.getList("visibleregions");
|
List<String> vis = cfg.getStringList("visibleregions");
|
||||||
if(vis != null) {
|
if(vis != null) {
|
||||||
visible = new HashSet<String>(vis);
|
visible = new HashSet<String>(vis);
|
||||||
}
|
}
|
||||||
List hid = cfg.getList("hiddenregions");
|
List<String> hid = cfg.getStringList("hiddenregions");
|
||||||
if(hid != null) {
|
if(hid != null) {
|
||||||
hidden = new HashSet<String>(hid);
|
hidden = new HashSet<String>(hid);
|
||||||
}
|
}
|
||||||
|
@ -2,5 +2,5 @@ name: Dynmap-Factions
|
|||||||
main: org.dynmap.factions.DynmapFactionsPlugin
|
main: org.dynmap.factions.DynmapFactionsPlugin
|
||||||
version: "${project.version}"
|
version: "${project.version}"
|
||||||
author: mikeprimm
|
author: mikeprimm
|
||||||
softdepend: [dynmap,Factions]
|
depend: [ dynmap, Factions ]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user