_nuwf

Kit Preview INVENTORY GUI Layout

The preview INVENTORY GUI should resemble the attached example.

Structure:

* Main inventory contents displayed in the center area using their original inventory slots. * A colored stained glass border separates inventory contents from equipment slots.

Equipment Section:

Bottom row should contain:

* Helmet * Chestplate * Leggings * Boots * Offhand

Border Coloring:

* The stained glass color should automatically match the kit's display dye color.

Examples:

* White Dye → White Stained Glass Pane * Purple Dye → Purple Stained Glass Pane * Red Dye → Red Stained Glass Pane * Blue Dye → Blue Stained Glass Pane * Green Dye → Green Stained Glass Pane

Example:

Kit: Wemmbu Display Dye: Purple Dye

Result:

* INVENTORY GUI icon = Purple Dye * Kit name color = Purple * Preview border = Purple Stained Glass Pane

Requirements:

* Players cannot remove or move items. * INVENTORY GUI is view-only. * Equipment should remain in dedicated slots regardless of inventory contents. * Empty decorative slots should be filled with the matching stained glass pane. * The preview should clearly separate inventory contents from armor/offhand items.

Kodari AI
KodariJun 11 at 6:37 pm 7
KitPreview
A Minecraft plugin that lets players visually preview kit loadouts through an interactive chest GUI. Kits are created from a player's live inventory and stored with a color dye theme. The preview GUI maps main inventory contents to their original slots, a colored stained-glass border separates them from armor/offhand slots, and the border color automatically matches the kit's assigned dye. Admins manage kits via /kit create/delete, while all players can browse and preview with /kit list and /kit preview.

[Generation stopped]

_nuwf
📎 1 file 2,739 chars
📄
pasted-code-1781203188897.txt
txt 112 lines
▶
You are NOT allowed to design extra systems or expand scope beyond what is listed below.

You are building a complete Minecraft kits plugin that must compile into a working .jar.

TARGET
Minecraft 1.21+ compatible
Use Paper API (preferred) but must also work on Spigot-compatible servers
Java 17 minimum
Output must be a fully functional plugin JAR project
❌ HARD RULES (DO NOT BREAK)

Do NOT:

Invent new commands (no /kit delete unless specified)
Add pagination systems unless explicitly required
Add unnecessary INVENTORY GUI frameworks
Drift into “architecture planning”
Create extra menus, buttons, or systems not listed
Rewrite requirements in your own structure

If something is not listed → DO NOT IMPLEMENT IT.

✅ REQUIRED FEATURES
1. Kits System Core

Each kit contains:

Inventory contents (main inventory slots mapped exactly)
Armor contents
Offhand item
Display name
Dye color (used for INVENTORY GUI glass + kit icon)
Locked state (boolean)
2. Commands
/kit create 
Saves player's current inventory as a kit
Sets default dye = WHITE if none specified
Stores armor + offhand
Creates kit entry
/kit list
Opens a INVENTORY GUI showing all kits
Each kit is represented as a dye item matching its color
/kit preview 
Opens read-only INVENTORY GUI
Shows:
Main inventory in correct slots
Armor section
Offhand slot
Uses stained glass border matching kit dye color
/kit claim 
Gives kit to player
Must:
Check LuckPerms permission: kit.
Check inventory space
If no space → cancel with message
3. Kit Editing
/kit edit 

Opens INVENTORY GUI with ONLY:

Change dye color (INVENTORY GUI selection of dyes)
Toggle locked/unlocked state

NO OTHER OPTIONS.

4. Permissions
kit. required to claim a kit
Admin bypass for OPs
5. INVENTORY GUI RULES
Must be chest INVENTORY GUI
Must NOT use pagination
Must NOT add navigation buttons
Must NOT add back/close complexity beyond standard inventory close
Kit border glass color = kit dye color
6. Messages

Must include:

No permission message
Kit not found message
Not enough inventory space message
Kit successfully claimed message
⚙️ TECHNICAL REQUIREMENTS
Must compile into a working plugin JAR
Must include:
plugin.yml
main plugin class
kit manager class
kit data class
INVENTORY GUI classes
command classes
Must use clean Java structure (no pseudo-code)
Must persist kits (file storage JSON or YAML)
🚫 VERY IMPORTANT

This is NOT a design task.

You are generating a production-ready Minecraft plugin project.

If you add anything outside requirements, it is considered incorrect.

🎯 OUTPUT FORMAT

Return:

Full file structure
All Java source files
plugin.yml
build.gradle (or Maven pom.xml)
Any config files

Everything must be complete and compilable.
Kodari AI
KodariJun 11 at 6:54 pm 94

Here is the complete, compilable plugin across all required files:


Here’s the complete file structure and a summary of how each requirement maps to code:

Plain Text
src/main/java/com/kodari/kitpreview/
├── KitPreviewPlugin.java
├── command/
│   └── KitCommand.java
├── inventory/
│   ├── InventoryButton.java
│   ├── InventoryGUI.java
│   ├── InventoryHandler.java
│   ├── gui/
│   │   ├── GUIListener.java
│   │   └── GUIManager.java
│   └── impl/
│       ├── KitEditGUI.java
│       ├── KitListGUI.java
│       └── KitPreviewGUI.java
├── kit/
│   ├── Kit.java
│   ├── KitColor.java
│   └── KitManager.java
└── util/
    └── ColorUtil.java
src/main/resources/
└── plugin.yml
build.gradle

Key design decisions:

Requirement
Implementation
Preview slot layout
Slots 0–35 = inventory contents, 36–44 = full glass border row, 47–51 = Helmet/Chest/Legs/Boots/Offhand with glass padding
Border color = dye color
KitColor
enum maps each
*_DYE
to its matching
*_STAINED_GLASS_PANE
via XSeries
View-only (no item movement)
InventoryGUI.onClick
always calls
event.setCancelled(true)
before any slot lookup;
InventoryDragEvent
is also cancelled
Empty slots → glass
All 54 slots filled with glass first; item slots are then overlaid on top
Persistence
kits.yml
using Bukkit’s built-in
ItemStack
YAML serialization
kit.<name>
permission
Bukkit
player.hasPermission("kit." + name)
— OP bypass is automatic
Edit GUI
16 dye selectors in rows 0–1, lock toggle at slot 31 (center of row 3), live refresh on click
Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
21 1,372
src/main/java/com/kodari/kitpreview/KitPreviewPlugin.java
package com.kodari.kitpreview;

import com.kodari.kitpreview.command.KitCommand;
import com.kodari.kitpreview.inventory.gui.GUIListener;
import com.kodari.kitpreview.inventory.gui.GUIManager;
import com.kodari.kitpreview.kit.KitManager;
import org.bukkit.plugin.java.JavaPlugin;

public class KitPreviewPlugin extends JavaPlugin {

    private KitManager kitManager;
    private GUIManager guiManager;

    @Override
    public void onEnable() {
        this.kitManager = new KitManager(this);
        this.kitManager.loadAll();

        this.guiManager = new GUIManager();

        getServer().getPluginManager().registerEvents(new GUIListener(guiManager), this);

        KitCommand kitCommand = new KitCommand(kitManager, guiManager);
        getCommand("kit").setExecutor(kitCommand);
        getCommand("kit").setTabCompleter(kitCommand);
    }

    @Override
    public void onDisable() {
        if (kitManager != null) {
            kitManager.saveAll();
        }
    }
}