File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
src/main/java/ch/njol/skript/structures Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -82,10 +82,9 @@ public class StructCommand extends Structure {
82
82
83
83
public static final Priority PRIORITY = new Priority (500 );
84
84
85
- private static final Pattern
86
- COMMAND_PATTERN = Pattern .compile ("(?i)^command /?(\\ S+)\\ s*(\\ s+(.+))?$" ),
87
- ARGUMENT_PATTERN = Pattern .compile ("<\\ s*(?:([^>]+?)\\ s*:\\ s*)?(.+?)\\ s*(?:=\\ s*(" + SkriptParser .wildcard + "))?\\ s*>" ),
88
- DESCRIPTION_PATTERN = Pattern .compile ("(?<!\\ \\ )%-?(.+?)%" );
85
+ private static final Pattern COMMAND_PATTERN = Pattern .compile ("(?i)^command\\ s+/?(\\ S+)\\ s*(\\ s+(.+))?$" );
86
+ private static final Pattern ARGUMENT_PATTERN = Pattern .compile ("<\\ s*(?:([^>]+?)\\ s*:\\ s*)?(.+?)\\ s*(?:=\\ s*(" + SkriptParser .wildcard + "))?\\ s*>" );
87
+ private static final Pattern DESCRIPTION_PATTERN = Pattern .compile ("(?<!\\ \\ )%-?(.+?)%" );
89
88
90
89
private static final AtomicBoolean SYNC_COMMANDS = new AtomicBoolean ();
91
90
@@ -184,7 +183,10 @@ public boolean load() {
184
183
185
184
Matcher matcher = COMMAND_PATTERN .matcher (fullCommand );
186
185
boolean matches = matcher .matches ();
187
- assert matches ;
186
+ if (!matches ) {
187
+ Skript .error ("Invalid command structure pattern" );
188
+ return false ;
189
+ }
188
190
189
191
String command = matcher .group (1 ).toLowerCase ();
190
192
ScriptCommand existingCommand = Commands .getScriptCommand (command );
You can’t perform that action at this time.
0 commit comments