Skip to content

Commit 153ad5f

Browse files
fix errors when using regex expressions in executing command
1 parent 9e5b5b5 commit 153ad5f

File tree

6 files changed

+10
-6
lines changed

6 files changed

+10
-6
lines changed

CommandWhitelistBukkit/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>eu.endermite.commandwhitelist</groupId>
88
<artifactId>CommandWhitelist</artifactId>
9-
<version>2.5.2</version>
9+
<version>2.5.3</version>
1010
</parent>
1111

1212
<artifactId>Bukkit</artifactId>

CommandWhitelistBukkit/src/main/java/eu/endermite/commandwhitelist/bukkit/listeners/PlayerCommandPreProcessListener.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@ public void PlayerCommandSendEvent(org.bukkit.event.player.PlayerCommandPreproce
2020
if (player.hasPermission(CWPermission.BYPASS.permission())) return;
2121
String caseSensitiveLabel = CommandUtil.getCommandLabel(event.getMessage());
2222
String label = caseSensitiveLabel.toLowerCase();
23-
event.setMessage(event.getMessage().replaceFirst(caseSensitiveLabel, label));
23+
24+
String fullCommand = event.getMessage().substring(label.length()+1);
25+
fullCommand = "/"+label+fullCommand;
26+
27+
event.setMessage(fullCommand);
2428
BukkitAudiences audiences = CommandWhitelistBukkit.getAudiences();
2529
ConfigCache config = CommandWhitelistBukkit.getConfigCache();
2630

CommandWhitelistCommon/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>eu.endermite.commandwhitelist</groupId>
88
<artifactId>CommandWhitelist</artifactId>
9-
<version>2.5.2</version>
9+
<version>2.5.3</version>
1010
</parent>
1111

1212
<artifactId>Common</artifactId>

CommandWhitelistVelocity/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>eu.endermite.commandwhitelist</groupId>
88
<artifactId>CommandWhitelist</artifactId>
9-
<version>2.5.2</version>
9+
<version>2.5.3</version>
1010
</parent>
1111

1212
<artifactId>Velocity</artifactId>

CommandWhitelistWaterfall/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>eu.endermite.commandwhitelist</groupId>
88
<artifactId>CommandWhitelist</artifactId>
9-
<version>2.5.2</version>
9+
<version>2.5.3</version>
1010
</parent>
1111

1212
<artifactId>Waterfall</artifactId>

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>eu.endermite.commandwhitelist</groupId>
88
<artifactId>CommandWhitelist</artifactId>
9-
<version>2.5.2</version>
9+
<version>2.5.3</version>
1010
<modules>
1111
<module>CommandWhitelistCommon</module>
1212
<module>CommandWhitelistBukkit</module>

0 commit comments

Comments
 (0)