Skip to content
This repository was archived by the owner on Mar 6, 2021. It is now read-only.

Commit f555c4e

Browse files
author
Kier Davis
committed
Possible fix of multiple-worded commands issue
1 parent cd13b16 commit f555c4e

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

data/plugin.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: UltraCommand
2-
version: 0.5.3
2+
version: 0.5.4
33
author: Kier Davis <kierdavis@gmail.com>
44

55
main: com.kierdavis.ultracommand.UltraCommand

src/UltraCommand.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -319,9 +319,9 @@ public boolean doCommand(Player player, String[] parts) {
319319
StringBuilder b = new StringBuilder();
320320
b.append(parts[0]);
321321

322-
for (int i = 1; i < parts.length; i++) {
322+
for (int i = 0; i < parts.length; i++) {
323323
String thisCmdName = b.toString().replaceAll(" ", "_");
324-
CustomCommandContext thisCCC = getCustomCommandContext(cmdName, player, Arrays.copyOfRange(parts, i, parts.length));
324+
CustomCommandContext thisCCC = getCustomCommandContext(cmdName, player, Arrays.copyOfRange(parts, i+1, parts.length));
325325

326326
if (thisCCC != null) {
327327
cmdName = thisCmdName;
@@ -333,7 +333,8 @@ public boolean doCommand(Player player, String[] parts) {
333333
getLogger().info(cmdName.toString());
334334
getLogger().info(thisCmdName.toString());
335335

336-
b.append(" ").append(parts[i]);
336+
if (i > 0) b.append(" ");
337+
b.append(parts[i]);
337338
}
338339

339340
if (ccc != null) {

0 commit comments

Comments
 (0)