wheatzi_
📎 1 file 4,618 chars
📄
pasted-code-1786986634503.txt
txt 243 lines
▶
# ChurroKits — LuckPerms Access System

Add a complete **LuckPerms integration** to ChurroKits.

Some kits should be locked by default. Players only get access when they have the correct LuckPerms permission.

## Kit Permissions

Every kit automatically generates a permission based on its kit name.

For example:

```text
Starter Kit
→ churrokits.kit.starter

VIP Kit
→ churrokits.kit.vip

Elite Kit
→ churrokits.kit.elite

Legend Kit
→ churrokits.kit.legend
```

The permission should automatically be generated from the kit's ID/name.

Convert names into clean permission nodes:

```text
"VIP" → churrokits.kit.vip
"Elite Kit" → churrokits.kit.elite
"OP Starter" → churrokits.kit.opstarter
```

## LuckPerms

Use LuckPerms as the permission system.

When creating a kit, ChurroKits should automatically show the permission that controls access.

Example in the admin editor:

```text
╔════════════════════════════════╗
║        EDIT VIP KIT            ║
╠════════════════════════════════╣
║                                ║
║ Permission:                    ║
║ churrokits.kit.vip             ║
║                                ║
║ Status: 🔒 LOCKED              ║
║                                ║
║ Players need this permission   ║
║ to claim the kit.              ║
║                                ║
║ [COPY PERMISSION]              ║
║ [EDIT KIT]                     ║
║ [BACK]                         ║
╚════════════════════════════════╝
```

## Locked Kit INVENTORY GUI

If a player doesn't have the permission, show the kit but make it clearly locked.

Example:

```text
🔒 VIP KIT

§cLOCKED

§7You don't have access to this kit.

§7Required Permission:
§echurrokits.kit.vip

§8Contact a server administrator
§8if you believe you should have access.
```

The player must NOT be able to claim the kit while they don't have permission.

## Giving Access

Admins should be able to give access through LuckPerms.

For example:

```text
/lp user PlayerName permission set churrokits.kit.vip true
```

Or for a group:

```text
/lp group vip permission set churrokits.kit.vip true
```

ChurroKits should display the exact LuckPerms command needed.

## Automatic Permission Generation

Whenever an admin creates a new kit:

```text
/churrokits create god
```

ChurroKits automatically generates:

```text
churrokits.kit.god
```

If the kit is:

```text
/churrokits create media
```

the permission becomes:

```text
churrokits.kit.media
```

Do NOT make admins manually type the permission unless they want to override it.

## Admin Editor

Add a permission section to every kit:

```text
KIT SETTINGS

Name:
VIP

Permission:
churrokits.kit.vip

Requires Permission:
YES

Locked By Default:
YES

Cooldown:
24 hours

[EDIT PERMISSION]
[SAVE]
```

Allow admins to:

* Enable/disable permission requirements.
* Change the permission node.
* Copy the permission.
* See the generated LuckPerms command.
* Make a kit public.
* Make a kit locked.
* Set a custom permission.

## `/churrokits permission`

Add:

```text
/churrokits permission  
```

This should **not directly bypass LuckPerms**.

Instead, it should show the admin the exact LuckPerms command needed to give that player access.

Example:

```text
/churrokits permission Steve vip
```

Output:

```text
§6ChurroKits
§7Kit: §eVIP
§7Permission: §achurrokits.kit.vip

§7Give Steve access using:

§f/lp user Steve permission set churrokits.kit.vip true
```

Also add:

```text
/churrokits permissiongroup  
```

Example:

```text
/churrokits permissiongroup vip vip
```

Output:

```text
/lp group vip permission set churrokits.kit.vip true
```

## No LuckPerms

If LuckPerms isn't installed:

* ChurroKits should still load.
* Public kits should continue working.
* Permission-locked kits should display a clear warning in console.
* Do not crash the plugin.
* Show the admin that LuckPerms is required for permission-controlled kits.

## Important

The permission system must integrate with the rest of ChurroKits:

* `/kits`
* Personal kit layout editor
* Admin kit editor
* Kit cooldowns
* Kit claiming
* Kit previews
* Kit INVENTORY GUI
* Kit categories
* PlaceholderAPI

A player can organize a locked kit in their personal layout, but they **cannot claim it until they receive the required LuckPerms permission**.

Make the whole system feel polished and easy for server staff to manage.
Kodari AI
KodariAug 17 at 5:12 pm 4
ChurroKitsPermissions
Adds LuckPerms integration to ChurroKits, automatically generating permission nodes from kit names. Locked kits display in the GUI with a clear lock icon, required permission, and deny claiming until access is granted. Admin editor shows permission status, copy button, and generated LuckPerms commands. New commands /churrokits permission and /churrokits permissiongroup display exact LuckPerms commands for granting access. Plugin loads without LuckPerms, keeping public kits functional while warning about locked kits.
  1. Create the Gradle/plugin metadata and default kit configuration.

  2. Implement kit, cooldown, layout, messaging, and optional PlaceholderAPI services.

  3. Add player/admin inventory GUIs and event handling.

  4. Register /kits and /churrokits commands, including LuckPerms command guidance and permission enforcement.

Implemented ChurroKits from scratch with:

  • Automatic kit permission generation: churrokits.kit.<clean-id>

  • LuckPerms-compatible access checks using Bukkit permissions

  • Locked-kit GUI display with required permission

  • Permission-protected claiming and cooldown enforcement

  • /churrokits permission <player> <kit>

  • /churrokits permissiongroup <group> <kit>

  • Admin editor GUI with permission status and LuckPerms commands

  • Public/locked toggles and custom permission nodes

  • /kits GUI with categories, previews, pagination, and locked indicators

  • Personal kit layout editor

  • Kit creation, deletion, reload, and permission management commands

  • Optional PlaceholderAPI placeholders

  • Graceful operation when LuckPerms is unavailable

  • Persistent kits, cooldowns, and player layouts

  • Default Starter, VIP, and Elite kits

  • Gradle build and plugin metadata files

wheatzi_

bu tmake it so i can edit it with op and dle then and chean ge the icon for the kit when you calim and stuff

Kodari AI
KodariAug 17 at 5:15 pm 3
  1. Add OP/admin kit editing with kit deletion.

  2. Add editable kit icons and use them consistently in kit GUIs and claim-related displays.

  3. Preserve existing permission, cooldown, layout, and preview behavior.

The existing system already gives OPs churrokits.admin, and kit icons are persisted and used by /kits. I’m extending the admin editor with direct icon editing, item editing, name/category/cooldown editing commands, and a safe GUI delete action.

Implemented.

  • OPs can use /churrokits editor.

  • Click a kit to edit it.

  • Click Kit icon while holding an item to change the icon.

  • The new icon appears in /kits, previews, layouts, and admin menus.

  • Added item editor:

    • Left-click a slot while holding an item to add/replace it.

    • Right-click an item to remove it.

    • Clear all items button.

  • Added delete button in the admin editor.

  • Added editing commands:

    Plain Text
    /churrokits seticon <kit> [material]
    /churrokits setname <kit> <name>
    /churrokits setcategory <kit> <category>
    /churrokits setcooldown <kit> <seconds>
    
  • Existing commands still work:

    Plain Text
    /churrokits delete <kit>
    /churrokits setpermission <kit> <node|public>
    /churrokits toggle <kit>
    

The admin permission remains churrokits.admin, which is granted to OPs by default.

wheatzi_

no in the plugin i mean like thwn you do /kit its right click on the kits to edit the lay in the KITS no the INVENTORY GUI lay out

Kodari AI
KodariAug 17 at 5:18 pm 1
  1. Make right-clicking a kit in /kits open the OP kit editor instead of the personal layout editor.

  2. Keep left-click claiming, locked-kit behavior, and the separate personal layout editor unchanged.

  3. Ensure the kit editor’s item/icon changes affect the actual kit shown in /kits.

Right-clicking a kit in /kits now works differently for staff:

  • OP/admin right-click: opens the kit editor.

  • Non-admin right-click: opens the normal kit preview.

  • Admin left-click: still claims the kit normally.

  • The kit editor lets you:

    • Change the kit icon by holding an item and clicking Kit icon

    • Edit the actual kit contents

    • Toggle permissions

    • Delete the kit

    • View LuckPerms commands

The personal layout editor remains separate through the Personal layout button, so right-clicking a kit will no longer open or modify the inventory menu layout.

wheatzi_

and make sure it copy everything enchants off hand and armour

Kodari AI
KodariAug 17 at 5:21 pm 3
  1. Update kit capture so it records the full player inventory, armor, off-hand, and item metadata.

  2. Preserve enchantments and all item data when saving and restoring kits.

  3. Ensure the admin kit editor can copy the player’s complete loadout, not just the main inventory.

Updated the kit editor:

  • Added Copy current loadout button.

  • Copies the player’s full inventory.

  • Copies all armor slots.

  • Copies the off-hand item.

  • Preserves enchantments, names, lore, attributes, durability, and other item data.

  • Saves all item metadata correctly in kits.yml.

  • Claiming a kit gives the armor and off-hand items too.

  • Existing kits using the old material format still load correctly.

Use it through:

/kits → right-click the kit as OP → Edit kit items → Copy current loadout.

wheatzi_

yes good but to edit the kits with op liek to add items you need op and to do /churrokits edit or editor but if you want to just edit where the items our in your invo in the kits menu you deont need op

Kodari AI
KodariAug 17 at 5:25 pm 1
  1. Restrict kit-content editing to OP/admin users and /churrokits edit/editor.

  2. Make the /kits personal inventory-layout editor available to everyone without OP.

  3. Keep right-click kit editing reserved for OP/admins while preserving normal preview behavior for other players.

  • Added /churrokits edit as an alias for /churrokits editor.

  • Kit content editing, item adding/removing, loadout copying, icon changes, and deletion now require churrokits.admin (OP by default).

  • Added permission checks to all admin kit-editing GUIs.

  • The Personal layout button in /kits remains available to everyone without OP, allowing players to rearrange kit positions only.

  • Regular players can still preview kits with right-click but cannot edit their contents.

wheatzi_

makw it so when you wqant to edit the layout of the kits you see the hole INVENTORY GUI and you can move thing around but cant add thing from invo but make sure yo u can see the full INVENTORY GUI/kit and move them round

Kodari AI
KodariAug 17 at 5:32 pm 3
  1. Update the personal layout editor to display the complete kit inventory GUI.

  2. Allow players to move kit entries between GUI slots without adding or removing kit contents.

  3. Keep kit contents, armor, off-hand, and admin editing protected from the layout editor.

Updated the personal kit layout editor:

  • /kits → Personal layout now shows the complete 54-slot GUI.

  • Click one kit, then click another slot to swap/move it.

  • Empty slots can be used as destinations.

  • The actual /kits menu now uses each player’s saved layout.

  • Kit icons cannot be added from the player inventory.

  • Inventory dragging, shift-clicking, hotbar swapping, and item placement are blocked.

  • Kit contents, armor, off-hand items, and enchantments are unaffected.

  • Reset still restores the default kit layout.

wheatzi_

make sure that i can edit everything and stuff and the bigger INVENTORY GUI for the previe but it should the the lay editor

1 image attached
Kodari AI
KodariAug 17 at 5:40 pm 2
  1. Make the personal layout editor use the same large chest-style inventory as the kit preview.

  2. Show the full kit contents in that editor, including armor and off-hand slots where possible.

  3. Keep it a layout-only editor: players can move kit entries, but cannot add, remove, or alter kit contents.

The layout editor is already a 54-slot chest GUI and blocks player-inventory additions. I’m updating the separate preview to the same large inventory size and making it display the kit’s complete saved loadout—storage, armor, and off-hand—without changing the layout editor into an item editor.

Updated the preview to use the larger 54-slot inventory GUI.

  • Displays the complete kit:

    • Main inventory items

    • Armor

    • Off-hand

    • Enchantments and all item metadata

  • The layout editor remains separate.

  • /kits → Personal layout still lets players move kit icons around.

  • Players cannot add items from their own inventory or edit kit contents.

  • OP/admin kit editing remains available through /churrokits edit or /churrokits editor.

wheatzi_

name the file 2.0 vesion

Kodari AI
KodariAug 17 at 5:41 pm 1

Updated ChurroKits to version 2.0 in:

  • plugin.yml

  • build.gradle

The built plugin file will now use the 2.0 version.

wheatzi_

i mean the lay out of the item in this INVENTORY GUI but thanks for making it bigger now make it so you can move the items round in this INVENTORY GUI and make it so it daves for that person

1 image attached
Kodari AI
KodariAug 17 at 5:48 pm 2
  1. Make the kit preview inventory an interactive, per-player item-layout editor.

  2. Allow moving/swapping the displayed kit items, including armor/off-hand entries, without changing the saved kit contents.

  3. Persist each player’s arrangement and reload it whenever they open that kit’s preview.

Updated the kit preview layout editor:

  • Players can click an item, then click another slot to move/swap it.

  • Empty slots can be used as destinations.

  • The full 54-slot preview GUI is editable.

  • Armor, off-hand, enchants, and item metadata remain displayed.

  • Kit contents themselves are not changed.

  • Each player’s arrangement is saved separately in preview-layouts.yml.

  • Layouts reload automatically when that player opens the kit preview.

  • Players do not need OP or special permission to rearrange the preview.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
manifest.kod
settings.gradle
Code
26 1,455
src/main/java/com/churrokits/ChurroKitsPlugin.java
package com.churrokits;

import com.churrokits.command.ChurroKitsCommand;
import com.churrokits.command.KitsCommand;
import com.churrokits.gui.GuiListener;
import com.churrokits.gui.GuiManager;
import com.churrokits.kit.CooldownManager;
import com.churrokits.kit.KitManager;
import com.churrokits.kit.LayoutManager;
import com.churrokits.kit.PreviewLayoutManager;
import com.churrokits.util.MessageManager;
import org.bukkit.Bukkit;
import org.bukkit.command.PluginCommand;
import org.bukkit.plugin.java.JavaPlugin;

public class ChurroKitsPlugin extends JavaPlugin {
    private KitManager kitManager;
    private CooldownManager cooldownManager;
    private LayoutManager layoutManager;
    private PreviewLayoutManager previewLayoutManager;
    private MessageManager messageManager;
    private GuiManager guiManager;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        saveResource("kits.yml", false);
        kitManager = new KitManager(this);
        cooldownManager = new CooldownManager(this);
        layoutManager = new LayoutManager(this, kitManager);
        previewLayoutManager = new PreviewLayoutManager(this);
        messageManager = new MessageManager(this);
        guiManager = new GuiManager(this);

        Bukkit.getPluginManager().registerEvents(new GuiListener(), this);
        registerCommands();

        if (Bukkit.getPluginManager().getPlugin("LuckPerms") == null && kitManager.hasPermissionLockedKits()) {
            getLogger().warning("LuckPerms is not installed. Permission-locked kits will remain locked until a permission provider is available.");
        }
        if (Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null) {
            new ChurroKitsExpansion(this).register();
        }
    }

    private void registerCommands() {
        PluginCommand kits = getCommand("kits");
        if (kits != null) {
            KitsCommand executor = new KitsCommand(this);
            kits.setExecutor(executor);
            kits.setTabCompleter(executor);
        }
        PluginCommand admin = getCommand("churrokits");
        if (admin != null) {
            ChurroKitsCommand executor = new ChurroKitsCommand(this);
            admin.setExecutor(executor);
            admin.setTabCompleter(executor);
        }
    }

    @Override
    public void onDisable() {
        if (cooldownManager != null) cooldownManager.save();
        if (layoutManager != null) layoutManager.save();
        if (previewLayoutManager != null) previewLayoutManager.save();
        if (kitManager != null) kitManager.save();
    }

    public KitManager getKitManager() { return kitManager; }
    public CooldownManager getCooldownManager() { return cooldownManager; }
    public LayoutManager getLayoutManager() { return layoutManager; }
    public PreviewLayoutManager getPreviewLayoutManager() { return previewLayoutManager; }
    public MessageManager getMessageManager() { return messageManager; }
    public GuiManager getGuiManager() { return guiManager; }
}