Display price as positive and have the messages explain

This commit is contained in:
Teriuihi 2022-01-12 02:01:12 +01:00
parent edf98f9204
commit a5a019d1e6
2 changed files with 4 additions and 4 deletions

View File

@ -111,8 +111,8 @@ public class SellGUI extends GUIMerchant {
Template.template("amount", String.valueOf(purchase.amount())),
Template.template("item", StringUtils.capitalize(purchase.material().name()
.toLowerCase().replaceAll("_", " "))),
Template.template("price", String.format("%,.2f", purchase.price())),
Template.template("points", String.valueOf(purchase.totalPointCost())),
Template.template("price", String.format("%,.2f", purchase.price() * -1)),
Template.template("points", String.valueOf(-purchase.totalPointCost())),
Template.template("total_points", String.valueOf(newPoints)),
Template.template("villager_name", villagerType.getDisplayName())
));

View File

@ -54,11 +54,11 @@ public class CommandSell extends SubCommand {
}
EconUser user = EconUser.getUser(player.getUniqueId());
Integer curPoints = user.getPointsMap().getOrDefault(villagerType.getName(), 0);
double cost = price.calculatePriceThing(curPoints, price.getPoints(), true, price.getPoints());
double cost = price.calculatePriceThing(curPoints, price.getPoints(), false, price.getPoints());
player.sendMiniMessage(Config.SELL_ITEM_MESSAGE, List.of(
Template.template("material", item.name()),
Template.template("price", String.valueOf(cost)),
Template.template("points", String.valueOf(-price.getPoints())),
Template.template("points", String.valueOf(price.getPoints())),
Template.template("current_points", String.valueOf(curPoints)),
Template.template("villager_type", villagerType.getDisplayName())
));