Debugging to figure out why more than one stick isn't being loaded.

This commit is contained in:
graywolf336 2014-03-14 15:44:19 -05:00
parent 737a7e35e2
commit 2778c79150
3 changed files with 15 additions and 3 deletions

View File

@ -2,6 +2,7 @@ package com.graywolf336.jail;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map.Entry;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.configuration.file.FileConfiguration;
@ -32,8 +33,15 @@ public class JailStickManager {
private void loadJailSticks(JailMain pl) { private void loadJailSticks(JailMain pl) {
FileConfiguration config = pl.getConfig(); FileConfiguration config = pl.getConfig();
if(pl.inDebug()) {
for(Entry<Material, Stick> s : sticks.entrySet()) {
pl.debug(s.getKey().toString().toLowerCase() + "," + s.getValue().toString());
}
}
//item name,time,jail name,reason //item name,time,jail name,reason
for(String s : config.getStringList(Settings.JAILSTICKSTICKS.getPath())) { for(String s : config.getStringList(Settings.JAILSTICKSTICKS.getPath())) {
pl.debug(s);
String[] a = s.split(","); String[] a = s.split(",");
//Check if the jail given, if any, exists //Check if the jail given, if any, exists

View File

@ -4,7 +4,7 @@ package com.graywolf336.jail.beans;
* Represents a Jail Stick, contains all the information. * Represents a Jail Stick, contains all the information.
* *
* @author graywolf336 * @author graywolf336
* @version 1.0.0 * @version 1.0.1
* @since 3.0.0 * @since 3.0.0
* *
*/ */
@ -29,4 +29,9 @@ public class Stick {
public long getTime() { public long getTime() {
return this.time; return this.time;
} }
@Override
public String toString() {
return time + "," + jail + "," + reason;
}
} }

View File

@ -62,12 +62,11 @@ public class LegacyManager {
try { try {
loadOldConfig(); loadOldConfig();
return true;
}catch (Exception e) { }catch (Exception e) {
pl.getLogger().severe("Failed to load the old configuration for some reason."); pl.getLogger().severe("Failed to load the old configuration for some reason.");
return false; return false;
} }
return false;
} }
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")