Skip to content

Commit

Permalink
fix errors when using regex expressions in executing command
Browse files Browse the repository at this point in the history
  • Loading branch information
YouHaveTrouble committed Oct 8, 2022
1 parent 9e5b5b5 commit 153ad5f
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CommandWhitelistBukkit/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>eu.endermite.commandwhitelist</groupId>
<artifactId>CommandWhitelist</artifactId>
<version>2.5.2</version>
<version>2.5.3</version>
</parent>

<artifactId>Bukkit</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ public void PlayerCommandSendEvent(org.bukkit.event.player.PlayerCommandPreproce
if (player.hasPermission(CWPermission.BYPASS.permission())) return;
String caseSensitiveLabel = CommandUtil.getCommandLabel(event.getMessage());
String label = caseSensitiveLabel.toLowerCase();
event.setMessage(event.getMessage().replaceFirst(caseSensitiveLabel, label));

String fullCommand = event.getMessage().substring(label.length()+1);
fullCommand = "/"+label+fullCommand;

event.setMessage(fullCommand);
BukkitAudiences audiences = CommandWhitelistBukkit.getAudiences();
ConfigCache config = CommandWhitelistBukkit.getConfigCache();

Expand Down
2 changes: 1 addition & 1 deletion CommandWhitelistCommon/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>eu.endermite.commandwhitelist</groupId>
<artifactId>CommandWhitelist</artifactId>
<version>2.5.2</version>
<version>2.5.3</version>
</parent>

<artifactId>Common</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion CommandWhitelistVelocity/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>eu.endermite.commandwhitelist</groupId>
<artifactId>CommandWhitelist</artifactId>
<version>2.5.2</version>
<version>2.5.3</version>
</parent>

<artifactId>Velocity</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion CommandWhitelistWaterfall/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>eu.endermite.commandwhitelist</groupId>
<artifactId>CommandWhitelist</artifactId>
<version>2.5.2</version>
<version>2.5.3</version>
</parent>

<artifactId>Waterfall</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>eu.endermite.commandwhitelist</groupId>
<artifactId>CommandWhitelist</artifactId>
<version>2.5.2</version>
<version>2.5.3</version>
<modules>
<module>CommandWhitelistCommon</module>
<module>CommandWhitelistBukkit</module>
Expand Down

0 comments on commit 153ad5f

Please sign in to comment.