Skip to content

Commit

Permalink
Fix old config files not accepted by validator due to missing origina…
Browse files Browse the repository at this point in the history
…l stack
  • Loading branch information
WolfyScript committed Jan 5, 2024
1 parent dc8631e commit 21ac468
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,12 @@ static <T extends RecipeItemStack> Validator<T> validatorFor() {
.forEach(apiReferenceInitStep -> apiReferenceInitStep.def()
.validate(container -> container.value()
.map(reference -> {
if (!ItemUtils.isAirOrNull(reference.referencedStack())) {
return container.update().type(ValidationContainer.ResultType.VALID);
if (reference.identifier().isEmpty()) {
return container.update().type(ValidationContainer.ResultType.PENDING).fault(MISSING_THIRD_PARTY);
}
if (ItemUtils.isAirOrNull(reference.originalStack())) {
return container.update().type(ValidationContainer.ResultType.INVALID).fault(INVALID_ITEM);
}
return container.update().type(ValidationContainer.ResultType.PENDING).fault(MISSING_THIRD_PARTY);
// TODO: Find a better workaround
// For now, ignore reference original stack check, to allow old config files.
return container.update().type(ValidationContainer.ResultType.VALID);
}).orElseGet(() -> container.update().type(ValidationContainer.ResultType.INVALID).fault(NULL_ITEM))
))
.optional()
Expand Down

0 comments on commit 21ac468

Please sign in to comment.