fixed bug where players can claim items if inventory is full resulting in the item dropping to the floor.

Took 4 minutes
This commit is contained in:
Kiran Hart 2022-02-02 11:32:50 -05:00
parent 017d6ee9f7
commit 1627fad0e0

View File

@ -86,6 +86,12 @@ public class GUIExpiredItems extends Gui {
for (AuctionedItem auctionItem : data) {
setButton(slot++, auctionItem.getItem(), ClickType.LEFT, e -> {
if (!Settings.ALLOW_INDIVIDUAL_ITEM_CLAIM.getBoolean()) return;
if (e.player.getInventory().firstEmpty() == -1) {
AuctionHouse.getInstance().getLocale().getMessage("general.noroomclaim").sendPrefixedMessage(e.player);
return;
}
if (this.lastClicked == null) {
this.lastClicked = System.currentTimeMillis() + Settings.CLAIM_MS_DELAY.getInt();
} else if (this.lastClicked > System.currentTimeMillis()) {