From 5d713025af6fd8f6c9bf9c1a493ec4055c465424 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Sun, 2 Oct 2022 09:13:14 +1100 Subject: [PATCH] SPIGOT-7163: CraftMerchantRecipe doesn't copy demand and specialPrice from BukkitMerchantRecipe By: md_5 --- .../bukkit/craftbukkit/inventory/CraftMerchantRecipe.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftMerchantRecipe.java b/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftMerchantRecipe.java index 707c89f706..4796a04a5b 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftMerchantRecipe.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftMerchantRecipe.java @@ -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;