Skip to content

Commit

Permalink
feat: improve polymorphism on recipe results
Browse files Browse the repository at this point in the history
  • Loading branch information
klikli-dev committed Jul 23, 2024
1 parent e891022 commit 033936c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public RecipeResultType<?> getType() {
}

@Override
public RecipeResult copyWithCount(int count) {
public ItemRecipeResult copyWithCount(int count) {
return new ItemRecipeResult(this.stack.copyWithCount(count));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public RecipeResultType<?> getType() {
}

@Override
public RecipeResult copyWithCount(int count) {
public TagRecipeResult copyWithCount(int count) {
return new TagRecipeResult(this.tag, count, this.patch);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ public RecipeResultType<?> getType() {
}

@Override
public RecipeResult copyWithCount(int count) {
public WeightedItemRecipeResult copyWithCount(int count) {
return new WeightedItemRecipeResult(this.stack.copyWithCount(count), this.weight.asInt());
}

@Override
public RecipeResult copyWithWeight(int weight) {
public WeightedItemRecipeResult copyWithWeight(int weight) {
return new WeightedItemRecipeResult(this.stack, weight);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,12 @@ public RecipeResultType<?> getType() {
}

@Override
public RecipeResult copyWithCount(int count) {
public WeightedTagRecipeResult copyWithCount(int count) {
return new WeightedTagRecipeResult(this.tag, count, this.patch, this.weight.asInt());
}

@Override
public RecipeResult copyWithWeight(int weight) {
public WeightedTagRecipeResult copyWithWeight(int weight) {
return new WeightedTagRecipeResult(this.tag, this.count, this.patch, weight);
}
}

0 comments on commit 033936c

Please sign in to comment.