diff --git a/src/main/java/com/graywolf336/jail/JailsAPI.java b/src/main/java/com/graywolf336/jail/JailsAPI.java index 1324fe7..524adf2 100644 --- a/src/main/java/com/graywolf336/jail/JailsAPI.java +++ b/src/main/java/com/graywolf336/jail/JailsAPI.java @@ -1,71 +1,71 @@ -package com.graywolf336.jail; - -/** - * The static api interface for Jail plugin. - * - *
- * - * If you're looking for non-static methods, please see the - * {@link JailMain} interface. - * - * @author graywolf336 - * @version 3.0.0 - * @since 3.0.0 - */ -public class JailsAPI { - private static JailMain pl; - - protected JailsAPI(JailMain plugin) { - pl = plugin; - } - - /** - * The instance of the {@link JailManager} which contains all the jails and in return prisoners. - * - * @return instance of the {@link JailManager} - * @see JailManager - */ - public static JailManager getJailManager() { - return pl.getJailManager(); - } - - /** - * The instance of the {@link PrisonerManager} which handles all the jailing of players. - * - * @return instance of the {@link PrisonerManager} - * @see PrisonerManager - */ - public static PrisonerManager getPrisonerManager() { - return pl.getPrisonerManager(); - } - - /** - * The instance of the {@link JailStickManager} which handles all the jail sticks. - * - * @return instance of the {@link JailStickManager} - * @see JailStickManager - */ - public static JailStickManager getJailStickManager() { - return pl.getJailStickManager(); - } - - /** - * The instance of the {@link HandCuffManager} which handles all the handcuffing of players. - * - * @return instance of the {@link HandCuffManager} - * @see HandCuffManager - */ - public static HandCuffManager getHandCuffManager() { - return pl.getHandCuffManager(); - } - - /** - * The instance of the {@link JailVoteManager} which handles all the voting to jail players. - * - * @return instance of the {@link JailVoteManager} - * @see JailVoteManager - */ - public static JailVoteManager getJailVoteManager() { - return pl.getJailVoteManager(); - } -} +package com.graywolf336.jail; + +/** + * The static api interface for Jail plugin. + * + * + * + * If you're looking for non-static methods, please see the + * {@link JailMain} interface. + * + * @author graywolf336 + * @version 3.0.0 + * @since 3.0.0 + */ +public class JailsAPI { + private static JailMain pl; + + protected JailsAPI(JailMain plugin) { + pl = plugin; + } + + /** + * The instance of the {@link JailManager} which contains all the jails and in return prisoners. + * + * @return instance of the {@link JailManager} + * @see JailManager + */ + public static JailManager getJailManager() { + return pl.getJailManager(); + } + + /** + * The instance of the {@link PrisonerManager} which handles all the jailing of players. + * + * @return instance of the {@link PrisonerManager} + * @see PrisonerManager + */ + public static PrisonerManager getPrisonerManager() { + return pl.getPrisonerManager(); + } + + /** + * The instance of the {@link JailStickManager} which handles all the jail sticks. + * + * @return instance of the {@link JailStickManager} + * @see JailStickManager + */ + public static JailStickManager getJailStickManager() { + return pl.getJailStickManager(); + } + + /** + * The instance of the {@link HandCuffManager} which handles all the handcuffing of players. + * + * @return instance of the {@link HandCuffManager} + * @see HandCuffManager + */ + public static HandCuffManager getHandCuffManager() { + return pl.getHandCuffManager(); + } + + /** + * The instance of the {@link JailVoteManager} which handles all the voting to jail players. + * + * @return instance of the {@link JailVoteManager} + * @see JailVoteManager + */ + public static JailVoteManager getJailVoteManager() { + return pl.getJailVoteManager(); + } +} diff --git a/src/main/java/com/graywolf336/jail/Update.java b/src/main/java/com/graywolf336/jail/Update.java index bc58533..604331b 100644 --- a/src/main/java/com/graywolf336/jail/Update.java +++ b/src/main/java/com/graywolf336/jail/Update.java @@ -1,172 +1,172 @@ -package com.graywolf336.jail; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.net.MalformedURLException; -import java.net.URL; -import java.net.URLConnection; - -import org.json.simple.JSONArray; -import org.json.simple.JSONObject; -import org.json.simple.JSONValue; - -import com.graywolf336.jail.enums.Settings; - -public class Update { - private JailMain plugin; - - // The project's unique ID - private static final int projectID = 31139; - - // Static information for querying the API - private static final String BUKKIT_API_QUERY = "https://api.curseforge.com/servermods/files?projectIds=" + projectID; - private static final String CI_STABLEDEV_API_QUERY = "http://ci.graywolf336.com/job/Jail/lastStableBuild/api/json"; - private static final String CI_DEV_API_QUERY = "http://ci.graywolf336.com/job/Jail/lastSuccessfulBuild/api/json"; - private boolean needed = false; - - // The url for the new file and file version - private String fileUrl = "", version = ""; - - protected Update(JailMain plugin) { - this.plugin = plugin; - } - - public void query() { - String channel = plugin.getConfig().getString(Settings.UPDATECHANNEL.getPath(), "bukkit"); - URL url = null; - - try { - if(channel.equalsIgnoreCase("stable-dev")) { - url = new URL(CI_STABLEDEV_API_QUERY); - }else if(channel.equalsIgnoreCase("dev")) { - url = new URL(CI_DEV_API_QUERY); - }else { - url = new URL(BUKKIT_API_QUERY); - } - } catch (MalformedURLException e) { - plugin.getLogger().warning("The url for checking for an update was malformed, please open a ticket about this."); - return; - } - - try { - // Open a connection and query the project - URLConnection conn = url.openConnection(); - - // Add the user-agent to identify the program - conn.addRequestProperty("User-Agent", "Jail Update Checker"); - - // Read the response of the query - // The response will be in a JSON format, so only reading one line is necessary. - final BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream())); - String response = reader.readLine(); - - if(channel.equalsIgnoreCase("stable-dev") || channel.equalsIgnoreCase("dev")) { - // Parse the object from the response from the CI server - JSONObject obj = (JSONObject) JSONValue.parse(response); - // Get the latest build number - long number = Long.parseLong(obj.get("number").toString()); - // Get the current running version - String[] ver = plugin.getDescription().getVersion().split("-b"); - // Let them know they're on a custom version when on build #0. - if(ver[ver.length - 1].equalsIgnoreCase("0")) { - plugin.getLogger().info("You are using a custom version, you can disable update checking."); - } - - // Parse the current build number to a number - long curr = Long.parseLong(ver[ver.length - 1]); - plugin.debug(number + " verus " + curr); - // Check if the build on the CI server is higher than the one we're running - needed = number > curr; - - // Alert the console that an update is needed, if it is needed - if(needed) { - this.version = obj.get("fullDisplayName").toString(); - this.fileUrl = obj.get("url").toString(); - plugin.getLogger().info("New development version of Jail is available: " + this.version); - plugin.getLogger().info(this.fileUrl); - } - }else { - // Parse the array of files from the query's response - JSONArray array = (JSONArray) JSONValue.parse(response); - - // Make sure there are results returned - if (array.size() > 0) { - // Get the newest file's details - JSONObject latest = (JSONObject) array.get(array.size() - 1); - - // Split the numbers into their own separate items - String remoteVer = ((String) latest.get("name")).split(" v")[1]; - - // 3.0.0-SNAPSHOT-b0 - String currentVer = plugin.getDescription().getVersion().split("-")[0]; - - plugin.debug(remoteVer + " verus " + currentVer); - this.needed = this.versionCompare(remoteVer, currentVer) > 0; - - if(needed) { - this.version = latest.get("name").toString(); - this.fileUrl = latest.get("fileUrl").toString(); - plugin.getLogger().info("New stable version of Jail is available: " + this.version); - plugin.getLogger().info(this.fileUrl); - } - } - } - } catch (IOException e) { - // There was an error reading the query - e.printStackTrace(); - plugin.getLogger().severe("There was an error checking for an update, please see the above stacktrace for details before reporting."); - return; - } - } - - /** - * Compares two version strings. - * - * Use this instead of String.compareTo() for a non-lexicographical - * comparison that works for version strings. e.g. "1.10".compareTo("1.6"). - * - * @note It does not work if "1.10" is supposed to be equal to "1.10.0". - * - * @param str1 a string of ordinal numbers separated by decimal points. - * @param str2 a string of ordinal numbers separated by decimal points. - * @return The result is a negative integer if str1 is _numerically_ less than str2. - * The result is a positive integer if str1 is _numerically_ greater than str2. - * The result is zero if the strings are _numerically_ equal. - */ - private Integer versionCompare(String str1, String str2) { - String[] vals1 = str1.split("\\."); - String[] vals2 = str2.split("\\."); - int i = 0; - // set index to first non-equal ordinal or length of shortest version string - while (i < vals1.length && i < vals2.length && vals1[i].equals(vals2[i])) { - i++; - } - - // compare first non-equal ordinal number - if (i < vals1.length && i < vals2.length) { - return Integer.signum(Integer.valueOf(vals1[i]).compareTo(Integer.valueOf(vals2[i]))); - } - - // the strings are equal or one string is a substring of the other - // e.g. "1.2.3" = "1.2.3" or "1.2.3" < "1.2.3.4" - else { - return Integer.signum(vals1.length - vals2.length); - } - } - - /** Returns true if there is an update needed, false if not. */ - public boolean isAvailable() { - return this.needed; - } - - /** Returns the new version. */ - public String getNewVersion() { - return this.version; - } - - /** Returns the new file url. */ - public String getFileUrl() { - return this.fileUrl; - } -} +package com.graywolf336.jail; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLConnection; + +import org.json.simple.JSONArray; +import org.json.simple.JSONObject; +import org.json.simple.JSONValue; + +import com.graywolf336.jail.enums.Settings; + +public class Update { + private JailMain plugin; + + // The project's unique ID + private static final int projectID = 31139; + + // Static information for querying the API + private static final String BUKKIT_API_QUERY = "https://api.curseforge.com/servermods/files?projectIds=" + projectID; + private static final String CI_STABLEDEV_API_QUERY = "http://ci.graywolf336.com/job/Jail/lastStableBuild/api/json"; + private static final String CI_DEV_API_QUERY = "http://ci.graywolf336.com/job/Jail/lastSuccessfulBuild/api/json"; + private boolean needed = false; + + // The url for the new file and file version + private String fileUrl = "", version = ""; + + protected Update(JailMain plugin) { + this.plugin = plugin; + } + + public void query() { + String channel = plugin.getConfig().getString(Settings.UPDATECHANNEL.getPath(), "bukkit"); + URL url = null; + + try { + if(channel.equalsIgnoreCase("stable-dev")) { + url = new URL(CI_STABLEDEV_API_QUERY); + }else if(channel.equalsIgnoreCase("dev")) { + url = new URL(CI_DEV_API_QUERY); + }else { + url = new URL(BUKKIT_API_QUERY); + } + } catch (MalformedURLException e) { + plugin.getLogger().warning("The url for checking for an update was malformed, please open a ticket about this."); + return; + } + + try { + // Open a connection and query the project + URLConnection conn = url.openConnection(); + + // Add the user-agent to identify the program + conn.addRequestProperty("User-Agent", "Jail Update Checker"); + + // Read the response of the query + // The response will be in a JSON format, so only reading one line is necessary. + final BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream())); + String response = reader.readLine(); + + if(channel.equalsIgnoreCase("stable-dev") || channel.equalsIgnoreCase("dev")) { + // Parse the object from the response from the CI server + JSONObject obj = (JSONObject) JSONValue.parse(response); + // Get the latest build number + long number = Long.parseLong(obj.get("number").toString()); + // Get the current running version + String[] ver = plugin.getDescription().getVersion().split("-b"); + // Let them know they're on a custom version when on build #0. + if(ver[ver.length - 1].equalsIgnoreCase("0")) { + plugin.getLogger().info("You are using a custom version, you can disable update checking."); + } + + // Parse the current build number to a number + long curr = Long.parseLong(ver[ver.length - 1]); + plugin.debug(number + " verus " + curr); + // Check if the build on the CI server is higher than the one we're running + needed = number > curr; + + // Alert the console that an update is needed, if it is needed + if(needed) { + this.version = obj.get("fullDisplayName").toString(); + this.fileUrl = obj.get("url").toString(); + plugin.getLogger().info("New development version of Jail is available: " + this.version); + plugin.getLogger().info(this.fileUrl); + } + }else { + // Parse the array of files from the query's response + JSONArray array = (JSONArray) JSONValue.parse(response); + + // Make sure there are results returned + if (array.size() > 0) { + // Get the newest file's details + JSONObject latest = (JSONObject) array.get(array.size() - 1); + + // Split the numbers into their own separate items + String remoteVer = ((String) latest.get("name")).split(" v")[1]; + + // 3.0.0-SNAPSHOT-b0 + String currentVer = plugin.getDescription().getVersion().split("-")[0]; + + plugin.debug(remoteVer + " verus " + currentVer); + this.needed = this.versionCompare(remoteVer, currentVer) > 0; + + if(needed) { + this.version = latest.get("name").toString(); + this.fileUrl = latest.get("fileUrl").toString(); + plugin.getLogger().info("New stable version of Jail is available: " + this.version); + plugin.getLogger().info(this.fileUrl); + } + } + } + } catch (IOException e) { + // There was an error reading the query + e.printStackTrace(); + plugin.getLogger().severe("There was an error checking for an update, please see the above stacktrace for details before reporting."); + return; + } + } + + /** + * Compares two version strings. + * + * Use this instead of String.compareTo() for a non-lexicographical + * comparison that works for version strings. e.g. "1.10".compareTo("1.6"). + * + * @note It does not work if "1.10" is supposed to be equal to "1.10.0". + * + * @param str1 a string of ordinal numbers separated by decimal points. + * @param str2 a string of ordinal numbers separated by decimal points. + * @return The result is a negative integer if str1 is _numerically_ less than str2. + * The result is a positive integer if str1 is _numerically_ greater than str2. + * The result is zero if the strings are _numerically_ equal. + */ + private Integer versionCompare(String str1, String str2) { + String[] vals1 = str1.split("\\."); + String[] vals2 = str2.split("\\."); + int i = 0; + // set index to first non-equal ordinal or length of shortest version string + while (i < vals1.length && i < vals2.length && vals1[i].equals(vals2[i])) { + i++; + } + + // compare first non-equal ordinal number + if (i < vals1.length && i < vals2.length) { + return Integer.signum(Integer.valueOf(vals1[i]).compareTo(Integer.valueOf(vals2[i]))); + } + + // the strings are equal or one string is a substring of the other + // e.g. "1.2.3" = "1.2.3" or "1.2.3" < "1.2.3.4" + else { + return Integer.signum(vals1.length - vals2.length); + } + } + + /** Returns true if there is an update needed, false if not. */ + public boolean isAvailable() { + return this.needed; + } + + /** Returns the new version. */ + public String getNewVersion() { + return this.version; + } + + /** Returns the new file url. */ + public String getFileUrl() { + return this.fileUrl; + } +} diff --git a/src/main/java/com/graywolf336/jail/beans/CreationPlayer.java b/src/main/java/com/graywolf336/jail/beans/CreationPlayer.java index 4b846db..7cc53a5 100644 --- a/src/main/java/com/graywolf336/jail/beans/CreationPlayer.java +++ b/src/main/java/com/graywolf336/jail/beans/CreationPlayer.java @@ -1,227 +1,227 @@ -package com.graywolf336.jail.beans; - -import java.util.HashSet; - -import org.bukkit.Bukkit; -import org.bukkit.Location; - -/** - * Represents an instance of a player creating something, whether it be a jail or cell. - * - * @author graywolf336 - * @since 3.0.0 - * @version 1.1.0 - * - */ -public class CreationPlayer { - private String jailName, cellName; - private int step; - private int x1, y1, z1, x2, y2, z2; - private String inWorld, freeWorld; - private double inX, inY, inZ, freeX, freeY, freeZ; - private float inPitch, inYaw, freePitch, freeYaw; - private HashSet- * - * If it is a Jail, then when these numbers are returned it means the following: - *
- *
- * Notice: Using this method can cause the step to go above four (three for cell),
- * which might cause errors later on. Only use when you know that it won't
- * be used again or you know for a fact that the next step is not above four (three for cell).
- *
- */
- public void nextStep() {
- this.step++;
- }
-
- /** Sets the first corner with the given location. */
- public void setCornerOne(Location loc) {
- this.x1 = loc.getBlockX();
- this.y1 = loc.getBlockY();
- this.z1 = loc.getBlockZ();
- }
-
- /** Sets the first corner with the given x, y, and z. */
- public void setCornerOne(int x, int y, int z) {
- this.x1 = x;
- this.y1 = y;
- this.z1 = z;
- }
-
- /** Returns the first corner coords an array of int. 0 = x, 1 = y, 2 = z */
- public int[] getCornerOne() {
- int[] t = {x1, y1, z1};
- return t;
- }
-
- /** Sets the second corner with the given location. */
- public void setCornerTwo(Location loc) {
- this.x2 = loc.getBlockX();
- this.y2 = loc.getBlockY();
- this.z2 = loc.getBlockZ();
- }
-
- /** Sets the second corner with the given x, y, and z. */
- public void setCornerTwo(int x, int y, int z) {
- this.x2 = x;
- this.y2 = y;
- this.z2 = z;
- }
-
- /** Returns the second corner coords an array of int. 0 = x, 1 = y, 2 = z */
- public int[] getCornerTwo() {
- int[] t = {x2, y2, z2};
- return t;
- }
-
- /** Sets the teleport in coords from the given location. */
- public void setTeleportIn(Location location) {
- this.inWorld = location.getWorld().getName();
- this.inX = location.getX();
- this.inY = location.getY();
- this.inZ = location.getZ();
- this.inYaw = location.getYaw();
- this.inPitch = location.getPitch();
- }
-
- /** Sets the teleport in coords from the given params. */
- public void setTeleportIn(String world, double x, double y, double z, float yaw, float pitch) {
- this.inWorld = world;
- this.inX = x;
- this.inY = y;
- this.inZ = z;
- this.inYaw = yaw;
- this.inPitch = pitch;
- }
-
- /** Gets the teleport in location in a {@link Location}. */
- public Location getTeleportIn() {
- return new Location(Bukkit.getWorld(inWorld), inX, inY, inZ, inYaw, inPitch);
- }
-
- /** Gets the teleport in location in a {@link SimpleLocation}. */
- public SimpleLocation getTeleportInSL() {
- return new SimpleLocation(inWorld, inX, inY, inZ, inYaw, inPitch);
- }
-
- /** Sets the teleport free coords from the given location. */
- public void setTeleportFree(Location location) {
- this.freeWorld = location.getWorld().getName();
- this.freeX = location.getX();
- this.freeY = location.getY();
- this.freeZ = location.getZ();
- this.freeYaw = location.getYaw();
- this.freePitch = location.getPitch();
- }
-
- /** Sets the teleport in coords from the given params. */
- public void setTeleportFree(String world, double x, double y, double z, float yaw, float pitch) {
- this.freeWorld = world;
- this.freeX = x;
- this.freeY = y;
- this.freeZ = z;
- this.freeYaw = yaw;
- this.freePitch = pitch;
- }
-
- /** Gets the teleport free location in a {@link Location}. */
- public Location getTeleportFree() {
- return new Location(Bukkit.getWorld(freeWorld), freeX, freeY, freeZ, freeYaw, freePitch);
- }
-
- /** Gets the teleport free location in a {@link SimpleLocation}. */
- public SimpleLocation getTeleportFreeSL() {
- return new SimpleLocation(freeWorld, freeX, freeY, freeZ, freeYaw, freePitch);
- }
-
- /** Adds a sign to this cell. */
- public void addSign(SimpleLocation sign) {
- this.signs.add(sign);
- }
-
- /** Returns all the signs, null if none (usually null when a jail is being created). */
- public HashSet
+ *
+ * If it is a Jail, then when these numbers are returned it means the following:
+ *
+ *
+ * Notice: Using this method can cause the step to go above four (three for cell),
+ * which might cause errors later on. Only use when you know that it won't
+ * be used again or you know for a fact that the next step is not above four (three for cell).
+ *
+ */
+ public void nextStep() {
+ this.step++;
+ }
+
+ /** Sets the first corner with the given location. */
+ public void setCornerOne(Location loc) {
+ this.x1 = loc.getBlockX();
+ this.y1 = loc.getBlockY();
+ this.z1 = loc.getBlockZ();
+ }
+
+ /** Sets the first corner with the given x, y, and z. */
+ public void setCornerOne(int x, int y, int z) {
+ this.x1 = x;
+ this.y1 = y;
+ this.z1 = z;
+ }
+
+ /** Returns the first corner coords an array of int. 0 = x, 1 = y, 2 = z */
+ public int[] getCornerOne() {
+ int[] t = {x1, y1, z1};
+ return t;
+ }
+
+ /** Sets the second corner with the given location. */
+ public void setCornerTwo(Location loc) {
+ this.x2 = loc.getBlockX();
+ this.y2 = loc.getBlockY();
+ this.z2 = loc.getBlockZ();
+ }
+
+ /** Sets the second corner with the given x, y, and z. */
+ public void setCornerTwo(int x, int y, int z) {
+ this.x2 = x;
+ this.y2 = y;
+ this.z2 = z;
+ }
+
+ /** Returns the second corner coords an array of int. 0 = x, 1 = y, 2 = z */
+ public int[] getCornerTwo() {
+ int[] t = {x2, y2, z2};
+ return t;
+ }
+
+ /** Sets the teleport in coords from the given location. */
+ public void setTeleportIn(Location location) {
+ this.inWorld = location.getWorld().getName();
+ this.inX = location.getX();
+ this.inY = location.getY();
+ this.inZ = location.getZ();
+ this.inYaw = location.getYaw();
+ this.inPitch = location.getPitch();
+ }
+
+ /** Sets the teleport in coords from the given params. */
+ public void setTeleportIn(String world, double x, double y, double z, float yaw, float pitch) {
+ this.inWorld = world;
+ this.inX = x;
+ this.inY = y;
+ this.inZ = z;
+ this.inYaw = yaw;
+ this.inPitch = pitch;
+ }
+
+ /** Gets the teleport in location in a {@link Location}. */
+ public Location getTeleportIn() {
+ return new Location(Bukkit.getWorld(inWorld), inX, inY, inZ, inYaw, inPitch);
+ }
+
+ /** Gets the teleport in location in a {@link SimpleLocation}. */
+ public SimpleLocation getTeleportInSL() {
+ return new SimpleLocation(inWorld, inX, inY, inZ, inYaw, inPitch);
+ }
+
+ /** Sets the teleport free coords from the given location. */
+ public void setTeleportFree(Location location) {
+ this.freeWorld = location.getWorld().getName();
+ this.freeX = location.getX();
+ this.freeY = location.getY();
+ this.freeZ = location.getZ();
+ this.freeYaw = location.getYaw();
+ this.freePitch = location.getPitch();
+ }
+
+ /** Sets the teleport in coords from the given params. */
+ public void setTeleportFree(String world, double x, double y, double z, float yaw, float pitch) {
+ this.freeWorld = world;
+ this.freeX = x;
+ this.freeY = y;
+ this.freeZ = z;
+ this.freeYaw = yaw;
+ this.freePitch = pitch;
+ }
+
+ /** Gets the teleport free location in a {@link Location}. */
+ public Location getTeleportFree() {
+ return new Location(Bukkit.getWorld(freeWorld), freeX, freeY, freeZ, freeYaw, freePitch);
+ }
+
+ /** Gets the teleport free location in a {@link SimpleLocation}. */
+ public SimpleLocation getTeleportFreeSL() {
+ return new SimpleLocation(freeWorld, freeX, freeY, freeZ, freeYaw, freePitch);
+ }
+
+ /** Adds a sign to this cell. */
+ public void addSign(SimpleLocation sign) {
+ this.signs.add(sign);
+ }
+
+ /** Returns all the signs, null if none (usually null when a jail is being created). */
+ public HashSet
- *
- * When the method returns false, the usage message is printed to the sender. If the method
- * handles the command in any way, such as sending a message to the sender or actually doing
- * something, then it should return true so that the sender of the command doesn't get the
- * usage message.
- *
- * @param jm An instance of the {@link JailManager}
- * @param sender The {@link CommandSender sender} of the command
- * @param args The args, in an array
- * @return True if the method handled it in any way, false if we should send the usage message.
- */
- public boolean execute(JailManager jm, CommandSender sender, String... args) throws Exception;
-}
+package com.graywolf336.jail.command;
+
+import org.bukkit.command.CommandSender;
+
+import com.graywolf336.jail.JailManager;
+
+/**
+ * The base of all the commands.
+ *
+ * @author graywolf336
+ * @since 3.0.0
+ * @version 1.0.0
+ */
+public interface Command {
+ /**
+ * Execute the command given the arguments, returning whether the command handled it or not.
+ *
+ *
+ *
+ * When the method returns false, the usage message is printed to the sender. If the method
+ * handles the command in any way, such as sending a message to the sender or actually doing
+ * something, then it should return true so that the sender of the command doesn't get the
+ * usage message.
+ *
+ * @param jm An instance of the {@link JailManager}
+ * @param sender The {@link CommandSender sender} of the command
+ * @param args The args, in an array
+ * @return True if the method handled it in any way, false if we should send the usage message.
+ */
+ public boolean execute(JailManager jm, CommandSender sender, String... args) throws Exception;
+}
diff --git a/src/main/java/com/graywolf336/jail/command/subcommands/JailHelpCommand.java b/src/main/java/com/graywolf336/jail/command/subcommands/JailHelpCommand.java
index d9d8eaf..932b787 100644
--- a/src/main/java/com/graywolf336/jail/command/subcommands/JailHelpCommand.java
+++ b/src/main/java/com/graywolf336/jail/command/subcommands/JailHelpCommand.java
@@ -1,24 +1,24 @@
-package com.graywolf336.jail.command.subcommands;
-
-import org.bukkit.ChatColor;
-import org.bukkit.command.CommandSender;
-
-import com.graywolf336.jail.JailManager;
-import com.graywolf336.jail.command.Command;
-import com.graywolf336.jail.command.CommandInfo;
-
-@CommandInfo(
- maxArgs = 1,
- minimumArgs = 0,
- needsPlayer = false,
- pattern = "help|h",
- permission = "jail.command.jailhelp",
- usage = "/jail help [page]"
- )
-public class JailHelpCommand implements Command {
- public boolean execute(JailManager jm, CommandSender sender, String... args) throws Exception {
- sender.sendMessage(ChatColor.GREEN + "This command will be filled out shortly, use this link for now:");
- sender.sendMessage(ChatColor.GREEN + "https://github.com/graywolf336/Jail/wiki/Commands");
- return true;
- }
-}
+package com.graywolf336.jail.command.subcommands;
+
+import org.bukkit.ChatColor;
+import org.bukkit.command.CommandSender;
+
+import com.graywolf336.jail.JailManager;
+import com.graywolf336.jail.command.Command;
+import com.graywolf336.jail.command.CommandInfo;
+
+@CommandInfo(
+ maxArgs = 1,
+ minimumArgs = 0,
+ needsPlayer = false,
+ pattern = "help|h",
+ permission = "jail.command.jailhelp",
+ usage = "/jail help [page]"
+ )
+public class JailHelpCommand implements Command {
+ public boolean execute(JailManager jm, CommandSender sender, String... args) throws Exception {
+ sender.sendMessage(ChatColor.GREEN + "This command will be filled out shortly, use this link for now:");
+ sender.sendMessage(ChatColor.GREEN + "https://github.com/graywolf336/Jail/wiki/Commands");
+ return true;
+ }
+}
diff --git a/src/main/java/com/graywolf336/jail/listeners/CellSignListener.java b/src/main/java/com/graywolf336/jail/listeners/CellSignListener.java
index 3c8279d..26f3c0d 100644
--- a/src/main/java/com/graywolf336/jail/listeners/CellSignListener.java
+++ b/src/main/java/com/graywolf336/jail/listeners/CellSignListener.java
@@ -1,156 +1,156 @@
-package com.graywolf336.jail.listeners;
-
-import java.util.HashSet;
-import java.util.List;
-
-import org.bukkit.block.Sign;
-import org.bukkit.event.EventHandler;
-import org.bukkit.event.EventPriority;
-import org.bukkit.event.Listener;
-
-import com.graywolf336.jail.JailMain;
-import com.graywolf336.jail.Util;
-import com.graywolf336.jail.beans.SimpleLocation;
-import com.graywolf336.jail.enums.Lang;
-import com.graywolf336.jail.enums.Settings;
-import com.graywolf336.jail.events.PrisonerJailedEvent;
-import com.graywolf336.jail.events.PrisonerReleasedEvent;
-import com.graywolf336.jail.events.PrisonerTimeChangeEvent;
-import com.graywolf336.jail.events.PrisonerTransferredEvent;
-
-public class CellSignListener implements Listener {
- private String lineOne, lineTwo, lineThree, lineFour;
- private JailMain pl;
-
- public CellSignListener(JailMain plugin) {
- pl = plugin;
- List
+ *
+ *
+ * If it is a Cell, then when these numbers are returned it means the following:
+ *
+ *
+ *
+ * @return The step of the Jail/Cell Creation, as an integer.
+ */
+ public int getStep() {
+ return this.step;
+ }
+
+ /**
+ * Sets the step of the creation.
+ *
+ * @param step The state of the creation, see {@link #getStep() getStep} for more information.
+ */
+ public void setStep(int step) {
+ this.step = step;
+ }
+
+ /**
+ * Increments the current step up one.
+ *
+ *