Skip to content

Commit e9aae89

Browse files
Copilotptthanh02
andcommitted
Implement enhanced SpawnerMenuFormUI with layout sync and new features
Co-authored-by: ptthanh02 <73684260+ptthanh02@users.noreply.github.com>
1 parent 321e89e commit e9aae89

5 files changed

Lines changed: 296 additions & 119 deletions

File tree

core/src/main/java/github/nighter/smartspawner/SmartSpawner.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,4 +433,16 @@ public void debug(String message) {
433433
public SpawnerMenuFormUI getSpawnerMenuFormUI() {
434434
return spawnerMenuFormUI;
435435
}
436+
437+
public SpawnerMenuAction getSpawnerMenuAction() {
438+
return spawnerMenuAction;
439+
}
440+
441+
public SpawnerStackerUI getSpawnerStackerUI() {
442+
return spawnerStackerUI;
443+
}
444+
445+
public SpawnerSellManager getSpawnerSellManager() {
446+
return spawnerSellManager;
447+
}
436448
}

core/src/main/java/github/nighter/smartspawner/spawner/gui/main/SpawnerMenuAction.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,18 @@ private boolean handleLayoutAction(Player player, SpawnerData spawner, int slot,
161161
handleExpBottleClick(player, spawner, true);
162162
handleSellAllItems(player, spawner);
163163
return true;
164+
case "sell_all":
165+
if (isClickTooFrequent(player)) {
166+
return true;
167+
}
168+
// Check permissions for selling
169+
if (!plugin.hasSellIntegration() || !player.hasPermission("smartspawner.sellall")) {
170+
messageService.sendMessage(player, "no_permission");
171+
return true;
172+
}
173+
// Sell all items only (no XP collection)
174+
handleSellAllItems(player, spawner);
175+
return true;
164176
case "collect_exp":
165177
handleExpBottleClick(player, spawner, false);
166178
return true;

0 commit comments

Comments
 (0)