Skip to content

Commit 67ca2c2

Browse files
lowercase command label
1 parent 99f7c24 commit 67ca2c2

File tree

7 files changed

+13
-9
lines changed

7 files changed

+13
-9
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.0</version>
9+
<version>2.5.1</version>
1010
</parent>
1111

1212
<artifactId>Bukkit</artifactId>

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ public class PlayerCommandPreProcessListener implements Listener {
1717
public void PlayerCommandSendEvent(org.bukkit.event.player.PlayerCommandPreprocessEvent event) {
1818
Player player = event.getPlayer();
1919
if (player.hasPermission("commandwhitelist.bypass")) return;
20-
String label = CommandUtil.getCommandLabel(event.getMessage().toLowerCase());
20+
String caseSensitiveLabel = CommandUtil.getCommandLabel(event.getMessage());
21+
String label = caseSensitiveLabel.toLowerCase();
22+
event.setMessage(event.getMessage().replaceFirst(caseSensitiveLabel, label));
2123
BukkitAudiences audiences = CommandWhitelistBukkit.getAudiences();
2224
ConfigCache config = CommandWhitelistBukkit.getConfigCache();
2325

CommandWhitelistBukkit/src/main/java/eu/endermite/commandwhitelist/bukkit/listeners/protocollib/PacketCommandPreProcessListener.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,11 @@ public void onPacketReceiving(PacketEvent event) {
3434
if (!string.startsWith("/")) return;
3535
Player player = event.getPlayer();
3636
if (player.hasPermission(CWPermission.BYPASS.permission())) return;
37-
3837
ConfigCache config = CommandWhitelistBukkit.getConfigCache();
39-
String label = CommandUtil.getCommandLabel(string.toLowerCase());
38+
String caseSensitiveLabel = CommandUtil.getCommandLabel(string);
39+
String label = caseSensitiveLabel.toLowerCase();
40+
packet.getStrings().write(0, string.replaceFirst(caseSensitiveLabel, label));
41+
4042
HashSet<String> commands = CommandWhitelistBukkit.getCommands(player);
4143
BukkitAudiences audiences = CommandWhitelistBukkit.getAudiences();
4244
if (!commands.contains(label)) {

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.0</version>
9+
<version>2.5.1</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.0</version>
9+
<version>2.5.1</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.0</version>
9+
<version>2.5.1</version>
1010
</parent>
1111

1212
<artifactId>Waterfall</artifactId>

pom.xml

Lines changed: 2 additions & 2 deletions
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.0</version>
9+
<version>2.5.1</version>
1010
<modules>
1111
<module>CommandWhitelistCommon</module>
1212
<module>CommandWhitelistBukkit</module>
@@ -46,7 +46,7 @@
4646
</goals>
4747
<configuration>
4848
<createDependencyReducedPom>false</createDependencyReducedPom>
49-
<finalName>${project.name}-${project.parent.version}</finalName>
49+
<finalName>${project.name}-${project.version}</finalName>
5050
</configuration>
5151
</execution>
5252
</executions>

0 commit comments

Comments
 (0)