SPIGOT-7163: CraftMerchantRecipe doesn't copy demand and specialPrice from BukkitMerchantRecipe

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot 2022-10-02 09:13:14 +11:00
parent 159ae52462
commit 5d713025af

View File

@ -2,8 +2,6 @@ package org.bukkit.craftbukkit.inventory;
import com.google.common.base.Preconditions;
import java.util.List;
import net.minecraft.util.MathHelper;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.MerchantRecipe;
@ -18,6 +16,7 @@ public class CraftMerchantRecipe extends MerchantRecipe {
addIngredient(CraftItemStack.asBukkitCopy(merchantRecipe.costB));
}
@Deprecated
public CraftMerchantRecipe(ItemStack result, int uses, int maxUses, boolean experienceReward, int experience, float priceMultiplier) {
this(result, uses, maxUses, experienceReward, experience, priceMultiplier, 0, 0);
}
@ -123,7 +122,7 @@ public class CraftMerchantRecipe extends MerchantRecipe {
if (recipe instanceof CraftMerchantRecipe) {
return (CraftMerchantRecipe) recipe;
} else {
CraftMerchantRecipe craft = new CraftMerchantRecipe(recipe.getResult(), recipe.getUses(), recipe.getMaxUses(), recipe.hasExperienceReward(), recipe.getVillagerExperience(), recipe.getPriceMultiplier());
CraftMerchantRecipe craft = new CraftMerchantRecipe(recipe.getResult(), recipe.getUses(), recipe.getMaxUses(), recipe.hasExperienceReward(), recipe.getVillagerExperience(), recipe.getPriceMultiplier(), recipe.getDemand(), recipe.getSpecialPrice());
craft.setIngredients(recipe.getIngredients());
return craft;