Show correct remaining stock for Gambleshops

This commit is contained in:
Len 2024-08-04 20:37:51 +02:00
parent 24581b5caa
commit 633bc97abb

View File

@ -89,7 +89,14 @@ public class PlayerShop {
return (int) (balance / getPrice());
}
case GAMBLE -> {
return getInventory().getContents().length;
ArrayList<ItemStack> contents = new ArrayList<>();
for (ItemStack it : this.getInventory().getContents()) {
if (it != null) {
contents.add(it);
}
}
return contents.size();
}
default -> {
return 0;