Large diffs are not rendered by default.

@@ -0,0 +1,14 @@
package org.simiancage.DeathTpPlus.helpers;

/**
* PluginName: DeathTpPlus
* Class: PluginStatsDTP
* User: DonRedhorse
* Date: 04.01.12
* Time: 20:27
*/

// PluginStats from com.randomappdev.pluginstats http://pluginstats.randomappdev.com/howto.html

public class PluginStatsDTP {
}
@@ -71,6 +71,9 @@ public void onPlayerJoin(PlayerJoinEvent event) {
if (worker.hasTomb(playerName)) {
worker.getTomb(playerName).checkSigns();
}
if (event.getPlayer().hasPermission("deathtpplus.admin.version")) {
event.getPlayer().sendMessage("A new version of DeathTpPlus is available!");
}
}


@@ -11,8 +11,10 @@
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.RegisteredServiceProvider;
import org.dynmap.DynmapAPI;
import org.simiancage.DeathTpPlus.DeathTpPlus;
import org.simiancage.DeathTpPlus.helpers.ConfigDTP;
import org.simiancage.DeathTpPlus.helpers.DynMapHelperDTP;
import org.simiancage.DeathTpPlus.helpers.LoggerDTP;
import org.yi.acru.bukkit.Lockette.Lockette;

@@ -22,6 +24,7 @@ public class ServerListenerDTP extends ServerListener {
private LoggerDTP log;
private ConfigDTP config;
private boolean missingEconomyWarn = true;
private boolean dynMapNotReady = true;


public ServerListenerDTP(DeathTpPlus plugin) {
@@ -45,6 +48,7 @@ public void onPluginDisable(PluginDisableEvent event) {
plugin.setEconomyActive(false);
log.info("un-hooked from Vault.");
log.info("as Vault was unloaded / disabled.");
missingEconomyWarn = true;
}
}

@@ -65,6 +69,19 @@ public void onPluginDisable(PluginDisableEvent event) {
plugin.setMaHandler(null);
plugin.setMobArenaEnabled(false);
}
Plugin checkDynmap = pm.getPlugin("dynmap");
if ((checkDynmap == null) && plugin.isDynmapEnabled()) {
log.info("Disabled DnyMap integration.");
log.info("as DynMap was unloaded / disabled.");
plugin.setDynmapEnabled(false);
plugin.setDynMap(null);
plugin.getDynMapHelperDTP().onDisable();
plugin.setDynMapHelperDTP(null);
plugin.setDynmapAPI(null);
dynMapNotReady = true;

}


}

@@ -74,6 +91,7 @@ public void onPluginEnable(PluginEnableEvent event) {
PluginManager pm = plugin.getServer().getPluginManager();
Plugin checkVault = pm.getPlugin("Vault");
Plugin checkMobArena = pm.getPlugin("MobArena");
Plugin checkDynMap = pm.getPlugin("dynmap");
if (checkVault != null && !plugin.isUseVault()) {
plugin.setUseVault(true);
log.info("Vault detected");
@@ -120,5 +138,30 @@ public void onPluginEnable(PluginEnableEvent event) {
plugin.setMaHandler(new MobArenaHandler());
plugin.setMobArenaEnabled(true);
}

if (checkDynMap != null && !plugin.isDynmapEnabled() && config.isIntegrateIntoDynmap()) {
log.info("Enabling DynMap Integration");
plugin.setDynMap(checkDynMap);
plugin.setDynmapEnabled(true);
}
if (checkDynMap.isEnabled() && plugin.isDynmapEnabled() && !plugin.isDynmapActive()) {
DynmapAPI api = (DynmapAPI) checkDynMap; /* Get API */
log.debug("dynMapApi", api);
if (api == null) {
if (dynMapNotReady) {
log.info("DynMap not ready yet.. waiting");
dynMapNotReady = false;
}
} else {
log.info("DynMap ready!");
plugin.setDynmapAPI(api);
plugin.setDynmapActive(true);
DynMapHelperDTP dynMapHelperDTP = new DynMapHelperDTP(plugin);
plugin.setDynMapHelperDTP(dynMapHelperDTP);

dynMapHelperDTP.onEnable();

}
}
}
}
@@ -63,6 +63,22 @@ public DeathLocationRecordDTP getRecord(String playerName) {
return deathLocation;
}

public List<DeathLocationRecordDTP> getAllRecords() {
List<DeathLocationRecordDTP> deathLocationRecordList = null;
try {
BufferedReader bufferedReader = new BufferedReader(new FileReader(deathLocationLogFile));
String line;
while ((line = bufferedReader.readLine()) != null) {
deathLocationRecordList.add(new DeathLocationRecordDTP(line));

}
bufferedReader.close();
} catch (IOException e) {
log.severe("Failed to read death location log", e);
}
return deathLocationRecordList;
}

public void setRecord(DeathDetailDTP deathDetail) {
List<DeathLocationRecordDTP> deathLocations = new ArrayList<DeathLocationRecordDTP>();
DeathLocationRecordDTP playerRecord = null;