đź“„
pasted-code-1792033024576.txt
txt
373 lines
â–¶
# ULTIMATEKITS — ADDITIONAL FEATURE IMPLEMENTATION
Implement features F, G, and H, plus the new LuckPerms Rank Integration system, into the existing UltimateKits Minecraft plugin.
These are mandatory additions to the existing project. Do not remove or break any previously implemented features.
Target: Paper 1.21.11+
Plugin: UltimateKits
Main command: /kits
Admin command: /kitadmin
Java: 21 or the version required by the target Paper release
Build system: Maven
# FEATURE F — CUSTOM KIT CLAIM EFFECTS
Implement a fully configurable reward effects system.
## 1. Supported Effects
Allow each kit to have its own effects when claimed successfully.
Support:
- Sounds.
- Particle effects.
- Titles and subtitles.
- Action bar messages.
- Chat announcements.
- Firework effects where appropriate.
- Configurable sound volume and pitch.
- Configurable particle count and offsets.
- Configurable title fade-in, stay, and fade-out durations.
- Optional broadcast announcements for special kits.
- Optional effects when a kit becomes available again.
## 2. Effect Configuration
Administrators must be able to configure effects globally and individually per kit.
Example configuration:
effects:
enabled: true
player-preferences: true
default:
sound: ENTITY_PLAYER_LEVELUP
particles: true
title: "Kit Claimed!"
subtitle: "You received {kit} "
action-bar: "Successfully claimed {kit}!"
kits:
vip:
sound: UI_TOAST_CHALLENGE_COMPLETE
particles: true
title: "VIP Kit Claimed!"
subtitle: "Enjoy your rewards!"
Requirements:
- Validate sound and particle identifiers.
- Handle invalid configuration without crashing.
- Allow effects to be disabled globally or individually.
- Add a player preference to disable nonessential effects.
- Do not play claim-success effects if delivery fails.
- Ensure effects trigger only once per successful claim.
- Use MiniMessage formatting with configurable legacy formatting support.
- Keep effects lightweight and avoid unnecessary repeating tasks.
Add appropriate player settings and administrator commands to test, edit, and reload effects.
# FEATURE G — ADVANCED EQUIPMENT AND INVENTORY RULES
Implement configurable kit delivery rules.
## 1. Kit Content Types
Support:
- Normal inventory items.
- Armor slots.
- Offhand items.
- Potion effects.
- Optional console commands.
- Optional permission-based rewards.
- Custom item metadata supported by the Paper API.
Administrators must be able to edit these through the in-game kit editor.
## 2. Inventory Policies
Provide configurable delivery policies:
- MERGE: Add items to available inventory slots without intentionally replacing existing items.
- REQUIRE_EMPTY_SPACE: Refuse the claim unless all kit items fit.
- INVENTORY_THEN_DROP: Place items in the inventory and drop overflow safely.
- INVENTORY_THEN_QUEUE: Place items in the inventory and queue remaining items for later delivery.
For armor and offhand equipment, support:
- KEEP_EXISTING: Do not replace occupied equipment slots.
- REPLACE_EXISTING: Replace equipment only when the administrator explicitly configures this policy and the existing items are safely preserved.
- REQUIRE_EMPTY_SLOTS: Refuse the claim if required equipment slots are occupied.
Requirements:
- Never silently delete or overwrite existing player items.
- When replacing equipment, safely preserve the replaced items through an explicit overflow policy.
- Handle full inventories without item loss.
- Prevent duplicate delivery after disconnects, server restarts, or concurrent claims.
- Persist queued items and delivery transaction state.
- Handle items with enchantments, custom names, lore, potion metadata, armor metadata, and supported item components.
- Validate kit contents before delivery.
- Validate permissions and cooldowns immediately before granting rewards.
- Do not charge players or trigger claim effects when delivery fails.
- Prevent reward duplication from command spam or simultaneous GUI clicks.
## 3. Delivery Transaction Safety
Create a claim transaction system.
Each claim must have a unique transaction ID and persistent status, such as:
- PENDING
- PROCESSING
- COMPLETED
- FAILED
- NEEDS_RECOVERY
Record the transaction before delivery begins.
Implement recovery logic for interrupted transactions. Do not automatically retry a transaction if doing so could duplicate items.
For ambiguous delivery states, preserve the transaction for administrator review rather than risking duplication or item loss.
Provide administrator diagnostics and recovery commands. Document how transactions are recovered after an unexpected server shutdown.
# FEATURE H — ADMIN DASHBOARD
Implement a polished, interactive GUI dashboard accessible through:
/kitadmin
## 1. Dashboard Layout
Create a configurable inventory menu with buttons for:
- Manage Kits
- Manage Categories
- Create Kit
- Create Category
- Kit Editor
- Player Management
- Rank and Permission Management
- Cooldown Management
- Claim Statistics
- Reward Delivery Queue
- Effects Configuration
- Inventory Rules
- Backup and Restore
- Import and Export
- Configuration Status
- Reload Configuration
- Debug Diagnostics
Use suitable Minecraft materials, clear display names, and informative lore.
## 2. Statistics
Display:
- Total kits.
- Enabled kits.
- Disabled kits.
- Total categories.
- Total successful claims.
- Most claimed kits.
- Recent claim activity.
- Pending queued rewards.
- Failed or interrupted transactions.
- Storage and database health.
- Optional economy and PlaceholderAPI integration status.
- LuckPerms integration status.
Statistics must use actual plugin data rather than hardcoded example numbers.
## 3. Administrative Actions
Allow authorized administrators to:
- Create, edit, duplicate, enable, disable, and delete kits.
- Create and edit categories.
- Search for kits.
- Inspect a player's kit eligibility.
- Reset a player's cooldowns.
- View pending deliveries.
- Review interrupted transactions.
- Create and restore backups.
- Reload supported configuration safely.
- Inspect permission requirements.
- Test claim effects.
- Inspect plugin diagnostics.
Require confirmation for destructive actions.
## 4. Dashboard Security
Every action must have its own permission check.
Do not assume a player is authorized merely because they opened the dashboard.
Console commands must continue to work where appropriate.
Hide unauthorized controls from users without the relevant permissions. Revalidate authorization whenever an action is executed.
Prevent GUI exploits, item movement, unauthorized clicks, and accidental item transfers.
# NEW FEATURE — LUCKPERMS RANK-BASED KIT SYSTEM
This feature is essential.
Integrate UltimateKits with LuckPerms so players can claim kits based on their ranks and permissions.
LuckPerms must be an optional integration. If LuckPerms is absent, the plugin must still work using standard Bukkit permissions.
## 1. Supported Rank Kits
Provide example kits for:
- Default
- VIP
- VIP+
- MVP
- MVP+
- Elite
- Legend
- Staff
These are example configurations, not hardcoded ranks. Server administrators must be able to rename, remove, or add ranks and kits.
## 2. Permission-Based Access
Use standard LuckPerms-compatible permission checks.
Example permissions:
ultimatekits.kit.default
ultimatekits.kit.vip
ultimatekits.kit.vipplus
ultimatekits.kit.mvp
ultimatekits.kit.mvpplus
ultimatekits.kit.elite
ultimatekits.kit.legend
ultimatekits.kit.staff
Each kit must have a configurable required permission.
For example, the VIP kit must require:
ultimatekits.kit.vip
A player who has this permission through their LuckPerms group inheritance must be able to claim the VIP kit.
A player without the permission must not be able to claim it, even if they know the command or manipulate a GUI.
## 3. Example LuckPerms Setup
Include documentation explaining how administrators can configure LuckPerms.
Example commands:
/lp creategroup vip
/lp group vip permission set ultimatekits.kit.vip true
/lp group default permission set ultimatekits.use true
/lp user parent add vip
These commands are examples for a basic setup. Explain how to assign the kit permission to existing groups and how to configure inheritance between ranks.
Do not automatically create LuckPerms groups or grant permissions without an administrator explicitly requesting such behavior.
## 4. Rank-Specific Kits
Each rank kit must support:
- Unique items and rewards.
- Individual cooldowns.
- One-time or repeatable claims.
- Custom GUI icons.
- Rank-specific descriptions.
- Permission-based visibility.
- Rank-specific claim effects.
- Configurable inventory delivery rules.
- Optional economy prices.
- Configurable category placement.
Example:
- Default Kit: free, one-time.
- VIP Kit: permission required, 24-hour cooldown.
- VIP+ Kit: permission required, 24-hour cooldown.
- MVP Kit: permission required, 12-hour cooldown.
- Legend Kit: permission required, 6-hour cooldown.
These are example values and must be editable in configuration.
## 5. GUI Rank Visibility
In the kits menu:
- Display kits the player is permitted to access.
- Optionally show locked rank kits with a clear permission-required message.
- Allow administrators to choose between hiding locked kits and showing them as locked.
- Show the appropriate rank requirement in the kit lore.
- Display cooldown status separately from permission status.
- Never let GUI visibility alone determine whether a player can claim a kit.
When a player clicks a locked VIP kit, show a configurable message such as:
"You need the VIP rank to claim this kit."
Allow administrators to customize this message and the displayed rank name.
## 6. Rank Inheritance
Respect LuckPerms permission inheritance.
If a higher rank inherits a lower rank's permissions, the player must receive access to the lower rank's kits automatically.
Example:
- VIP inherits Default.
- VIP+ inherits VIP.
- MVP inherits VIP+.
- Legend inherits MVP.
These inheritance relationships must be configured in LuckPerms, not hardcoded into UltimateKits.
Do not infer rank access from a player's prefix, suffix, display name, or group name. Use permission checks instead.
## 7. Rank and Kit Administration
Provide commands:
/kitadmin setpermission
/kitadmin rank info
/kitadmin rank check
/kitadmin rank kits
/kitadmin rank reload
Requirements:
- Show whether a player has the required permission.
- Display which kits the player is eligible to claim.
- Show cooldowns separately from rank eligibility.
- Never grant rank permissions through a normal player claim.
- Keep rank permission administration within LuckPerms or authorized server administration.
- Handle offline player inspection safely where supported.
- Do not require LuckPerms to create, edit, or use ordinary permission-based kits.
## 8. Testing Requirements
Test all additions:
1. A default player can claim the Default kit.
2. A player without the VIP permission cannot claim the VIP kit.
3. A player assigned to the VIP group can claim the VIP kit.
4. A player inheriting the VIP permission through a higher group can claim the VIP kit.
5. Revoking the required permission prevents future claims.
6. A full inventory follows the configured delivery policy.
7. Existing armor is never silently destroyed.
8. Claim effects run only after successful delivery.
9. Admin dashboard buttons enforce permissions.
10. Pending rewards and transactions persist across restarts.
11. LuckPerms being absent does not disable the core plugin.
12. All additions compile against the target Paper API.
# FINAL IMPLEMENTATION REQUIREMENT
Integrate features F, G, and H and the LuckPerms rank system into the existing UltimateKits project.
Do not create a separate plugin or replace existing features.
Update all relevant Java classes, configuration files, plugin metadata, permission documentation, commands, tab completion, database schemas, and GUI layouts.
Compile the entire project and fix errors before delivery. Provide the complete source project and a compiled JAR when the environment supports building it.
Do not claim a feature is complete unless its implementation actually exists and has been tested.
Implement claim effects and player effect preferences.
Add safe kit delivery and persistent claim transactions.
Build the permission-secured admin dashboard and diagnostics.
Add configurable permission/rank kit access with optional LuckPerms compatibility.
Created a new Maven-based UltimateKits project because the workspace was empty; there was no existing plugin code to integrate with or preserve.
Claim effects: Added configurable global/per-kit sounds, particles, titles, subtitles, action bars, chat/broadcast messages, and fireworks. Player effect preferences persist; claim effects run only after a successful delivery.
Claims and delivery: Added configurable inventory/equipment policies, persistent queues, cooldowns, and transaction records. Interrupted claims are held for review rather than automatically replayed; admin commands can inspect and resolve claim and queue transactions.
Admin and rank access: Added a permission-checked dashboard with kit enable/disable controls and live summary data. Kit permissions use Bukkit checks, which honor LuckPerms inheritance when LuckPerms is installed; example rank kits, commands, and setup guidance are included.
Documentation: Added
README.mdwith LuckPerms setup and transaction-recovery instructions.
Not complete: The requested full in-game editor, category management, create/duplicate/delete workflows, backup/restore, import/export, and complete statistics/integration dashboard are not implemented. I also have not run a Paper-server integration test or verified a compiled JAR, so this should not be treated as a fully tested implementation.
is there a category to put certain kits in?
Yes—each kit has a category field in kits.yml (for example, category: rank). Right now it’s shown in the kit’s lore, but kits aren’t grouped or filtered by category in the menu.
can you make the mode have different categories and make me able to move the kits to the slot i want to move them
Add kit categories to the menu.
Let each kit be assigned to a specific menu slot.
Added category buttons to the kits menu, generated from each kit’s category: value in kits.yml. Use different values—such as rank, pvp, or utility—to create separate categories; All Kits shows every kit.
Added menu-slot: to set a kit’s position. Slots are numbered 0–44 across the first five rows; the sample kits are set to slots 0–7. If a slot is missing, invalid, or already occupied, the kit goes in the next available slot.
can you edit plugins and make it so i can do that?
Add an in-game way to rearrange kits and save their slots.
Keep the category menu usable while editing.
Added an in-game kit layout editor. Use Arrange Kit Slots in the admin dashboard or run /kitadmin layout (requires ultimatekits.admin.kits). Click a kit, then its destination slot; placing it on another kit swaps their positions, and changes save automatically.
Categories remain available in the kits menu; set each kit’s category: in kits.yml to organize them.
package com.ultimatekits;
import com.ultimatekits.command.KitAdminCommand;
import com.ultimatekits.command.KitsCommand;
import com.ultimatekits.command.KitTabCompleter;
import com.ultimatekits.effects.EffectsManager;
import com.ultimatekits.gui.KitMenuListener;
import com.ultimatekits.kit.DeliveryQueueListener;
import com.ultimatekits.kit.DeliveryQueue;
import com.ultimatekits.kit.KitClaimService;
import com.ultimatekits.kit.KitRepository;
import com.ultimatekits.kit.TransactionStore;
import org.bukkit.plugin.java.JavaPlugin;
public final class UltimateKits extends JavaPlugin {
private EffectsManager effectsManager;
private KitRepository kitRepository;
private KitClaimService claimService;
private TransactionStore transactionStore;
private DeliveryQueue deliveryQueue;
@Override
public void onEnable() {
saveDefaultConfig();
this.effectsManager = new EffectsManager(this);
this.kitRepository = new KitRepository(this);
this.transactionStore = new TransactionStore(this);
this.deliveryQueue = new DeliveryQueue(this);
this.claimService = new KitClaimService(this, kitRepository, transactionStore, deliveryQueue);
getCommand("kits").setExecutor(new KitsCommand(this));
getCommand("kitadmin").setExecutor(new KitAdminCommand(this));
getCommand("kits").setTabCompleter(new KitTabCompleter(this));
getCommand("kitadmin").setTabCompleter(new KitTabCompleter(this));
getServer().getPluginManager().registerEvents(new KitMenuListener(this), this);
getServer().getPluginManager().registerEvents(new DeliveryQueueListener(this), this);
getLogger().info("UltimateKits enabled with " + kitRepository.getKits().size() + " configured kits.");
}
public EffectsManager getEffectsManager() {
return effectsManager;
}
public KitRepository getKitRepository() {
return kitRepository;
}
public KitClaimService getClaimService() {
return claimService;
}
public TransactionStore getTransactionStore() {
return transactionStore;
}
public DeliveryQueue getDeliveryQueue() {
return deliveryQueue;
}
public void reloadUltimateKits() {
reloadConfig();
kitRepository.reload();
effectsManager.reload();
}
}