mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-01-11 01:42:52 +08:00
Move command prefix stripping to ChatManager
This commit is contained in:
parent
82ec63c4e4
commit
5aba7da7ef
@ -113,10 +113,6 @@ public final class CommandMap {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove prefix if present.
|
|
||||||
if (!Character.isLetter(rawMessage.charAt(0)))
|
|
||||||
rawMessage = rawMessage.substring(1);
|
|
||||||
|
|
||||||
// Parse message.
|
// Parse message.
|
||||||
String[] split = rawMessage.split(" ");
|
String[] split = rawMessage.split(" ");
|
||||||
List<String> args = new LinkedList<>(Arrays.asList(split));
|
List<String> args = new LinkedList<>(Arrays.asList(split));
|
||||||
|
@ -34,7 +34,7 @@ public class ChatManager {
|
|||||||
|
|
||||||
// Check if command
|
// Check if command
|
||||||
if (PREFIXES.contains(message.charAt(0))) {
|
if (PREFIXES.contains(message.charAt(0))) {
|
||||||
CommandMap.getInstance().invoke(player, target, message);
|
CommandMap.getInstance().invoke(player, target, message.substring(1));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user