Fixed items below $4 getting an invalid point calculation

This commit is contained in:
Teriuihi 2021-12-22 21:00:58 +01:00
parent 6c72ac417e
commit 0af3bcb843

View File

@ -55,7 +55,7 @@ public class SellGUI extends GUIMerchant {
Economy econ = VillagerUI.getInstance().getEconomy(); Economy econ = VillagerUI.getInstance().getEconomy();
EconUser econUser = EconUser.getUser(player.getUniqueId()); EconUser econUser = EconUser.getUser(player.getUniqueId());
int oldPoints = Objects.requireNonNullElse(econUser.getPointsMap().get(villagerType.getName()), 0); int oldPoints = Objects.requireNonNullElse(econUser.getPointsMap().get(villagerType.getName()), 0);
int trans_pts = (int) (Math.floor(price.getPrice(amount)/ WorthConfig.POINT_MOD) * amount); int trans_pts = (int) ((Math.floor(price.getPrice(amount) / WorthConfig.POINT_MOD) + 1) * amount);
double cost = price.calculatePriceThing(oldPoints, trans_pts); double cost = price.calculatePriceThing(oldPoints, trans_pts);
econ.depositPlayer(player, cost); econ.depositPlayer(player, cost);