Update to use Bukkit 1.7.10-R0.1 API, rip out old SpoutPlugin support
This commit is contained in:
parent
af1bcd1094
commit
0f722da05d
7 changed files with 9 additions and 351 deletions
|
|
@ -2,11 +2,9 @@ package org.dynmap.bukkit;
|
|||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedList;
|
||||
|
|
@ -103,11 +101,9 @@ public class DynmapPlugin extends JavaPlugin implements DynmapAPI {
|
|||
private PermissionProvider permissions;
|
||||
private String version;
|
||||
public SnapshotCache sscache;
|
||||
private boolean has_spout = false;
|
||||
public PlayerList playerList;
|
||||
private MapManager mapManager;
|
||||
public static DynmapPlugin plugin;
|
||||
public SpoutPluginBlocks spb;
|
||||
public PluginManager pm;
|
||||
private Metrics metrics;
|
||||
private BukkitEnableCoreCallback enabCoreCB = new BukkitEnableCoreCallback();
|
||||
|
|
@ -169,26 +165,10 @@ public class DynmapPlugin extends JavaPlugin implements DynmapAPI {
|
|||
private class BukkitEnableCoreCallback extends DynmapCore.EnableCoreCallbacks {
|
||||
@Override
|
||||
public void configurationLoaded() {
|
||||
/* Check for Spout */
|
||||
if(detectSpout()) {
|
||||
if(core.configuration.getBoolean("spout/enabled", true)) {
|
||||
has_spout = true;
|
||||
Log.info("Detected Spout");
|
||||
if(spb == null) {
|
||||
spb = new SpoutPluginBlocks(DynmapPlugin.this);
|
||||
}
|
||||
modsused.add("SpoutPlugin");
|
||||
}
|
||||
else {
|
||||
Log.info("Detected Spout - Support Disabled");
|
||||
}
|
||||
File st = new File(core.getDataFolder(), "renderdata/spout-texture.txt");
|
||||
if(st.exists()) {
|
||||
st.delete();
|
||||
}
|
||||
if(!has_spout) { /* If not, clean up old spout texture, if needed */
|
||||
File st = new File(core.getDataFolder(), "renderdata/spout-texture.txt");
|
||||
if(st.exists())
|
||||
st.delete();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -634,7 +614,7 @@ public class DynmapPlugin extends JavaPlugin implements DynmapAPI {
|
|||
return false;
|
||||
}
|
||||
@Override
|
||||
public int getHealth() {
|
||||
public double getHealth() {
|
||||
if(player != null)
|
||||
return helper.getHealth(player);
|
||||
else
|
||||
|
|
@ -842,7 +822,6 @@ public class DynmapPlugin extends JavaPlugin implements DynmapAPI {
|
|||
@EventHandler(priority=EventPriority.MONITOR, ignoreCancelled=true)
|
||||
public void onPluginEnabled(PluginEnableEvent evt) {
|
||||
if (!readyToEnable()) {
|
||||
spb.markPluginEnabled(evt.getPlugin());
|
||||
if (readyToEnable()) { /* If we;re ready now, finish enable */
|
||||
doEnable(); /* Finish enable */
|
||||
}
|
||||
|
|
@ -867,18 +846,10 @@ public class DynmapPlugin extends JavaPlugin implements DynmapAPI {
|
|||
}
|
||||
|
||||
private boolean readyToEnable() {
|
||||
if (spb != null) {
|
||||
return spb.isReady();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private void doEnable() {
|
||||
/* Prep spout support, if needed */
|
||||
if(spb != null) {
|
||||
spb.processSpoutBlocks(this, core);
|
||||
}
|
||||
|
||||
/* Enable core */
|
||||
if(!core.enableCore(enabCoreCB)) {
|
||||
this.setEnabled(false);
|
||||
|
|
@ -1515,18 +1486,6 @@ public class DynmapPlugin extends JavaPlugin implements DynmapAPI {
|
|||
}
|
||||
}
|
||||
|
||||
private boolean detectSpout() {
|
||||
Plugin p = this.getServer().getPluginManager().getPlugin("Spout");
|
||||
if(p != null) {
|
||||
return p.isEnabled();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean hasSpout() {
|
||||
return has_spout;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void assertPlayerInvisibility(String player, boolean is_invisible,
|
||||
String plugin_id) {
|
||||
|
|
@ -1577,14 +1536,6 @@ public class DynmapPlugin extends JavaPlugin implements DynmapAPI {
|
|||
return 0;
|
||||
}
|
||||
});
|
||||
features.addPlotter(new Metrics.Plotter("Spout") {
|
||||
@Override
|
||||
public int getValue() {
|
||||
if(plugin.has_spout)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
});
|
||||
features.addPlotter(new Metrics.Plotter("Login Security") {
|
||||
@Override
|
||||
public int getValue() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue