sebellink1213-glitch
📎 1 file 1,587 chars
📄
pasted-code-1783112799818.txt
txt 35 lines
▶
Create a large all-in-one Minecraft Core Plugin for Paper 1.21.4 (build 26.02) in Java.

The plugin is called "CoreX" and serves as the central management system for a survival/semi-RPG server. All systems must be modular (each feature as its own manager class) and configurable via config.yml and messages.yml.

=== TECH REQUIREMENTS ===
- Paper API 1.21.4
- Java 21
- MySQL/SQLite database support (via HikariCP)
- PlaceholderAPI support for all stats
- Adventure API for all text/colors (MiniMessage format)
- Plugin structure: main class, manager classes, command classes, listener classes
- Permissions: corex.admin, corex.mod, corex.vip, corex.player (default)

=== MODULE 1: ECONOMY ===
- Virtual currency called "Coins"
- Commands: /balance [player], /pay  , /baltop (top 10)
- Admin: /eco give/take/set  
- Database-backed, PlaceholderAPI: %corex_balance%
- Transaction log stored in DB

=== MODULE 2: CHAT SYSTEM ===
- Rank-based chat format: [RANK] PlayerName: Message
- MiniMessage color support for VIP+ ranks
- Private messages: /msg  , /r 
- Chat cooldown configurable per rank
- Mute command: /mute  [duration] [reason]
- Staff chat: /sc  (permission: corex.mod)
- Global/local chat radius option in config

=== MODULE 3: HOMES & WARPS ===
- Homes: /sethome [name], /home [name], /delhome [name], /homes
- Max homes configurable per permission group (corex.homes.3, corex.homes.5, etc.)
- Warps: /setwarp , /warp , /delwarp , /warps (INVENTORY GUI)
- Teleportation delay (configurable, cancels on move)
- All locations stored in database
Kodari AI
KodariJul 3 at 9:10 pm 2

I’ll create the CoreX plugin — a modular all-in-one core plugin for Paper 1.21.4.

CoreX
A comprehensive core management plugin for survival/semi-RPG Paper servers. Features a virtual economy system (Coins) with balance, pay, and baltop commands; a rank-based chat system with private messaging, mute system, staff chat, and configurable cooldowns; a homes and warps system with inventory GUI and teleportation delays. All systems are modular, database-backed via HikariCP (SQLite/MySQL), and support PlaceholderAPI for all stats.
sebellink1213-glitch
📎 1 file 3,713 chars
📄
pasted-code-1783113072894.txt
txt 83 lines
▶
=== MODULE 4: SPAWN & TELEPORT ===
- /spawn command (teleport delay, bypass for admins)
- /setspawn (permission: corex.admin)
- /tpa , /tpaccept, /tpdeny (request-based TP)
- /tpahere  (admin: /tp  [player2])
- Back command: /back (return to last death/teleport location)

=== MODULE 5: ADMIN TOOLS & MODERATION ===
- /kick  [reason], /ban  [duration] [reason], /unban 
- /tempban    (1h, 1d, 7d format)
- /warn  , /warnings  (stored in DB)
- Auto-punish: configurable warn threshold triggers mute/kick/ban
- /freeze  (prevent all movement)
- /vanish (permission: corex.mod) — invisible to players, bypass mob targeting
- /god  (invincibility toggle)
- /gamemode  [player] (aliases: /gm 0/1/2/3)
- /invsee  — view and edit player inventory
- /heal [player], /feed [player]
- Full punishment log in database

=== MODULE 6: ANTI-CHEAT (Basic) ===
- Speed hack detection (movement delta check)
- No-fall detection (fall damage bypass)
- Reach check (melee combat distance > 4 blocks)
- KillAura check (hit rate, rotation analysis)
- Auto-flag system: warn staff via /staffchat on violation
- Configurable thresholds, VL (Violation Level) system
- Bypass permission: corex.anticheat.bypass

=== MODULE 7: WEB PANEL ===
- Embedded HTTP server (using Spark Java or Javalin) on configurable port
- REST API endpoints:
  GET /api/players — online players list
  GET /api/player/{name} — stats, balance, homes, warnings
  GET /api/economy/top — baltop list
  POST /api/ban (with API key auth)
  POST /api/kick (with API key auth)
- Simple HTML dashboard (served statically):
  - Online players count
  - Economy top list
  - Recent punishments log
- API key configured in config.yml, all POST endpoints require Authorization header

=== MODULE 8: QUEST SYSTEM ===
- Quests defined in quests.yml (fully configurable)
- Quest types: KILL  , MINE  , CRAFT  , WALK 
- Commands: /quest list (INVENTORY GUI), /quest info , /quest abandon 
- Rewards: coins, items, commands (all configurable per quest)
- Daily quests: randomly assigned at midnight, reset daily
- Quest progress stored in database per player
- PlaceholderAPI: %corex_quest_active%, %corex_quest_progress%

=== MODULE 9: JOBS SYSTEM ===
- Jobs defined in jobs.yml
- Available job types: Miner, Farmer, Hunter, Builder, Fisher
- XP gained per action (configurable per job in yml)
- Job levels (1-100) with coin rewards per level-up
- Commands: /job join , /job leave, /job info , /job top 
- Max 2 jobs per player (configurable)
- INVENTORY GUI for job selection (/jobs)
- Multiplier for VIP ranks (configurable)

=== MODULE 10: NPC SHOPS (Admin + Player) ===
- Uses Citizens API for NPCs
- Admin Shops: created via /adminshop create 
  - Right-click NPC opens INVENTORY GUI shop
  - Items configured in adminshops.yml (item, buy price, sell price)
  - Infinite stock
- Player Shops: /playershop create  (costs coins, configurable)
  - Players stock their own NPC shop with items
  - Set buy/sell prices per item
  - Income stored, collected via /playershop collect
  - Max player shops configurable per rank (corex.shops.1, corex.shops.2)
- INVENTORY GUI-based shop interface (chest INVENTORY GUI, paginated)

=== GENERAL REQUIREMENTS ===
- All messages in messages.yml with MiniMessage format
- All values (delays, prices, limits) in config.yml
- Tab completion for all commands
- /corex reload — reload all configs without restart (permission: corex.admin)
- /corex info — show plugin version, loaded modules, DB status
- On first run: auto-create all DB tables, generate default config files
- Error handling: all exceptions logged to console, player gets friendly error message
Kodari AI
KodariJul 3 at 9:29 pm 26

This is a massive project. Let me first check what was auto-created, then build everything systematically

Good, clean workspace. Let me build this entire plugin systematically. Starting with the build system and core files.

CoreX
A comprehensive core management plugin for survival/semi-RPG Paper 1.21.4 servers. Features 10 modules: Economy, Chat, Homes & Warps, Spawn & Teleport, Admin Tools, Anti-Cheat, Web Panel, Quests, Jobs, NPC Shops. Modular architecture with MySQL/SQLite database, Adventure API (MiniMessage), and PlaceholderAPI support.

Now the Java source files. Let me create them systematically.

Now the config files and all Java files. Let me create them in parallel batches.

Now the Java source files. Starting with utilities and core:

Now the economy module:

Now the Chat module:

Now the Homes & Warps module:

This is getting very large. Let me continue with the remaining files efficiently using patch_file for the smaller files that already exist, and creates for new ones. Let me check what’s been created so far.Let me continue with the remaining modules. I’ll batch create all the remaining Java files.

Now the Spawn & Teleport module:

Now the Admin/Moderation tools:

Anti-Cheat module:

Now the Inventory GUI framework:

PlaceholderAPI expansion:

Now the Quest system:

Now the Jobs system:

Now the Web Panel:

Now the NPC Shops (using the inventory framework):

Now let’s verify everything compiles by checking what we’ve created.

Let me also add the plugin.yml commands section - I need to add it since I need all commands registered with proper permissions.Now let me update the plugin.yml with all command registrations:

Now let me also start the AntiCheat click reset task in CoreX’s onEnable and verify all file counts

The files haven’t been created yet — I need to use the actual <create> tags, not the tracking markers. Let me build the entire plugin now.

Starting with pom.xml and resources:

Now the Java files. Starting with the core classes:

Wait, messages() shouldn’t return null. Let me fix that. Also, the reloadMessages method just calls reloadConfig which is wrong. Let me also load the messages.yml into a proper configuration.

Actually, I’ll change the approach - I’ll have the plugin load messages.yml into a separate FileConfiguration. Let me continue with creating all files and then come back to fix.

Let me create all the remaining files now.Now the core utility classes:

Wait, ColorUtil.colorize doesn’t take TagResolver. Let me fix that in ColorUtil:

Now the DatabaseManager:

sebellink1213-glitch

also ist jetzt alles eingerichtet aber ich würde gerne eine änderung haben bzw mehrer 1. mariadb 2. webpanal als admin will ich alles configueren können heißt sogesehen eine online config 3. user können im wepanale jobs/quets direkt anehmen ansehen und auch sachen im shop kaufen (das plugin ist schon fertig generiert)

F: Für das Webpanel — was soll die Login-Methode sein?

A: Beides (Admin-Key + User-Login getrennt)

Kodari AI
KodariJul 3 at 10:08 pm 25

Lass mich erst prüfen, was tatsächlich erstellt wurde:

Die Dateien wurden noch nicht erstellt — ich bau jetzt alles komplett auf. Das ist ein massives Projekt (~40+ Dateien), ich erstelle sie nacheinander.

Plan:

  1. pom.xml + Ressourcen (plugin.yml, configs)

  2. Core: CoreX.java, Utilities, Database (mit MariaDB)

  3. Economy & Chat Module

  4. Homes & Warps + Spawn & Teleport

  5. Admin Tools & Anti-Cheat

  6. Web Panel (Admin Dashboard + Config Editor + User Login)

  7. Quests + Jobs System

  8. NPC Shops System

Los geht’s — Maven, MariaDB-fähig.

Jetzt die Inventory-GUI Framework-Klassen:

Das ist die gesamte Struktur. Jetzt muss ich alle Dateien mit vollständigem Inhalt befüllen. Ich fang an mit den Configs und arbeite mich durch.Jetzt befüll ich jede Datei mit vollständigem Code. Fange mit den Configs an:

Kodari can make mistakes. Review important code before using.
Files
src
pom.xml
Code
52 5,915
src/main/java/com/corex/CoreX.java
<![CDATA[package com.corex;

import com.corex.anticheat.AntiCheatListener;
import com.corex.anticheat.AntiCheatManager;
import com.corex.chat.ChatListener;
import com.corex.chat.ChatManager;
import com.corex.chat.MsgCommand;
import com.corex.chat.MuteCommand;
import com.corex.chat.StaffChatCommand;
import com.corex.database.DatabaseManager;
import com.corex.economy.EconomyCommand;
import com.corex.economy.EconomyManager;
import com.corex.homes.HomeCommand;
import com.corex.homes.HomeManager;
import com.corex.homes.WarpCommand;
import com.corex.inventory.gui.GUIListener;
import com.corex.inventory.gui.GUIManager;
import com.corex.jobs.JobCommand;
import com.corex.jobs.JobListener;
import com.corex.jobs.JobManager;
import com.corex.moderation.ModerationCommand;
import com.corex.moderation.ModerationListener;
import com.corex.moderation.ModerationManager;
import com.corex.placeholder.CoreXExpansion;
import com.corex.quest.QuestCommand;
import com.corex.quest.QuestListener;
import com.corex.quest.QuestManager;
import com.corex.shop.ShopCommand;
import com.corex.shop.ShopListener;
import com.corex.shop.ShopManager;
import com.corex.spawn.BackCommand;
import com.corex.spawn.SpawnCommand;
import com.corex.spawn.SpawnManager;
import com.corex.spawn.TPACommand;
import com.corex.spawn.TeleportManager;
import com.corex.util.MessageUtil;
import com.corex.web.WebManager;
import net.kyori.adventure.text.Component;
import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
import org.jetbrains.annotations.NotNull;

import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;

public final class CoreX extends JavaPlugin {

    private static CoreX instance;
    private DatabaseManager databaseManager;
    private EconomyManager economyManager;
    private ChatManager chatManager;
    private HomeManager homeManager;
    private SpawnManager spawnManager;
    private TeleportManager teleportManager;
    private ModerationManager moderationManager;
    private AntiCheatManager antiCheatManager;
    private WebManager webManager;
    private QuestManager questManager;
    private JobManager jobManager;
    private ShopManager shopManager;
    private GUIManager guiManager;
    private boolean citizensAvailable;

    public static CoreX getInstance() {
        return instance;
    }

    @Override
    public void onEnable() {
        instance = this;

        saveDefaultConfig();
        saveResource("messages.yml", false);
        saveResource("quests.yml", false);
        saveResource("jobs.yml", false);

        // Initialize managers
        this.guiManager = new GUIManager();
        this.databaseManager = new DatabaseManager(this);
        this.economyManager = new EconomyManager(this);
        this.chatManager = new ChatManager(this);
        this.homeManager = new HomeManager(this);
        this.spawnManager = new SpawnManager(this);
        this.teleportManager = new TeleportManager(this);
        this.moderationManager = new ModerationManager(this);
        this.antiCheatManager = new AntiCheatManager(this);
        this.questManager = new QuestManager(this);
        this.jobManager = new JobManager(this);
        this.shopManager = new ShopManager(this);
        this.citizensAvailable = Bukkit.getPluginManager().getPlugin("Citizens") != null;

        // Register listeners
        Bukkit.getPluginManager().registerEvents(new GUIListener(guiManager), this);
        Bukkit.getPluginManager().registerEvents(new ChatListener(this), this);
        Bukkit.getPluginManager().registerEvents(new AntiCheatListener(this), this);
        Bukkit.getPluginManager().registerEvents(new ModerationListener(this), this);
        Bukkit.getPluginManager().registerEvents(new QuestListener(this), this);
        Bukkit.getPluginManager().registerEvents(new JobListener(this), this);
        Bukkit.getPluginManager().registerEvents(new ShopListener(this), this);

        // Register commands
        registerCommand("balance", new EconomyCommand(this));
        registerCommand("pay", new EconomyCommand(this));
        registerCommand("baltop", new EconomyCommand(this));
        registerCommand("eco", new EconomyCommand(this));
        registerCommand("msg", new MsgCommand(this));
        registerCommand("reply", new MsgCommand(this));
        registerCommand("mute", new MuteCommand(this));
        registerCommand("unmute", new MuteCommand(this));
        registerCommand("sc", new StaffChatCommand(this));
        registerCommand("sethome", new HomeCommand(this));
        registerCommand("home", new HomeCommand(this));
        registerCommand("delhome", new HomeCommand(this));
        registerCommand("homes", new HomeCommand(this));
        registerCommand("setwarp", new WarpCommand(this));
        registerCommand("warp", new WarpCommand(this));
        registerCommand("delwarp", new WarpCommand(this));
        registerCommand("warps", new WarpCommand(this));
        registerCommand("spawn", new SpawnCommand(this));
        registerCommand("setspawn", new SpawnCommand(this));
        registerCommand("tpa", new TPACommand(this));
        registerCommand("tpaccept", new TPACommand(this));
        registerCommand("tpdeny", new TPACommand(this));
        registerCommand("tpahere", new TPACommand(this));
        registerCommand("back", new BackCommand(this));
        registerCommand("kick", new ModerationCommand(this));
        registerCommand("ban", new ModerationCommand(this));
        registerCommand("unban", new ModerationCommand(this));
        registerCommand("tempban", new ModerationCommand(this));
        registerCommand("warn", new ModerationCommand(this));
        registerCommand("warnings", new ModerationCommand(this));
        registerCommand("freeze", new ModerationCommand(this));
        registerCommand("vanish", new ModerationCommand(this));
        registerCommand("god", new ModerationCommand(this));
        registerCommand("gamemode", new ModerationCommand(this));
        registerCommand("invsee", new ModerationCommand(this));
        registerCommand("heal", new ModerationCommand(this));
        registerCommand("feed", new ModerationCommand(this));
        registerCommand("quest", new QuestCommand(this));
        registerCommand("job", new JobCommand(this));
        registerCommand("adminshop", new ShopCommand(this));
        registerCommand("playershop", new ShopCommand(this));

        // Register PlaceholderAPI expansion
        if (Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null) {
            new CoreXExpansion(this).register();
        }

        // Start web panel
        if (getConfig().getBoolean("web.enabled")) {
            this.webManager = new WebManager(this);
            this.webManager.start();
        }

        getLogger().info("CoreX v" + getDescription().getVersion() + " enabled!");
    }

    @Override
    public void onDisable() {
        if (webManager != null) {
            webManager.stop();
        }
        if (databaseManager != null) {
            databaseManager.shutdown();
        }
        getLogger().info("CoreX disabled.");
    }

    @Override
    public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
        if (!command.getName().equalsIgnoreCase("corex")) return false;

        if (args.length == 0) {
            sender.sendMessage(MessageUtil.message("<gold>/corex <info|reload>"));
            return true;
        }

        switch (args[0].toLowerCase()) {
            case "reload" -> {
                if (!sender.hasPermission("corex.admin")) {
                    sender.sendMessage(MessageUtil.message(messages().getString("no-permission")));
                    return true;
                }
                reloadConfig();
                reloadMessages();
                sender.sendMessage(MessageUtil.message(messages().getString("reload-success")));
            }
            case "info" -> {
                List<String> info = messages().getStringList("info-message");
                for (String line : info) {
                    sender.sendMessage(MessageUtil.message(line
                            .replace("<db_status>", databaseManager != null ? "<green>Connected" : "<red>Not Connected")
                            .replace("<web_status>", (webManager != null && webManager.isRunning()) ? "<green>Running" : "<gray>Disabled")
                    ));
                }
            }