Remove the debugging messages and add a debugging variable.

This commit is contained in:
graywolf336 2013-12-28 13:37:18 -06:00
parent 81ec445deb
commit 17f627350b
2 changed files with 14 additions and 6 deletions

View File

@ -7,6 +7,7 @@ import org.bukkit.plugin.java.JavaPlugin;
import com.graywolf336.jail.beans.Jail; import com.graywolf336.jail.beans.Jail;
import com.graywolf336.jail.command.CommandHandler; import com.graywolf336.jail.command.CommandHandler;
import com.graywolf336.jail.enums.Settings;
import com.graywolf336.jail.listeners.BlockListener; import com.graywolf336.jail.listeners.BlockListener;
import com.graywolf336.jail.listeners.EntityListener; import com.graywolf336.jail.listeners.EntityListener;
import com.graywolf336.jail.listeners.PlayerListener; import com.graywolf336.jail.listeners.PlayerListener;
@ -16,6 +17,7 @@ public class JailMain extends JavaPlugin {
private JailIO io; private JailIO io;
private JailManager jm; private JailManager jm;
private PrisonerManager pm; private PrisonerManager pm;
private boolean debug = false;
public void onEnable() { public void onEnable() {
loadConfig(); loadConfig();
@ -34,6 +36,10 @@ public class JailMain extends JavaPlugin {
plm.registerEvents(new EntityListener(), this); plm.registerEvents(new EntityListener(), this);
plm.registerEvents(new PlayerListener(this), this); plm.registerEvents(new PlayerListener(this), this);
debug = getConfig().getBoolean(Settings.DEBUG.getPath());
if(debug) getLogger().info("Debugging enabled.");
//For the time, we will use: //For the time, we will use:
//http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/TimeUnit.html#convert(long, java.util.concurrent.TimeUnit) //http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/TimeUnit.html#convert(long, java.util.concurrent.TimeUnit)
} }
@ -94,4 +100,9 @@ public class JailMain extends JavaPlugin {
public PrisonerManager getPrisonerManager() { public PrisonerManager getPrisonerManager() {
return this.pm; return this.pm;
} }
/** Returns if the plugin is in debug state or not. */
public boolean inDebug() {
return this.debug;
}
} }

View File

@ -117,16 +117,13 @@ public class Cell {
public boolean hasChest() { public boolean hasChest() {
Chest c = getChest(); Chest c = getChest();
if(c != null) { if(c != null) {
if(c.getInventory().getSize() >= 40) { if(c.getInventory().getSize() >= 40)
Bukkit.getLogger().info("The cell " + this.name + " has a chest.");
return true; return true;
}else { else {
Bukkit.getLogger().severe("The cell " + this.name + " has chest that isn't a double chest, please fix."); Bukkit.getLogger().severe("The cell " + this.name + " has chest that isn't a double chest, please fix.");
return false; return false;
} }
}else { }else
Bukkit.getLogger().info("The cell " + this.name + " doesn't have a chest.");
return false; return false;
}
} }
} }