From eb0c3ba46cfc9658a79871f42dffb7434900ef30 Mon Sep 17 00:00:00 2001 From: EpicKnarvik97 Date: Fri, 11 Mar 2022 12:10:42 +0100 Subject: [PATCH] Fixes a bug when calling jail with the jail prefix --- src/main/java/com/graywolf336/jail/Update.java | 4 ++-- .../com/graywolf336/jail/command/subcommands/JailCommand.java | 2 ++ src/main/resources/config.yml | 4 ++-- src/main/resources/plugin.yml | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/graywolf336/jail/Update.java b/src/main/java/com/graywolf336/jail/Update.java index 5b95165..78975f5 100644 --- a/src/main/java/com/graywolf336/jail/Update.java +++ b/src/main/java/com/graywolf336/jail/Update.java @@ -74,7 +74,7 @@ public class Update { // Parse the current build number to a number long curr = Long.parseLong(ver[ver.length - 1]); - plugin.debug(number + " verus " + curr); + plugin.debug(number + " versus " + curr); // Check if the build on the CI server is higher than the one we're running needed = number > curr; @@ -100,7 +100,7 @@ public class Update { // 3.0.0-SNAPSHOT-b0 String currentVer = plugin.getDescription().getVersion().split("-")[0]; - plugin.debug(remoteVer + " verus " + currentVer); + plugin.debug(remoteVer + " versus " + currentVer); this.needed = this.versionCompare(remoteVer, currentVer) > 0; if (needed) { diff --git a/src/main/java/com/graywolf336/jail/command/subcommands/JailCommand.java b/src/main/java/com/graywolf336/jail/command/subcommands/JailCommand.java index d9b5c93..a17fb25 100644 --- a/src/main/java/com/graywolf336/jail/command/subcommands/JailCommand.java +++ b/src/main/java/com/graywolf336/jail/command/subcommands/JailCommand.java @@ -36,6 +36,7 @@ import java.util.List; usage = "/jail [name] (-t time) (-j JailName) (-c CellName) (-a AnyCell) (-m Muted) (-r A reason for jailing)" ) public class JailCommand implements Command { + private static final String noJailPermission = "jail.cantbejailed"; private final List commands = Arrays.asList("p", "t", "i", "j", "c", "a", "m", "r", "f"); @@ -64,6 +65,7 @@ public class JailCommand implements Command { if (!arguments.contains("-p")) { arguments.add(0, "-p"); } + arguments.removeIf(String::isEmpty); Jailing params; diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 3ce66fe..9d0f2a6 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -20,10 +20,10 @@ jailing: during: blockBreakPenalty: 5m blockBreakProtection: true - blockBreakWhiteList: [ 'wheat', 'carrot', 'potato' ] # these blocks can be broken at any time by prisoners + blockBreakWhiteList: [ 'wheat', 'carrot', 'potato', 'beetroot', 'glow_berries' ] # these blocks can be broken at any time by prisoners blockPlacePenalty: 5m blockPlaceProtection: true - blockPlaceWhiteList: [ 'wheat', 'carrot', 'potato' ] # these blocks can be placed at any time by prisoners + blockPlaceWhiteList: [ 'wheat', 'carrot', 'potato', 'beetroot', 'glow_berries' ] # these blocks can be placed at any time by prisoners cellsign: - '%player%' - '%prettytime%' diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index a5ef576..8cc8bb5 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -6,7 +6,7 @@ authors: [ graywolf336 ] website: dev.bukkit.org/server-mods/jail/ softdepend: [ WorldEdit, Vault, Multiverse-Core ] load: POSTWORLD -api-version: 1.17 +api-version: 1.18 commands: jail: