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