sinnalwayssimle

create me a home plugin no INVENTORY GUI have command /sethome name /home name and /nshomes reload to reload config and tabcomplater reload and can edit message sound and like permission per rank for cooldown tp to home like default 2 vip 5 example in luckperms permission nshomes.vip.5 like that have 4 rank default home2 , vip 5 , legend 8 and custom 10 make sure all code is opimized and no lag server and everything can edit from config.yml and have save player home data and more if u know thanks.

Kodari AI
KodariApr 1 at 10:04 am 15,233 (v2)

I’ll create a comprehensive home plugin with permission-based limits, configurable messages/sounds, and optimized data storage.

NSHomes
Advanced home management plugin with permission-based home limits and cooldowns. Features include /sethome, /home, /delhome, and /homes commands with full configurability. Supports tier-based permissions (nshomes.vip.5 or nshomes.vip) for flexible limit control. Includes persistent data storage, cooldown system, custom sounds, and tab completion. Optimized for performance with async data operations and efficient caching.

All files created! Here’s what I’ve built:

Features:

  • ✅ Commands: /sethome, /home, /delhome, /homes, /nshomes reload

  • ✅ Full tab completion for all commands

  • ✅ Permission-based limits supporting both nshomes.vip.5 (direct number) AND nshomes.vip (config lookup)

  • ✅ 4 tiers: default (2), vip (5), legend (8), custom (10)

  • ✅ Per-tier cooldown system with bypass permission

  • ✅ XSound for cross-version compatibility

  • ✅ Async data loading, YAML storage per player

  • ✅ Memory-efficient caching

  • ✅ All messages/sounds/limits configurable

Optimizations:

  • Data cached in memory for instant access

  • Async loading on startup prevents blocking

  • Efficient permission checking (checks highest tier)

  • Auto-save on shutdown

  • No database overhead

Permission system: The plugin checks for the HIGHEST home limit from either:

  1. Numeric permissions: nshomes.custom.15 = 15 homes

  2. Tier permissions: nshomes.legend = uses config value (8 homes)

Players can use /homes to see their current homes with their limit displayed!

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
15 908
src/main/java/com/nshomes/NSHomes.java
package com.nshomes;

import com.nshomes.commands.DelHomeCommand;
import com.nshomes.commands.HomeCommand;
import com.nshomes.commands.HomesCommand;
import com.nshomes.commands.NSHomesCommand;
import com.nshomes.commands.SetHomeCommand;
import com.nshomes.managers.ConfigManager;
import com.nshomes.managers.DataManager;
import com.nshomes.managers.HomeManager;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class NSHomes extends JavaPlugin {
    private ConfigManager configManager;
    private DataManager dataManager;
    private HomeManager homeManager;

    @Override
    public void onEnable() {
        this.configManager = new ConfigManager(this);
        this.dataManager = new DataManager(this);
        this.homeManager = new HomeManager(this);

        registerCommands();

        Bukkit.getScheduler().runTaskAsynchronously(this, () -> {
            this.dataManager.loadAllData();
            getLogger().info("NSHomes has been enabled!");
        });
    }

    @Override
    public void onDisable() {
        if (this.dataManager != null) {
            this.dataManager.saveAllData();
        }
        getLogger().info("NSHomes has been disabled!");
    }

    private void registerCommands() {
        getCommand("sethome").setExecutor(new SetHomeCommand(this));
        getCommand("sethome").setTabCompleter(new SetHomeCommand(this));
        
        getCommand("home").setExecutor(new HomeCommand(this));
        getCommand("home").setTabCompleter(new HomeCommand(this));
        
        getCommand("delhome").setExecutor(new DelHomeCommand(this));
        getCommand("delhome").setTabCompleter(new DelHomeCommand(this));
        
        getCommand("homes").setExecutor(new HomesCommand(this));
        
        getCommand("nshomes").setExecutor(new NSHomesCommand(this));
        getCommand("nshomes").setTabCompleter(new NSHomesCommand(this));
    }

    public void reload() {
        this.configManager.reload();
        this.dataManager.saveAllData();
        this.dataManager.loadAllData();
    }
}