Spokers
Пользователь
- Сообщения
- 70
- Решения
- 1
1)Получаю баланс в double, добавляю +0.013, получаю 0.013, добавляю ещё 0.013 получаю 0.013
2)Spigot 1.8
2)Spigot 1.8
Java:
if (e.getClickedBlock().getState() instanceof Sign) {
final ItemStack air = new ItemStack(Material.AIR);
double summary = 0.0;
for (int i = 0; i < 36; ++i) {
final ItemStack item = p.getInventory().getItem(i);
if (p.getInventory().getItem(i) != null) {
if(p.getInventory().getItemInHand().getType() == Material.SAND) {
p.getInventory().setItem(i, air);
summary += 0.013 * item.getAmount();
double infobalance = pl.getInt("users."+p.getName()+".balance");
//double ss = infobalance+0.013 * item.getAmount();
double ss = 0.013 * item.getAmount();
double s =infobalance+ss;
pl.set("users."+p.getName()+".balance", s);
p.sendMessage("Балик:"+infobalance+"+"+ss+"="+s);
p.updateInventory();
saveDate(pl,pl_new);
p.updateInventory();
}
}
}
p.sendMessage("Всё проданно на §6" + summary + "§7$.");
}