First attempt at working on the transferring of prisoners
This commit is contained in:
parent
d0e41ed908
commit
d0312afc66
@ -79,6 +79,11 @@ public class JailIO {
|
||||
return getLanguageString(langString, new String[] {});
|
||||
}
|
||||
|
||||
/** Returns the message in the language, no variables are replaced.*/
|
||||
public String getLanguageString(LangString langString, LangString langString2) {
|
||||
return getLanguageString(langString, getLanguageString(langString2, new String[] {}));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the message in the language, with the provided variables being replaced.
|
||||
*
|
||||
@ -215,6 +220,7 @@ public class JailIO {
|
||||
flat.set(cNode + "prisoner.muted", p.isMuted());
|
||||
flat.set(cNode + "prisoner.time", p.getRemainingTime());
|
||||
flat.set(cNode + "prisoner.offlinePending", p.isOfflinePending());
|
||||
flat.set(cNode + "prisoner.toBeTransferred", p.isToBeTransferred());
|
||||
flat.set(cNode + "prisoner.jailer", p.getJailer());
|
||||
flat.set(cNode + "prisoner.reason", p.getReason());
|
||||
flat.set(cNode + "prisoner.inventory", p.getInventory());
|
||||
@ -233,6 +239,7 @@ public class JailIO {
|
||||
flat.set(pNode + "muted", p.isMuted());
|
||||
flat.set(pNode + "time", p.getRemainingTime());
|
||||
flat.set(pNode + "offlinePending", p.isOfflinePending());
|
||||
flat.set(pNode + "toBeTransferred", p.isToBeTransferred());
|
||||
flat.set(pNode + "jailer", p.getJailer());
|
||||
flat.set(pNode + "reason", p.getReason());
|
||||
flat.set(pNode + "inventory", p.getInventory());
|
||||
@ -319,6 +326,7 @@ public class JailIO {
|
||||
flat.getString(cellNode + "prisoner.jailer"),
|
||||
flat.getString(cellNode + "prisoner.reason"));
|
||||
p.setOfflinePending(flat.getBoolean(cellNode + "prisoner.offlinePending"));
|
||||
p.setToBeTransferred(flat.getBoolean(cellNode + "prisoner.toBeTransferred"));
|
||||
p.setPreviousPosition(flat.getString(cellNode + "prisoner.previousLocation"));
|
||||
p.setPreviousGameMode(flat.getString(cellNode + "prisoner.previousGameMode"));
|
||||
p.setInventory(flat.getString(cellNode + "prisoner.inventory", ""));
|
||||
@ -342,6 +350,7 @@ public class JailIO {
|
||||
flat.getString(pNode + "jailer"),
|
||||
flat.getString(pNode + "reason"));
|
||||
pris.setOfflinePending(flat.getBoolean(pNode + "offlinePending"));
|
||||
pris.setToBeTransferred(flat.getBoolean(pNode + "toBeTransferred"));
|
||||
pris.setPreviousPosition(flat.getString(pNode + "previousLocation"));
|
||||
pris.setPreviousGameMode(flat.getString(pNode + "previousGameMode"));
|
||||
pris.setInventory(flat.getString(pNode + "inventory", ""));
|
||||
|
@ -150,4 +150,9 @@ public class JailMain extends JavaPlugin {
|
||||
public boolean inDebug() {
|
||||
return this.debug;
|
||||
}
|
||||
|
||||
/** Logs a debugging message to the console if debugging is enabled. */
|
||||
public void debug(String message) {
|
||||
if(inDebug()) getLogger().info("[Debug]: " + message);
|
||||
}
|
||||
}
|
||||
|
@ -410,4 +410,101 @@ public class PrisonerManager {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void transferPrisoner(Jail origin, Cell originCell, Jail targetJail, Cell targetCell, Prisoner prisoner) {
|
||||
Player player = pl.getServer().getPlayer(prisoner.getName());
|
||||
|
||||
//If there is no origin cell, then we need to basically just put them to their targetJail
|
||||
if(originCell == null) {
|
||||
//But first thing is first, let's check if there is a targetCell we're putting them in
|
||||
if(targetCell == null) {
|
||||
//There is no cell, so we're just going to be putting them into
|
||||
//the target jail and that's it
|
||||
targetJail.addPrisoner(prisoner);
|
||||
//Now then let's remove them from their old jail
|
||||
origin.removePrisoner(prisoner);
|
||||
|
||||
//If the player is not online, trigger them to be teleported when they
|
||||
//come online again
|
||||
if(player == null) {
|
||||
//Set them to have an action on offline pending, so it gets triggered
|
||||
prisoner.setOfflinePending(true);
|
||||
//Now let's set them to be transferred when they come online next
|
||||
prisoner.setToBeTransferred(true);
|
||||
}else {
|
||||
prisoner.setTeleporting(true);
|
||||
player.teleport(targetJail.getTeleportIn());
|
||||
prisoner.setTeleporting(false);
|
||||
player.sendMessage(pl.getJailIO().getLanguageString(LangString.TRANSFERRED, targetJail.getName()));
|
||||
}
|
||||
}else {
|
||||
//They are set to go to the targetCell, so handle accordingly
|
||||
targetCell.setPrisoner(prisoner);
|
||||
|
||||
//If the player is not online, trigger them to be teleported when they
|
||||
//come online again
|
||||
if(player == null) {
|
||||
//Set them to have an action on offline pending, so it gets triggered
|
||||
prisoner.setOfflinePending(true);
|
||||
//Now let's set them to be transferred when they come online next
|
||||
prisoner.setToBeTransferred(true);
|
||||
}else {
|
||||
prisoner.setTeleporting(true);
|
||||
player.teleport(targetCell.getTeleport());
|
||||
prisoner.setTeleporting(false);
|
||||
player.sendMessage(pl.getJailIO().getLanguageString(LangString.TRANSFERRED, targetJail.getName()));
|
||||
}
|
||||
}
|
||||
}else {
|
||||
//They are being transferred from a cell, so we need to handle getting the inventory
|
||||
//and all that sort of stuff from the old cell before we transfer them over to the new cell
|
||||
|
||||
//If they're not being sent to a cell any more, handle that differently as well
|
||||
if(targetCell == null) {
|
||||
//Add them to the target jail
|
||||
targetJail.addPrisoner(prisoner);
|
||||
//Next, remove them from the cell
|
||||
originCell.removePrisoner();
|
||||
|
||||
//If the cell they came from has any items from their inventory,
|
||||
//let's get it all and store it
|
||||
if(originCell.hasChest()) {
|
||||
//Convert the inventory to base64 string and store it in the prisoner's file
|
||||
prisoner.setInventory(Util.toBase64(originCell.getChest().getInventory()));
|
||||
//Clear the origin cell's inventory so nothing is left behind
|
||||
originCell.getChest().getInventory().clear();
|
||||
}
|
||||
}else {
|
||||
//They are being transferred to a cell in another cell,
|
||||
//we aren't going to do any sanity checks as we hope the method that is
|
||||
//calling this one does those sanity checks for us.
|
||||
|
||||
//Set the cell's prisoner to this one
|
||||
targetCell.setPrisoner(prisoner);
|
||||
//Remove the prisoner from the old one
|
||||
originCell.removePrisoner();
|
||||
|
||||
//Check if the origin cell has a chest, put all the player's inventory into it
|
||||
if(originCell.hasChest()) {
|
||||
//If the targetCell has a chest
|
||||
if(targetCell.hasChest()) {
|
||||
//Loop through the origin's chest inventory and add it to the target cell's chest
|
||||
for(ItemStack i : originCell.getChest().getInventory().getContents()) {
|
||||
targetCell.getChest().getInventory().addItem(i);
|
||||
}
|
||||
|
||||
//Clear the origin cell's chest as it is clear now
|
||||
originCell.getChest().getInventory().clear();
|
||||
}else {
|
||||
//targetCell has no chest so we aren't going to try and put anything into it
|
||||
|
||||
//Convert the inventory to base64 string and store it in the prisoner's file
|
||||
prisoner.setInventory(Util.toBase64(originCell.getChest().getInventory()));
|
||||
//Clear the origin cell's inventory so nothing is left behind
|
||||
originCell.getChest().getInventory().clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ import org.bukkit.Location;
|
||||
*/
|
||||
public class Prisoner {
|
||||
private String name, jailer, reason, inventory, armor;
|
||||
private boolean muted, offlinePending, teleporting;
|
||||
private boolean muted, offlinePending, teleporting, toBeTransferred;
|
||||
private long time, afk;
|
||||
private Location previousPosition;
|
||||
private GameMode previousGameMode;
|
||||
@ -37,6 +37,7 @@ public class Prisoner {
|
||||
this.reason = reason;
|
||||
this.offlinePending = false;
|
||||
this.teleporting = false;
|
||||
this.toBeTransferred = false;
|
||||
this.previousPosition = null;
|
||||
this.previousGameMode = GameMode.SURVIVAL;
|
||||
this.inventory = "";
|
||||
@ -127,6 +128,16 @@ public class Prisoner {
|
||||
this.teleporting = teleport;
|
||||
}
|
||||
|
||||
/** Gets whether the prisoner is going to be transferred or not, mainly for teleporting on join purposes. */
|
||||
public boolean isToBeTransferred() {
|
||||
return this.toBeTransferred;
|
||||
}
|
||||
|
||||
/** Sets whether the prisoner is going to be transferred or not, mainly for teleporting on join purposes. */
|
||||
public void setToBeTransferred(boolean transferred) {
|
||||
this.toBeTransferred = transferred;
|
||||
}
|
||||
|
||||
/** Gets the previous location of this player, can be null. */
|
||||
public Location getPreviousLocation() {
|
||||
return this.previousPosition;
|
||||
|
@ -27,6 +27,7 @@ import com.graywolf336.jail.command.jcommands.RemoveCell;
|
||||
import com.graywolf336.jail.command.jcommands.Stop;
|
||||
import com.graywolf336.jail.command.jcommands.TeleIn;
|
||||
import com.graywolf336.jail.command.jcommands.TeleOut;
|
||||
import com.graywolf336.jail.command.jcommands.Transfer;
|
||||
import com.graywolf336.jail.command.jcommands.Version;
|
||||
import com.graywolf336.jail.command.subcommands.JailCellCreateCommand;
|
||||
import com.graywolf336.jail.command.subcommands.JailCheckCommand;
|
||||
@ -42,6 +43,7 @@ import com.graywolf336.jail.command.subcommands.JailRemoveCellCommand;
|
||||
import com.graywolf336.jail.command.subcommands.JailStopCommand;
|
||||
import com.graywolf336.jail.command.subcommands.JailTeleInCommand;
|
||||
import com.graywolf336.jail.command.subcommands.JailTeleOutCommand;
|
||||
import com.graywolf336.jail.command.subcommands.JailTransferCommand;
|
||||
import com.graywolf336.jail.command.subcommands.JailVersionCommand;
|
||||
import com.graywolf336.jail.enums.LangString;
|
||||
|
||||
@ -197,6 +199,7 @@ public class JailHandler {
|
||||
load(JailStopCommand.class);
|
||||
load(JailTeleInCommand.class);
|
||||
load(JailTeleOutCommand.class);
|
||||
load(JailTransferCommand.class);
|
||||
load(JailVersionCommand.class);
|
||||
|
||||
//Puts the commands in the HashMap
|
||||
@ -224,6 +227,8 @@ public class JailHandler {
|
||||
addCmds.put("teleportin", new TeleIn());
|
||||
addCmds.put("teleout", new TeleOut());
|
||||
addCmds.put("teleportout", new TeleOut());
|
||||
addCmds.put("transfer", new Transfer());
|
||||
addCmds.put("trans", new Transfer());
|
||||
addCmds.put("version", new Version());
|
||||
addCmds.put("ver", new Version());
|
||||
addCmds.put("v", new Version());
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.graywolf336.jail.command.jcommands;
|
||||
package com.graywolf336.jail.command.commands.params;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
@ -0,0 +1,45 @@
|
||||
package com.graywolf336.jail.command.commands.params;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.beust.jcommander.Parameter;
|
||||
|
||||
public class Transferring {
|
||||
@Parameter
|
||||
private List<String> parameters = new ArrayList<String>();
|
||||
|
||||
@Parameter(names = { "-player", "-p", "-prisoner" }, description = "The name of the player we are jailing.")
|
||||
private String player = "";
|
||||
|
||||
@Parameter(names = { "-jail", "-j", "-prison" }, description = "The jail we are sending the player to.")
|
||||
private String jail = "";
|
||||
|
||||
@Parameter(names = { "-cell", "-c"}, description = "The cell in the jail we are sending them to.")
|
||||
private String cell = "";
|
||||
|
||||
/** Returns the parameters. */
|
||||
public List<String> parameters() {
|
||||
return parameters;
|
||||
}
|
||||
|
||||
/** Returns the player parameter. */
|
||||
public String player() {
|
||||
return player;
|
||||
}
|
||||
|
||||
/** Returns the jail parameter. */
|
||||
public String jail() {
|
||||
return jail;
|
||||
}
|
||||
|
||||
/** Sets the jail parameter. */
|
||||
public void setJail(String jail) {
|
||||
this.jail = jail;
|
||||
}
|
||||
|
||||
/** Returns the cell parameter. */
|
||||
public String cell() {
|
||||
return cell;
|
||||
}
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package com.graywolf336.jail.command.jcommands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.beust.jcommander.Parameter;
|
||||
import com.beust.jcommander.Parameters;
|
||||
|
||||
@Parameters(commandDescription = "Transfers a player to another jail.")
|
||||
public class Transfer {
|
||||
@Parameter
|
||||
private List<String> parameters = new ArrayList<String>();
|
||||
}
|
@ -17,7 +17,7 @@ import com.graywolf336.jail.beans.Jail;
|
||||
import com.graywolf336.jail.beans.Prisoner;
|
||||
import com.graywolf336.jail.command.Command;
|
||||
import com.graywolf336.jail.command.CommandInfo;
|
||||
import com.graywolf336.jail.command.jcommands.Jailing;
|
||||
import com.graywolf336.jail.command.commands.params.Jailing;
|
||||
import com.graywolf336.jail.enums.LangString;
|
||||
import com.graywolf336.jail.enums.Settings;
|
||||
import com.graywolf336.jail.events.PrePrisonerJailedEvent;
|
||||
@ -63,6 +63,14 @@ public class JailCommand implements Command {
|
||||
return true;
|
||||
}
|
||||
|
||||
//Check if they've actually given us a player to jail
|
||||
if(params.player().isEmpty()) {
|
||||
sender.sendMessage(jm.getPlugin().getJailIO().getLanguageString(LangString.PROVIDEAPLAYER, LangString.JAILING));
|
||||
return true;
|
||||
}else {
|
||||
jm.getPlugin().debug("We are getting ready to handle jailing: " + params.jail());
|
||||
}
|
||||
|
||||
//Check if the given player is already jailed or not
|
||||
if(jm.isPlayerJailed(params.player())) {
|
||||
sender.sendMessage(jm.getPlugin().getJailIO().getLanguageString(LangString.ALREADYJAILED));
|
||||
|
@ -0,0 +1,101 @@
|
||||
package com.graywolf336.jail.command.subcommands;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
import com.beust.jcommander.JCommander;
|
||||
import com.beust.jcommander.ParameterException;
|
||||
import com.graywolf336.jail.JailManager;
|
||||
import com.graywolf336.jail.beans.Cell;
|
||||
import com.graywolf336.jail.beans.Jail;
|
||||
import com.graywolf336.jail.command.Command;
|
||||
import com.graywolf336.jail.command.CommandInfo;
|
||||
import com.graywolf336.jail.command.commands.params.Transferring;
|
||||
import com.graywolf336.jail.enums.LangString;
|
||||
|
||||
@CommandInfo(
|
||||
maxArgs = 6,
|
||||
minimumArgs = 2,
|
||||
needsPlayer = false,
|
||||
pattern = "transfer|trans",
|
||||
permission = "jail.command.jailtransfer",
|
||||
usage = "/jail transfer -p player -j jail -c cell"
|
||||
)
|
||||
public class JailTransferCommand implements Command {
|
||||
public boolean execute(JailManager jm, CommandSender sender, String... args) throws Exception {
|
||||
if(jm.getJails().isEmpty()) {
|
||||
sender.sendMessage(jm.getPlugin().getJailIO().getLanguageString(LangString.NOJAILS));
|
||||
return true;
|
||||
}
|
||||
|
||||
//Parse the command
|
||||
Transferring params = new Transferring();
|
||||
|
||||
try {
|
||||
new JCommander(params, args);
|
||||
}catch(ParameterException e) {
|
||||
sender.sendMessage(ChatColor.RED + e.getMessage());
|
||||
return true;
|
||||
}
|
||||
|
||||
//Verify they gave us a player and if so check if they're jailed
|
||||
if(params.player().isEmpty()) {
|
||||
sender.sendMessage(jm.getPlugin().getJailIO().getLanguageString(LangString.PROVIDEAPLAYER, LangString.TRANSFERRING));
|
||||
return true;
|
||||
}else if(!jm.isPlayerJailed(params.player())) {
|
||||
sender.sendMessage(jm.getPlugin().getJailIO().getLanguageString(LangString.NOTJAILED, params.player()));
|
||||
return true;
|
||||
}
|
||||
|
||||
jm.getPlugin().debug("Checking everything before we transfer: " + params.player());
|
||||
|
||||
//If they didn't provide a jail, tell them we need one
|
||||
if(params.jail().isEmpty()) {
|
||||
sender.sendMessage(jm.getPlugin().getJailIO().getLanguageString(LangString.PROVIDEAJAIL, LangString.TRANSFERRING));
|
||||
return true;
|
||||
}else {
|
||||
//Check if the jail they did provide exists
|
||||
if(jm.getJail(params.jail()) == null) {
|
||||
sender.sendMessage(jm.getPlugin().getJailIO().getLanguageString(LangString.NOJAIL, params.jail()));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Jail target = jm.getJail(params.jail());
|
||||
Cell targetCell = null;
|
||||
|
||||
//Check if they provided a cell and if so does it exist
|
||||
if(!params.cell().isEmpty()) {
|
||||
if(target.getCell(params.cell()) == null) {
|
||||
sender.sendMessage(jm.getPlugin().getJailIO().getLanguageString(LangString.NOCELL, params.cell()));
|
||||
return true;
|
||||
}else {
|
||||
//Store the cell for easy of access and also check if it already is full
|
||||
targetCell = target.getCell(params.cell());
|
||||
if(targetCell.hasPrisoner()) {
|
||||
//If the cell has a prisoner, don't allow jailing them to that particular cell
|
||||
sender.sendMessage(jm.getPlugin().getJailIO().getLanguageString(LangString.CELLNOTEMPTY, params.cell()));
|
||||
|
||||
//But suggest the first empty cell we find
|
||||
Cell suggestedCell = jm.getJail(params.jail()).getFirstEmptyCell();
|
||||
if(suggestedCell != null) {
|
||||
sender.sendMessage(jm.getPlugin().getJailIO().getLanguageString(LangString.SUGGESTEDCELL, new String[] { params.jail(), suggestedCell.getName() }));
|
||||
}else {
|
||||
sender.sendMessage(jm.getPlugin().getJailIO().getLanguageString(LangString.NOEMPTYCELLS, params.jail()));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
jm.getPlugin().debug("Sending the transferring off, jail and cell check all came out clean.");
|
||||
|
||||
//Start the transferring of the prisoner
|
||||
jm.getPlugin().getPrisonerManager().transferPrisoner(jm.getJailPlayerIsIn(params.player()),
|
||||
jm.getJailPlayerIsIn(params.player()).getCellPrisonerIsIn(params.player()),
|
||||
target, targetCell, jm.getPrisoner(params.player()));
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
@ -62,12 +62,18 @@ public enum LangString {
|
||||
PROTECTIONMESSAGE ("jailing"),
|
||||
/** The message sent to the prisoner when they try to do something and it is protected, but no penalty. */
|
||||
PROTECTIONMESSAGENOPENALTY ("jailing"),
|
||||
/** The message sent to the sender when they need to provide a player. */
|
||||
PROVIDEAPLAYER ("jailing"),
|
||||
/** The message sent to the sender when they need to provide a jail. */
|
||||
PROVIDEAJAIL ("jailing"),
|
||||
/** The message sent to the sender of a command when suggesting a cell. */
|
||||
SUGGESTEDCELL ("jailing"),
|
||||
/** The message sent to the sender when they teleport someone to a jail's teleport in location. */
|
||||
TELEIN ("jailing"),
|
||||
/** The message sent to the sender when they teleport someone to a jail's teleport out location. */
|
||||
TELEOUT ("jailing"),
|
||||
/** The message sent to the player when they get transferred to a new jail. */
|
||||
TRANSFERRED ("jailing"),
|
||||
/** The message sent when players are released from jail. */
|
||||
UNJAILED ("jailing"),
|
||||
/** The message went when an offline player is unjailed. */
|
||||
@ -96,6 +102,8 @@ public enum LangString {
|
||||
ALLJAILS ("general"),
|
||||
/** The message sent whenever a cell is successfully removed. */
|
||||
CELLREMOVED ("general"),
|
||||
/** The simple word jailing to be put in other parts. */
|
||||
JAILING ("jailing"),
|
||||
/** The message sent whenever a jail is successfully removed. */
|
||||
JAILREMOVED ("general"),
|
||||
/** Message sent when doing something that requires a cell but the given name of a cell doesn't exist. */
|
||||
@ -118,6 +126,8 @@ public enum LangString {
|
||||
PLUGINRELOADED ("general"),
|
||||
/** The message sent whenever the prisoners are cleared from jail(s). */
|
||||
PRISONERSCLEARED ("general"),
|
||||
/** The simple word transferring to be put in other parts. */
|
||||
TRANSFERRING ("general"),
|
||||
/** The message sent whenever someone does a command we don't know. */
|
||||
UNKNOWNCOMMAND ("general");
|
||||
|
||||
|
@ -18,6 +18,7 @@ import org.bukkit.event.player.PlayerRespawnEvent;
|
||||
import com.graywolf336.jail.JailMain;
|
||||
import com.graywolf336.jail.JailManager;
|
||||
import com.graywolf336.jail.Util;
|
||||
import com.graywolf336.jail.beans.Cell;
|
||||
import com.graywolf336.jail.beans.Jail;
|
||||
import com.graywolf336.jail.beans.Prisoner;
|
||||
import com.graywolf336.jail.enums.LangString;
|
||||
@ -83,13 +84,29 @@ public class PlayerListener implements Listener {
|
||||
//Let's check if the player is jailed
|
||||
if(pl.getJailManager().isPlayerJailed(event.getPlayer().getName())) {
|
||||
//Get the prisoner object
|
||||
Prisoner p = pl.getJailManager().getJailPlayerIsIn(event.getPlayer().getName()).getPrisoner(event.getPlayer().getName());
|
||||
Jail j = pl.getJailManager().getJailPlayerIsIn(event.getPlayer().getName());
|
||||
Prisoner p = j.getPrisoner(event.getPlayer().getName());
|
||||
|
||||
//Check if they're offline pending, as if this is true then they were jailed offline
|
||||
if(p.isOfflinePending()) {
|
||||
if(p.getRemainingTime() == 0L) {
|
||||
//If their remaining time is 0, let's unjail them
|
||||
pl.getPrisonerManager().releasePrisoner(event.getPlayer(), p);
|
||||
}else {
|
||||
}else if(p.isToBeTransferred()) {
|
||||
Cell c = j.getCellPrisonerIsIn(event.getPlayer().getName());
|
||||
|
||||
//If the player is not jailed in a cell, teleport them to the jail's in
|
||||
if(c == null) {
|
||||
p.setTeleporting(true);
|
||||
event.getPlayer().teleport(j.getTeleportIn());
|
||||
p.setTeleporting(false);
|
||||
}else {
|
||||
//If they are in a cell, teleport them into that cell
|
||||
p.setTeleporting(true);
|
||||
event.getPlayer().teleport(c.getTeleport());
|
||||
p.setTeleporting(false);
|
||||
}
|
||||
} else {
|
||||
//Their remaining time isn't 0 so let's proceed with jailing of the prisoner
|
||||
pl.getPrisonerManager().jailPrisoner(event.getPlayer().getName());
|
||||
}
|
||||
|
@ -10,6 +10,7 @@ language:
|
||||
general:
|
||||
alljails: 'all the jails'
|
||||
cellremoved: '&9Cell %0% has been successfully removed from the jail %1%.'
|
||||
jailing: '&9jailing'
|
||||
jailremoved: '&9Jail %0% has been successfully removed.'
|
||||
nocell: '&cNo cell found by the name of &0& in the jail %1%.'
|
||||
nocells: '&cNo cells found in the jail %0%.'
|
||||
@ -21,6 +22,7 @@ language:
|
||||
playernotonline: '&cThat player is not online!'
|
||||
pluginreloaded: '&9Jail data successfully reloaded.'
|
||||
prisonerscleared: '&cAll the prisoners from %0% have been cleared.'
|
||||
transferring: '&9transferring'
|
||||
unknowncommand: '&cNo commands registered by the name of %0%.'
|
||||
jailing:
|
||||
afkkickmessage: '&cYou can not be afk while being jailed.'
|
||||
@ -44,9 +46,12 @@ language:
|
||||
onlinejail: '&2%0% was jailed for %1% minutes.'
|
||||
protectionmessage: '&c%0% minutes have been added to your time for %1%.'
|
||||
protectionmessagenopenalty: '&cProtection enabled for %0%, do not do it again.'
|
||||
provideaplayer: '&cPlease provide a player when %0% &cthem.'
|
||||
provideajail: '&cPlease provide a jail to %0% &cthem to.'
|
||||
suggestedcell: '&cAn empty cell in the same jail, %0%, was found: %1%'
|
||||
telein: "&9Teleported %0% to %1%'s teleport in location."
|
||||
teleout: "&9Teleported %0% to %1%'s teleport out location."
|
||||
transferred: '&9You have been transferred to %0%.'
|
||||
unjailed: '&2You have been released! Please respect the server rules.'
|
||||
willbeunjailed: '&2%0% will be released the next time they log on.'
|
||||
handcuffing:
|
||||
|
@ -6,7 +6,7 @@ import org.junit.Test;
|
||||
|
||||
import com.beust.jcommander.JCommander;
|
||||
import com.beust.jcommander.ParameterException;
|
||||
import com.graywolf336.jail.command.jcommands.Jailing;
|
||||
import com.graywolf336.jail.command.commands.params.Jailing;
|
||||
|
||||
public class TestCommandParams {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user