Remove the debugging messages and add a debugging variable.
This commit is contained in:
parent
81ec445deb
commit
17f627350b
@ -7,6 +7,7 @@ import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import com.graywolf336.jail.beans.Jail;
|
||||
import com.graywolf336.jail.command.CommandHandler;
|
||||
import com.graywolf336.jail.enums.Settings;
|
||||
import com.graywolf336.jail.listeners.BlockListener;
|
||||
import com.graywolf336.jail.listeners.EntityListener;
|
||||
import com.graywolf336.jail.listeners.PlayerListener;
|
||||
@ -16,6 +17,7 @@ public class JailMain extends JavaPlugin {
|
||||
private JailIO io;
|
||||
private JailManager jm;
|
||||
private PrisonerManager pm;
|
||||
private boolean debug = false;
|
||||
|
||||
public void onEnable() {
|
||||
loadConfig();
|
||||
@ -34,6 +36,10 @@ public class JailMain extends JavaPlugin {
|
||||
plm.registerEvents(new EntityListener(), 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:
|
||||
//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() {
|
||||
return this.pm;
|
||||
}
|
||||
|
||||
/** Returns if the plugin is in debug state or not. */
|
||||
public boolean inDebug() {
|
||||
return this.debug;
|
||||
}
|
||||
}
|
||||
|
@ -117,16 +117,13 @@ public class Cell {
|
||||
public boolean hasChest() {
|
||||
Chest c = getChest();
|
||||
if(c != null) {
|
||||
if(c.getInventory().getSize() >= 40) {
|
||||
Bukkit.getLogger().info("The cell " + this.name + " has a chest.");
|
||||
if(c.getInventory().getSize() >= 40)
|
||||
return true;
|
||||
}else {
|
||||
else {
|
||||
Bukkit.getLogger().severe("The cell " + this.name + " has chest that isn't a double chest, please fix.");
|
||||
return false;
|
||||
}
|
||||
}else {
|
||||
Bukkit.getLogger().info("The cell " + this.name + " doesn't have a chest.");
|
||||
}else
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user