star_og56

Create a premium, production-ready Minecraft plugin named StarHome, built with Maven, using a clean modular architecture and designed for maximum compatibility with PaperMC, Folia, and Purpur, supporting Minecraft versions 1.21 through 1.21.11 (including 1.21.9, 1.21.10 and 1.21.11). The plugin must provide a polished "/home" INVENTORY GUI-based home-management system with configurable messages, sounds, colors, item names, lore, INVENTORY GUI titles, teleport delay, and home limits. When a player executes "/home", open a 4-row (36-slot) inventory INVENTORY GUI. Slots 10–16 represent the player's home slots and must initially display Gray Beds when a home is not configured; once a home is created, that corresponding bed changes to a Yellow Bed. Clicking a Yellow Bed should start a 5-second teleport countdown, with configurable countdown messages/sounds, and teleport the player to the saved home location after the countdown; the teleport must be cancelled safely if the player moves, takes damage, changes world, dies, closes the INVENTORY GUI, or another configurable cancellation condition occurs. Slots 19–25 must contain Gray Dye for unused home slots and change to Yellow Dye when the corresponding home exists. Clicking a Gray Dye should open a home-creation/setup interface where the player can enter or confirm the home name/details, and the INVENTORY GUI must provide a Green Dye/Green item labelled “Set Home” for confirmation and a Red Dye/Red item labelled “Cancel Home” for cancellation; clicking Set Home must save the player's current location, create the home, update the relevant bed and dye to yellow, and refresh the INVENTORY GUI immediately, while Cancel must close/return safely without creating anything. When the player clicks a Yellow Dye representing an existing home, open a separate 3-row (27-slot) confirmation INVENTORY GUI asking whether the player wants to delete that home, with a clear Green confirmation button and Red cancellation button; confirming must permanently remove that selected home and restore its bed/dye representation to the unused gray state. By default, every player may create 3 homes, while additional homes must be unlocked through permissions such as "starhome.home.4", "starhome.home.5", "starhome.home.6", "starhome.home.7", with the system designed to support further dynamic permission-based home limits in the future. Include permissions such as "starhome.use", "starhome.home.4", "starhome.home.5", "starhome.home.6", "starhome.home.7", "starhome.admin", and appropriate wildcard permissions where useful. Home data must persist across server restarts using a reliable storage system such as YAML or SQLite, with safe saving/loading, corruption protection, UUID-based player storage, world/location serialization, and no loss of homes. The INVENTORY GUI must have dynamic colors, item names, lore, status text, and placeholders depending on whether a home exists, including information such as home name, world, coordinates, creation status, teleport status, and available home slots. Make the entire plugin highly configurable through configuration files, including INVENTORY GUI layout, material types, slot positions, titles, item names, lore, messages, sounds, teleport countdown, home limits, permissions, and language/messages. Ensure the plugin is genuinely compatible with Folia's region-threaded architecture, avoiding unsafe Bukkit API calls and using Folia-compatible scheduling/teleport methods where required, while remaining fully functional on Paper and Purpur. Use modern Java and Maven project structure, proper "plugin.yml"/required metadata, clean command handling, tab completion, permissions, event listeners, inventory identification using "PersistentDataContainer" or another robust method instead of relying only on display names, null/edge-case protection, reload support where safe, and optimized asynchronous database/file operations without performing unsafe world/player operations asynchronously. The "/home" command should support useful subcommands such as "/home", "/home set <name>", "/home delete <name>", "/home list", and "/home reload" for administrators if appropriate, while the primary experience remains the premium INVENTORY GUI system. Prevent exploits such as item duplication, clicking invalid slots, manipulating INVENTORY GUI items, creating homes beyond permission limits, deleting another player's home, teleporting after cancellation, or bypassing the countdown. The final project should be a complete, professional-grade StarHome Maven plugin source project, with organized packages, comments where useful, configurable INVENTORY GUI/menu classes, home manager, storage manager, command manager, permission manager, teleport manager, Folia/Paper scheduler abstraction, listeners, utilities, configuration files, default language file, README/documentation, and all required Maven dependencies, ready to compile and build into a ".jar" and install directly on PaperMC, Folia, or Purpur servers running Minecraft 1.21–1.21.11.

Kodari AI
KodariAug 17 at 10:16 am 4
StarHome
StarHome is a premium inventory GUI-based home management plugin for PaperMC, Folia, and Purpur servers. Players execute /home to open a 36-slot GUI displaying home slots as gray beds that turn yellow when configured. Clicking a yellow bed starts a configurable 5-second teleport countdown with cancellation on movement, damage, world change, death, or GUI close. Gray dye slots open a home creation interface with green set and red cancel buttons, while yellow dye opens a deletion confirmation GUI. Supports permission-based home limits starting at 3, dynamic placeholders for home names, worlds, coordinates, and slot status. Features YAML storage with UUID-based persistence, corruption protection, Folia-compatible scheduling, configurable messages, sounds, colors, item materials, and GUI layouts. Includes /home set, delete, list, and reload subcommands with full exploit prevention and tab completion.
  1. Create the Maven project metadata, plugin descriptors, configurable defaults, language file, and documentation.

  2. Add the core model, YAML persistence, permissions, configuration, and scheduler/teleport services.

  3. Add the inventory GUI framework and home/setup/delete menus.

  4. Add command handling, event listeners, plugin bootstrap, and Folia/Paper-safe lifecycle wiring.

  1. Created the complete Maven StarHome project with Paper/Folia/Purpur metadata, permissions, configurable GUI layouts, messages, sounds, and README documentation.

  2. Added UUID-based YAML home persistence with asynchronous serialized writes, temporary-file replacement, corruption protection, and shutdown handling.

  3. Implemented home models, permission-based limits, configurable slot support, create/delete/list/set commands, tab completion, and admin reload.

  4. Added 36-slot home GUI, 27-slot setup GUI, deletion confirmation GUI, persistent item identifiers, configurable materials, lore, placeholders, and status data.

  5. Added Folia-compatible player scheduling, teleport countdown cancellation on movement, damage, world changes, death, GUI close, and disconnect.

  6. Added event listeners, chat-based home naming, sounds, lifecycle wiring, and plugin bootstrap under com.kodari.starhome.StarHomePlugin.

Kodari can make mistakes. Review important code before using.
Files
src
manifest.kod
pom.xml
README.md
Code
24 1,236
src/main/java/com/kodari/starhome/StarHomePlugin.java
package com.kodari.starhome;

import com.kodari.starhome.command.HomeCommand;
import com.kodari.starhome.gui.MenuManager;
import com.kodari.starhome.listener.StarHomeListener;
import com.kodari.starhome.service.ChatInputService;
import com.kodari.starhome.service.ConfigService;
import com.kodari.starhome.service.HomeService;
import com.kodari.starhome.service.MessageService;
import com.kodari.starhome.service.PermissionService;
import com.kodari.starhome.service.SoundService;
import com.kodari.starhome.service.TeleportService;
import com.kodari.starhome.storage.HomeStorage;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

public final class StarHomePlugin extends JavaPlugin {
    private ConfigService configService;
    private MessageService messages;
    private PermissionService permissions;
    private HomeService homes;
    private MenuManager menus;
    private SoundService sounds;
    private TeleportService teleports;
    private ChatInputService inputs;

    @Override public void onEnable() {
        saveDefaultConfig();
        configService = new ConfigService(this);
        initializeServices();
        HomeCommand command = new HomeCommand(this);
        if (getCommand("home") != null) { getCommand("home").setExecutor(command); getCommand("home").setTabCompleter(command); }
        Bukkit.getPluginManager().registerEvents(new StarHomeListener(this, menus), this);
        getLogger().info("StarHome enabled with Folia-compatible scheduling.");
    }

    private void initializeServices() {
        messages = new MessageService(this, configService);
        permissions = new PermissionService(configService);
        homes = new HomeService(new HomeStorage(this), configService, permissions);
        menus = new MenuManager(this);
        sounds = new SoundService(this);
        teleports = new TeleportService(this);
        inputs = new ChatInputService(this);
    }

    public void reloadServices() {
        teleports.cancelAll();
        configService.reload();
        initializeServices();
    }

    public ConfigService config() { return configService; }
    public MessageService messages() { return messages; }
    public PermissionService permissions() { return permissions; }
    public HomeService homes() { return homes; }
    public MenuManager menus() { return menus; }
    public SoundService sounds() { return sounds; }
    public TeleportService teleports() { return teleports; }
    public ChatInputService inputs() { return inputs; }

    @Override public void onDisable() {
        if (teleports != null) teleports.cancelAll();
        if (homes != null) homes.persist();
        if (homes != null) homes.shutdown();
    }
}