zynorixe

also in last tel me all dependenies

๐Ÿ“Ž 1 file 7,564 chars
๐Ÿ“„
pasted-code-1782625554750.txt
txt 416 lines
โ–ถ
Create a professional Minecraft Java Edition Authentication & Hub Plugin for Paper/Spigot/Purpur servers.

PLUGIN NAME

ZYNOR-AUTH

DESCRIPTION

ZYNOR-AUTH is a premium Minecraft authentication, lobby, and world-management plugin designed for Paper, Spigot, and Purpur servers. It provides secure player registration, login protection, Discord logging, Citizens NPC integration, Multiverse world management, and a professional authentication experience before players access the main server worlds.

BRANDING

* Plugin Name: ZYNOR-AUTH
* Prefix: ยง6[ZYNOR-AUTH] ยงr
* Theme: Gold, Black, Dark Gray
* Modern INVENTORY GUI Design
* Premium Authentication Experience
* Professional Code Structure

CORE CONCEPT

Players join the main server directly.

No Velocity.
No BungeeCord.
No Limbo Server.

The server contains a dedicated Authentication World where every player must authenticate before accessing the main lobby.

AUTHENTICATION SYSTEM

When a player joins for the first time:

* Automatically teleport them to the Authentication World.
* Require registration using:

/register  

Returning players:

* Must login using:

/login 

Security Features:

* Block movement before authentication.
* Block jumping before authentication.
* Block block breaking.
* Block block placing.
* Block inventory interaction.
* Block entity interaction.
* Block chest access.
* Block item dropping.
* Block item pickup.
* Block world switching.
* Block NPC interaction.
* Block chat messages.
* Block private messages.
* Block all commands except authentication commands.
* Configurable login timeout.
* Configurable maximum login attempts.
* Account lock after too many failed attempts.
* Session login support.
* Secure BCrypt password hashing.
* Automatic session expiration.

AUTHENTICATION WORLD

World Name:

auth

Features:

* Protected spawn area.
* Authentication INVENTORY GUI.
* Login reminders.
* Register reminders.
* Action Bar reminders.
* BossBar reminders.
* Titles and subtitles.
* Sound effects.
* Configurable spawn location.
* Authentication holograms.

LOBBY SYSTEM

After successful authentication:

* Teleport player to Lobby World.
* Show welcome title.
* Show subtitle.
* Play welcome sounds.
* Show action bar message.
* Save player session.

Lobby World:

lobby

MULTIVERSE SUPPORT

Integrate with Multiverse-Core.

World Structure:

* auth
* lobby
* survival
* lifesteal
* boxpvp
* practice

CITIZENS NPC SUPPORT

Create support for Citizens NPCs.

Lobby NPCs:

* Survival NPC
* Lifesteal NPC
* BoxPvP NPC
* Practice NPC

NPC Features:

* Click NPC to join game mode.
* Teleport player to configured world.
* Play teleport sound.
* Show title.
* Show action bar.
* Configurable permissions.
* Configurable destinations.

WORLD REDIRECTION

Survival NPC:
โ†’ survival world

Lifesteal NPC:
โ†’ lifesteal world

BoxPvP NPC:
โ†’ boxpvp world

Practice NPC:
โ†’ practice world

COMMANDS

Player Commands:

* /register
* /login
* /logout
* /changepassword

Admin Commands:

* /authreload
* /authadmin
* /forcelogin
* /forcelogout
* /resetpassword
* /unlockaccount
* /authinfo

ADMIN FEATURES

* Force login players.
* Force logout players.
* Reset passwords.
* Unlock accounts.
* View authentication status.
* View player data.
* Reload configurations.
* Manage sessions.
* Manage NPC destinations.

DISCORD INTEGRATION

Create advanced Discord Webhook support.

Webhook Categories:

* Authentication Logs Webhook
* Security Logs Webhook
* Admin Logs Webhook
* Player Activity Logs Webhook
* Server Status Logs Webhook
* Error Logs Webhook

AUTHENTICATION LOGS

Send Discord embeds when:

* Player registers.
* Player logs in.
* Player logs out.
* Password changes.
* Failed login attempts.
* Account lock events.
* Account unlock events.

Embed Fields:

* Player Name
* UUID
* Timestamp
* Authentication Status
* Login Method
* Current World

PLAYER ACTIVITY LOGS

Send Discord embeds when:

* Player joins server.
* Player leaves server.
* Player switches world.
* Player uses NPC.
* Player teleports.
* Player enters Survival.
* Player enters Lifesteal.
* Player enters BoxPvP.
* Player enters Practice.

SECURITY LOGS

Send Discord alerts when:

* Multiple failed login attempts occur.
* Account lock occurs.
* Unauthorized access attempts occur.
* Suspicious activities occur.
* Permission abuse occurs.

ADMIN LOGS

Send Discord embeds when:

* Staff force login a player.
* Staff force logout a player.
* Staff reset a password.
* Staff unlock an account.
* Staff reload plugin.
* Staff use admin commands.

SERVER STATUS LOGS

Send Discord embeds when:

* Server starts.
* Server stops.
* Plugin enables.
* Plugin disables.
* Plugin reloads.

ERROR LOGS

Send Discord alerts when:

* Plugin errors occur.
* Authentication errors occur.
* Configuration errors occur.
* NPC errors occur.
* Teleportation errors occur.
* World loading errors occur.

DISCORD EMBEDS

Use professional Discord embeds:

* Custom colors.
* Custom footer.
* Server icon support.
* Timestamp support.
* Configurable embed layout.
* Modern premium design.

FILE STORAGE SYSTEM

Do NOT use:

* MySQL
* MariaDB
* PostgreSQL
* MongoDB
* SQLite
* Any external database

Use only:

* YAML files
* JSON files
* Local file storage

Files:

* players.yml
* sessions.yml
* logs.yml
* worlds.yml
* npc.yml
* messages.yml
* config.yml
* discord.yml

PERMISSIONS

* zynorauth.register
* zynorauth.login
* zynorauth.logout
* zynorauth.changepassword
* zynorauth.admin
* zynorauth.reload
* zynorauth.forcelogin
* zynorauth.forcelogout
* zynorauth.resetpassword
* zynorauth.unlockaccount

INVENTORY GUI FEATURES

Authentication INVENTORY GUI:

* Register Button
* Login Button
* Help Button
* Server Information Button

Admin INVENTORY GUI:

* Player Management
* Account Management
* Session Management
* Configuration Management
* NPC Management

MESSAGES SYSTEM

Fully customizable:

* messages.yml
* colors support
* MiniMessage support
* PlaceholderAPI support

PLACEHOLDERAPI SUPPORT

Create placeholders:

* %zynorauth_status%
* %zynorauth_registered%
* %zynorauth_session%
* %zynorauth_world%

PERFORMANCE

* Support 500+ concurrent players.
* Async file operations.
* Async Discord webhook requests.
* Optimized event listeners.
* Low memory usage.
* No memory leaks.

COMPATIBILITY

Minecraft:

* 1.20.x
* 1.21.x
* Latest versions

Software:

* PaperMC
* Spigot
* Purpur

CODE REQUIREMENTS

* Java 21
* Maven project
* Clean OOP architecture
* Modular design
* Production-ready code
* Full source code
* Well-documented code
* Error handling
* Logging system
* Professional package structure

EXPECTED OUTPUT

Generate:

* Complete plugin source code.
* Maven project structure.
* plugin.yml
* pom.xml
* Configuration files.
* Event listeners.
* Authentication manager.
* Session manager.
* Citizens NPC integration.
* Multiverse integration.
* Discord webhook integration.
* INVENTORY GUI system.
* Permissions system.
* Setup guide.
* Build guide.
* Production-ready implementation.

The final plugin must be fully functional, secure, optimized, professional, and ready to compile directly in IntelliJ IDEA using Java 21 and Maven.
Kodari AI
KodariJun 28 at 5:49 am 1

Iโ€™ll create the ZYNOR-AUTH plugin - a premium Minecraft authentication, lobby, and world-management system.

ZynorAuth
A premium Minecraft authentication and hub plugin for Paper/Spigot/Purpur servers providing secure player registration, login protection, session management, Discord logging, Citizens NPC integration, and Multiverse world management. Features BCrypt password hashing, full event protection before authentication, customizable messages, PlaceholderAPI support, and a modern inventory GUI system.

Starting with build configuration, main plugin class, and core systems.

Now let me verify cross-file consistency. Let me check that every method called exists:

  1. ZynorAuth.getConfigManager() - has @Getter on configManager โœ“

  2. ZynorAuth.getMessageManager() - has @Getter on messageManager โœ“

  3. ZynorAuth.getDiscordConfig() - has @Getter on discordConfig โœ“

  4. ZynorAuth.getPlayerStorage() - has @Getter on playerStorage โœ“

  5. ZynorAuth.getSessionStorage() - has @Getter on sessionStorage โœ“

  6. ZynorAuth.getLogStorage() - has @Getter on logStorage โœ“

  7. ZynorAuth.getAuthManager() - has @Getter on authManager โœ“

  8. ZynorAuth.getSessionManager() - has @Getter on sessionManager โœ“

  9. ZynorAuth.getWorldManager() - has @Getter on worldManager โœ“

  10. ZynorAuth.getNpcManager() - has @Getter on npcManager โœ“

  11. ZynorAuth.getDiscordManager() - has @Getter on discordManager โœ“

  12. ZynorAuth.getGuiManager() - has @Getter on guiManager โœ“

  13. ConfigManager.getLoginTimeout() - has @Getter on loginTimeout โœ“

  14. ConfigManager.getMaxLoginAttempts() - has @Getter on maxLoginAttempts โœ“

  15. ConfigManager.getMinPasswordLength() - has @Getter on minPasswordLength โœ“

  16. ConfigManager.getMaxPasswordLength() - has @Getter on maxPasswordLength โœ“

  17. ConfigManager.getLockDuration() - has @Getter on lockDuration โœ“

  18. ConfigManager.getSessionTimeout() - has @Getter on sessionTimeout โœ“

  19. ConfigManager.getBcryptCost() - has @Getter on bcryptCost โœ“

  20. ConfigManager.isSessionLogin() - has @Getter on sessionLogin โœ“

  21. ConfigManager.getWorldName(key) - defined in ConfigManager โœ“

  22. ConfigManager.getSpawnLocation(key) - defined in ConfigManager โœ“

  23. MessageManager.get(path) - defined โœ“

  24. MessageManager.get(path, placeholder, replacement) - defined โœ“

  25. MessageManager.getNoPrefix(path) - defined โœ“

  26. MessageManager.getPrefix() - defined โœ“

  27. DiscordConfig.getWebhook(category) - defined โœ“

  28. DiscordConfig.getColor(name) - defined โœ“

  29. DiscordConfig.getFooterText() - defined โœ“

  30. DiscordConfig.getServerIcon() - defined โœ“

  31. DiscordConfig.isLoggingEnabled(category, event) - defined โœ“

  32. WorldManager.teleportToAuthWorld(player) - defined โœ“

  33. WorldManager.teleportToLobby(player) - defined โœ“

  34. WorldManager.teleportToWorld(player, worldKey) - defined โœ“

  35. AuthManager.register(player, password) - defined โœ“

  36. AuthManager.login(player, password) - defined โœ“

  37. AuthManager.authenticate(player) - defined โœ“

  38. AuthManager.deauthenticate(player) - defined โœ“

  39. AuthManager.isAuthenticated(player) - defined โœ“

  40. AuthManager.isRegistered(uuid) - defined โœ“

  41. AuthManager.isLocked(uuid) - defined โœ“

  42. AuthManager.lockAccount(uuid) - defined โœ“

  43. AuthManager.unlockAccount(uuid) - defined โœ“

  44. AuthManager.changePassword(player, old, new) - defined โœ“

  45. AuthManager.resetPassword(uuid, password) - defined โœ“

  46. AuthManager.getFailedAttempts(uuid) - defined โœ“

  47. AuthManager.getLastLogin(uuid) - defined โœ“

  48. AuthManager.getRegistered(uuid) - defined โœ“

  49. AuthManager.trySessionRestore(player) - defined โœ“

  50. AuthManager.cleanup() - defined โœ“

  51. SessionManager.createSession(player) - defined โœ“

  52. SessionManager.isValidSession(player) - defined โœ“

  53. SessionManager.removeSession(player) - defined โœ“

  54. SessionManager.removeSession(uuid) - defined โœ“

  55. SessionManager.hasSession(uuid) - defined โœ“

  56. GUIManager.openGUI(gui, player) - defined โœ“

  57. GUIManager.unregisterInventory(inventory) - defined โœ“

  58. DiscordManager.sendLog(type, title, desc, color) - defined โœ“

  59. DiscordManager.reload() - defined โœ“

  60. NPCManager.loadNPCs() - defined โœ“

  61. NPCManager.despawnAll() - defined โœ“

  62. NPCManager.loadConfig() - defined โœ“

  63. NPCManager.isEnabled() - defined โœ“

  64. NPCManager.getNPCDataByNPC(npc) - defined โœ“

  65. TimeUtil.formatTimestamp(millis) - defined โœ“

  66. ChatUtil.colorize(text) - defined โœ“

  67. ChatUtil.toComponent(text) - defined โœ“

  68. YamlStorage.reload() - defined โœ“

  69. YamlStorage.contains(path) - defined โœ“

  70. YamlStorage.getString(path) - defined โœ“

  71. YamlStorage.getBoolean(path, def) - defined โœ“

  72. YamlStorage.getLong(path, def) - defined โœ“

  73. YamlStorage.getInt(path, def) - defined โœ“

  74. YamlStorage.set(path, value) - defined โœ“

  75. YamlStorage.remove(path) - defined โœ“

  76. YamlStorage.getKeys(path) - defined โœ“

  77. YamlStorage.getSection(path) - defined โœ“

  78. ZynorAuth.reloadPlugin() - defined โœ“

All cross-file dependencies checked. All methods exist where theyโ€™re called.

Now let me think about the dependency list for the plugin:

Soft Dependencies:

  1. Citizens - For NPC system. Optional - NPC features gracefully disabled if missing.

  2. Multiverse-Core - For world management. Optional - fallback to Bukkit world API.

  3. PlaceholderAPI - For placeholders (%zynorauth_*%). Optional - expansion only registers if PAPI present.

Included Libraries (shaded):

  1. BCrypt (at.favre.lib:bcrypt:0.10.2) - For secure password hashing, shaded into the jar.

Build/Compile Dependencies (not needed at runtime):

  1. Paper API 1.20.4-R0.1-SNAPSHOT - Provided by server, compile only

  2. Lombok 1.18.36 - Annotation processing, compile only

The plugin uses local YAML file storage only (players.yml, sessions.yml, logs.yml) - no external database required. All data is stored in the pluginโ€™s data folder.

Kodari can make mistakes. Review important code before using.
Files
src
pom.xml
Code
38 3,122
src/main/java/com/zynorauth/ZynorAuth.java
package com.zynorauth;

import com.zynorauth.auth.AuthManager;
import com.zynorauth.commands.*;
import com.zynorauth.config.ConfigManager;
import com.zynorauth.config.DiscordConfig;
import com.zynorauth.config.MessageManager;
import com.zynorauth.discord.DiscordManager;
import com.zynorauth.discord.WebhookType;
import com.zynorauth.gui.GUIListener;
import com.zynorauth.gui.GUIManager;
import com.zynorauth.listeners.AuthProtectionListener;
import com.zynorauth.listeners.PlayerListener;
import com.zynorauth.npc.NPCListener;
import com.zynorauth.npc.NPCManager;
import com.zynorauth.placeholder.AuthExpansion;
import com.zynorauth.session.SessionManager;
import com.zynorauth.storage.YamlStorage;
import com.zynorauth.util.ChatUtil;
import com.zynorauth.world.WorldManager;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

import java.util.logging.Level;

@Getter
public final class ZynorAuth extends JavaPlugin {

    private ConfigManager configManager;
    private MessageManager messageManager;
    private DiscordConfig discordConfig;
    private YamlStorage playerStorage;
    private YamlStorage sessionStorage;
    private YamlStorage logStorage;
    private AuthManager authManager;
    private SessionManager sessionManager;
    private WorldManager worldManager;
    private NPCManager npcManager;
    private DiscordManager discordManager;
    private GUIManager guiManager;
    private CommandManager commandManager;

    @Override
    public void onEnable() {
        long start = System.currentTimeMillis();

        saveDefaultConfig();
        saveResource("messages.yml", false);
        saveResource("discord.yml", false);
        saveResource("worlds.yml", false);
        saveResource("npc.yml", false);

        this.configManager = new ConfigManager(this);
        this.messageManager = new MessageManager(this);
        this.discordConfig = new DiscordConfig(this);

        this.playerStorage = new YamlStorage(this, "players.yml");
        this.sessionStorage = new YamlStorage(this, "sessions.yml");
        this.logStorage = new YamlStorage(this, "logs.yml");

        this.discordManager = new DiscordManager(this);

        this.worldManager = new WorldManager(this);
        this.npcManager = new NPCManager(this);
        this.sessionManager = new SessionManager(this);
        this.authManager = new AuthManager(this);
        this.guiManager = new GUIManager();
        this.commandManager = new CommandManager(this);

        registerListeners();
        commandManager.registerCommands();
        npcManager.loadNPCs();

        if (Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null) {
            new AuthExpansion(this).register();
            getLogger().info("PlaceholderAPI expansion registered.");
        }

        discordManager.sendLog(WebhookType.SERVER_STATUS, "Plugin Enabled",
                "ZYNOR-AUTH has been enabled successfully.", discordConfig.getColor("info"));

        long elapsed = System.currentTimeMillis() - start;
        getLogger().info("ZYNOR-AUTH v" + getDescription().getVersion() + " enabled in " + elapsed + "ms.");
    }

    @Override
    public void onDisable() {
        if (discordManager != null) {
            discordManager.sendLog(WebhookType.SERVER_STATUS, "Plugin Disabled",
                    "ZYNOR-AUTH has been disabled.", discordConfig.getColor("error"));
        }
        if (npcManager != null) {
            npcManager.despawnAll();
        }
        if (authManager != null) {
            authManager.cleanup();
        }
        getLogger().info("ZYNOR-AUTH disabled.");
    }

    public void reloadPlugin() {
        reloadConfig();
        configManager.reload();
        messageManager.reload();
        discordConfig.reload();
        playerStorage.reload();
        sessionStorage.reload();
        logStorage.reload();
        npcManager.loadConfig();
        getLogger().info("ZYNOR-AUTH configuration reloaded.");
    }

    private void registerListeners() {
        Bukkit.getPluginManager().registerEvents(new PlayerListener(this), this);
        Bukkit.getPluginManager().registerEvents(new AuthProtectionListener(this), this);
        Bukkit.getPluginManager().registerEvents(new GUIListener(guiManager), this);

        if (Bukkit.getPluginManager().getPlugin("Citizens") != null) {
            Bukkit.getPluginManager().registerEvents(new NPCListener(this), this);
            getLogger().info("Citizens integration enabled.");
        }

        if (Bukkit.getPluginManager().getPlugin("Multiverse-Core") != null) {
            getLogger().info("Multiverse-Core integration enabled.");
        }
    }
}