Skip to content
This repository was archived by the owner on Jun 3, 2024. It is now read-only.

Commit fd38a84

Browse files
committed
Add PatchworkItemGroup constructor for (int, String)
1 parent ae3b817 commit fd38a84

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

patchwork-dispatcher/src/main/java/com/patchworkmc/api/redirects/itemgroup/PatchworkItemGroup.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,14 @@ public PatchworkItemGroup(String name) {
2929
super(getNewArrayIndex(), name);
3030
}
3131

32+
public PatchworkItemGroup(int index, String name) {
33+
this(name);
34+
35+
if (index != -1) {
36+
throw new IllegalArgumentException("ItemGroup constructor potentially tried to overwrite an existing creative tab!");
37+
}
38+
}
39+
3240
private static int getNewArrayIndex() {
3341
// Get a new slot in the array
3442

0 commit comments

Comments
 (0)