From 5aba7da7eff974c743611767f714096d3301c055 Mon Sep 17 00:00:00 2001 From: AnimeGitB Date: Wed, 4 May 2022 17:21:15 +0930 Subject: [PATCH] Move command prefix stripping to ChatManager --- src/main/java/emu/grasscutter/command/CommandMap.java | 4 ---- src/main/java/emu/grasscutter/game/managers/ChatManager.java | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/main/java/emu/grasscutter/command/CommandMap.java b/src/main/java/emu/grasscutter/command/CommandMap.java index 26a3552e8..a5386809f 100644 --- a/src/main/java/emu/grasscutter/command/CommandMap.java +++ b/src/main/java/emu/grasscutter/command/CommandMap.java @@ -113,10 +113,6 @@ public final class CommandMap { return; } - // Remove prefix if present. - if (!Character.isLetter(rawMessage.charAt(0))) - rawMessage = rawMessage.substring(1); - // Parse message. String[] split = rawMessage.split(" "); List args = new LinkedList<>(Arrays.asList(split)); diff --git a/src/main/java/emu/grasscutter/game/managers/ChatManager.java b/src/main/java/emu/grasscutter/game/managers/ChatManager.java index 3236e6f35..7377717a5 100644 --- a/src/main/java/emu/grasscutter/game/managers/ChatManager.java +++ b/src/main/java/emu/grasscutter/game/managers/ChatManager.java @@ -34,7 +34,7 @@ public class ChatManager { // Check if command if (PREFIXES.contains(message.charAt(0))) { - CommandMap.getInstance().invoke(player, target, message); + CommandMap.getInstance().invoke(player, target, message.substring(1)); return; }