New command for signs, closes #79

A new command for signs. Refreshing them, cleaning them, and verifying
them. Changed up some internal apis, if you were using them sorry for
breaking it. Also, really update the signs when we jail someone who is
offline via a new event.
This commit is contained in:
graywolf336 2015-06-05 18:01:31 -05:00
parent bd1b3ec04d
commit 384fa3601b
12 changed files with 487 additions and 201 deletions

View File

@ -461,7 +461,7 @@ public class JailIO {
if(j != null) {
if(j.getWorld() != null) {
Cell c = new Cell(set.getString("name"));
Cell c = new Cell(set.getInt("cellid"), set.getString("name"));
c.setTeleport(new SimpleLocation(j.getWorldName(), set.getDouble("tp.x"), set.getDouble("tp.y"), set.getDouble("tp.z"),
set.getFloat("tp.yaw"), set.getFloat("tp.pitch")));
@ -805,6 +805,9 @@ public class JailIO {
try {
for(Cell c : j.getCells()) {
if(c.getDatabaseID() != -1)
saveCell(j, c, false);
if(c.hasPrisoner() && c.getPrisoner().wasChanged()) {
Prisoner p = c.getPrisoner();
PreparedStatement pPS = getConnection().prepareStatement("REPLACE INTO `" + prefix + "prisoners` (`uuid`, `name`, `jail`, `cell`, `muted`, `time`,"
@ -989,8 +992,13 @@ public class JailIO {
case 2:
try {
pl.debug("Saving the cell " + c.getName());
PreparedStatement cPS = getConnection().prepareStatement("INSERT INTO `" + prefix + "cells` (`name`, `jail`, `tp.x`, `tp.y`, `tp.z`, `tp.yaw`,"
+ "`tp.pitch`, `chest.x`, `chest.y`, `chest.z`, `signs`) VALUES (?,?,?,?,?,?,?,?,?,?,?)");
boolean hasId = c.getDatabaseID() != -1;
PreparedStatement cPS = getConnection().prepareStatement((hasId ? "REPLACE" : "INSERT")
+ " INTO `" + prefix + "cells` (" + (hasId ? "`cellid`, " : "")
+ "`name`, `jail`, `tp.x`, `tp.y`, `tp.z`, `tp.yaw`,"
+ "`tp.pitch`, `chest.x`, `chest.y`, `chest.z`, `signs`) VALUES ("
+ (hasId ? c.getDatabaseID() + "," : "") + "?,?,?,?,?,?,?,?,?,?,?)");
cPS.setString(1, c.getName());
cPS.setString(2, j.getName());

View File

@ -30,10 +30,11 @@ import com.graywolf336.jail.enums.Lang;
*
* @author graywolf336
* @since 2.x.x
* @version 3.0.0
* @version 3.1.0
*/
public class Util {
private final static Pattern DURATION_PATTERN = Pattern.compile("^(\\d+)\\s*(m(?:inute)?s?|h(?:ours?)?|d(?:ays?)?|s(?:econd)?s?)?$", Pattern.CASE_INSENSITIVE);
private static String[] signLines = new String[] { "", "", "", "" };
/**
* Checks if the first {@link Vector} is inside this region.
@ -72,7 +73,7 @@ public class Util {
point1 = second;
}
return (point1 <= loc) && (loc <= point2);
return point1 <= loc && loc <= point2;
}
/**
@ -169,6 +170,16 @@ public class Util {
return getColorfulMessage(msg);
}
/** Replaces all the variables in the messages with their possible values. */
public static String[] replaceAllVariables(Prisoner p, String... msgs) {
String[] results = new String[msgs.length];
for(int i = 0; i < msgs.length; i++)
results[i] = replaceAllVariables(p, msgs[i]);
return results;
}
/** Returns the wand used throughout the different creation steps. */
public static ItemStack getWand() {
ItemStack wand = new ItemStack(Material.WOOD_SWORD);
@ -271,7 +282,23 @@ public class Util {
sb.append(seconds);
sb.append("s");
return(sb.toString());
return sb.toString();
}
/**
* Updates the local cache of the lines which go on signs.
*
* @param lines array of string which go on signs, must contain exactly four.
* @throws Exception Throws an exception if there aren't exactly four lines.
*/
public static void updateSignLinesCache(String[] lines) throws Exception {
if(lines.length != 4) throw new Exception("Exactly four lines are required for the signs.");
signLines = lines;
}
/** Gets all the lines which go on the cell signs. */
public static String[] getSignLines() {
return signLines;
}
/**
@ -310,8 +337,8 @@ public class Util {
dataOutput.writeInt(items.length);
// Save every element in the list
for (int i = 0; i < items.length; i++) {
dataOutput.writeObject(items[i]);
for (ItemStack item : items) {
dataOutput.writeObject(item);
}
// Serialize that array

View File

@ -1,13 +1,27 @@
package com.graywolf336.jail.beans;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import org.bukkit.Location;
import org.bukkit.block.Chest;
import com.graywolf336.jail.interfaces.ICell;
/**
* Pass this an instance of this class into the jailing of a player and they go to any open cell.
*
* @author graywolf336
* @since 3.0.0
* @version 1.0.0
*
*/
public class AnyCell implements ICell {
public int getDatabaseID() {
throw new UnsupportedOperationException();
}
public String getName() {
throw new UnsupportedOperationException();
}
@ -48,6 +62,18 @@ public class AnyCell implements ICell {
throw new UnsupportedOperationException();
}
public List<String> getInvalidSigns() {
throw new UnsupportedOperationException();
}
public List<String> cleanSigns() {
throw new UnsupportedOperationException();
}
public HashMap<String, List<String>> updateSigns() {
throw new UnsupportedOperationException();
}
public void setTeleport(SimpleLocation location) {
throw new UnsupportedOperationException();
}

View File

@ -1,21 +1,29 @@
package com.graywolf336.jail.beans;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.BlockState;
import org.bukkit.block.Chest;
import org.bukkit.block.Sign;
import com.graywolf336.jail.Util;
import com.graywolf336.jail.enums.Lang;
import com.graywolf336.jail.interfaces.ICell;
/** Represents a Cell inside of a {@link Jail}.
*
* @author graywolf336
* @since 3.0.0
* @version 1.1.4
* @version 1.2.0
*/
public class Cell implements ICell {
private int databaseid;
private String name;
private Prisoner p;
private HashSet<SimpleLocation> signs;
@ -27,11 +35,29 @@ public class Cell implements ICell {
* @param name The name of the cell.
*/
public Cell(String name) {
this.databaseid = -1;
this.name = name;
this.signs = new HashSet<SimpleLocation>();
this.changed = false;
}
/**
* Creates a new Cell with the id in the database and the name.
*
* @param id The id of the cell in the database.
* @param name The name of the cell.
*/
public Cell(int id, String name) {
this.databaseid = id;
this.name = name;
this.signs = new HashSet<SimpleLocation>();
this.changed = false;
}
public int getDatabaseID() {
return this.databaseid;
}
public String getName() {
return this.name;
}
@ -86,6 +112,75 @@ public class Cell implements ICell {
return r;
}
public List<String> getInvalidSigns() {
List<String> invalid = new ArrayList<String>();
for(SimpleLocation s : new HashSet<SimpleLocation>(signs))
if (s.getLocation().getBlock().getState() instanceof Sign)
continue;
else
invalid.add(s.toString());
return invalid;
}
public List<String> cleanSigns() {
List<String> cleaned = new ArrayList<String>();
for(SimpleLocation s : new HashSet<SimpleLocation>(signs)) {
if (s.getLocation().getBlock().getState() instanceof Sign) {
continue;
}else {
changed = true;
signs.remove(s);
cleaned.add(s.toString());
}
}
return cleaned;
}
public HashMap<String, List<String>> updateSigns() {
List<String> removed = new ArrayList<String>();
List<String> updated = new ArrayList<String>();
for(SimpleLocation s : new HashSet<SimpleLocation>(signs)) {
BlockState bs = s.getLocation().getBlock().getState();
if (bs instanceof Sign) {
Sign sign = (Sign) bs;
if(hasPrisoner()) {
String[] lines = Util.replaceAllVariables(p, Util.getSignLines());
sign.setLine(0, lines[0]);
sign.setLine(1, lines[1]);
sign.setLine(2, lines[2]);
sign.setLine(3, lines[3]);
sign.update(true, false);
}else {
sign.setLine(0, "");
sign.setLine(1, Lang.CELLEMPTYSIGN.get());
sign.setLine(2, "");
sign.setLine(3, "");
sign.update(true, false);
}
updated.add(s.toString());
}else {
changed = true;
signs.remove(s);
removed.add(s.toString());
}
}
HashMap<String, List<String>> results = new HashMap<String, List<String>>();
results.put("removed", removed);
results.put("updated", updated);
return results;
}
public void setTeleport(SimpleLocation location) {
this.teleport = location;
this.changed = true;

View File

@ -1,13 +1,27 @@
package com.graywolf336.jail.beans;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import org.bukkit.Location;
import org.bukkit.block.Chest;
import com.graywolf336.jail.interfaces.ICell;
/**
* Pass this an instance of this class into the jailing of a player and they won't go into a cell.
*
* @author graywolf336
* @since 3.0.0
* @version 1.0.0
*
*/
public class NoCell implements ICell {
public int getDatabaseID() {
throw new UnsupportedOperationException();
}
public String getName() {
throw new UnsupportedOperationException();
}
@ -48,6 +62,18 @@ public class NoCell implements ICell {
throw new UnsupportedOperationException();
}
public List<String> getInvalidSigns() {
throw new UnsupportedOperationException();
}
public List<String> cleanSigns() {
throw new UnsupportedOperationException();
}
public HashMap<String, List<String>> updateSigns() {
throw new UnsupportedOperationException();
}
public void setTeleport(SimpleLocation location) {
throw new UnsupportedOperationException();
}

View File

@ -28,6 +28,7 @@ import com.graywolf336.jail.command.subcommands.JailMuteCommand;
import com.graywolf336.jail.command.subcommands.JailPayCommand;
import com.graywolf336.jail.command.subcommands.JailRecordCommand;
import com.graywolf336.jail.command.subcommands.JailReloadCommand;
import com.graywolf336.jail.command.subcommands.JailSignsCommand;
import com.graywolf336.jail.command.subcommands.JailStatusCommand;
import com.graywolf336.jail.command.subcommands.JailStickCommand;
import com.graywolf336.jail.command.subcommands.JailStopCommand;
@ -261,6 +262,7 @@ public class JailHandler {
load(JailPayCommand.class);
load(JailRecordCommand.class);
load(JailReloadCommand.class);
load(JailSignsCommand.class);
load(JailStatusCommand.class);
load(JailStickCommand.class);
load(JailStopCommand.class);

View File

@ -0,0 +1,140 @@
package com.graywolf336.jail.command.subcommands;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map.Entry;
import org.bukkit.command.CommandSender;
import org.bukkit.util.StringUtil;
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.command.Command;
import com.graywolf336.jail.command.CommandInfo;
import com.graywolf336.jail.enums.Lang;
@CommandInfo(
maxArgs = -1,
minimumArgs = 2,
needsPlayer = false,
pattern = "signs",
permission = "jail.command.jailsigns",
usage = "/jail signs [clean|refresh|verify] [jail] (cell)..."
)
public class JailSignsCommand implements Command {
private static final String[] options = new String[] { "clean", "refresh", "verify" };
public boolean execute(JailManager jm, CommandSender sender, String... args) throws Exception {
if(!jm.isValidJail(args[2])) {
sender.sendMessage(" " + Lang.NOJAIL.get(args[1]));
return true;
}
Jail j = jm.getJail(args[2]);
HashMap<String, List<String>> items = new HashMap<String, List<String>>();
if(args[1].equalsIgnoreCase("clean")) {
//if they type clean, we can remove all signs which are no longer signs
//then provide them a list of signs which got cleaned up
for(Cell c : j.getCells()) {
if(Util.isStringInsideArray(c.getName(), args) || args.length == 3) {
if(c.hasSigns()) {
List<String> cleaned = c.cleanSigns();
if(!cleaned.isEmpty()) {
items.put(c.getName(), cleaned);
}
}
}
}
if(items.isEmpty()) {
sender.sendMessage(Lang.NOINVALIDSIGNS.get());
}else {
sender.sendMessage(Lang.CLEANEDSIGNS.get());
for(Entry<String, List<String>> e : items.entrySet()) {
sender.sendMessage(" " + e.getKey());
for(String s : e.getValue())
sender.sendMessage(" Sign: " + s);
}
}
return true;
}else if(args[1].equalsIgnoreCase("refresh")) {
//if they type refresh, we will go through all the signs and update them to
//display the correct message on the sign whether empty or time
int cells = 0;
int updated = 0;
int removed = 0;
for(Cell c : j.getCells()) {
if(Util.isStringInsideArray(c.getName(), args) || args.length == 3) {
HashMap<String, List<String>> results = c.updateSigns();
updated += results.get("updated").size();
removed += results.get("removed").size();
cells++;
}
}
sender.sendMessage(Lang.SIGNSREFRESHED.get(new String[] { String.valueOf(updated), String.valueOf(removed), String.valueOf(cells) }));
return true;
}else if(args[1].equalsIgnoreCase("verify")) {
//if they type verify, we will go through all the signs and then provide them
//as a list of cells which have signs that aren't actually signs and provide
//the location where the signs are
for(Cell c : j.getCells()) {
if(Util.isStringInsideArray(c.getName(), args) || args.length == 3) {
List<String> invalids = c.getInvalidSigns();
if(!invalids.isEmpty()) {
items.put(c.getName(), invalids);
}
}
}
if(items.isEmpty()) {
sender.sendMessage(Lang.NOINVALIDSIGNS.get());
}else {
sender.sendMessage(Lang.INVALIDSIGNS.get());
for(Entry<String, List<String>> e : items.entrySet()) {
sender.sendMessage(" " + e.getKey());
for(String s : e.getValue())
sender.sendMessage(" " + Lang.SIGN.get() + ": " + s);
}
}
return true;
}else
return false;
}
public List<String> provideTabCompletions(JailManager jm, CommandSender sender, String... args) throws Exception {
List<String> results = new ArrayList<String>();
switch(args.length) {
case 2:
for(String s : options)
if(args[1].isEmpty() || StringUtil.startsWithIgnoreCase(s, args[1]))
results.add(s);
break;
case 3:
results.addAll(jm.getJailsByPrefix(args[2]));
break;
default:
if(jm.isValidJail(args[2]))
for(Cell c : jm.getJail(args[2]).getCells())
if(!Util.isStringInsideArray(c.getName(), args))
results.add(c.getName());
break;
}
Collections.sort(results);
return results;
}
}

View File

@ -133,6 +133,10 @@ public enum Lang {
CELLREMOVALUNSUCCESSFUL("general"),
/** The message sent whenever a cell is successfully removed. */
CELLREMOVED("general"),
/** The message sent when cleaning our cell signs. */
CLEANEDSIGNS("general"),
/** The message sent when seeing what signs are invalid. */
INVALIDSIGNS("general"),
/** The line on a cell's sign when the prisoner is jailed forever. */
JAILEDFOREVERSIGN("general"),
/** The simple word jailing to be put in other parts. */
@ -151,6 +155,8 @@ public enum Lang {
NOCELL("general"),
/** Message sent when needing a cell or something and there are no cells. */
NOCELLS("general"),
/** Message sent when no invalid signs were found. */
NOINVALIDSIGNS("general"),
/** The message sent whenever the sender does something which the jail does not found. */
NOJAIL("general"),
/** The message sent whenever the sender does something and there are no jails. */
@ -173,6 +179,10 @@ public enum Lang {
RECORDENTRY("general"),
/** The message format sent saying how many times a user has been jailed. */
RECORDTIMESJAILED("general"),
/** The simple word: sign. */
SIGN("general"),
/** The message sent when the signs are refreshed. */
SIGNSREFRESHED("general"),
/** The format of the time entry we should use for the record entries. */
TIMEFORMAT("general"),
/** The simple word transferring to be put in other parts. */

View File

@ -1,6 +1,8 @@
package com.graywolf336.jail.interfaces;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import org.bukkit.Location;
import org.bukkit.block.Chest;
@ -9,6 +11,9 @@ import com.graywolf336.jail.beans.Prisoner;
import com.graywolf336.jail.beans.SimpleLocation;
public interface ICell {
/** Gets the id of the cell in the database, <strong>internal usage only</strong> */
public int getDatabaseID();
/** Gets the name of the cell. */
public String getName();
@ -39,6 +44,19 @@ public interface ICell {
/** Returns the entire list of signs in a string. */
public String getSignString();
/** Gets a list of all the signs which are invalid (not signs anymore). */
public List<String> getInvalidSigns();
/** Removes all the signs which are no longer sign blocks. */
public List<String> cleanSigns();
/**
* Updates all the signs this cell has.
*
* @return collection of changes. The <strong>"removed"</strong> entry has all the signs which were removed. The <strong>"updated"</strong> entry has all the signs which got updated.
*/
public HashMap<String, List<String>> updateSigns();
/** Sets the location of where the prisoner will be teleported at when jailed here. */
public void setTeleport(SimpleLocation location);

View File

@ -1,20 +1,17 @@
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.JailPluginReloadedEvent;
import com.graywolf336.jail.events.PrePrisonerJailedEvent;
import com.graywolf336.jail.events.OfflinePrisonerJailedEvent;
import com.graywolf336.jail.events.PrisonerJailedEvent;
import com.graywolf336.jail.events.PrisonerReleasedEvent;
import com.graywolf336.jail.events.PrisonerTimeChangeEvent;
import com.graywolf336.jail.events.PrisonerTransferredEvent;
@ -31,6 +28,13 @@ public class CellSignListener implements Listener {
if(lines.size() >= 2) lineTwo = lines.get(1);
if(lines.size() >= 3) lineThree = lines.get(2);
if(lines.size() >= 4) lineFour = lines.get(3);
try {
Util.updateSignLinesCache(new String[] { lineOne, lineTwo, lineThree, lineFour });
}catch(Exception e) {
//this should never happen
pl.debug("Error on Cell Sign Listener constructor:" + e.getMessage());
}
}
@EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR)
@ -38,126 +42,46 @@ public class CellSignListener implements Listener {
pl.getServer().getScheduler().scheduleSyncDelayedTask(pl, new Runnable() {
public void run() {
if (event.hasCell() && event.getCell().hasSigns()) {
HashSet<SimpleLocation> signs = event.getCell().getSigns();
String s1 = Util.replaceAllVariables(event.getPrisoner(), lineOne);
String s2 = Util.replaceAllVariables(event.getPrisoner(), lineTwo);
String s3 = Util.replaceAllVariables(event.getPrisoner(), lineThree);
String s4 = Util.replaceAllVariables(event.getPrisoner(), lineFour);
for (SimpleLocation s : signs) {
if (s.getLocation().getBlock().getState() instanceof Sign) {
Sign sign = (Sign) s.getLocation().getBlock().getState();
sign.setLine(0, s1);
sign.setLine(1, s2);
sign.setLine(2, s3);
sign.setLine(3, s4);
sign.update();
} else {
// Remove the sign from the cell since it isn't
// a valid sign
event.getCell().getSigns().remove(s);
}
}
event.getCell().updateSigns();
}
}
});
}
@EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR)
public void changeCellSignsOnJail(PrePrisonerJailedEvent event) {
@EventHandler(priority = EventPriority.MONITOR)
public void changeSignsOnOfflineJailing(OfflinePrisonerJailedEvent event) {
if (event.hasCell() && event.getCell().hasSigns()) {
HashSet<SimpleLocation> signs = event.getCell().getSigns();
String s1 = Util.replaceAllVariables(event.getPrisoner(), lineOne);
String s2 = Util.replaceAllVariables(event.getPrisoner(), lineTwo);
String s3 = Util.replaceAllVariables(event.getPrisoner(), lineThree);
String s4 = Util.replaceAllVariables(event.getPrisoner(), lineFour);
event.getCell().updateSigns();
}
}
for (SimpleLocation s : signs) {
if (s.getLocation().getBlock().getState() instanceof Sign) {
Sign sign = (Sign) s.getLocation().getBlock().getState();
sign.setLine(0, s1);
sign.setLine(1, s2);
sign.setLine(2, s3);
sign.setLine(3, s4);
sign.update();
} else {
// Remove the sign from the cell since it isn't
// a valid sign
event.getCell().getSigns().remove(s);
}
}
@EventHandler(priority = EventPriority.MONITOR)
public void changeCellSignsOnJail(PrisonerJailedEvent event) {
if (event.hasCell() && event.getCell().hasSigns()) {
event.getCell().updateSigns();
}
}
@EventHandler
public void clearTheCellSigns(PrisonerReleasedEvent event) {
if (event.hasCell() && event.getCell().hasSigns()) {
HashSet<SimpleLocation> signs = event.getCell().getSigns();
for (SimpleLocation s : signs) {
if (s.getLocation().getBlock().getState() instanceof Sign) {
Sign sign = (Sign) s.getLocation().getBlock().getState();
sign.setLine(0, "");
sign.setLine(1, Lang.CELLEMPTYSIGN.get());
sign.setLine(2, "");
sign.setLine(3, "");
sign.update();
} else {
// Remove the sign from the cell since it isn't
// a valid sign
event.getCell().getSigns().remove(s);
}
}
event.getCell().updateSigns();
}
}
@EventHandler
public void handleSignsOnTransfer(PrisonerTransferredEvent event) {
if (event.hasOriginalCell() && event.getOriginalCell().hasSigns()) {
HashSet<SimpleLocation> signs = event.getOriginalCell().getSigns();
for (SimpleLocation s : signs) {
if (s.getLocation().getBlock().getState() instanceof Sign) {
Sign sign = (Sign) s.getLocation().getBlock().getState();
sign.setLine(0, "");
sign.setLine(1, Lang.CELLEMPTYSIGN.get());
sign.setLine(2, "");
sign.setLine(3, "");
sign.update();
} else {
// Remove the sign from the cell since it isn't
// a valid sign
event.getOriginalCell().getSigns().remove(s);
}
}
event.getOriginalCell().updateSigns();
}
if (event.hasTargetCell() && event.getTargetCell().hasSigns()) {
HashSet<SimpleLocation> signs = event.getTargetCell().getSigns();
String s1 = Util.replaceAllVariables(event.getPrisoner(), lineOne);
String s2 = Util.replaceAllVariables(event.getPrisoner(), lineTwo);
String s3 = Util.replaceAllVariables(event.getPrisoner(), lineThree);
String s4 = Util.replaceAllVariables(event.getPrisoner(), lineFour);
for (SimpleLocation s : signs) {
if (s.getLocation().getBlock().getState() instanceof Sign) {
Sign sign = (Sign) s.getLocation().getBlock().getState();
sign.setLine(0, s1);
sign.setLine(1, s2);
sign.setLine(2, s3);
sign.setLine(3, s4);
sign.update();
} else {
// Remove the sign from the cell since it isn't
// a valid sign
event.getTargetCell().getSigns().remove(s);
}
}
event.getTargetCell().updateSigns();
}
}
@EventHandler(priority = EventPriority.MONITOR)
public void handleSignLineUpdates(JailPluginReloadedEvent event) {
public void handleSignLineUpdates(JailPluginReloadedEvent event) throws Exception {
List<String> lines = pl.getConfig().getStringList(Settings.CELLSIGNLINES.getPath());
//Reset the lines to nothing
@ -170,5 +94,7 @@ public class CellSignListener implements Listener {
if(lines.size() >= 2) lineTwo = lines.get(1);
if(lines.size() >= 3) lineThree = lines.get(2);
if(lines.size() >= 4) lineFour = lines.get(3);
Util.updateSignLinesCache(new String[] { lineOne, lineTwo, lineThree, lineFour });
}
}

View File

@ -17,6 +17,8 @@ language:
cellemptysign: 'Empty cell'
cellremovalunsuccessful: '&cThe removal of cell %0% from jail %1% was unsuccessful because there is a prisoner in there still. Release or transfer before trying to remove the cell again.'
cellremoved: '&9Cell %0% has been successfully removed from the jail %1%.'
cleanedsigns: '&aThe following signs were successfully cleaned:'
invalidsigns: '&cThe following signs are invalid:'
jailedforeversign: '&cfor life'
jailing: '&9jailing'
jailremovalunsuccessful: '&cThe removal of the jail %0% was unsuccessful because there are prisoners in there, please release or transfer them first.'
@ -26,6 +28,7 @@ language:
jailstickusagedisabled: '&cThe usage of Jail Sticks has been disabled by the Administrator.'
nocell: '&cNo cell found by the name of %0% in the jail %1%.'
nocells: '&cNo cells found in the jail %0%.'
noinvalidsigns: '&aNo invalid signs were found.'
nojail: '&cNo jail found by the name of %0%.'
nojails: '&cThere are currently no jails.'
nopermission: '&cInsufficient permission.'
@ -37,6 +40,8 @@ language:
prisonerscleared: '&cAll the prisoners from %0% have been cleared.'
recordentry: '&7[%0%]: &9%1% &fjailed by &9%2% &ffor &9%3% &fminutes with a reason of &9%4%&f. [%5%]'
recordtimesjailed: '&c%0% has been jailed &a%1% &ctimes.'
sign: 'Sign'
signsrefreshed: '&aWe have successfully refreshed %0% signs and removed %1% signs in %2% cells.'
timeformat: "MM/dd/yyyy HH:mm:ss"
transferring: '&9transferring'
unknowncommand: '&cNo commands registered by the name of %0%.'

View File

@ -50,6 +50,7 @@ permissions:
jail.command.jailmute: true
jail.command.jailrecord: true
jail.command.jailreload: true
jail.command.jailsigns: true
jail.command.jailstop: true
jail.command.jailtelein: true
jail.command.jailteleout: true
@ -106,6 +107,8 @@ permissions:
default: op
jail.command.jailmute:
default: op
jail.command.jailsigns:
default: op
jail.command.jailstop:
default: op
jail.command.jailset: