Skip to content

Commit

Permalink
Fix not having a custom item breaking JEI State
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredlll08 committed Jun 26, 2021
1 parent 895ad88 commit 264ddde
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/main/java/com/blamejared/jeitweaker/JEIAddonPlugin.java
Expand Up @@ -43,6 +43,9 @@ public void registerItemSubtypes(ISubtypeRegistration registration) {
.map(iItemStack -> iItemStack.getInternal().getItem())
.distinct()
.toArray(Item[]::new);
if(items.length == 0){
return;
}
registration.useNbtForSubtypes(items);
}

Expand Down Expand Up @@ -97,10 +100,12 @@ public void onRuntimeAvailable(IJeiRuntime iJeiRuntime) {
}
});

iJeiRuntime.getIngredientManager()
.addIngredientsAtRuntime(VanillaTypes.ITEM, JEIManager.CUSTOM_ITEMS.stream()
.map(IItemStack::getInternal)
.collect(Collectors.toList()));
if(!JEIManager.CUSTOM_ITEMS.isEmpty()) {
iJeiRuntime.getIngredientManager()
.addIngredientsAtRuntime(VanillaTypes.ITEM, JEIManager.CUSTOM_ITEMS.stream()
.map(IItemStack::getInternal)
.collect(Collectors.toList()));
}


JEI_CATEGORIES.clear();
Expand Down

0 comments on commit 264ddde

Please sign in to comment.