mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-31 00:20:44 +01:00
53 lines
2.2 KiB
Diff
53 lines
2.2 KiB
Diff
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||
|
From: Mariell Hoversholm <proximyst@proximyst.com>
|
||
|
Date: Mon, 9 Nov 2020 20:33:38 +0100
|
||
|
Subject: [PATCH] Add ignore discounts API
|
||
|
|
||
|
|
||
|
diff --git a/src/main/java/org/bukkit/inventory/MerchantRecipe.java b/src/main/java/org/bukkit/inventory/MerchantRecipe.java
|
||
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||
|
--- a/src/main/java/org/bukkit/inventory/MerchantRecipe.java
|
||
|
+++ b/src/main/java/org/bukkit/inventory/MerchantRecipe.java
|
||
|
@@ -0,0 +0,0 @@ public class MerchantRecipe implements Recipe {
|
||
|
private boolean experienceReward;
|
||
|
private int villagerExperience;
|
||
|
private float priceMultiplier;
|
||
|
+ private boolean ignoreDiscounts; // Paper
|
||
|
|
||
|
public MerchantRecipe(@NotNull ItemStack result, int maxUses) {
|
||
|
this(result, 0, maxUses, false);
|
||
|
@@ -0,0 +0,0 @@ public class MerchantRecipe implements Recipe {
|
||
|
}
|
||
|
|
||
|
public MerchantRecipe(@NotNull ItemStack result, int uses, int maxUses, boolean experienceReward, int villagerExperience, float priceMultiplier) {
|
||
|
+ // Paper start - add ignoreDiscounts param
|
||
|
+ this(result, uses, maxUses, experienceReward, villagerExperience, priceMultiplier, false);
|
||
|
+ }
|
||
|
+ public MerchantRecipe(@NotNull ItemStack result, int uses, int maxUses, boolean experienceReward, int villagerExperience, float priceMultiplier, boolean ignoreDiscounts) {
|
||
|
+ this.ignoreDiscounts = ignoreDiscounts;
|
||
|
+ // Paper end
|
||
|
this.result = result;
|
||
|
this.uses = uses;
|
||
|
this.maxUses = maxUses;
|
||
|
@@ -0,0 +0,0 @@ public class MerchantRecipe implements Recipe {
|
||
|
public void setPriceMultiplier(float priceMultiplier) {
|
||
|
this.priceMultiplier = priceMultiplier;
|
||
|
}
|
||
|
+
|
||
|
+ // Paper start
|
||
|
+ /**
|
||
|
+ * @return Whether all discounts on this trade should be ignored.
|
||
|
+ */
|
||
|
+ public boolean shouldIgnoreDiscounts() {
|
||
|
+ return ignoreDiscounts;
|
||
|
+ }
|
||
|
+
|
||
|
+ /**
|
||
|
+ * @param ignoreDiscounts Whether all discounts on this trade should be ignored.
|
||
|
+ */
|
||
|
+ public void setIgnoreDiscounts(boolean ignoreDiscounts) {
|
||
|
+ this.ignoreDiscounts = ignoreDiscounts;
|
||
|
+ }
|
||
|
+ // Paper end
|
||
|
}
|