Skip to content

Commit

Permalink
修复配方getResultItem
Browse files Browse the repository at this point in the history
  • Loading branch information
DancingSnow0517 committed Sep 26, 2024
1 parent c3019ba commit a9b0949
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ protected void init() {
MultiblockRecipe recipe = toRecipe();
if (recipe != null) {
ItemStack result = recipe.getResult();
// "MultiblockRecipe.builder(\"%s\", %d)".formatted(BuiltInRegistries.ITEM.getKey(result.getItem()),
// result.getCount())
StringBuilder codeBuilder = new StringBuilder("MultiblockRecipe.builder(\"%s\", %d)"
.formatted(BuiltInRegistries.ITEM.getKey(result.getItem()), result.getCount()));
codeBuilder.append("\n");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public boolean canCraftInDimensions(int pWidth, int pHeight) {

@Override
public ItemStack getResultItem(HolderLookup.Provider pRegistries) {
return results.getFirst();
return results.isEmpty() ? ItemStack.EMPTY : results.getFirst();
}

@Override
Expand All @@ -53,7 +53,7 @@ public boolean matches(ItemProcessInput pInput, Level pLevel) {

@Override
public ItemStack assemble(ItemProcessInput pInput, HolderLookup.Provider pRegistries) {
return this.results.getFirst();
return results.isEmpty() ? ItemStack.EMPTY : results.getFirst();
}

public int getMaxCraftTime(ItemProcessInput pInput) {
Expand Down

0 comments on commit a9b0949

Please sign in to comment.