SPIGOT-7163: CraftMerchantRecipe doesn't copy demand and specialPrice from BukkitMerchantRecipe
This commit is contained in:
parent
5329dd6fd2
commit
aaf484f6fd
@ -2,8 +2,6 @@ package org.bukkit.craftbukkit.inventory;
|
|||||||
|
|
||||||
import com.google.common.base.Preconditions;
|
import com.google.common.base.Preconditions;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import net.minecraft.util.MathHelper;
|
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.inventory.MerchantRecipe;
|
import org.bukkit.inventory.MerchantRecipe;
|
||||||
|
|
||||||
@ -18,6 +16,7 @@ public class CraftMerchantRecipe extends MerchantRecipe {
|
|||||||
addIngredient(CraftItemStack.asBukkitCopy(merchantRecipe.costB));
|
addIngredient(CraftItemStack.asBukkitCopy(merchantRecipe.costB));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
public CraftMerchantRecipe(ItemStack result, int uses, int maxUses, boolean experienceReward, int experience, float priceMultiplier) {
|
public CraftMerchantRecipe(ItemStack result, int uses, int maxUses, boolean experienceReward, int experience, float priceMultiplier) {
|
||||||
this(result, uses, maxUses, experienceReward, experience, priceMultiplier, 0, 0);
|
this(result, uses, maxUses, experienceReward, experience, priceMultiplier, 0, 0);
|
||||||
}
|
}
|
||||||
@ -123,7 +122,7 @@ public class CraftMerchantRecipe extends MerchantRecipe {
|
|||||||
if (recipe instanceof CraftMerchantRecipe) {
|
if (recipe instanceof CraftMerchantRecipe) {
|
||||||
return (CraftMerchantRecipe) recipe;
|
return (CraftMerchantRecipe) recipe;
|
||||||
} else {
|
} 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());
|
craft.setIngredients(recipe.getIngredients());
|
||||||
|
|
||||||
return craft;
|
return craft;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user