geforkt von Mirrors/Paper
Add ignore discounts API
Dieser Commit ist enthalten in:
Ursprung
4226c7f7a4
Commit
9c8829553b
@ -57,6 +57,7 @@ public class MerchantRecipe implements Recipe {
|
|||||||
private int demand;
|
private int demand;
|
||||||
private int villagerExperience;
|
private int villagerExperience;
|
||||||
private float priceMultiplier;
|
private float priceMultiplier;
|
||||||
|
private boolean ignoreDiscounts; // Paper
|
||||||
|
|
||||||
public MerchantRecipe(@NotNull ItemStack result, int maxUses) {
|
public MerchantRecipe(@NotNull ItemStack result, int maxUses) {
|
||||||
this(result, 0, maxUses, false);
|
this(result, 0, maxUses, false);
|
||||||
@ -71,6 +72,15 @@ public class MerchantRecipe implements Recipe {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public MerchantRecipe(@NotNull ItemStack result, int uses, int maxUses, boolean experienceReward, int villagerExperience, float priceMultiplier, int demand, int specialPrice) {
|
public MerchantRecipe(@NotNull ItemStack result, int uses, int maxUses, boolean experienceReward, int villagerExperience, float priceMultiplier, int demand, int specialPrice) {
|
||||||
|
// Paper start - add ignoreDiscounts param
|
||||||
|
this(result, uses, maxUses, experienceReward, villagerExperience, priceMultiplier, demand, specialPrice, false);
|
||||||
|
}
|
||||||
|
public MerchantRecipe(@NotNull ItemStack result, int uses, int maxUses, boolean experienceReward, int villagerExperience, float priceMultiplier, boolean ignoreDiscounts) {
|
||||||
|
this(result, uses, maxUses, experienceReward, villagerExperience, priceMultiplier, 0, 0, ignoreDiscounts);
|
||||||
|
}
|
||||||
|
public MerchantRecipe(@NotNull ItemStack result, int uses, int maxUses, boolean experienceReward, int villagerExperience, float priceMultiplier, int demand, int specialPrice, boolean ignoreDiscounts) {
|
||||||
|
this.ignoreDiscounts = ignoreDiscounts;
|
||||||
|
// Paper end
|
||||||
this.result = result;
|
this.result = result;
|
||||||
this.uses = uses;
|
this.uses = uses;
|
||||||
this.maxUses = maxUses;
|
this.maxUses = maxUses;
|
||||||
@ -283,4 +293,20 @@ public class MerchantRecipe implements Recipe {
|
|||||||
public void setPriceMultiplier(float priceMultiplier) {
|
public void setPriceMultiplier(float priceMultiplier) {
|
||||||
this.priceMultiplier = 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
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren