🐛 fix bug where players can't use /ah sell after their first sell w.o relogging (caused by setting regarding opening main ah gui after confirm/list)

Took 1 minute
This commit is contained in:
Kiran Hart 2023-02-21 13:31:07 -05:00
parent f6f5a8bc07
commit 85ec3f32d7
No known key found for this signature in database
GPG Key ID: 5F36C7BC79D3EBC3
4 changed files with 25 additions and 19 deletions

View File

@ -369,9 +369,10 @@ public final class CommandSell extends AbstractCommand {
return;
}
if (Settings.OPEN_MAIN_AUCTION_HOUSE_AFTER_MENU_LIST.getBoolean())
if (Settings.OPEN_MAIN_AUCTION_HOUSE_AFTER_MENU_LIST.getBoolean()) {
player.removeMetadata("AuctionHouseConfirmListing", AuctionHouse.getInstance());
instance.getGuiManager().showGUI(player, new GUIAuctionHouse(auctionPlayer));
else
} else
AuctionHouse.newChain().sync(player::closeInventory).execute();
});
@ -394,9 +395,10 @@ public final class CommandSell extends AbstractCommand {
return;
}
if (Settings.OPEN_MAIN_AUCTION_HOUSE_AFTER_MENU_LIST.getBoolean())
if (Settings.OPEN_MAIN_AUCTION_HOUSE_AFTER_MENU_LIST.getBoolean()) {
player.removeMetadata("AuctionHouseConfirmListing", AuctionHouse.getInstance());
instance.getGuiManager().showGUI(player, new GUIAuctionHouse(auctionPlayer));
else
} else
AuctionHouse.newChain().sync(player::closeInventory).execute();
});

View File

@ -58,7 +58,7 @@ public final class GUIBundleCreation extends AbstractPlaceholderGui {
for (int i = 0; i < 45; i++)
setItem(i, CompMaterial.AIR.parseItem());
Arrays.asList(45, 46, 47, 48, 49,50, 51, 52, 53).forEach(i -> setAction(i, e -> e.event.setCancelled(true)));
Arrays.asList(45, 46, 47, 48, 49, 50, 51, 52, 53).forEach(i -> setAction(i, e -> e.event.setCancelled(true)));
setOnClose(close -> {
for (int i = 0; i < 45; i++) {
@ -144,9 +144,10 @@ public final class GUIBundleCreation extends AbstractPlaceholderGui {
return;
}
if (Settings.OPEN_MAIN_AUCTION_HOUSE_AFTER_MENU_LIST.getBoolean())
if (Settings.OPEN_MAIN_AUCTION_HOUSE_AFTER_MENU_LIST.getBoolean()) {
player.removeMetadata("AuctionHouseConfirmListing", AuctionHouse.getInstance());
instance.getGuiManager().showGUI(auctionPlayer.getPlayer(), new GUIAuctionHouse(auctionPlayer));
else
} else
AuctionHouse.newChain().sync(player::closeInventory).execute();
});
}));
@ -159,9 +160,10 @@ public final class GUIBundleCreation extends AbstractPlaceholderGui {
return;
}
if (Settings.OPEN_MAIN_AUCTION_HOUSE_AFTER_MENU_LIST.getBoolean())
if (Settings.OPEN_MAIN_AUCTION_HOUSE_AFTER_MENU_LIST.getBoolean()) {
player.removeMetadata("AuctionHouseConfirmListing", AuctionHouse.getInstance());
instance.getGuiManager().showGUI(auctionPlayer.getPlayer(), new GUIAuctionHouse(auctionPlayer));
else
} else
AuctionHouse.newChain().sync(player::closeInventory).execute();
});
}

View File

@ -169,7 +169,7 @@ public final class GUISellAuction extends AbstractPlaceholderGui {
string = ChatColor.stripColor(string);
if (!NumberUtils.isDouble(string)) {
AuctionHouse.getInstance().getLocale().getMessage("general.notanumber").processPlaceholder("value", string).sendPrefixedMessage(player);
AuctionHouse.getInstance().getLocale().getMessage("general.notanumber").processPlaceholder("value", string).sendPrefixedMessage(player);
return false;
}
@ -213,7 +213,7 @@ public final class GUISellAuction extends AbstractPlaceholderGui {
string = ChatColor.stripColor(string);
if (!NumberUtils.isDouble(string)) {
AuctionHouse.getInstance().getLocale().getMessage("general.notanumber").processPlaceholder("value", string).sendPrefixedMessage(player);
AuctionHouse.getInstance().getLocale().getMessage("general.notanumber").processPlaceholder("value", string).sendPrefixedMessage(player);
return false;
}
@ -263,7 +263,7 @@ public final class GUISellAuction extends AbstractPlaceholderGui {
string = ChatColor.stripColor(string);
if (!NumberUtils.isDouble(string)) {
AuctionHouse.getInstance().getLocale().getMessage("general.notanumber").processPlaceholder("value", string).sendPrefixedMessage(player);
AuctionHouse.getInstance().getLocale().getMessage("general.notanumber").processPlaceholder("value", string).sendPrefixedMessage(player);
return false;
}
@ -299,7 +299,7 @@ public final class GUISellAuction extends AbstractPlaceholderGui {
.make(), click -> {
if (!AuctionAPI.getInstance().meetsListingRequirements(click.player, this.auctionPlayer.getItemBeingListed())) return;
if (!auctionPlayer.canListItem()) return;
if (!auctionPlayer.canListItem()) return;
click.gui.exit();
@ -343,9 +343,10 @@ public final class GUISellAuction extends AbstractPlaceholderGui {
return;
}
if (Settings.OPEN_MAIN_AUCTION_HOUSE_AFTER_MENU_LIST.getBoolean())
if (Settings.OPEN_MAIN_AUCTION_HOUSE_AFTER_MENU_LIST.getBoolean()) {
player.removeMetadata("AuctionHouseConfirmListing", AuctionHouse.getInstance());
click.manager.showGUI(click.player, new GUIAuctionHouse(this.auctionPlayer));
else
} else
AuctionHouse.newChain().sync(click.player::closeInventory).execute();
});
}

View File

@ -157,7 +157,7 @@ public final class GUISellBin extends AbstractPlaceholderGui {
string = ChatColor.stripColor(string);
if (!NumberUtils.isDouble(string)) {
AuctionHouse.getInstance().getLocale().getMessage("general.notanumber").processPlaceholder("value", string).sendPrefixedMessage(player);
AuctionHouse.getInstance().getLocale().getMessage("general.notanumber").processPlaceholder("value", string).sendPrefixedMessage(player);
return false;
}
@ -187,7 +187,7 @@ public final class GUISellBin extends AbstractPlaceholderGui {
.make(), click -> {
if (!AuctionAPI.getInstance().meetsListingRequirements(click.player, this.auctionPlayer.getItemBeingListed())) return;
if (!auctionPlayer.canListItem()) return;
if (!auctionPlayer.canListItem()) return;
click.gui.exit();
@ -218,9 +218,10 @@ public final class GUISellBin extends AbstractPlaceholderGui {
return;
}
if (Settings.OPEN_MAIN_AUCTION_HOUSE_AFTER_MENU_LIST.getBoolean())
if (Settings.OPEN_MAIN_AUCTION_HOUSE_AFTER_MENU_LIST.getBoolean()) {
player.removeMetadata("AuctionHouseConfirmListing", AuctionHouse.getInstance());
click.manager.showGUI(click.player, new GUIAuctionHouse(this.auctionPlayer));
else
} else
AuctionHouse.newChain().sync(click.player::closeInventory).execute();
});
}