Show correct remaining stock for Gambleshops
This commit is contained in:
parent
24581b5caa
commit
633bc97abb
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user