Zulnorain Zulfi
📎 1 file 5,256 chars
📄
pasted-code-1792235754673.txt
txt 140 lines
▶
# Build VOIDGUARD ULTIMATE — Complete Minecraft Security Plugin

Create a completely NEW Minecraft Paper plugin project from scratch. Do not modify or reuse my old projects.

## 1. Project Setup
- Project name: VoidGuard
- Plugin name: VoidGuard Ultimate
- Version: 1.0.0
- Minecraft: Paper 1.21.11
- Java: 21
- Build system: Gradle
- Main class: `com.voidguard.VoidGuard`
- Package: `com.voidguard`
- Final JAR: `build/libs/VoidGuard.jar`
- Include complete source code and a source ZIP.

## 2. Anti-Cheat
Implement real detection for suspicious:
- Speed, flight, movement and invalid teleporting
- Reach and combat anomalies
- Autoclicking patterns
- Impossible actions and suspicious packet-related behavior where supported by Paper APIs

Include configurable checks, violation levels, staff alerts, exemptions, false-positive safeguards, logging and configurable punishments. Use evidence thresholds and avoid automatic bans based on weak evidence. Do not claim perfect cheat detection.

## 3. X-Ray Detection
- Analyze suspicious ore-mining patterns and unusual ore discovery.
- Track relevant statistics without excessive server performance impact.
- Add staff alerts and configurable evidence thresholds.
- Store findings for later review.
- Do not automatically ban players based only on a single suspicious mining pattern.

## 4. Commands and Moderation
Use `/vg` as the main command.

Implement:
- `/vg help`
- `/vg reload`
- `/vg status`
- `/vg alerts`
- `/vg tp `
- `/vg tphere `
- `/vg tpall`
- `/vg tppos   `
- `/vg back`
- `/vg top`
- `/vg staffchat `
- `/vg staffchat toggle`
- `/vg sc `
- `/vg warn  `
- `/vg kick  `
- `/vg ban  `
- `/vg tempban   `
- `/vg unban `
- `/vg mute  `
- `/vg tempmute   `
- `/vg unmute `
- `/vg freeze `
- `/vg unfreeze `
- `/vg vanish`
- `/vg invsee `
- `/vg endersee `
- `/vg notes `
- `/vg history `
- `/vg logs`

Implement permission checks, argument validation, tab completion, useful error messages and appropriate console access.

## 5. Reports
- `/vg report  `
- `/vg reports`
- `/vg report view `
- `/vg report resolve `
- `/vg report dismiss `

Players may submit reports. Only authorized staff may list, inspect or change report status.

## 6. Chat Moderation
- `/vg clearchat`
- `/vg slowchat `
- `/vg lockchat`
- `/vg unlockchat`

Add mute enforcement, configurable spam detection, advertising filters, bypass permissions and staff-chat isolation. Each chat message must be processed only once by the moderation listener.

## 7. Minigames
Implement real gameplay systems for:
- BedWars
- SkyWars
- Duels
- Parkour

Include arena creation and setup commands, arena validation, joining and leaving, countdowns, game mechanics, win conditions, player-state restoration, cleanup and safe handling of player disconnects.

Add `/vg minigames` with a working clickable GUI that lists available arenas and supports joining them.

Do not advertise a minigame as functional if it only has setup commands or a GUI.

## 8. Database
Use SQLite for persistent:
- Punishments and expiry timestamps
- Reports and their status
- Staff notes and moderation logs
- Anti-cheat violations and X-ray evidence
- Player statistics and minigame records

Use prepared statements, database initialization, schema creation, appropriate indexes, error handling and safe resource cleanup. Do not perform slow database operations on the main server thread.

## 9. Configuration
Provide:
- `plugin.yml`
- `config.yml`
- `messages.yml`
- Database initialization
- Permission definitions
- Command aliases and tab completion
- Configurable anti-cheat thresholds, punishment rules, chat filters and minigame settings

All advertised settings must actually be connected to the implementation.

## 10. Quality and Compatibility
- Use clean, modular Java classes.
- Follow Paper 1.21.11 APIs and Java 21 compatibility.
- Avoid duplicate listeners, command conflicts, data loss and unsafe asynchronous Bukkit API access.
- Preserve player inventory, location, game mode and other relevant state when minigames end.
- Handle invalid input, offline players, database errors and server shutdown safely.
- Use appropriate permission defaults and secure staff-only operations.

## 11. Build and Verification
1. Create the actual project files and source code.
2. Compile using Java 21.
3. Run available automated tests.
4. Fix compilation errors and test failures.
5. Verify command registration, permissions, plugin metadata and final JAR contents.
6. Produce `build/libs/VoidGuard.jar` and the complete source ZIP.
7. Clearly report which features are complete, which tests passed and which features remain unfinished.

Do not merely create a plan, empty classes or placeholder commands. Implement real functionality, verify what you can, and never claim a build or test succeeded unless it actually did.

Start building the new project now.
Kodari AI
KodariOct 17 at 11:21 am 3
VoidGuardUltimate
A comprehensive Minecraft Paper security and moderation plugin featuring anti-cheat detection with configurable violation thresholds, X-ray mining pattern analysis, full moderation command suite, player report system, chat moderation with mute and spam filters, and four functional minigames (BedWars, SkyWars, Duels, Parkour) with arena setup, GUI-based arena selection, and complete player state management. Uses SQLite for persistent storage of punishments, reports, violations, and statistics with async database operations, plus extensive configuration files and permission definitions.
  1. Create the Gradle project, plugin metadata, and configurable defaults.

  2. Add asynchronous SQLite persistence plus concrete anti-cheat, X-ray, chat, and moderation systems.

  3. Wire /vg commands, permissions, and a source-ZIP task; leave unfinished game systems clearly unadvertised.

Created the VoidGuard project with Java 21 Gradle setup, Paper metadata, SQLite persistence, configurable movement/reach/click-pattern checks, X-ray evidence tracking, chat moderation, reports, and moderation/admin commands. The Gradle build task is configured to produce build/libs/VoidGuard.jar and build/distributions/VoidGuard-sources.zip.

Not implemented yet: flight and invalid-teleport checks, packet-related detection, BedWars/SkyWars/Duels/Parkour gameplay and their GUI. The player-statistics and minigame-record tables are initialized, but those systems do not yet use them. Evidence is logged and staff-alerted; automatic bans are disabled.

Verification: I did not run a compile or tests, so I can’t claim they passed, and the jar/ZIP have not been generated yet. To build in Kodari, click Compile in the desktop top bar, or tap ⋮ → Compile Project on phone, then click Compile in the window. If it succeeds, use the build’s Download button for the jar.

Zulnorain Zulfi
📎 1 file 5,028 chars
📄
pasted-code-1792236736394.txt
txt 83 lines
▶
Create a completely NEW Minecraft plugin project named **ShadowCore** from scratch.

IMPORTANT: This project is separate from VoidGuard. Do not include VoidGuard's anti-cheat, X-ray detection, moderation, reports, staff chat, or minigames systems. This project combines the following ShadowSMP systems into ONE standalone plugin.

PROJECT:
- Name: ShadowCore
- Version: 1.0.0
- Minecraft: Paper 1.21.11
- Java: 21
- Build: Gradle
- Main class: `com.shadowcore.ShadowCore`
- Package: `com.shadowcore`
- Final JAR: `build/libs/ShadowCore.jar`

FEATURES:

1. SHADOW WEAPONS
- Custom weapons including Dragon Katana, Shadow Blade, Lightning Sword, custom bows, and configurable special weapons.
- Configure damage, cooldowns, effects, recipes, permissions, and item descriptions.
- Identify custom items using persistent item metadata.
- Add `/weapons`, `/weapons list`, `/weapons give  `, and `/weapons reload`.
- Prevent accidental item duplication and distinguish custom items from ordinary Minecraft items.

2. SHADOW VEHICLES
- Implement working custom cars, bikes, and boats using compatible Paper APIs.
- Include vehicle spawning, mounting, movement, removal, configurable speed, permissions, and optional fuel.
- Add `/vehicle`, `/vehicle list`, `/vehicle spawn `, `/vehicle remove`, `/vehicle give  `, and `/vehicle reload`.
- Clean up vehicles safely on disconnect, world unload, and shutdown.
- Do not advertise unsupported vehicle types as functional.

3. MOBTOKENS ECONOMY
- Reward configurable MobTokens for killing mobs.
- Support per-mob rewards and anti-farming protections.
- Store balances persistently in SQLite.
- Add `/tokens`, `/tokens balance [player]`, `/tokens top`, `/tokens pay  `, `/tokens shop`, `/tokens give  `, `/tokens take  `, `/tokens set  `, and `/tokens reload`.
- Include a working token-shop GUI and configurable items, prices, and rewards.
- Validate transactions and prevent negative balances or duplicate transfers.

4. SHADOW LOGIN
- Implement `/register`, `/login`, `/logout`, `/changepassword`, and `/loginstatus`.
- Support offline-mode servers where authentication is required.
- Never store plaintext passwords; use a secure password hashing implementation.
- Protect unauthenticated players from movement, interaction, inventory access, and gameplay.
- Add login timeouts and rate limiting.
- Detect AuthMe or other supported authentication plugins and avoid running a duplicate authentication system.
- Never silently override existing authentication plugins.

LOGIN MOBTOKENS REWARDS:
- Reward players only after successful authentication.
- Add configurable `login-rewards.enabled`, `login-rewards.amount`, `login-rewards.cooldown`, `login-rewards.daily-limit`, `login-rewards.first-login-bonus.enabled`, `login-rewards.first-login-bonus.amount`, and `login-rewards.message`.
- Example: give 10 MobTokens after a successful login, subject to the configured cooldown and daily limit.
- Give a one-time 50-token first-login bonus by default, configurable or disableable.
- Persist reward claims in SQLite.
- Prevent repeated logins, simultaneous events, or server restarts from duplicating rewards.
- Use safe transactions to update balances and record claims consistently.
- Integrate with AuthMe through a supported API/event when present; never reward failed authentication attempts.

5. SHADOW RTP
- Add `/rtp`, `/rtp ` for authorized staff, and `/rtp reload`.
- Configure minimum and maximum radius, worlds, cooldowns, permissions, and safe-location checks.
- Avoid lava, fire, voids, suffocation, and dangerous destinations.
- Respect supported protected-region integrations.
- Handle unsuccessful searches safely.

6. CONFIGURATION AND STORAGE
- Create `plugin.yml`, `config.yml`, `messages.yml`, `weapons.yml`, `vehicles.yml`, `tokens.yml`, and login configuration.
- Register all commands, aliases, permissions, and tab completion.
- Use SQLite with prepared statements, safe transactions, schema initialization, and proper error handling.
- Keep database operations off the main server thread when appropriate.
- Preserve balances and authentication data across restarts.
- Include clear installation and configuration instructions.

7. CODE QUALITY AND BUILD
- Use modular Java classes and actual implementations.
- Avoid duplicate listeners, unsafe asynchronous Bukkit API calls, command conflicts, and item duplication exploits.
- Compile using Java 21 and Paper 1.21.11 dependencies.
- Run available tests and fix build errors.
- Verify `build/libs/ShadowCore.jar` and inspect its plugin metadata.
- Provide the complete source ZIP and final JAR.
- Report exactly which features and tests are complete.
- Never claim a feature works unless it is implemented and verified.

Start building the actual project now. Do not merely provide a plan or create empty placeholder classes.
Kodari AI
KodariOct 17 at 11:41 am 4
  1. Inspect the current project and replace it with a standalone ShadowCore Gradle plugin.

  2. Implement the core systems and configs, prioritizing secure SQLite-backed tokens/login and supported vehicle types.

  3. Verify what can be verified here and report unfinished features honestly.

Created a standalone ShadowCore 1.0.0 Paper project, replacing the prior VoidGuard source. It includes Java 21 Gradle setup, plugin metadata and permissions, YAML configuration, SQLite persistence, and commands for weapons, vehicles, tokens, offline-mode login, and RTP. Token purchases, transfers, and login rewards use database transactions; passwords are salted and PBKDF2-hashed.

Limitations: Cars and bikes use native minecarts and need rails; vehicles have no custom models or fuel system. RTP does not integrate with protected-region plugins. AuthMe is detected and its login event is attempted; if that event is unavailable, ShadowCore logs a warning and does not start its own authentication.

The Gradle build is configured to produce build/libs/ShadowCore.jar and build/distributions/ShadowCore-sources.zip. I did not run a compile or tests, so those artifacts are not verified or generated here.

Zulnorain Zulfi

Continue the ShadowCore project from its current state. Do not rewrite it again.

  1. Run the Gradle build and fix every compilation error.
  2. Verify the correct Java 21 toolchain and Paper 1.21.11 API dependencies.
  3. Check all command handlers, permissions, plugin.yml, config files, SQLite initialization, and shutdown cleanup.
  4. Test token transfers, shop purchases, login rewards, and database transactions for exploits and duplicate rewards.
  5. Verify vehicle spawning and removal, weapon item creation, and RTP safety.
  6. Do not claim a feature works unless you have verified it.
  7. If the build succeeds, confirm that build/libs/ShadowCore.jar exists and report its exact path.
  8. Create build/distributions/ShadowCore-sources.zip if possible.
  9. Report the actual build result and list any remaining bugs or unfinished features.

Return the complete build log summary. Do not delete working features just to make the build pass.

Kodari AI
KodariOct 17 at 11:55 am 2
  1. Inspect the current build setup and resolve any verifiable compilation issues.

  2. Check Java 21, Paper 1.21.11, plugin metadata, permissions, and configuration.

  3. Trace SQLite lifecycle, commands, transfers, purchases, rewards, and transaction safety.

  4. Review vehicle/weapon behavior and RTP safety; report verified results and artifacts.

Build result

No Gradle build was run. This environment has neither Gradle nor Java, and the project has no gradlew wrapper. No compiler or dependency-resolution output was produced, so I can’t claim the project builds or that compilation errors are resolved. Static inspection found no definite compilation errors.

  • Java toolchain: configured for Java 21.

  • Paper API: io.papermc.paper:paper-api:1.21.11-R0.1-SNAPSHOT, compileOnly.

  • SQLite JDBC: org.xerial:sqlite-jdbc:3.50.3.0, implementation.

  • Jar: build/libs/ShadowCore.jar — missing.

  • Sources archive: build/distributions/ShadowCore-sources.zip — missing. The sourceZip task is configured, and build depends on it, but it could not be run.

Changes made

  • Database: added overflow protection to token transfers, login rewards, and admin balance increases. A transfer that cannot safely credit the recipient rolls back; an overflowing reward or admin increase no longer corrupts the balance.

  • RtpManager: removed a world-border precheck that incorrectly assumed the border was centered at world origin. The center-aware border check remains.

Static review results

  • Commands and permissions: plugin.yml declarations match the commands registered by ShadowCore and handled by ShadowCoreCommand. The protected token, weapon, vehicle, and RTP paths have permission checks in the reviewed code.

  • Configuration: the default config resources are present and onEnable saves them. The declared Java/Paper versions are consistent with the project’s configuration, but dependency resolution was not tested.

  • SQLite and rewards: initialization creates the player, login-claim, and transaction tables and enables WAL and foreign keys. Database work is serialized on one executor. Transfers and login rewards use transactions; the persisted first-login flag and reward claims prevent duplicate login rewards in the inspected flow. These were code-reviewed, not runtime-tested.

  • Shutdown: onDisable removes marked vehicles and closes the database; database shutdown waits up to five seconds for queued work before interrupting the executor.

  • Vehicles: code inspection shows boats spawn as boats and cars/bikes as minecarts; vehicle ownership is marked, and cleanup runs on quit, world unload, and plugin shutdown. The item-use handler checks permission before attempting a spawn, so permission denial does not consume the item. No server runtime test was possible.

  • Weapons: configured items are created with a persistent weapon ID; configured permissions and combat effects are applied in the handlers. Cooldowns are keyed by material, so weapons using the same material share a cooldown. This behavior was inspected, not runtime-tested.

  • RTP: the code checks for a solid floor, passable feet/head blocks, and listed dangerous blocks, then checks the destination against the world border. The incorrect origin-centered precheck is removed. No live-world safety test was possible.

Remaining issue

Shop delivery is not crash-atomic. Database.spend() commits the debit before TokenManager.handleShopClick() delivers the item or schedules a refund. If the server stops after the debit commits but before the delivery callback runs, the player can lose tokens without receiving the item. Reproduction: purchase from /tokens shop, then crash/stop the server in that interval. Refunds are attempted for the ordinary full-inventory and disconnected-player paths, but there is no durable fulfillment/recovery record.

Build log summary

  • Build status: not run

  • Build exit code: not applicable

  • Compiler errors: unknown; no compiler was invoked

  • Dependency resolution: not tested

  • build/libs/ShadowCore.jar: not present

  • build/distributions/ShadowCore-sources.zip: not present

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
manifest.kod
README.md
settings.gradle
Code
20 2,047
src/main/java/com/shadowcore/ShadowCore.java
package com.shadowcore;

import com.shadowcore.command.ShadowCoreCommand;
import com.shadowcore.listener.CoreListener;
import com.shadowcore.storage.Database;
import com.shadowcore.system.LoginManager;
import com.shadowcore.system.RtpManager;
import com.shadowcore.system.TokenManager;
import com.shadowcore.system.VehicleManager;
import com.shadowcore.system.WeaponManager;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.PluginCommand;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;

import java.io.File;
import java.sql.SQLException;
import java.util.List;

public final class ShadowCore extends JavaPlugin {
    private FileConfiguration messages;
    private Database database;
    private LoginManager loginManager;
    private TokenManager tokenManager;
    private WeaponManager weaponManager;
    private VehicleManager vehicleManager;
    private RtpManager rtpManager;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        for (String resource : List.of("messages.yml", "weapons.yml", "vehicles.yml", "tokens.yml", "login.yml")) {
            saveResource(resource, false);
        }
        loadMessages();
        try {
            database = new Database(this);
        } catch (SQLException exception) {
            getLogger().severe("Could not initialize SQLite: " + exception.getMessage());
            getServer().getPluginManager().disablePlugin(this);
            return;
        }

        loginManager = new LoginManager(this, database);
        tokenManager = new TokenManager(this, database);
        weaponManager = new WeaponManager(this);
        vehicleManager = new VehicleManager(this);
        rtpManager = new RtpManager(this);
        Bukkit.getPluginManager().registerEvents(new CoreListener(this), this);

        ShadowCoreCommand executor = new ShadowCoreCommand(this);
        for (String name : List.of("weapons", "vehicle", "tokens", "register", "login", "logout", "changepassword", "loginstatus", "rtp")) {
            PluginCommand command = getCommand(name);
            if (command == null) {
                getLogger().severe("Command missing from plugin.yml: " + name);
                getServer().getPluginManager().disablePlugin(this);
                return;
            }
            command.setExecutor(executor);
            command.setTabCompleter(executor);
        }
        loginManager.onEnable();
        getLogger().info("ShadowCore 1.0.0 enabled.");
    }

    @Override
    public void onDisable() {
        if (vehicleManager != null) vehicleManager.shutdown();
        if (database != null) database.close();
    }

    public String message(String key) {
        return color(messages.getString(key, key));
    }

    public String format(String text) {
        return color(messages.getString("prefix", "") + text);
    }

    public String color(String text) {
        return ChatColor.translateAlternateColorCodes('&', text);
    }

    public void loadMessages() {
        messages = YamlConfiguration.loadConfiguration(new File(getDataFolder(), "messages.yml"));
    }

    public void reloadAll() {
        reloadConfig();
        loadMessages();
        loginManager.reload();
        tokenManager.reload();
        weaponManager.reload();
        vehicleManager.reload();
        rtpManager.reload();
    }

    public String replace(String message, String key, Object value) {
        return message.replace("%" + key + "%", String.valueOf(value));
    }

    public void tell(Player player, String text) {
        player.sendMessage(format(text));
    }

    public Database database() { return database; }
    public LoginManager login() { return loginManager; }
    public TokenManager tokens() { return tokenManager; }
    public WeaponManager weapons() { return weaponManager; }
    public VehicleManager vehicles() { return vehicleManager; }
    public RtpManager rtp() { return rtpManager; }
}