- Баллы
- 66
- Имя в Minecraft
- Serega_3010
#Начинающий
Мне нужна помощь: Я хочу получить число из записей в файле yml (purchase) и получаю ноль в переменной(priceBL и priceSL), но когда я пишу без переменной, просто так выражение, то пишет его. Прошу помощи!
Мне нужна помощь: Я хочу получить число из записей в файле yml (purchase) и получаю ноль в переменной(priceBL и priceSL), но когда я пишу без переменной, просто так выражение, то пишет его. Прошу помощи!
Код:
int nprice = getConfig().getInt("shops."+i+".nprice");
int priceBL = purchase.getInt("prices."+i+".priceb");
int priceSL = purchase.getInt("prices."+i+".prices");
double items = storage.getInt("storages."+i+"."+getConfig().getString("shops."+i+".item"));
double coins = 10000;
double x = Math.pow(Math.pow(1000/items,3), 1.0/8);
double y = 1;
double z = Math.pow(10000/coins, 1.0/4);
int priceB = (int) Math.round((priceBL+nprice*x*y)/2);
int priceS = (int) Math.round((priceSL+nprice*(0.75/z)*x*y)/2);
purchase.set("prices."+i+".priceb", priceB);
purchase.set("prices."+i+".prices", priceS);
sign.setLine(1, (int) items+"");
sign.setLine(2, priceB+"");
sign.setLine(3, priceS+"");
sign.update(false);
getLogger().info("go.."+priceBL+" "+priceSL);