From 033936c55fff9fad96c4e309dc735c0240f252a3 Mon Sep 17 00:00:00 2001 From: Kli Kli Date: Tue, 23 Jul 2024 17:03:44 +0200 Subject: [PATCH] feat: improve polymorphism on recipe results --- .../occultism/crafting/recipe/result/ItemRecipeResult.java | 2 +- .../occultism/crafting/recipe/result/TagRecipeResult.java | 2 +- .../crafting/recipe/result/WeightedItemRecipeResult.java | 4 ++-- .../crafting/recipe/result/WeightedTagRecipeResult.java | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/klikli_dev/occultism/crafting/recipe/result/ItemRecipeResult.java b/src/main/java/com/klikli_dev/occultism/crafting/recipe/result/ItemRecipeResult.java index a5ed8e3d1..d04f6e9a6 100644 --- a/src/main/java/com/klikli_dev/occultism/crafting/recipe/result/ItemRecipeResult.java +++ b/src/main/java/com/klikli_dev/occultism/crafting/recipe/result/ItemRecipeResult.java @@ -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)); } } diff --git a/src/main/java/com/klikli_dev/occultism/crafting/recipe/result/TagRecipeResult.java b/src/main/java/com/klikli_dev/occultism/crafting/recipe/result/TagRecipeResult.java index 084ae9bad..669f599ee 100644 --- a/src/main/java/com/klikli_dev/occultism/crafting/recipe/result/TagRecipeResult.java +++ b/src/main/java/com/klikli_dev/occultism/crafting/recipe/result/TagRecipeResult.java @@ -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); } } diff --git a/src/main/java/com/klikli_dev/occultism/crafting/recipe/result/WeightedItemRecipeResult.java b/src/main/java/com/klikli_dev/occultism/crafting/recipe/result/WeightedItemRecipeResult.java index 699370e4e..0c1597da0 100644 --- a/src/main/java/com/klikli_dev/occultism/crafting/recipe/result/WeightedItemRecipeResult.java +++ b/src/main/java/com/klikli_dev/occultism/crafting/recipe/result/WeightedItemRecipeResult.java @@ -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); } } diff --git a/src/main/java/com/klikli_dev/occultism/crafting/recipe/result/WeightedTagRecipeResult.java b/src/main/java/com/klikli_dev/occultism/crafting/recipe/result/WeightedTagRecipeResult.java index 0dc39757f..0a63c2079 100644 --- a/src/main/java/com/klikli_dev/occultism/crafting/recipe/result/WeightedTagRecipeResult.java +++ b/src/main/java/com/klikli_dev/occultism/crafting/recipe/result/WeightedTagRecipeResult.java @@ -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); } }