Skip to content

Commit

Permalink
Fixed potential crash with json recipes
Browse files Browse the repository at this point in the history
  • Loading branch information
LatvianModder committed Apr 9, 2024
1 parent caa37aa commit 1a061de
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import dev.latvian.mods.kubejs.util.UtilsJS;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.crafting.Ingredient;
import net.minecraft.world.item.crafting.Recipe;

public class JsonRecipeJS extends RecipeJS {
@Override
Expand Down Expand Up @@ -37,7 +36,7 @@ public boolean replaceInput(ReplacementMatch match, InputReplacement with) {
@SuppressWarnings("ConstantValue")
public boolean hasOutput(ReplacementMatch match) {
if (CommonProperties.get().matchJsonRecipes && match instanceof ItemMatch m && getOriginalRecipe() != null) {
var result = ((Recipe<?>) this).getResultItem(UtilsJS.staticRegistryAccess);
var result = getOriginalRecipe().getResultItem(UtilsJS.staticRegistryAccess);
return result != null && result != ItemStack.EMPTY && !result.isEmpty() && m.contains(result);
}

Expand Down

0 comments on commit 1a061de

Please sign in to comment.