Skip to content

Commit 41b2476

Browse files
authored
Fix MMO-Items not working when item id contains colon(s). (#194)
1 parent a465d9a commit 41b2476

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/com/extendedclip/deluxemenus/hooks/MMOItemsHook.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public ItemStack getItem(@NotNull final String... arguments) {
3535
return cached.clone();
3636
}
3737

38-
String[] splitArgs = arguments[0].split(":");
38+
String[] splitArgs = arguments[0].split(":", 2);
3939
if (splitArgs.length != 2) {
4040
return new ItemStack(Material.STONE, 1);
4141
}
@@ -70,7 +70,7 @@ public boolean itemMatchesIdentifiers(@NotNull ItemStack item, @NotNull String..
7070
if (arguments.length == 0) {
7171
return false;
7272
}
73-
String[] splitArgs = arguments[0].split(":");
73+
String[] splitArgs = arguments[0].split(":", 2);
7474
if (splitArgs.length != 2) return false;
7575
return splitArgs[0].equalsIgnoreCase(MMOItems.getTypeName(item)) && splitArgs[1].equalsIgnoreCase(MMOItems.getID(item));
7676
}

0 commit comments

Comments
 (0)