Skip to content

Commit

Permalink
fix: missing orElse
Browse files Browse the repository at this point in the history
  • Loading branch information
bconlon1 committed Feb 23, 2024
1 parent 01a7187 commit e340178
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@ public BlockStateRecipeSerializer(Function3<BlockStateIngredient, BlockPropertyP
this.flatCodec = RecordCodecBuilder.mapCodec(inst -> inst.group(
BlockStateIngredient.CODEC.fieldOf("ingredient").forGetter(AbstractBlockStateRecipe::getIngredient),
BlockPropertyPair.BLOCKSTATE_CODEC.fieldOf("result").forGetter(AbstractBlockStateRecipe::getResult),
Codec.STRING.fieldOf("mcfunction").forGetter(AbstractBlockStateRecipe::getFunctionString)
Codec.STRING.fieldOf("mcfunction").orElse("").forGetter(AbstractBlockStateRecipe::getFunctionString)
).apply(inst, this.factory));

this.codec = this.flatCodec.codec();
}

public MapCodec<T> flatCodec() {
return this.flatCodec;
}
Expand Down

0 comments on commit e340178

Please sign in to comment.