Add some debugging to the jailing of a player.

This commit is contained in:
graywolf336 2014-07-14 21:19:12 -05:00
parent 049ea63102
commit 27b557991e

View File

@ -233,6 +233,7 @@ public class PrisonerManager {
//Teleport them to the cell's teleport location //Teleport them to the cell's teleport location
//they will now be placed in jail. //they will now be placed in jail.
pl.debug("Teleporting " + player.getName() + " to " + jail.getName() + " in the cell " + cell.getName() + "'s in: " + jail.getTeleportIn().toString());
player.teleport(cell.getTeleport()); player.teleport(cell.getTeleport());
}else { }else {
//There is no cell we're jailing them to, so stick them in the jail //There is no cell we're jailing them to, so stick them in the jail
@ -247,6 +248,7 @@ public class PrisonerManager {
//Teleport them to the jail's teleport in location //Teleport them to the jail's teleport in location
//They will now be placed in jail. //They will now be placed in jail.
pl.debug("Teleporting " + player.getName() + " to " + jail.getName() + "'s in: " + jail.getTeleportIn().toString());
player.teleport(jail.getTeleportIn()); player.teleport(jail.getTeleportIn());
} }
@ -265,13 +267,13 @@ public class PrisonerManager {
if(pl.getConfig().getBoolean(Settings.SCOREBOARDENABLED.getPath())) { if(pl.getConfig().getBoolean(Settings.SCOREBOARDENABLED.getPath())) {
pl.getScoreBoardManager().addScoreBoard(player, prisoner); pl.getScoreBoardManager().addScoreBoard(player, prisoner);
} }
//Save the data, as we have changed it
pl.getJailIO().saveJail(jail);
//Call our custom event for when a prisoner is actually jailed. //Call our custom event for when a prisoner is actually jailed.
PrisonerJailedEvent event = new PrisonerJailedEvent(jail, cell, prisoner, player); PrisonerJailedEvent event = new PrisonerJailedEvent(jail, cell, prisoner, player);
pl.getServer().getPluginManager().callEvent(event); pl.getServer().getPluginManager().callEvent(event);
//Save the data, as we have changed it
pl.getJailIO().saveJail(jail);
} }
/** /**