Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
ziqian zhang
Grasscutter
Commits
5aba7da7
Commit
5aba7da7
authored
May 04, 2022
by
AnimeGitB
Committed by
Melledy
May 05, 2022
Browse files
Move command prefix stripping to ChatManager
parent
82ec63c4
Changes
2
Show whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/command/CommandMap.java
View file @
5aba7da7
...
...
@@ -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
<
String
>
args
=
new
LinkedList
<>(
Arrays
.
asList
(
split
));
...
...
src/main/java/emu/grasscutter/game/managers/ChatManager.java
View file @
5aba7da7
...
...
@@ -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
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment