MerchantRecipe: add copy constructor

This commit is contained in:
Joo200 2022-12-20 15:26:36 +01:00
parent c40bddd17f
commit 8fb0d8f90a

View File

@ -91,6 +91,13 @@ public class MerchantRecipe implements Recipe {
this.specialPrice = specialPrice; this.specialPrice = specialPrice;
} }
// Paper start - add copy ctor
public MerchantRecipe(@NotNull MerchantRecipe recipe) {
this(recipe.result.clone(), recipe.uses, recipe.maxUses, recipe.experienceReward, recipe.villagerExperience, recipe.priceMultiplier, recipe.demand, recipe.specialPrice, recipe.ignoreDiscounts);
this.setIngredients(recipe.ingredients);
}
// Paper end
@NotNull @NotNull
@Override @Override
public ItemStack getResult() { public ItemStack getResult() {