SPIGOT-7163: CraftMerchantRecipe doesn't copy demand and specialPrice from BukkitMerchantRecipe
By: md_5 <git@md-5.net>
This commit is contained in:
parent
159ae52462
commit
5d713025af
1 changed files with 2 additions and 3 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue