Fixed bug with price copying
This commit is contained in:
@@ -84,9 +84,12 @@ public final class PriceEconomy implements Price {
|
||||
|
||||
@Override
|
||||
public @NotNull PriceEconomy withMultiplier(double multiplier) {
|
||||
return new PriceEconomy(
|
||||
PriceEconomy copy = new PriceEconomy(
|
||||
baseContext,
|
||||
ctx -> function.apply(ctx) * multiplier
|
||||
);
|
||||
|
||||
copy.multipliers.putAll(this.multipliers);
|
||||
return copy;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -149,10 +149,13 @@ public final class PriceItem implements Price {
|
||||
|
||||
@Override
|
||||
public @NotNull PriceItem withMultiplier(double multiplier) {
|
||||
return new PriceItem(
|
||||
PriceItem copy = new PriceItem(
|
||||
baseContext,
|
||||
ctx -> function.apply(ctx) * multiplier,
|
||||
item
|
||||
);
|
||||
|
||||
copy.multipliers.putAll(this.multipliers);
|
||||
return copy;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user