overd4rth

MAKE NO BUGS, ADD SOUDNS,.

📎 1 file 7,557 chars
📄
pasted-code-1789416269574.txt
txt 357 lines
▶
# SMPHUB — GUI & Item Cap Requirements

Update the SMPHUB plugin with the following behavior and design requirements.

## 📦 ITEM CAP — IMPORTANT

The Item Cap system must enforce the cap by **dropping excess items**, NOT deleting them.

Example:

If the cap for Diamond is:

`32`

and a player somehow has:

`47 Diamonds`

the plugin should detect that they have **15 too many**.

It should automatically remove the excess 15 Diamonds from their inventory and **drop those 15 Diamonds naturally at the player's location**.

The player should therefore end up with exactly:

`32 Diamonds`

Nothing should be deleted or permanently lost.

This should work even if the player obtains excess items through:

* Picking items up
* Commands
* Chests
* Villagers
* Crafting
* Plugins
* Other legitimate inventory interactions

The system should continuously/appropriately enforce the configured cap without causing item duplication.

If multiple stacks of the same item exist in the inventory, calculate the player's **total amount of that item**, then remove only the amount exceeding the cap.

Example:

```text
Cap: 16

Inventory:
12 Diamonds
8 Diamonds
3 Diamonds

Total: 23

Excess: 7

Result:
16 Diamonds remain
7 Diamonds are dropped
```

Do NOT simply delete the entire stack.

---

# 🎨 GUI DESIGN — MAKE THIS ACTUALLY LOOK GOOD

The GUIs are extremely important.

I do NOT want a basic-looking chest GUI where it is just:

`Diamond = Item Cap`
`Barrier = Ban Item`
`Bed = Sleep`

with everything randomly placed.

Make it look like a **real Minecraft SMP control panel**.

The GUI should feel like the player is opening a **physical control room made out of Minecraft blocks and items**.

## Visual Style

Use Minecraft blocks/items creatively as part of the design.

For example:

* Stone / Deepslate / Blackstone for backgrounds
* Glass panes for borders
* Chains for decoration
* Copper / Iron / Gold blocks for accents
* Redstone-themed items for settings
* End-related blocks/items for End settings
* Crafting Table for OneCraft
* Hopper/chest items for item management
* Bed for One Player Sleep
* Ender Eye / End Stone / Dragon Egg for Ender Dragon settings

Do NOT make every slot a different random block.

Create a **consistent visual theme**.

The GUI should look intentional and designed.

---

# 🖥️ MAIN GUI

`/smphub`

Create a visually impressive main menu.

Suggested layout:

```text
╔══════════════════════════════════════╗
║              SMPHUB                  ║
║        SMP MANAGEMENT PANEL           ║
╠══════════════════════════════════════╣
║                                      ║
║   📦 ITEM MANAGEMENT                 ║
║                                      ║
║   [ ITEM CAP ]     [ BANNED ITEMS ]  ║
║                                      ║
║   ⚙ SERVER SETTINGS                  ║
║                                      ║
║   [ ONE PLAYER SLEEP ]               ║
║   [ DIMENSION CONTROL ]              ║
║                                      ║
║   🔨 SMP FEATURES                    ║
║                                      ║
║   [ ONECRAFT ]       [ DRAGON ]      ║
║                                      ║
╚══════════════════════════════════════╝
```

This is only an example of the structure. Feel free to create a better layout.

Use decorative borders and spacing so the GUI feels like a proper interface.

---

# 📦 ITEM CAP GUI

Make this a proper management interface.

Display configured item caps as actual item icons.

Example:

```text
┌──────────────────────────────────────┐
│             ITEM CAPS                │
│                                      │
│   💎 Diamond                         │
│   Maximum: 32                        │
│                                      │
│   🔥 End Crystal                     │
│   Maximum: 8                         │
│                                      │
│   ⛓ Netherite Ingot                 │
│   Maximum: 16                        │
│                                      │
│        [ + ADD ITEM ]                │
│                                      │
│             [ BACK ]                 │
└──────────────────────────────────────┘
```

Clicking an item should allow the admin to change its cap.

Make the item itself visible in the GUI rather than using generic icons whenever possible.

---

# 🚫 BANNED ITEMS GUI

Show all banned items using their actual Minecraft item icons.

Clicking an item should open a management menu.

Show what restrictions are currently active.

Example:

```text
Diamond Sword

Banned:
✓ Crafting
✓ Pickup
✗ Dropping
✓ Using
```

Allow the admin to change these restrictions.

---

# 🔨 ONECRAFT GUI

Make OneCraft visually distinct.

Use a **Crafting Table / Smithing Table** aesthetic.

The recipe editor should actually resemble a crafting interface.

For Crafting Table recipes:

```text
[ ][ ][ ]
[ ][ ][ ]   →   [ RESULT ]
[ ][ ][ ]

          [ SAVE ]
```

For Smithing Table recipes, use an appropriate smithing-style layout.

Do not make the admin enter recipe ingredients through commands.

Everything should be done through the GUI.

---

# 💤 ONE PLAYER SLEEP GUI

Use a Bed as the main icon.

Show:

```text
ONE PLAYER SLEEP

Status:
🟢 ENABLED

Players required:
1

[ ENABLE ]
[ DISABLE ]
```

Make the current status immediately obvious.

---

# 🌎 DIMENSION CONTROL GUI

Use appropriate dimension-themed Minecraft items.

For example:

🌎 Overworld — Grass Block
🌋 Nether — Netherrack / Nether-related item
🌌 End — End Stone / Eye of Ender

Each dimension should display:

`ENABLED` or `DISABLED`

Clicking it toggles the setting.

---

# 🐉 ENDER DRAGON GUI

Make this one of the coolest GUIs in the plugin.

Use an End-themed design.

Possible decorations:

* End Stone
* Obsidian
* Purple/black stained glass
* Ender Eyes
* Dragon Egg
* Purpur
* Crying Obsidian

Display:

### ❤️ Dragon Health

```text
Current Health:
500 HP
```

Clicking it allows the admin to change the maximum health.

---

### 🚪 Exit Portal Lock

Display:

```text
Portal Lock:
🟢 ENABLED

Duration:
5 Minutes
```

When active after the first Dragon kill:

```text
🔒 PORTAL LOCKED

Unlocks in:
04:37
```

After the timer finishes:

```text
🔓 PORTAL UNLOCKED
```

The duration should be configurable.

---

# ✨ GENERAL GUI POLISH

Add small details that make the plugin feel premium:

* Hover lore that explains what each button does
* Consistent fonts/colors using Minecraft formatting
* Clear enabled/disabled states
* Click sounds
* Appropriate interaction sounds
* Subtle animations where possible
* Confirmation screens for destructive actions
* Back buttons on every sub-menu
* Close buttons
* Prevent item stealing/dragging
* Prevent shift-click exploits
* Prevent number-key item swapping
* Prevent players from placing items into management GUIs
* Handle invalid clicks safely

The GUIs should feel like **one complete SMPHUB system**, not separate menus made by different people.

## Overall Goal

When someone opens `/smphub`, it should immediately look like a **high-quality Minecraft SMP management panel**.

Think:

**Minecraft blocks + clean GUI design + SMP administration + premium plugin UI.**

Prioritize both **functionality and visual quality**.
Kodari AI
KodariSep 14 at 8:13 pm 4
SmpHubControlPanel
A premium SMP management plugin featuring a visually polished control panel GUI with themed item management, configurable item caps that drop excess items naturally at player locations, banned item restriction toggles, OneCraft recipe editor with crafting-table aesthetics, one player sleep toggle, dimension enable/disable controls, and an End-themed Ender Dragon health and exit portal lock manager. All GUIs use consistent block-themed decoration, hover lore, click sounds, confirmation screens, and exploit prevention.
  1. Core plugin and configuration: create the Gradle project, plugin entrypoint, command, config access, and managers.

  2. Enforcement: add item-cap dropping, banned-item restrictions, sleep, dimensions, dragon locks/health, and OneCraft persistence.

  3. GUI system: build the themed SMPHUB menus, editors, confirmation flow, sounds, and protected inventory interactions.

  4. Registration/resources: wire listeners and provide default configuration and plugin metadata.

  1. Created the SMPHUB Gradle project with Paper API, XSeries compatibility, plugin metadata, permissions, and default configuration.

  2. Implemented item caps that count total inventory amounts, remove only excess items, and naturally drop them at the player’s location.

  3. Added banned-item restrictions for pickup, dropping, crafting, using, and inventory movement.

  4. Added configurable one-player sleep, dimension controls, dragon health management, post-kill portal locks, and OneCraft recipe persistence.

  5. Built themed SMPHUB GUIs with actual item icons, borders, navigation, confirmation screens, protected inventories, sounds, cap editors, restriction editors, dimension toggles, dragon controls, and a visual OneCraft editor.

overd4rth

remove black stained glass and replace it with gray stianed in the menu. remove the preitems in the itemcaps for excample, do it wit h all, fix the dragon health (pretty much i cant go into config) WITH AFTER EVERY DRAGON FIGHT. remove the deepslatre, redstone and filøler blocks i nthe menu, supposed to look simple and bright. and dont make a ocmpluicartd systme when u for example click on itemcap to change the cap, like god damn thats many options??? You must know that theres HUMANS changing these not bots, they can just REMOVE the itemcap and add it back. for the onecraft u do /smphub:onecraft (type of crafting) (how many times can be crafted) <- show these so people know, like u do /smphub:onecraft and in the tab it shows the question, then once u enter with holding the item u wanna one craft a crafting type u chose shows up where u can put the recipe, the onecraft list is just there to display the one crafts. like stop making everything like first alr clikck on that, oh i goitta glick on that, then click on that. with one craft remove that damn menu for adjusting and caps as well as the premade ones, when u click on one nothing happens, when u hover over one it disaplys the amount, when u shift+right click thnen it disappears, REMEMEBR the command /smphub:itemcap (hold your item) (amount) add /banitem and the item u are holding is BANNED, if its a splash pot strength 2, then no one can use it anymore, when u try splashing it throug ANYTHIGJN at all it dosesnt work. you ghet my point wiht banning an item, and same system with the one craft, when u click on a glass nothing happens, but when u shift+rmb ITS GONE. AND NO ADD SYSTEM WITHIN THE SMPHUB COMMAND also remove al lblack stained and replace with gray stianed, remove red glass stains and things that give it outlines, just give it more shady or blakc outlines or a less color like white idk dude. there should also be an option to edit enchant control. 3 options, book, armor, weapons. AND MAKE THIS WITH LIKE CLICKING AND IT GOES UP, AND RIGHT CLICK IT GOES DOWN WITH THEM. REMEMBER TO KEEP IT VANILLA . just make it more simple dude

Kodari AI
KodariSep 15 at 1:52 pm 8
  1. Simplify all menus: replace dark/red/deepslate/redstone/filler styling with a bright gray-stained-glass theme and remove multi-step cap/OneCraft add flows.

  2. Move item-cap and ban-item creation to held-item commands, with hover-only list entries and shift-right-click removal.

  3. Rework OneCraft into /smphub:onecraft <type> <amount> with tab completion and a single recipe editor opened after the command.

  4. Fix dragon-health editing/persistence and add the requested simple enchant-control controls.

  5. Verify command registration, listeners, and GUI click behavior so no management item can be stolen or accidentally activated.

  1. Menu theme: switched shared filler and every menu border to gray stained glass, removed black/red/pink/purple/deepslate styling, and replaced redstone/block-style controls with plain vanilla icons.

  2. Item caps and bans: next, remove GUI add/edit flows and implement held-item commands plus hover-only list behavior.

  3. OneCraft: then simplify its command/editor flow and list removal interaction.

  4. Dragon/enchant controls: finish health persistence/reset behavior and add the three click-adjustable enchant categories.

  1. Item-cap/ban commands: added held-item commands, removed default entries and GUI add/edit controls, and made list entries hover-only with shift-right-click removal.

  2. Ban enforcement: expanded blocking to crafting ingredients, item movement, hoppers, dispensers, placement, thrown potions, and bow use.

  3. OneCraft: next, replace the single preloaded editor/list flow with command-created recipes, type/amount tab completion, and display-only entries with shift-right removal.

  1. OneCraft: replaced the old single preloaded recipe with command-created crafting/smithing recipes, per-player craft limits, a display-only recipe list, and a one-screen ingredient editor opened from the command.

  2. Dragon/enchant controls: next, correct dragon max-health application on every spawn/fight and add vanilla enchantment-level controls for books, armor, and weapons.

  3. Final consistency pass: wire registrations and catch command/listener edge cases.

  1. Dragon health: corrected new dragons to receive the configured maximum health instead of retaining the vanilla current health, and apply the setting to existing dragons on enable and every respawn.

  2. Enchant control: added a bright three-category menu; left-click raises and right-click lowers vanilla enchantment limits for books, armor, and weapons.

  3. Final pass: checking registrations, forbidden menu materials, and the new command/listener references for consistency.

Implemented the simplified SMPHUB system.

  • Replaced all black, red, purple, pink, brown, and deepslate GUI styling with gray stained-glass panels and brighter vanilla icons.

  • Removed the cap, banned-item, and OneCraft add/edit picker systems.

  • Added:

    • /smphub:itemcap <amount> while holding an item.

    • /banitem while holding an item.

    • /smphub:onecraft <crafting|smithing> <times> with tab completion.

  • Item-cap entries now:

    • Display the real item icon.

    • Show the cap amount on hover.

    • Do nothing on normal click.

    • Remove on shift + right-click.

  • Banned-item entries use the same interaction system and display all active restrictions.

  • Banned items are blocked from pickup, dropping, crafting, smithing, placement, consumption, interaction, dispensers, hoppers, thrown potions, and bows.

  • OneCraft now has:

    • A display-only recipe list.

    • Hovered craft limits.

    • Shift-right-click removal.

    • A single recipe editor opened directly by command.

    • Crafting-table and smithing-table layouts.

    • Per-player craft limits.

  • Fixed dragon health application so configured health is actually applied to new and existing dragons after respawns/fights.

  • Added vanilla enchantment controls for:

    • Books

    • Armor

    • Weapons

  • Enchantment controls increase with left-click and decrease with right-click.

  • Kept GUI protection, drag prevention, item-stealing prevention, and click sounds.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
38 2,116
src/main/java/com/smphub/SmpHubPlugin.java
package com.smphub;

import com.smphub.command.SmpHubCommand;
import com.smphub.command.BanItemCommand;
import com.smphub.command.ItemCapCommand;
import com.smphub.enforcement.BannedItemListener;
import com.smphub.enforcement.CapEnforcementListener;
import com.smphub.enforcement.DimensionListener;
import com.smphub.enforcement.DragonListener;
import com.smphub.enforcement.OneCraftListener;
import com.smphub.enforcement.EnchantControlListener;
import com.smphub.enforcement.SleepListener;
import com.smphub.gui.GUIListener;
import com.smphub.manager.BannedItemManager;
import com.smphub.manager.ConfigStore;
import com.smphub.manager.DimensionManager;
import com.smphub.manager.DragonManager;
import com.smphub.manager.ItemCapManager;
import com.smphub.manager.OneCraftManager;
import com.smphub.manager.SleepManager;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

public class SmpHubPlugin extends JavaPlugin {
    private ConfigStore configStore;
    private ItemCapManager itemCapManager;
    private BannedItemManager bannedItemManager;
    private SleepManager sleepManager;
    private DimensionManager dimensionManager;
    private DragonManager dragonManager;
    private OneCraftManager oneCraftManager;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        configStore = new ConfigStore(this);
        itemCapManager = new ItemCapManager(this, configStore);
        bannedItemManager = new BannedItemManager(this, configStore);
        sleepManager = new SleepManager(configStore);
        dimensionManager = new DimensionManager(configStore);
        dragonManager = new DragonManager(this, configStore);
        oneCraftManager = new OneCraftManager(this, configStore);
        oneCraftManager.registerRecipes();

        Bukkit.getPluginManager().registerEvents(new GUIListener(), this);
        Bukkit.getPluginManager().registerEvents(new CapEnforcementListener(this, itemCapManager), this);
        Bukkit.getPluginManager().registerEvents(new BannedItemListener(bannedItemManager), this);
        Bukkit.getPluginManager().registerEvents(new SleepListener(sleepManager), this);
        Bukkit.getPluginManager().registerEvents(new DimensionListener(dimensionManager), this);
        Bukkit.getPluginManager().registerEvents(new DragonListener(dragonManager), this);
        Bukkit.getPluginManager().registerEvents(new OneCraftListener(oneCraftManager), this);
        Bukkit.getPluginManager().registerEvents(new EnchantControlListener(configStore), this);
        Bukkit.getScheduler().runTask(this, dragonManager::applyHealthToExistingDragons);

        getCommand("smphub").setExecutor(new SmpHubCommand(this));
        getCommand("itemcap").setExecutor(new ItemCapCommand(this));
        getCommand("banitem").setExecutor(new BanItemCommand(this));
        getCommand("onecraft").setExecutor(new com.smphub.command.OneCraftCommand(this));
        getCommand("onecraft").setTabCompleter(new com.smphub.command.OneCraftCommand(this));
        Bukkit.getScheduler().runTaskTimer(this, itemCapManager::enforceOnline, 20L, 20L);
    }

    public ConfigStore getConfigStore() {
        return configStore;
    }

    public ItemCapManager getItemCapManager() {
        return itemCapManager;
    }

    public BannedItemManager getBannedItemManager() {
        return bannedItemManager;
    }

    public SleepManager getSleepManager() {
        return sleepManager;
    }

    public DimensionManager getDimensionManager() {
        return dimensionManager;
    }

    public DragonManager getDragonManager() {
        return dragonManager;
    }

    public OneCraftManager getOneCraftManager() {
        return oneCraftManager;
    }
}