Fix the spacing and clean it up.

This commit is contained in:
graywolf336
2014-07-27 14:46:25 -05:00
parent f89de50d75
commit 71a60e6ee3
92 changed files with 9955 additions and 9940 deletions

View File

@ -9,33 +9,33 @@ import com.graywolf336.jail.command.CommandInfo;
import com.graywolf336.jail.enums.Lang;
@CommandInfo(
maxArgs = 1,
minimumArgs = 1,
needsPlayer = false,
pattern = "handcuff|hc",
permission = "jail.command.handcuff",
usage = "/handcuff [player]"
)
maxArgs = 1,
minimumArgs = 1,
needsPlayer = false,
pattern = "handcuff|hc",
permission = "jail.command.handcuff",
usage = "/handcuff [player]"
)
public class HandCuffCommand implements Command {
public boolean execute(JailManager jm, CommandSender sender, String... args) {
Player player = jm.getPlugin().getServer().getPlayer(args[0]);
if(player == null) {
sender.sendMessage(Lang.PLAYERNOTONLINE.get());
}else if(player.hasPermission("jail.cantbehandcuffed")) {
sender.sendMessage(Lang.CANTBEHANDCUFFED.get(player.getName()));
}else if(jm.isPlayerJailed(player.getUniqueId())) {
sender.sendMessage(Lang.CURRENTLYJAILEDHANDCUFF.get(player.getName()));
}else if(jm.getPlugin().getHandCuffManager().isHandCuffed(player.getUniqueId())) {
sender.sendMessage(Lang.HANDCUFFSRELEASED.get(player.getName()));
jm.getPlugin().getHandCuffManager().removeHandCuffs(player.getUniqueId());
player.sendMessage(Lang.UNHANDCUFFED.get());
}else {
jm.getPlugin().getHandCuffManager().addHandCuffs(player.getUniqueId(), player.getLocation());
sender.sendMessage(Lang.HANDCUFFSON.get(player.getName()));
player.sendMessage(Lang.HANDCUFFED.get());
}
return true;
}
public boolean execute(JailManager jm, CommandSender sender, String... args) {
Player player = jm.getPlugin().getServer().getPlayer(args[0]);
if(player == null) {
sender.sendMessage(Lang.PLAYERNOTONLINE.get());
}else if(player.hasPermission("jail.cantbehandcuffed")) {
sender.sendMessage(Lang.CANTBEHANDCUFFED.get(player.getName()));
}else if(jm.isPlayerJailed(player.getUniqueId())) {
sender.sendMessage(Lang.CURRENTLYJAILEDHANDCUFF.get(player.getName()));
}else if(jm.getPlugin().getHandCuffManager().isHandCuffed(player.getUniqueId())) {
sender.sendMessage(Lang.HANDCUFFSRELEASED.get(player.getName()));
jm.getPlugin().getHandCuffManager().removeHandCuffs(player.getUniqueId());
player.sendMessage(Lang.UNHANDCUFFED.get());
}else {
jm.getPlugin().getHandCuffManager().addHandCuffs(player.getUniqueId(), player.getLocation());
sender.sendMessage(Lang.HANDCUFFSON.get(player.getName()));
player.sendMessage(Lang.HANDCUFFED.get());
}
return true;
}
}

View File

@ -8,17 +8,17 @@ import com.graywolf336.jail.command.Command;
import com.graywolf336.jail.command.CommandInfo;
@CommandInfo(
maxArgs = 0,
minimumArgs = 0,
needsPlayer = false,
pattern = "togglejaildebug|tjd",
permission = "jail.command.toggledebug",
usage = "/togglejaildebug"
)
maxArgs = 0,
minimumArgs = 0,
needsPlayer = false,
pattern = "togglejaildebug|tjd",
permission = "jail.command.toggledebug",
usage = "/togglejaildebug"
)
public class ToggleJailDebugCommand implements Command {
public boolean execute(JailManager jm, CommandSender sender, String... args) {
boolean debug = jm.getPlugin().setDebugging(!jm.getPlugin().inDebug());
sender.sendMessage("Jail debugging is now: " + (debug ? ChatColor.GREEN + "enabled" : ChatColor.RED + "disabled"));
return true;
}
public boolean execute(JailManager jm, CommandSender sender, String... args) {
boolean debug = jm.getPlugin().setDebugging(!jm.getPlugin().inDebug());
sender.sendMessage("Jail debugging is now: " + (debug ? ChatColor.GREEN + "enabled" : ChatColor.RED + "disabled"));
return true;
}
}

View File

@ -9,27 +9,27 @@ import com.graywolf336.jail.command.CommandInfo;
import com.graywolf336.jail.enums.Lang;
@CommandInfo(
maxArgs = 1,
minimumArgs = 1,
needsPlayer = false,
pattern = "unhandcuff|uhc",
permission = "jail.command.handcuff",
usage = "/unhandcuff [player]"
)
maxArgs = 1,
minimumArgs = 1,
needsPlayer = false,
pattern = "unhandcuff|uhc",
permission = "jail.command.handcuff",
usage = "/unhandcuff [player]"
)
public class UnHandCuffCommand implements Command {
public boolean execute(JailManager jm, CommandSender sender, String... args) {
Player player = jm.getPlugin().getServer().getPlayerExact(args[0]);
if(player == null) {
sender.sendMessage(Lang.PLAYERNOTONLINE.get());
}else if(jm.getPlugin().getHandCuffManager().isHandCuffed(player.getUniqueId())) {
sender.sendMessage(Lang.HANDCUFFSRELEASED.get(player.getName()));
jm.getPlugin().getHandCuffManager().removeHandCuffs(player.getUniqueId());
player.sendMessage(Lang.UNHANDCUFFED.get());
}else {
sender.sendMessage(Lang.NOTHANDCUFFED.get(player.getName()));
}
return true;
}
public boolean execute(JailManager jm, CommandSender sender, String... args) {
Player player = jm.getPlugin().getServer().getPlayerExact(args[0]);
if(player == null) {
sender.sendMessage(Lang.PLAYERNOTONLINE.get());
}else if(jm.getPlugin().getHandCuffManager().isHandCuffed(player.getUniqueId())) {
sender.sendMessage(Lang.HANDCUFFSRELEASED.get(player.getName()));
jm.getPlugin().getHandCuffManager().removeHandCuffs(player.getUniqueId());
player.sendMessage(Lang.UNHANDCUFFED.get());
}else {
sender.sendMessage(Lang.NOTHANDCUFFED.get(player.getName()));
}
return true;
}
}

View File

@ -13,51 +13,51 @@ import com.graywolf336.jail.enums.Lang;
import com.graywolf336.jail.enums.Settings;
@CommandInfo(
maxArgs = 1,
minimumArgs = 1,
needsPlayer = false,
pattern = "unjail|uj",
permission = "jail.command.unjail",
usage = "/unjail [player]"
)
maxArgs = 1,
minimumArgs = 1,
needsPlayer = false,
pattern = "unjail|uj",
permission = "jail.command.unjail",
usage = "/unjail [player]"
)
public class UnJailCommand implements Command {
public boolean execute(JailManager jm, CommandSender sender, String... args) {
//Check if the player is jailed
if(jm.isPlayerJailedByLastKnownUsername(args[0])) {
Jail j = jm.getJailPlayerIsInByLastKnownName(args[0]);
Prisoner pris = j.getPrisonerByLastKnownName(args[0]);
Player p = jm.getPlugin().getServer().getPlayer(pris.getUUID());
//Check if the player is on the server or not
if(p == null) {
//Check if the player has offline pending and their remaining time is above 0, if so then
//forceably unjail them
if(pris.isOfflinePending() && pris.getRemainingTime() != 0L) {
jm.getPlugin().getPrisonerManager().forceUnJail(j, j.getCellPrisonerIsIn(pris.getUUID()), p, pris, sender);
}else {
//The player is not, so we'll set the remaining time to zero and do it when they login next
pris.setRemainingTime(0L);
pris.setOfflinePending(true);
sender.sendMessage(Lang.WILLBEUNJAILED.get(args[0]));
}
}else {
//Player is online, so let's try unjailing them
try {
jm.getPlugin().getPrisonerManager().unJail(j, j.getCellPrisonerIsIn(pris.getUUID()), p, pris, sender);
} catch (Exception e) {
sender.sendMessage(ChatColor.RED + e.getMessage());
}
}
if(jm.getPlugin().getConfig().getBoolean(Settings.LOGJAILINGTOCONSOLE.getPath())) {
jm.getPlugin().getLogger().info(ChatColor.stripColor(Lang.BROADCASTUNJAILING.get(new String[] { args[0], sender.getName() })));
}
}else {
//The player is not currently jailed
sender.sendMessage(Lang.NOTJAILED.get(args[0]));
}
return true;
}
public boolean execute(JailManager jm, CommandSender sender, String... args) {
//Check if the player is jailed
if(jm.isPlayerJailedByLastKnownUsername(args[0])) {
Jail j = jm.getJailPlayerIsInByLastKnownName(args[0]);
Prisoner pris = j.getPrisonerByLastKnownName(args[0]);
Player p = jm.getPlugin().getServer().getPlayer(pris.getUUID());
//Check if the player is on the server or not
if(p == null) {
//Check if the player has offline pending and their remaining time is above 0, if so then
//forceably unjail them
if(pris.isOfflinePending() && pris.getRemainingTime() != 0L) {
jm.getPlugin().getPrisonerManager().forceUnJail(j, j.getCellPrisonerIsIn(pris.getUUID()), p, pris, sender);
}else {
//The player is not, so we'll set the remaining time to zero and do it when they login next
pris.setRemainingTime(0L);
pris.setOfflinePending(true);
sender.sendMessage(Lang.WILLBEUNJAILED.get(args[0]));
}
}else {
//Player is online, so let's try unjailing them
try {
jm.getPlugin().getPrisonerManager().unJail(j, j.getCellPrisonerIsIn(pris.getUUID()), p, pris, sender);
} catch (Exception e) {
sender.sendMessage(ChatColor.RED + e.getMessage());
}
}
if(jm.getPlugin().getConfig().getBoolean(Settings.LOGJAILINGTOCONSOLE.getPath())) {
jm.getPlugin().getLogger().info(ChatColor.stripColor(Lang.BROADCASTUNJAILING.get(new String[] { args[0], sender.getName() })));
}
}else {
//The player is not currently jailed
sender.sendMessage(Lang.NOTJAILED.get(args[0]));
}
return true;
}
}

View File

@ -10,28 +10,28 @@ import com.graywolf336.jail.enums.Lang;
import com.graywolf336.jail.enums.Settings;
@CommandInfo(
maxArgs = 1,
minimumArgs = 1,
needsPlayer = false,
pattern = "unjailforce|ujf",
permission = "jail.command.unjailforce",
usage = "/unjailforce [player]"
)
maxArgs = 1,
minimumArgs = 1,
needsPlayer = false,
pattern = "unjailforce|ujf",
permission = "jail.command.unjailforce",
usage = "/unjailforce [player]"
)
public class UnJailForceCommand implements Command {
public boolean execute(JailManager jm, CommandSender sender, String... args) {
//Check if the player is jailed
if(jm.isPlayerJailedByLastKnownUsername(args[0])) {
jm.getPlugin().getPrisonerManager().forceRelease(jm.getPrisonerByLastKnownName(args[0]), sender);
if(jm.getPlugin().getConfig().getBoolean(Settings.LOGJAILINGTOCONSOLE.getPath())) {
jm.getPlugin().getLogger().info(ChatColor.stripColor(Lang.BROADCASTUNJAILING.get(new String[] { args[0], sender.getName() })));
}
}else {
//The player is not currently jailed
sender.sendMessage(Lang.NOTJAILED.get(args[0]));
}
return true;
}
public boolean execute(JailManager jm, CommandSender sender, String... args) {
//Check if the player is jailed
if(jm.isPlayerJailedByLastKnownUsername(args[0])) {
jm.getPlugin().getPrisonerManager().forceRelease(jm.getPrisonerByLastKnownName(args[0]), sender);
if(jm.getPlugin().getConfig().getBoolean(Settings.LOGJAILINGTOCONSOLE.getPath())) {
jm.getPlugin().getLogger().info(ChatColor.stripColor(Lang.BROADCASTUNJAILING.get(new String[] { args[0], sender.getName() })));
}
}else {
//The player is not currently jailed
sender.sendMessage(Lang.NOTJAILED.get(args[0]));
}
return true;
}
}

View File

@ -5,32 +5,32 @@ import java.util.List;
import com.lexicalscope.jewel.cli.Option;
public interface Jailing {
@Option(longName={"player", "pl"}, shortName="p", description = "the player's name")
public String getPlayer();
@Option(longName={"time", "length"}, shortName="t", description = "the amount of time")
public String getTime();
@Option(longName={"jail", "prison"}, shortName="j", description = "the jail")
public String getJail();
@Option(longName={"cell"}, shortName="c", description = "the cell")
public String getCell();
@Option(longName={"anycell"}, shortName="a", description = "decides whether the plugin will pick any open cell")
public boolean getAnyCell();
@Option(longName={"muted", "canttalk"}, shortName="m", description = "whether the prisoner is muted or not")
public boolean getMuted();
@Option(longName={"reason"}, shortName="r", description = "the reason this player is being jailed")
public List<String> getReason();
public boolean isTime();
public boolean isJail();
public boolean isCell();
public boolean isAnyCell();
public boolean isMuted();
public boolean isReason();
@Option(longName={"player", "pl"}, shortName="p", description = "the player's name")
public String getPlayer();
@Option(longName={"time", "length"}, shortName="t", description = "the amount of time")
public String getTime();
@Option(longName={"jail", "prison"}, shortName="j", description = "the jail")
public String getJail();
@Option(longName={"cell"}, shortName="c", description = "the cell")
public String getCell();
@Option(longName={"anycell"}, shortName="a", description = "decides whether the plugin will pick any open cell")
public boolean getAnyCell();
@Option(longName={"muted", "canttalk"}, shortName="m", description = "whether the prisoner is muted or not")
public boolean getMuted();
@Option(longName={"reason"}, shortName="r", description = "the reason this player is being jailed")
public List<String> getReason();
public boolean isTime();
public boolean isJail();
public boolean isCell();
public boolean isAnyCell();
public boolean isMuted();
public boolean isReason();
}

View File

@ -3,17 +3,17 @@ package com.graywolf336.jail.command.commands.jewels;
import com.lexicalscope.jewel.cli.Option;
public interface Transfer {
@Option(longName={"player", "pl"}, shortName="p", description = "the player's name")
public String getPlayer();
@Option(longName={"jail", "prison"}, shortName="j", description = "the jail")
public String getJail();
@Option(longName={"cell"}, shortName="c", description = "the cell")
public String getCell();
public boolean isPlayer();
public boolean isJail();
public boolean isCell();
@Option(longName={"player", "pl"}, shortName="p", description = "the player's name")
public String getPlayer();
@Option(longName={"jail", "prison"}, shortName="j", description = "the jail")
public String getJail();
@Option(longName={"cell"}, shortName="c", description = "the cell")
public String getCell();
public boolean isPlayer();
public boolean isJail();
public boolean isCell();
}