This commit is contained in:
2026-01-14 23:27:38 +00:00
parent 6d9b0fb038
commit 4734c911b5
19 changed files with 589 additions and 170 deletions
@@ -106,23 +106,26 @@ public class CreateAuctionGui implements MarketGui {
// Info panel
inventory.setItem(INFO_SLOT, new ItemBuilder(Material.OAK_SIGN)
.name("&6&lCreate Auction")
.name(msgManager.getRaw("create-auction.info-title"))
.lore(
"&7Set starting price, optional buyout,",
"&7and duration for your auction.",
msgManager.getRaw("create-auction.info-lore-1"),
msgManager.getRaw("create-auction.info-lore-2"),
"",
"&7Tax on sale: &f" + plugin.getConfigManager().getAuctionTax() + "%"
msgManager.getRaw("create-auction.tax-info").replace("{tax}", String.valueOf(plugin.getConfigManager().getAuctionTax()))
)
.build());
// Selected item display
if (selectedItem != null) {
String[] itemLoreParts = msgManager.getRaw("create-auction.item-lore").split("\\|");
java.util.List<String> itemLore = new java.util.ArrayList<>();
itemLore.add("");
for (String part : itemLoreParts) {
itemLore.add(part.replace("{amount}", String.valueOf(selectedItem.getAmount())));
}
inventory.setItem(ITEM_DISPLAY_SLOT, new ItemBuilder(selectedItem.clone())
.addLore(List.of(
"",
"&7Quantity: &f" + selectedItem.getAmount(),
"&eThis item will be auctioned"
))
.addLore(itemLore)
.build());
}
@@ -138,7 +141,7 @@ public class CreateAuctionGui implements MarketGui {
// Back button
inventory.setItem(BACK_SLOT, new ItemBuilder(Material.RED_WOOL)
.name(msgManager.getButton("back"))
.lore("&7Return to item selection")
.lore(msgManager.getRaw("create-auction.back-lore"))
.build());
// Confirm button
@@ -151,13 +154,13 @@ public class CreateAuctionGui implements MarketGui {
private void updateStartPriceElement() {
var msgManager = plugin.getMessageManager();
inventory.setItem(START_PRICE_SLOT, new ItemBuilder(Material.GOLD_INGOT)
.name("&6Starting Price: " + msgManager.formatCurrency(startPrice))
.name(msgManager.getRaw("create-auction.start-price-title").replace("{price}", msgManager.formatCurrency(startPrice)))
.lore(
"",
"&7Minimum bid to start",
"&7the auction.",
msgManager.getRaw("create-auction.start-price-lore-1"),
msgManager.getRaw("create-auction.start-price-lore-2"),
"",
"&eClick to change"
msgManager.getRaw("create-auction.start-price-click")
)
.glow()
.build());
@@ -171,25 +174,25 @@ public class CreateAuctionGui implements MarketGui {
if (buyoutPrice != null) {
inventory.setItem(BUYOUT_SLOT, new ItemBuilder(Material.DIAMOND)
.name("&bBuyout: " + msgManager.formatCurrency(buyoutPrice))
.name(msgManager.getRaw("create-auction.buyout-title-set").replace("{price}", msgManager.formatCurrency(buyoutPrice)))
.lore(
"",
"&7Instant purchase price.",
msgManager.getRaw("create-auction.buyout-lore-set-1"),
"",
"&eLeft-click to change",
"&cRight-click to remove"
msgManager.getRaw("create-auction.buyout-lore-set-2"),
msgManager.getRaw("create-auction.buyout-lore-set-3")
)
.glow()
.build());
} else {
inventory.setItem(BUYOUT_SLOT, new ItemBuilder(Material.DIAMOND)
.name("&bBuyout: &7Not set")
.name(msgManager.getRaw("create-auction.buyout-title-unset"))
.lore(
"",
"&7Optional instant purchase",
"&7price for your auction.",
msgManager.getRaw("create-auction.buyout-lore-unset-1"),
msgManager.getRaw("create-auction.buyout-lore-unset-2"),
"",
"&eClick to set buyout price"
msgManager.getRaw("create-auction.buyout-lore-unset-click")
)
.build());
}
@@ -199,15 +202,16 @@ public class CreateAuctionGui implements MarketGui {
* Updates the merged duration element (displays + clickable)
*/
private void updateDurationElement() {
var msgManager = plugin.getMessageManager();
String durationText = formatDuration(durationHours);
inventory.setItem(DURATION_SLOT, new ItemBuilder(Material.CLOCK)
.name("&eDuration: " + durationText)
.name(msgManager.getRaw("create-auction.duration-title").replace("{duration}", durationText))
.lore(
"",
"&7Auction ends after this time.",
msgManager.getRaw("create-auction.duration-lore"),
"",
"&eClick to change duration"
msgManager.getRaw("create-auction.duration-click")
)
.glow()
.build());
@@ -225,15 +229,21 @@ public class CreateAuctionGui implements MarketGui {
private void updateConfirmButton() {
var msgManager = plugin.getMessageManager();
String buyoutLine = buyoutPrice != null
? msgManager.getRaw("create-auction.confirm-buyout").replace("{price}", msgManager.formatCurrency(buyoutPrice))
: msgManager.getRaw("create-auction.confirm-buyout-none");
inventory.setItem(CONFIRM_SLOT, new ItemBuilder(Material.LIME_WOOL)
.name(msgManager.getButton("confirm"))
.lore(
"&7Item: &f" + selectedItem.getType().name() + " x" + selectedItem.getAmount(),
"&7Start: &a" + msgManager.formatCurrency(startPrice),
buyoutPrice != null ? "&7Buyout: &b" + msgManager.formatCurrency(buyoutPrice) : "&7Buyout: &7None",
"&7Duration: &e" + formatDuration(durationHours),
msgManager.getRaw("create-auction.confirm-item")
.replace("{item}", selectedItem.getType().name())
.replace("{amount}", String.valueOf(selectedItem.getAmount())),
msgManager.getRaw("create-auction.confirm-start").replace("{price}", msgManager.formatCurrency(startPrice)),
buyoutLine,
msgManager.getRaw("create-auction.confirm-duration").replace("{duration}", formatDuration(durationHours)),
"",
"&aClick to create auction!"
msgManager.getRaw("create-auction.confirm-click")
)
.glow()
.build());
@@ -103,23 +103,26 @@ public class CreateListingGui implements MarketGui {
// Info panel
inventory.setItem(INFO_SLOT, new ItemBuilder(Material.OAK_SIGN)
.name("&6&lCreate Listing")
.name(msgManager.getRaw("create-listing.info-title"))
.lore(
"&7Set a price and duration",
"&7for your listing.",
msgManager.getRaw("create-listing.info-lore-1"),
msgManager.getRaw("create-listing.info-lore-2"),
"",
"&7Tax: &f" + plugin.getConfigManager().getMarketTax() + "%"
msgManager.getRaw("create-listing.tax-info").replace("{tax}", String.valueOf(plugin.getConfigManager().getMarketTax()))
)
.build());
// Selected item display
if (selectedItem != null) {
String[] itemLoreParts = msgManager.getRaw("create-listing.item-lore").split("\\|");
List<String> itemLore = new java.util.ArrayList<>();
itemLore.add("");
for (String part : itemLoreParts) {
itemLore.add(part.replace("{amount}", String.valueOf(selectedItem.getAmount())));
}
inventory.setItem(ITEM_DISPLAY_SLOT, new ItemBuilder(selectedItem.clone())
.addLore(List.of(
"",
"&7Quantity: &f" + selectedItem.getAmount(),
"&eThis item will be listed"
))
.addLore(itemLore)
.build());
}
@@ -132,7 +135,7 @@ public class CreateListingGui implements MarketGui {
// Back button
inventory.setItem(BACK_SLOT, new ItemBuilder(Material.RED_WOOL)
.name(msgManager.getButton("back"))
.lore("&7Return to item selection")
.lore(msgManager.getRaw("create-listing.back-lore"))
.build());
// Confirm button
@@ -148,13 +151,15 @@ public class CreateListingGui implements MarketGui {
double earnings = price - tax;
inventory.setItem(PRICE_SLOT, new ItemBuilder(Material.GOLD_INGOT)
.name("&6Price: " + msgManager.formatCurrency(price))
.name(msgManager.getRaw("create-listing.price-title").replace("{price}", msgManager.formatCurrency(price)))
.lore(
"",
"&7Tax (" + plugin.getConfigManager().getMarketTax() + "%): &c" + msgManager.formatCurrency(tax),
"&7You receive: &a" + msgManager.formatCurrency(earnings),
msgManager.getRaw("create-listing.price-tax")
.replace("{percent}", String.valueOf(plugin.getConfigManager().getMarketTax()))
.replace("{amount}", msgManager.formatCurrency(tax)),
msgManager.getRaw("create-listing.price-earnings").replace("{amount}", msgManager.formatCurrency(earnings)),
"",
"&eClick to change price"
msgManager.getRaw("create-listing.price-click")
)
.glow()
.build());
@@ -164,15 +169,16 @@ public class CreateListingGui implements MarketGui {
* Updates the merged duration element (displays current duration + clickable to cycle)
*/
private void updateDurationElement() {
var msgManager = plugin.getMessageManager();
String durationText = formatDuration(durationHours);
inventory.setItem(DURATION_SLOT, new ItemBuilder(Material.CLOCK)
.name("&eDuration: " + durationText)
.name(msgManager.getRaw("create-listing.duration-title").replace("{duration}", durationText))
.lore(
"",
"&7Listing expires after this time",
msgManager.getRaw("create-listing.duration-lore"),
"",
"&eClick to change duration"
msgManager.getRaw("create-listing.duration-click")
)
.glow()
.build());
@@ -195,12 +201,14 @@ public class CreateListingGui implements MarketGui {
inventory.setItem(CONFIRM_SLOT, new ItemBuilder(Material.LIME_WOOL)
.name(msgManager.getButton("confirm"))
.lore(
"&7Item: &f" + selectedItem.getType().name() + " x" + selectedItem.getAmount(),
"&7Price: &a" + msgManager.formatCurrency(price),
"&7You receive: &a" + msgManager.formatCurrency(earnings),
"&7Duration: &e" + formatDuration(durationHours),
msgManager.getRaw("create-listing.confirm-item")
.replace("{item}", selectedItem.getType().name())
.replace("{amount}", String.valueOf(selectedItem.getAmount())),
msgManager.getRaw("create-listing.confirm-price").replace("{price}", msgManager.formatCurrency(price)),
msgManager.getRaw("create-listing.confirm-earnings").replace("{amount}", msgManager.formatCurrency(earnings)),
msgManager.getRaw("create-listing.confirm-duration").replace("{duration}", formatDuration(durationHours)),
"",
"&aClick to create listing!"
msgManager.getRaw("create-listing.confirm-click")
)
.glow()
.build());
@@ -115,21 +115,24 @@ public class ItemSelectionGui implements MarketGui {
}
// Info display
String modeText = mode == SelectionMode.LISTING ? "&eListing" : "&6Auction";
String infoLoreKey = mode == SelectionMode.LISTING ? "item-selection.info-lore-listing" : "item-selection.info-lore-auction";
String[] infoLoreParts = msgManager.getRaw(infoLoreKey).split("\\|");
java.util.List<String> infoLore = new java.util.ArrayList<>();
for (String part : infoLoreParts) {
infoLore.add(part);
}
infoLore.add("");
infoLore.add(msgManager.getRaw("item-selection.blacklisted-note"));
inventory.setItem(INFO_SLOT, new ItemBuilder(Material.PAPER)
.name("&fSelect an Item")
.lore(
"&7Click on an item from your",
"&7inventory to create a " + modeText + "&7.",
"",
"&7Blacklisted items are shown in red."
)
.name(msgManager.getRaw("item-selection.info-title"))
.lore(infoLore)
.build());
// Back button
inventory.setItem(BACK_SLOT, new ItemBuilder(Material.BARRIER)
.name(msgManager.getButton("back"))
.lore("&7Return to main menu")
.lore(msgManager.getRaw("item-selection.back-lore"))
.build());
}
@@ -155,10 +158,11 @@ public class ItemSelectionGui implements MarketGui {
* Creates a display item with selection lore
*/
private ItemStack createSelectableItem(ItemStack original) {
var msgManager = plugin.getMessageManager();
return new ItemBuilder(original.clone())
.addLore(java.util.List.of(
"",
"&a► Click to select"
msgManager.getRaw("item-selection.click-to-select")
))
.build();
}
@@ -167,11 +171,12 @@ public class ItemSelectionGui implements MarketGui {
* Creates a blocked/unavailable item display
*/
private ItemStack createBlockedItem(ItemStack original) {
var msgManager = plugin.getMessageManager();
return new ItemBuilder(Material.BARRIER)
.name("&c" + original.getType().name())
.name(msgManager.getRaw("item-selection.blocked-title").replace("{material}", original.getType().name()))
.lore(
"&7This item cannot be listed.",
"&cBlacklisted or invalid."
msgManager.getRaw("item-selection.blocked-lore-1"),
msgManager.getRaw("item-selection.blocked-lore-2")
)
.build();
}
@@ -104,78 +104,86 @@ public class NumberInputGui implements MarketGui {
// === DECREASE BUTTONS (LEFT SIDE) ===
inventory.setItem(SUB_1000_SLOT, new ItemBuilder(Material.RED_STAINED_GLASS_PANE)
.name("&c-1,000")
.lore("&7Click: &c-1,000", "&7Shift-click: &c-10,000")
.lore(msgManager.getRaw("number-input.click-adjust").replace("{amount}", "-1,000"),
msgManager.getRaw("number-input.shift-click").replace("{amount}", "-10,000"))
.build());
inventory.setItem(SUB_100_SLOT, new ItemBuilder(Material.RED_STAINED_GLASS_PANE)
.name("&c-100")
.lore("&7Click: &c-100", "&7Shift-click: &c-1,000")
.lore(msgManager.getRaw("number-input.click-adjust").replace("{amount}", "-100"),
msgManager.getRaw("number-input.shift-click").replace("{amount}", "-1,000"))
.build());
inventory.setItem(SUB_10_SLOT, new ItemBuilder(Material.RED_STAINED_GLASS_PANE)
.name("&c-10")
.lore("&7Click: &c-10", "&7Shift-click: &c-100")
.lore(msgManager.getRaw("number-input.click-adjust").replace("{amount}", "-10"),
msgManager.getRaw("number-input.shift-click").replace("{amount}", "-100"))
.build());
inventory.setItem(SUB_1_SLOT, new ItemBuilder(Material.RED_STAINED_GLASS_PANE)
.name("&c-1")
.lore("&7Click: &c-1", "&7Shift-click: &c-10")
.lore(msgManager.getRaw("number-input.click-adjust").replace("{amount}", "-1"),
msgManager.getRaw("number-input.shift-click").replace("{amount}", "-10"))
.build());
// === INCREASE BUTTONS (RIGHT SIDE) ===
inventory.setItem(ADD_1_SLOT, new ItemBuilder(Material.LIME_STAINED_GLASS_PANE)
.name("&a+1")
.lore("&7Click: &a+1", "&7Shift-click: &a+10")
.lore(msgManager.getRaw("number-input.click-adjust").replace("{amount}", "+1"),
msgManager.getRaw("number-input.shift-click").replace("{amount}", "+10"))
.build());
inventory.setItem(ADD_10_SLOT, new ItemBuilder(Material.LIME_STAINED_GLASS_PANE)
.name("&a+10")
.lore("&7Click: &a+10", "&7Shift-click: &a+100")
.lore(msgManager.getRaw("number-input.click-adjust").replace("{amount}", "+10"),
msgManager.getRaw("number-input.shift-click").replace("{amount}", "+100"))
.build());
inventory.setItem(ADD_100_SLOT, new ItemBuilder(Material.LIME_STAINED_GLASS_PANE)
.name("&a+100")
.lore("&7Click: &a+100", "&7Shift-click: &a+1,000")
.lore(msgManager.getRaw("number-input.click-adjust").replace("{amount}", "+100"),
msgManager.getRaw("number-input.shift-click").replace("{amount}", "+1,000"))
.build());
inventory.setItem(ADD_1000_SLOT, new ItemBuilder(Material.LIME_STAINED_GLASS_PANE)
.name("&a+1,000")
.lore("&7Click: &a+1,000", "&7Shift-click: &a+10,000")
.lore(msgManager.getRaw("number-input.click-adjust").replace("{amount}", "+1,000"),
msgManager.getRaw("number-input.shift-click").replace("{amount}", "+10,000"))
.build());
// === PRESET BUTTONS ===
inventory.setItem(SET_MIN_SLOT, new ItemBuilder(Material.ORANGE_STAINED_GLASS_PANE)
.name("&6Set Minimum")
.lore("&7Set to: &f" + msgManager.formatCurrency(minValue))
.name(msgManager.getRaw("number-input.set-minimum"))
.lore(msgManager.getRaw("number-input.set-to").replace("{value}", msgManager.formatCurrency(minValue)))
.build());
inventory.setItem(SET_MAX_SLOT, new ItemBuilder(Material.ORANGE_STAINED_GLASS_PANE)
.name("&6Set Maximum")
.lore("&7Set to: &f" + msgManager.formatCurrency(maxValue))
.name(msgManager.getRaw("number-input.set-maximum"))
.lore(msgManager.getRaw("number-input.set-to").replace("{value}", msgManager.formatCurrency(maxValue)))
.build());
// === ACTION BUTTONS ===
inventory.setItem(BACK_SLOT, new ItemBuilder(Material.RED_WOOL)
.name(msgManager.getButton("cancel"))
.lore("&7Cancel and go back")
.lore(msgManager.getRaw("number-input.cancel-lore"))
.build());
inventory.setItem(CONFIRM_SLOT, new ItemBuilder(Material.LIME_WOOL)
.name(msgManager.getButton("confirm"))
.lore("&7Confirm: &a" + msgManager.formatCurrency(currentValue))
.lore(msgManager.getRaw("number-input.confirm-lore").replace("{value}", msgManager.formatCurrency(currentValue)))
.build());
}
private void updateDisplay() {
var msgManager = plugin.getMessageManager();
inventory.setItem(DISPLAY_SLOT, new ItemBuilder(Material.GOLD_INGOT)
.name("&6&l" + msgManager.formatCurrency(currentValue))
.name(msgManager.getRaw("number-input.display-title").replace("{value}", msgManager.formatCurrency(currentValue)))
.lore(
"",
"&7Minimum: &f" + msgManager.formatCurrency(minValue),
"&7Maximum: &f" + msgManager.formatCurrency(maxValue),
msgManager.getRaw("number-input.minimum").replace("{value}", msgManager.formatCurrency(minValue)),
msgManager.getRaw("number-input.maximum").replace("{value}", msgManager.formatCurrency(maxValue)),
"",
"&eUse buttons to adjust"
msgManager.getRaw("number-input.use-buttons")
)
.glow()
.build());
@@ -183,7 +191,7 @@ public class NumberInputGui implements MarketGui {
// Also update confirm button lore
inventory.setItem(CONFIRM_SLOT, new ItemBuilder(Material.LIME_WOOL)
.name(plugin.getMessageManager().getButton("confirm"))
.lore("&7Confirm: &a" + msgManager.formatCurrency(currentValue))
.lore(msgManager.getRaw("number-input.confirm-lore").replace("{value}", msgManager.formatCurrency(currentValue)))
.build());
}
@@ -21,7 +21,7 @@ import pt.henrique.communityMarket.util.TextUtil;
* │ . . . . INFO . . . . │ Row 0 │
* │ . . . . ITEM . . . . │ Row 1: Item │
* │ . . . . DISPLAY . . . . │ Row 2: Qty │
* │ -64 -32 -16 -1 . +1 +16 +32 +64 │ Row 3: Adjust│
* │ -32 -16 -8 -1 . +1 +8 +16 +32 │ Row 3: Adjust│
* │ . MIN . . . . . MAX . │ Row 4: Preset│
* │ BACK . . . CONFIRM . . . .│ Row 5: Action│
* └─────────────────────────────────────────────────────┘
@@ -44,16 +44,16 @@ public class QuantitySelectGui implements MarketGui {
private static final int QUANTITY_DISPLAY_SLOT = 22; // Current quantity display
// Row 3: Decrease buttons (LEFT side) - slots 27-30
private static final int SUB_64_SLOT = 27; // -64
private static final int SUB_32_SLOT = 28; // -32
private static final int SUB_16_SLOT = 29; // -16
private static final int SUB_32_SLOT = 27; // -32
private static final int SUB_16_SLOT = 28; // -16
private static final int SUB_8_SLOT = 29; // -8
private static final int SUB_1_SLOT = 30; // -1
// Row 3: Increase buttons (RIGHT side) - slots 32-35
private static final int ADD_1_SLOT = 32; // +1
private static final int ADD_16_SLOT = 33; // +16
private static final int ADD_32_SLOT = 34; // +32
private static final int ADD_64_SLOT = 35; // +64
private static final int ADD_8_SLOT = 33; // +8
private static final int ADD_16_SLOT = 34; // +16
private static final int ADD_32_SLOT = 35; // +32
// Row 4: Preset buttons
private static final int SET_MIN_SLOT = 37; // Set to 1
@@ -103,12 +103,12 @@ public class QuantitySelectGui implements MarketGui {
// Info panel
inventory.setItem(INFO_SLOT, new ItemBuilder(Material.OAK_SIGN)
.name("&6&lSelect Quantity")
.name(msgManager.getRaw("quantity-select.title"))
.lore(
"&7Choose how many items",
"&7you want to sell.",
msgManager.getRaw("quantity-select.info-line-1"),
msgManager.getRaw("quantity-select.info-line-2"),
"",
"&7Available: &f" + maxQuantity
msgManager.getRaw("quantity-select.available").replace("{amount}", String.valueOf(maxQuantity))
)
.build());
@@ -118,7 +118,7 @@ public class QuantitySelectGui implements MarketGui {
inventory.setItem(ITEM_DISPLAY_SLOT, new ItemBuilder(displayItem)
.addLore(java.util.List.of(
"",
"&7Selected: &f" + currentQuantity
msgManager.getRaw("quantity-select.selected").replace("{amount}", String.valueOf(currentQuantity))
))
.build());
@@ -126,82 +126,84 @@ public class QuantitySelectGui implements MarketGui {
updateQuantityDisplay();
// === DECREASE BUTTONS (LEFT SIDE) ===
inventory.setItem(SUB_64_SLOT, new ItemBuilder(Material.RED_STAINED_GLASS_PANE)
.name("&c-64")
.lore("&7Click: &c-64")
.amount(64)
.build());
inventory.setItem(SUB_32_SLOT, new ItemBuilder(Material.RED_STAINED_GLASS_PANE)
.name("&c-32")
.lore("&7Click: &c-32")
.lore(msgManager.getRaw("quantity-select.click-adjust").replace("{amount}", "-32"))
.amount(32)
.build());
inventory.setItem(SUB_16_SLOT, new ItemBuilder(Material.RED_STAINED_GLASS_PANE)
.name("&c-16")
.lore("&7Click: &c-16")
.lore(msgManager.getRaw("quantity-select.click-adjust").replace("{amount}", "-16"))
.amount(16)
.build());
inventory.setItem(SUB_8_SLOT, new ItemBuilder(Material.RED_STAINED_GLASS_PANE)
.name("&c-8")
.lore(msgManager.getRaw("quantity-select.click-adjust").replace("{amount}", "-8"))
.amount(8)
.build());
inventory.setItem(SUB_1_SLOT, new ItemBuilder(Material.RED_STAINED_GLASS_PANE)
.name("&c-1")
.lore("&7Click: &c-1")
.lore(msgManager.getRaw("quantity-select.click-adjust").replace("{amount}", "-1"))
.build());
// === INCREASE BUTTONS (RIGHT SIDE) ===
inventory.setItem(ADD_1_SLOT, new ItemBuilder(Material.LIME_STAINED_GLASS_PANE)
.name("&a+1")
.lore("&7Click: &a+1")
.lore(msgManager.getRaw("quantity-select.click-adjust").replace("{amount}", "+1"))
.build());
inventory.setItem(ADD_8_SLOT, new ItemBuilder(Material.LIME_STAINED_GLASS_PANE)
.name("&a+8")
.lore(msgManager.getRaw("quantity-select.click-adjust").replace("{amount}", "+8"))
.amount(8)
.build());
inventory.setItem(ADD_16_SLOT, new ItemBuilder(Material.LIME_STAINED_GLASS_PANE)
.name("&a+16")
.lore("&7Click: &a+16")
.lore(msgManager.getRaw("quantity-select.click-adjust").replace("{amount}", "+16"))
.amount(16)
.build());
inventory.setItem(ADD_32_SLOT, new ItemBuilder(Material.LIME_STAINED_GLASS_PANE)
.name("&a+32")
.lore("&7Click: &a+32")
.lore(msgManager.getRaw("quantity-select.click-adjust").replace("{amount}", "+32"))
.amount(32)
.build());
inventory.setItem(ADD_64_SLOT, new ItemBuilder(Material.LIME_STAINED_GLASS_PANE)
.name("&a+64")
.lore("&7Click: &a+64")
.amount(64)
.build());
// === PRESET BUTTONS ===
inventory.setItem(SET_MIN_SLOT, new ItemBuilder(Material.ORANGE_STAINED_GLASS_PANE)
.name("&6Set Minimum")
.lore("&7Set to: &f1")
.name(msgManager.getRaw("quantity-select.set-minimum"))
.lore(msgManager.getRaw("quantity-select.set-to").replace("{amount}", "1"))
.build());
inventory.setItem(SET_MAX_SLOT, new ItemBuilder(Material.ORANGE_STAINED_GLASS_PANE)
.name("&6Set Maximum")
.lore("&7Set to: &f" + maxQuantity)
.name(msgManager.getRaw("quantity-select.set-maximum"))
.lore(msgManager.getRaw("quantity-select.set-to").replace("{amount}", String.valueOf(maxQuantity)))
.build());
// === ACTION BUTTONS ===
inventory.setItem(BACK_SLOT, new ItemBuilder(Material.RED_WOOL)
.name(msgManager.getButton("back"))
.lore("&7Return to item selection")
.lore(msgManager.getRaw("quantity-select.back-lore"))
.build());
updateConfirmButton();
}
private void updateQuantityDisplay() {
var msgManager = plugin.getMessageManager();
inventory.setItem(QUANTITY_DISPLAY_SLOT, new ItemBuilder(Material.PAPER)
.name("&6&lQuantity: " + currentQuantity)
.name("&6&l" + msgManager.getRaw("quantity-select.quantity-label") + ": " + currentQuantity)
.lore(
"",
"&7Minimum: &f1",
"&7Maximum: &f" + maxQuantity,
msgManager.getRaw("quantity-select.minimum").replace("{amount}", "1"),
msgManager.getRaw("quantity-select.maximum").replace("{amount}", String.valueOf(maxQuantity)),
"",
"&eUse buttons to adjust"
msgManager.getRaw("quantity-select.use-buttons")
)
.amount(Math.min(currentQuantity, 64))
.glow()
@@ -213,7 +215,7 @@ public class QuantitySelectGui implements MarketGui {
inventory.setItem(ITEM_DISPLAY_SLOT, new ItemBuilder(displayItem)
.addLore(java.util.List.of(
"",
"&7Selected: &f" + currentQuantity
msgManager.getRaw("quantity-select.selected").replace("{amount}", String.valueOf(currentQuantity))
))
.build());
}
@@ -222,7 +224,7 @@ public class QuantitySelectGui implements MarketGui {
var msgManager = plugin.getMessageManager();
inventory.setItem(CONFIRM_SLOT, new ItemBuilder(Material.LIME_WOOL)
.name(msgManager.getButton("confirm"))
.lore("&7Quantity: &a" + currentQuantity)
.lore(msgManager.getRaw("quantity-select.confirm-lore").replace("{amount}", String.valueOf(currentQuantity)))
.build());
}
@@ -235,16 +237,16 @@ public class QuantitySelectGui implements MarketGui {
switch (slot) {
// Decrease buttons
case SUB_64_SLOT -> adjustQuantity(-64);
case SUB_32_SLOT -> adjustQuantity(-32);
case SUB_16_SLOT -> adjustQuantity(-16);
case SUB_8_SLOT -> adjustQuantity(-8);
case SUB_1_SLOT -> adjustQuantity(-1);
// Increase buttons
case ADD_1_SLOT -> adjustQuantity(1);
case ADD_8_SLOT -> adjustQuantity(8);
case ADD_16_SLOT -> adjustQuantity(16);
case ADD_32_SLOT -> adjustQuantity(32);
case ADD_64_SLOT -> adjustQuantity(64);
// Preset buttons
case SET_MIN_SLOT -> {
+95
View File
@@ -335,6 +335,101 @@ time:
minutes: "{m}m"
seconds: "{s}s"
# Quantity Selector GUI
quantity-select:
title: "&6&lSelect Quantity"
info-line-1: "&7Choose how many items"
info-line-2: "&7you want to sell."
available: "&7Available: &f{amount}"
selected: "&7Selected: &f{amount}"
quantity-label: "Quantity"
minimum: "&7Minimum: &f{amount}"
maximum: "&7Maximum: &f{amount}"
use-buttons: "&eUse buttons to adjust"
click-adjust: "&7Click: &e{amount}"
set-minimum: "&6Set Minimum"
set-maximum: "&6Set Maximum"
set-to: "&7Set to: &f{amount}"
back-lore: "&7Return to item selection"
confirm-lore: "&7Quantity: &a{amount}"
# Item Selection GUI
item-selection:
info-title: "&fSelect an Item"
info-lore-listing: "&7Click on an item from your|&7inventory to create a &eListing&7."
info-lore-auction: "&7Click on an item from your|&7inventory to create a &6Auction&7."
blacklisted-note: "&7Blacklisted items are shown in red."
click-to-select: "&a► Click to select"
blocked-title: "&c{material}"
blocked-lore-1: "&7This item cannot be listed."
blocked-lore-2: "&cBlacklisted or invalid."
back-lore: "&7Return to main menu"
# Create Listing GUI
create-listing:
info-title: "&6&lCreate Listing"
info-lore-1: "&7Set a price and duration"
info-lore-2: "&7for your listing."
tax-info: "&7Tax: &f{tax}%"
item-lore: "&7Quantity: &f{amount}|&eThis item will be listed"
price-title: "&6Price: {price}"
price-tax: "&7Tax ({percent}%): &c{amount}"
price-earnings: "&7You receive: &a{amount}"
price-click: "&eClick to change price"
duration-title: "&eDuration: {duration}"
duration-lore: "&7Listing expires after this time"
duration-click: "&eClick to change duration"
back-lore: "&7Return to item selection"
confirm-item: "&7Item: &f{item} x{amount}"
confirm-price: "&7Price: &a{price}"
confirm-earnings: "&7You receive: &a{amount}"
confirm-duration: "&7Duration: &e{duration}"
confirm-click: "&aClick to create listing!"
# Create Auction GUI
create-auction:
info-title: "&6&lCreate Auction"
info-lore-1: "&7Set starting price, optional buyout,"
info-lore-2: "&7and duration for your auction."
tax-info: "&7Tax on sale: &f{tax}%"
item-lore: "&7Quantity: &f{amount}|&eThis item will be auctioned"
start-price-title: "&6Starting Price: {price}"
start-price-lore-1: "&7Minimum bid to start"
start-price-lore-2: "&7the auction."
start-price-click: "&eClick to change"
buyout-title-set: "&bBuyout: {price}"
buyout-title-unset: "&bBuyout: &7Not set"
buyout-lore-set-1: "&7Instant purchase price."
buyout-lore-set-2: "&eLeft-click to change"
buyout-lore-set-3: "&cRight-click to remove"
buyout-lore-unset-1: "&7Optional instant purchase"
buyout-lore-unset-2: "&7price for your auction."
buyout-lore-unset-click: "&eClick to set buyout price"
duration-title: "&eDuration: {duration}"
duration-lore: "&7Auction ends after this time."
duration-click: "&eClick to change duration"
back-lore: "&7Return to item selection"
confirm-item: "&7Item: &f{item} x{amount}"
confirm-start: "&7Start: &a{price}"
confirm-buyout: "&7Buyout: &b{price}"
confirm-buyout-none: "&7Buyout: &7None"
confirm-duration: "&7Duration: &e{duration}"
confirm-click: "&aClick to create auction!"
# Number Input GUI
number-input:
display-title: "&6&l{value}"
minimum: "&7Minimum: &f{value}"
maximum: "&7Maximum: &f{value}"
use-buttons: "&eUse buttons to adjust"
click-adjust: "&7Click: &e{amount}"
shift-click: "&7Shift-click: &e{amount}"
set-minimum: "&6Set Minimum"
set-maximum: "&6Set Maximum"
set-to: "&7Set to: &f{value}"
cancel-lore: "&7Cancel and go back"
confirm-lore: "&7Confirm: &a{value}"
# Help Content
help:
title: "&6&lCommunity Market Help"
+95
View File
@@ -335,6 +335,101 @@ time:
minutes: "{m}m"
seconds: "{s}s"
# GUI de Seleção de Quantidade
quantity-select:
title: "&6&lSelecionar Quantidade"
info-line-1: "&7Escolhe quantos itens"
info-line-2: "&7queres vender."
available: "&7Disponível: &f{amount}"
selected: "&7Selecionado: &f{amount}"
quantity-label: "Quantidade"
minimum: "&7Mínimo: &f{amount}"
maximum: "&7Máximo: &f{amount}"
use-buttons: "&eUsa os botões para ajustar"
click-adjust: "&7Clica: &e{amount}"
set-minimum: "&6Definir Mínimo"
set-maximum: "&6Definir Máximo"
set-to: "&7Definir para: &f{amount}"
back-lore: "&7Voltar à seleção de item"
confirm-lore: "&7Quantidade: &a{amount}"
# GUI de Seleção de Item
item-selection:
info-title: "&fSelecionar um Item"
info-lore-listing: "&7Clica num item do teu|&7inventário para criar um &eAnúncio&7."
info-lore-auction: "&7Clica num item do teu|&7inventário para criar um &6Leilão&7."
blacklisted-note: "&7Itens bloqueados aparecem a vermelho."
click-to-select: "&a► Clica para selecionar"
blocked-title: "&c{material}"
blocked-lore-1: "&7Este item não pode ser listado."
blocked-lore-2: "&cBloqueado ou inválido."
back-lore: "&7Voltar ao menu principal"
# GUI de Criar Anúncio
create-listing:
info-title: "&6&lCriar Anúncio"
info-lore-1: "&7Define um preço e duração"
info-lore-2: "&7para o teu anúncio."
tax-info: "&7Taxa: &f{tax}%"
item-lore: "&7Quantidade: &f{amount}|&eEste item será listado"
price-title: "&6Preço: {price}"
price-tax: "&7Taxa ({percent}%): &c{amount}"
price-earnings: "&7Recebes: &a{amount}"
price-click: "&eClica para alterar preço"
duration-title: "&eDuração: {duration}"
duration-lore: "&7O anúncio expira após este tempo"
duration-click: "&eClica para alterar duração"
back-lore: "&7Voltar à seleção de item"
confirm-item: "&7Item: &f{item} x{amount}"
confirm-price: "&7Preço: &a{price}"
confirm-earnings: "&7Recebes: &a{amount}"
confirm-duration: "&7Duração: &e{duration}"
confirm-click: "&aClica para criar anúncio!"
# GUI de Criar Leilão
create-auction:
info-title: "&6&lCriar Leilão"
info-lore-1: "&7Define preço inicial, compra imediata opcional,"
info-lore-2: "&7e duração para o teu leilão."
tax-info: "&7Taxa na venda: &f{tax}%"
item-lore: "&7Quantidade: &f{amount}|&eEste item será leiloado"
start-price-title: "&6Preço Inicial: {price}"
start-price-lore-1: "&7Licitação mínima para iniciar"
start-price-lore-2: "&7o leilão."
start-price-click: "&eClica para alterar"
buyout-title-set: "&bCompra Imediata: {price}"
buyout-title-unset: "&bCompra Imediata: &7Não definido"
buyout-lore-set-1: "&7Preço de compra instantânea."
buyout-lore-set-2: "&eClique esquerdo para alterar"
buyout-lore-set-3: "&cClique direito para remover"
buyout-lore-unset-1: "&7Preço opcional de compra"
buyout-lore-unset-2: "&7instantânea para o teu leilão."
buyout-lore-unset-click: "&eClica para definir preço de compra imediata"
duration-title: "&eDuração: {duration}"
duration-lore: "&7O leilão termina após este tempo."
duration-click: "&eClica para alterar duração"
back-lore: "&7Voltar à seleção de item"
confirm-item: "&7Item: &f{item} x{amount}"
confirm-start: "&7Início: &a{price}"
confirm-buyout: "&7Compra Imediata: &b{price}"
confirm-buyout-none: "&7Compra Imediata: &7Nenhum"
confirm-duration: "&7Duração: &e{duration}"
confirm-click: "&aClica para criar leilão!"
# GUI de Entrada Numérica
number-input:
display-title: "&6&l{value}"
minimum: "&7Mínimo: &f{value}"
maximum: "&7Máximo: &f{value}"
use-buttons: "&eUsa os botões para ajustar"
click-adjust: "&7Clica: &e{amount}"
shift-click: "&7Shift-clica: &e{amount}"
set-minimum: "&6Definir Mínimo"
set-maximum: "&6Definir Máximo"
set-to: "&7Definir para: &f{value}"
cancel-lore: "&7Cancelar e voltar"
confirm-lore: "&7Confirmar: &a{value}"
# Conteúdo de Ajuda
help:
title: "&6&lAjuda do Mercado Comunitário"