Skip to content

Commit 3661194

Browse files
authored
Fix usage of addCreativeItem by plugin causing players not being able to join
1 parent b910257 commit 3661194

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/main/java/cn/nukkit/item/Item.java

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ public static void initCreativeItems() {
442442
throw new IllegalStateException("Implementation of " + definition.getIdentifier() + " does not implement CustomItem");
443443
}
444444

445-
addCreativeItem(item, definition.getCreativeCategory(), definition.getCreativeGroup() == null ? "" : definition.getCreativeGroup());
445+
Item.CREATIVE_ITEMS.add(item, definition.getCreativeCategory(), definition.getCreativeGroup() == null ? "" : definition.getCreativeGroup());
446446
} catch (Exception e) {
447447
throw new RuntimeException(e);
448448
}
@@ -465,12 +465,7 @@ public static ArrayList<Item> getCreativeItems() {
465465
}
466466

467467
public static void addCreativeItem(Item item) {
468-
addCreativeItem(item, ItemDefinition.CreativeCategory.ALL, "");
469-
}
470-
471-
private static void addCreativeItem(Item item, ItemDefinition.CreativeCategory category, String group) {
472-
Item.CREATIVE_ITEMS.add(item.clone(), category, group);
473-
468+
Item.CREATIVE_ITEMS.add(item.clone());
474469
}
475470

476471
public static void removeCreativeItem(Item item) {
@@ -1394,7 +1389,7 @@ public void clear() {
13941389
}
13951390

13961391
public void add(Item item) {
1397-
add(item, ItemDefinition.CreativeCategory.ALL, ""); // TODO: vanilla items back to correct groups
1392+
add(item, ItemDefinition.CreativeCategory.ITEMS, ""); // TODO: vanilla items back to correct categories & groups
13981393
}
13991394

14001395
public void add(Item item, CreativeItemGroup group) {

0 commit comments

Comments
 (0)