From 614da20df8379f2813d7a67b9c0d7799c193c591 Mon Sep 17 00:00:00 2001 From: Andreas Troelsen Date: Thu, 1 Jul 2021 21:19:25 +0200 Subject: [PATCH] Make `/ma playerlist` pattern less greedy. This commit changes the pattern of the player list command to one that isn't quite as greedy. This change is enough to fix issue #676 and thus allow MobArenaStats to take control of its own command. The command framework could definitely do with a bit of a rework away from pattern matching towards aliases, which would prevent similar issues from cropping up down the line. For now, this is good enough. Fixes #676 --- changelog.md | 2 ++ .../garbagemule/MobArena/commands/user/PlayerListCommand.java | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index c360d47..bca9995 100644 --- a/changelog.md +++ b/changelog.md @@ -11,6 +11,8 @@ These changes will (most likely) be included in the next version. ## [Unreleased] +### Changed +- The regex pattern for the player list command is now less greedy, so it will only match on `/ma players`, `/ma playerlist`, and `/ma player-list`. The previous pattern matched on anything that starts with `player`, which rendered the `/ma player-stats` command in MobArenaStats impossible to invoke. ## [0.106] - 2021-05-09 ### Added diff --git a/src/main/java/com/garbagemule/MobArena/commands/user/PlayerListCommand.java b/src/main/java/com/garbagemule/MobArena/commands/user/PlayerListCommand.java index 824f6c0..a7acbf4 100644 --- a/src/main/java/com/garbagemule/MobArena/commands/user/PlayerListCommand.java +++ b/src/main/java/com/garbagemule/MobArena/commands/user/PlayerListCommand.java @@ -14,7 +14,7 @@ import java.util.List; @CommandInfo( name = "playerlist", - pattern = "player.*|listp.*", + pattern = "players|playerlist|player-list", usage = "/ma players ()", desc = "lists players in an arena", permission = "mobarena.use.playerlist"