star_og56

I'll build this as a complete Maven project. Given the scope, let me set up the structure and work through it systematically.

Now the model:

Now the TeleportManager:

Now the main HomeGUI class:

Now the delete confirmation INVENTORY GUI:

Now update executeTeleport to close the INVENTORY GUI before teleporting and remove pending first (it already removes pending first):

Now the main plugin class:

All files are in place. Let me try a syntax-only compile pass using javac against stub Paper classes isn't practical, so instead I'll try downloading Paper API to actually validate (network is disabled per config, but let's confirm):

Good, matches what I verified. Now let me package the project into a zip for delivery.

Complete Maven project for the StarHome plugin, built to spec:

Architecture — com.starhome package split into config, INVENTORY GUI, listener, manager, model, scheduler, storage, command, util, wired together in StarHome.java.

Key design choices worth knowing about:

  • Folia safety: everything goes through SchedulerAdapter, which wraps Paper's region-threaded scheduler API (entity.getScheduler(), RegionScheduler, GlobalRegionScheduler, AsyncScheduler) — never the legacy BukkitScheduler. This runs correctly on both Folia and plain Paper/Purpur with one code path.
  • INVENTORY GUI identification uses a custom GUIHolder (not titles), and every clickable item is tagged via PersistentDataContainer (ItemAction + slot index) rather than parsed from display names.
  • Exploit prevention: all clicks/drags in StarHome inventories are cancelled outright; every create/delete/teleport action is re-validated at execution time (permissions, slot state, ownership) rather than trusting what was true when the menu opened.
  • Teleport countdown cancels on move (configurable distance), damage, world change, death, third-party teleports, disconnect, or INVENTORY GUI close — the plugin's own pre-teleport close is distinguished by clearing the pending state first, so it's not misread as a cancellation.
  • Storage: YAML per-player files with atomic temp-file writes and per-entry corruption skipping. It's built behind a StorageManager interface so a SQLite backend can be dropped in later without touching any other code.
  • Home creation via INVENTORY GUI uses an auto-generated name (Home 1, Home 2, ...) since true text input needs an external anvil-INVENTORY GUI library; /home set <name> is there for custom naming.

One limitation: I don't have network access in this environment, so I couldn't run mvn clean package against the real Paper API to compile-check it — I did a careful manual pass instead. Run mvn clean package on your end (needs internet for the first Paper API download) and let me know if anything doesn't compile — happy to fix.

Kodari AI
KodariAug 18 at 8:18 am 2
StarHome
StarHome is a comprehensive Minecraft home management plugin featuring a GUI-based interface for creating, viewing, and teleporting to player homes. The plugin implements a secure inventory system with clickable buttons, persistent data storage through YAML files, and a robust teleport scheduler with cancellation on movement or damage. It includes configurable permissions, multi-home support with named locations, and a delete confirmation interface. The plugin leverages a custom GUI framework with lazy initialization and centralized event handling, ensuring smooth integration with both Folia and standard Paper servers through an adaptive scheduler system.
  1. Create the Maven project metadata and plugin resources.

  2. Add home models, YAML persistence, configuration, and scheduler abstraction.

  3. Add commands, teleport cancellation/countdown handling, and GUI flows.

  4. Wire registration and lifecycle management in the main plugin class.

Created the complete StarHome Maven project with:

  • Paper plugin metadata and configurable messages

  • YAML-backed per-player home storage with atomic writes

  • Home creation, deletion, listing, teleportation, and tab completion

  • GUI-based home management and delete confirmation

  • PersistentDataContainer GUI action handling

  • Teleport countdown with movement, damage, death, world-change, quit, and teleport cancellation

  • Scheduler abstraction using Paper’s entity scheduler

  • Main plugin lifecycle wiring and permission nodes

Kodari can make mistakes. Review important code before using.
Files
src
pom.xml
Code
21 979
src/main/java/com/starhome/StarHome.java
package com.starhome;

import com.starhome.command.HomeCommand;
import com.starhome.config.StarHomeConfig;
import com.starhome.gui.GUIListener;
import com.starhome.listener.TeleportListener;
import com.starhome.manager.HomeManager;
import com.starhome.manager.TeleportManager;
import com.starhome.scheduler.SchedulerAdapter;
import com.starhome.storage.YamlStorageManager;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

public class StarHome extends JavaPlugin {
    private StarHomeConfig configuration;
    private SchedulerAdapter scheduler;
    private HomeManager homes;
    private TeleportManager teleports;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        configuration = new StarHomeConfig(getConfig());
        scheduler = new SchedulerAdapter(this);
        homes = new HomeManager(new YamlStorageManager(getDataFolder()));
        teleports = new TeleportManager(this);

        HomeCommand command = new HomeCommand(this);
        getCommand("home").setExecutor(command);
        getCommand("home").setTabCompleter(command);
        Bukkit.getPluginManager().registerEvents(new GUIListener(), this);
        Bukkit.getPluginManager().registerEvents(new TeleportListener(this), this);
    }

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

    public StarHomeConfig getConfiguration() {
        return configuration;
    }

    public SchedulerAdapter getScheduler() {
        return scheduler;
    }

    public HomeManager getHomes() {
        return homes;
    }

    public TeleportManager getTeleports() {
        return teleports;
    }

    public String message(String key, String... replacements) {
        return configuration.message(key, replacements);
    }
}