Debugging to figure out why more than one stick isn't being loaded.
This commit is contained in:
		| @@ -2,6 +2,7 @@ package com.graywolf336.jail; | ||||
|  | ||||
| import java.util.ArrayList; | ||||
| import java.util.HashMap; | ||||
| import java.util.Map.Entry; | ||||
|  | ||||
| import org.bukkit.Material; | ||||
| import org.bukkit.configuration.file.FileConfiguration; | ||||
| @@ -32,8 +33,15 @@ public class JailStickManager { | ||||
| 	private void loadJailSticks(JailMain pl) { | ||||
| 		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 | ||||
| 		for(String s : config.getStringList(Settings.JAILSTICKSTICKS.getPath())) { | ||||
| 			pl.debug(s); | ||||
| 			String[] a = s.split(","); | ||||
| 			 | ||||
| 			//Check if the jail given, if any, exists | ||||
|   | ||||
| @@ -4,7 +4,7 @@ package com.graywolf336.jail.beans; | ||||
|  * Represents a Jail Stick, contains all the information. | ||||
|  *  | ||||
|  * @author graywolf336 | ||||
|  * @version 1.0.0 | ||||
|  * @version 1.0.1 | ||||
|  * @since 3.0.0 | ||||
|  * | ||||
|  */ | ||||
| @@ -29,4 +29,9 @@ public class Stick { | ||||
| 	public long getTime() { | ||||
| 		return this.time; | ||||
| 	} | ||||
| 	 | ||||
| 	@Override | ||||
| 	public String toString() { | ||||
| 		return time + "," + jail + "," + reason; | ||||
| 	} | ||||
| } | ||||
|   | ||||
| @@ -62,12 +62,11 @@ public class LegacyManager { | ||||
| 		 | ||||
| 		try { | ||||
| 			loadOldConfig(); | ||||
| 			return true; | ||||
| 		}catch (Exception e) { | ||||
| 			pl.getLogger().severe("Failed to load the old configuration for some reason."); | ||||
| 			return false; | ||||
| 		} | ||||
| 		 | ||||
| 		return false; | ||||
| 	} | ||||
|  | ||||
| 	@SuppressWarnings("deprecation") | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 graywolf336
					graywolf336