mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-11 02:02:04 -07: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:
@@ -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) {
|
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);
|
||||||
+ 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;
|
this.bukkitHandle = bukkit;
|
||||||
}
|
}
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
@@ -100,6 +105,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
this.handle = new net.minecraft.server.MerchantRecipe(
|
this.handle = new net.minecraft.server.MerchantRecipe(
|
||||||
net.minecraft.server.ItemStack.b,
|
net.minecraft.server.ItemStack.b,
|
||||||
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 {
|
@@ -0,0 +0,0 @@ public class CraftMerchantRecipe extends MerchantRecipe {
|
||||||
handle.priceMultiplier = priceMultiplier;
|
handle.priceMultiplier = priceMultiplier;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user