mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-16 06:30:46 +01:00
Fix NPE thrown when converting MerchantRecipe from Bukkit to NMS (#4755)
This bug was introduced in c451989b86
(Add ignore discounts API)
This commit is contained in:
parent
4ca833b607
commit
add661a180
1 changed files with 14 additions and 1 deletions
|
@ -41,7 +41,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
|
||||
public MerchantRecipe(ItemStack itemstack, ItemStack itemstack1, ItemStack itemstack2, int uses, int maxUses, int experience, float priceMultiplier, CraftMerchantRecipe bukkit) {
|
||||
- this(itemstack, itemstack1, itemstack2, uses, maxUses, experience, priceMultiplier);
|
||||
+ this(itemstack, itemstack1, itemstack2, uses, maxUses, experience, priceMultiplier, bukkit.shouldIgnoreDiscounts()); // Paper - shouldIgnoreDiscounts
|
||||
+ // Paper start - add ignoreDiscounts param
|
||||
+ this(itemstack, itemstack1, itemstack2, uses, maxUses, experience, priceMultiplier, false, bukkit);
|
||||
+ }
|
||||
+ public MerchantRecipe(ItemStack itemstack, ItemStack itemstack1, ItemStack itemstack2, int uses, int maxUses, int experience, float priceMultiplier, boolean ignoreDiscounts, CraftMerchantRecipe bukkit) {
|
||||
+ this(itemstack, itemstack1, itemstack2, uses, maxUses, experience, priceMultiplier, ignoreDiscounts);
|
||||
+ // Paper end
|
||||
this.bukkitHandle = bukkit;
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
@ -100,6 +105,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
this.handle = new net.minecraft.server.MerchantRecipe(
|
||||
net.minecraft.server.ItemStack.b,
|
||||
net.minecraft.server.ItemStack.b,
|
||||
@@ -0,0 +0,0 @@ public class CraftMerchantRecipe extends MerchantRecipe {
|
||||
maxUses,
|
||||
experience,
|
||||
priceMultiplier,
|
||||
+ ignoreDiscounts, // Paper - add ignoreDiscounts param
|
||||
this
|
||||
);
|
||||
this.setExperienceReward(experienceReward);
|
||||
@@ -0,0 +0,0 @@ public class CraftMerchantRecipe extends MerchantRecipe {
|
||||
handle.priceMultiplier = priceMultiplier;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue