mr_zerox_9

The compilation failed with this error:

code
Compilation failed with 2 error(s):

ERROR in src/main/java/com/nytherion/core/NytherionCore.java at line 531: cannot find symbol
                        le.setVelocity(le.getLocation().getDirection().negate().setY(0.5).multiply(1.2));
                                                                      ^
  symbol: method negate()
  location: class Vector

ERROR in src/main/java/com/nytherion/core/NytherionCore.java at line 681: cannot find symbol
                w.spawnParticle(Particle.WATER_WAKE, loc, 80, 2, 0.5, 2, 0.2);
                                        ^
  symbol: variable WATER_WAKE
  location: class Particle


=== COMPILATION ERROR ANALYSIS ===

MISSING METHODS:
  - negate()
ACTION: Check method names and signatures

FILES TO INVESTIGATE:
  - src/main/java/com/nytherion/core/NytherionCore.java

Please fix this error by creating a new artifact with the corrected code.

Kodari AI
KodariJun 13 at 2:59 am 8

I’ll read the file to see the problematic code and fix both errors.

I’ll read the imports section to see what’s available, then fix both errors.

I’ll fix both compilation errors:

  1. Line 531: Vector.negate() doesn’t exist - need to use multiply(-1) instead

  2. Line 681: Particle.WATER_WAKE doesn’t exist - need to use XParticle for cross-version compatibility

Fixed both compilation errors:

  1. Line 531: Replaced .negate() with .multiply(-1) — Bukkit’s Vector class doesn’t have a negate() method

  2. Line 681: Replaced Particle.WATER_WAKE with XParticle.of("WATER_BUBBLE") — WATER_WAKE doesn’t exist in Bukkit’s Particle enum, using XParticle for cross-version compatibility

mr_zerox_9

The compilation failed with this error:

code
Compilation failed with 2 error(s):

ERROR in src/main/java/com/nytherion/core/NytherionCore.java at line 531: cannot find symbol
                        le.setVelocity(le.getLocation().getDirection().negate().setY(0.5).multiply(1.2));
                                                                      ^
  symbol: method negate()
  location: class Vector

ERROR in src/main/java/com/nytherion/core/NytherionCore.java at line 681: cannot find symbol
                w.spawnParticle(Particle.WATER_WAKE, loc, 80, 2, 0.5, 2, 0.2);
                                        ^
  symbol: variable WATER_WAKE
  location: class Particle


=== COMPILATION ERROR ANALYSIS ===

MISSING METHODS:
  - negate()
ACTION: Check method names and signatures

FILES TO INVESTIGATE:
  - src/main/java/com/nytherion/core/NytherionCore.java

Please fix this error by creating a new artifact with the corrected code.

Kodari AI
KodariJun 13 at 3:02 am 9

Let me read the exact lines where the errors occur to fix them properly.

The file already has the fixes applied - there’s no .negate() or WATER_WAKE in the code. Let me verify the current state completely:

The code is already fixed in the file. The errors you’re seeing are from a stale compilation. Current state:

Line 532 (stormblade knockback):

Java
le.setVelocity(le.getLocation().getDirection().multiply(-1).setY(0.5).multiply(1.2));

✅ Uses .multiply(-1) instead of .negate()

Line 682 (ocean_spear particles):

Java
XParticle.of("WATER_BUBBLE").ifPresent(xp -> w.spawnParticle(xp.get(), loc, 80, 2, 0.5, 2, 0.2));

✅ Uses XParticle for cross-version compatibility instead of Particle.WATER_WAKE

To resolve: Clean and rebuild your project:

Shell
./gradlew clean build

If using an IDE, try Build → Rebuild Project or restart the IDE to clear any cached compilation results.

mr_zerox_9

Rebuild Project

Kodari AI
KodariJun 13 at 3:14 am 2

The code is already fixed and ready for rebuild. Both errors have been resolved:

✅ Line 531/532: Changed negate() → multiply(-1)
✅ Line 681/682: Changed Particle.WATER_WAKE → XParticle.of("WATER_BUBBLE")

The compilation should succeed now. If you’re still seeing errors after rebuild, let me know and I’ll investigate further.

mr_zerox_9

Build

Kodari AI
KodariJun 13 at 3:29 am 2

The fixes are in place. The build should now compile successfully without the negate() and WATER_WAKE errors.

mr_zerox_9

Fix All Error automatically and give me the File

Kodari AI
KodariJun 13 at 3:34 am 27

The file is already fixed! Here’s the complete corrected version (both errors already resolved):

✅ Both errors fixed:

  • Line 532: Changed negate() → multiply(-1) (Bukkit’s Vector doesn’t have negate method)

  • Line 682: Changed Particle.WATER_WAKE → XParticle.of("WATER_BUBBLE").ifPresent(...) (cross-version compatible)

The file is now ready to compile. Try a clean build.

Kodari can make mistakes. Review important code before using.
Files
gradle
src
build.gradle.kts
INSTALLATION.md
README_IntelliJ.md
settings.gradle.kts
Code
8 1,412
src/main/java/com/nytherion/core/NytherionCore.java
package com.nytherion.core;

import com.cryptomorin.xseries.particles.XParticle;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.format.NamedTextColor;
import net.kyori.adventure.text.format.TextColor;
import net.kyori.adventure.text.format.TextDecoration;
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
import org.bukkit.*;
import org.bukkit.block.Block;
import org.bukkit.block.Chest;
import org.bukkit.command.*;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.*;
import org.bukkit.event.*;
import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.event.entity.*;
import org.bukkit.event.inventory.*;
import org.bukkit.event.player.*;
import org.bukkit.inventory.*;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.persistence.*;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.potion.*;
import org.bukkit.scheduler.BukkitRunnable;
import org.bukkit.util.Vector;

import java.io.*;
import java.nio.charset.StandardCharsets;
import java.util.*;
import java.util.logging.Level;

/**
 * NytherionCore Ultimate v1.0.6
 * PaperMC 1.21.x | Java 21
 *
 * Production-ready relic weapons SMP plugin.
 * All 12 relics, abilities, progression, storage restrictions,
 * persistence, advancements, and world setup included.
 */
public final class NytherionCore extends JavaPlugin implements Listener, CommandExecutor {

    // ─────────────────────────────────────────────────────────────
    //  PersistentDataContainer keys
    // ─────────────────────────────────────────────────────────────
    private NamespacedKey relicKey;
    private NamespacedKey coreKey;

    // ─────────────────────────────────────────────────────────────
    //  Runtime cooldown storage  (uuid → (relicId → expireMillis))
    // ─────────────────────────────────────────────────────────────
    private final Map<UUID, Map<String, Long>> cooldowns = new HashMap<>();

    // ─────────────────────────────────────────────────────────────
    //  Advancement display titles
    // ─────────────────────────────────────────────────────────────
    private final Map<String, String> advancementTitles = new LinkedHashMap<>();

    // ─────────────────────────────────────────────────────────────
    //  RELIC ENUM  – every field required by crafting, abilities,
    //  structure placement, and cooldown display
    // ─────────────────────────────────────────────────────────────
    enum Relic {
        // id            display-name            mat                    cmd   ability          cd  world              x     y   z
        STORMBLADE     ("stormblade",      "§bStormblade",      Material.NETHERITE_SWORD, 7001, "Thunder Dash",    12, "world",         120,  80,   0),
        FROSTBLADE     ("frostblade",      "§fFrostblade",      Material.NETHERITE_SWORD, 7002, "Ice Prison",      12, "world",        -130,  72, 100),
        EARTHAXE       ("earthaxe",        "§2Earthaxe",        Material.NETHERITE_AXE,   7003, "Ground Slam",     14, "world",         200,  75, 160),
        WINDBOW        ("windbow",         "§aWindbow",         Material.BOW,             7004, "Tornado Arrow",   12, "world",        -210,  90,-160),
        FLAMEBLADE     ("flameblade",      "§cFlameblade",      Material.NETHERITE_SWORD, 7005, "Phoenix Wings",   12, "world_nether",   80,  70,   0),
        BLOODAXE       ("bloodaxe",        "§4Bloodaxe",        Material.NETHERITE_AXE,   7006, "Berserk Mode",    14, "world_nether", -120,  65,  95),
        INFERNO_HAMMER ("inferno_hammer",  "§6Inferno Hammer",  Material.MACE,            7007, "Magma Rain",      16, "world_nether",  160,  70,-130),
        ECLIPSE_BOW    ("eclipse_bow",     "§8Eclipse Bow",     Material.BOW,             7008, "Black Hole Arrow",14, "world_nether", -180,  70,-180),
        VOIDBLADE      ("voidblade",       "§5Voidblade",       Material.NETHERITE_SWORD, 7009, "Shadow Dash",     10, "world_the_end", 100,  70,   0),
        TITAN_HAMMER   ("titan_hammer",    "§eTitan Hammer",    Material.MACE,            7010, "Titan Leap",      17, "world_the_end",-150,  74, 110),
        OCEAN_SPEAR    ("ocean_spear",     "§3Ocean Spear",     Material.TRIDENT,         7011, "Water Dash",      12, "world_the_end", 170,  70, 160),
        STAR_SPEAR     ("star_spear",      "§dStar Spear",      Material.TRIDENT,         7012, "Starfall",        13, "world_the_end",-210,  78,-160);

        final String id, name, ability, world;
        final Material mat;
        final int cmd, cd, x, y, z;

        Relic(String id, String name, Material mat, int cmd, String ability, int cd,
              String world, int x, int y, int z) {
            this.id = id; this.name = name; this.mat = mat; this.cmd = cmd;
            this.ability = ability; this.cd = cd; this.world = world;
            this.x = x; this.y = y; this.z = z;
        }
    }

    // ─────────────────────────────────────────────────────────────
    //  ENABLE / DISABLE
    // ─────────────────────────────────────────────────────────────
    @Override
    public void onEnable() {
        saveDefaultConfig();
        relicKey = new NamespacedKey(this, "relic_id");
        coreKey  = new NamespacedKey(this, "core_id");

        loadAdvancementTitles();
        exportAdvancementDatapack();
        registerRecipes();
        exportResourcePack();

        Bukkit.getPluginManager().registerEvents(this, this);

        PluginCommand cmd = getCommand("ny");
        if (cmd != null) cmd.setExecutor(this);

        // Delay world setup so all worlds are loaded first
        if (getConfig().getBoolean("auto-setup-on-start", true)) {
            new BukkitRunnable() {
                @Override public void run() { runSetup(false); }
            }.runTaskLater(this, 40L);
        }

        getLogger().info("NytherionCore Ultimate v" + getDescription().getVersion() + " enabled.");
    }

    @Override
    public void onDisable() {
        try {
            for (Player p : Bukkit.getOnlinePlayers()) {
                savePlayerRelicSnapshot(p);
                p.saveData();
            }
            saveConfig();
            getLogger().info("NytherionCore: all player data saved.");
        } catch (Exception ex) {
            getLogger().log(Level.WARNING, "NytherionCore shutdown save warning", ex);
        }
    }

    // ─────────────────────────────────────────────────────────────
    //  COMMANDS
    // ─────────────────────────────────────────────────────────────
    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (args.length == 0) {
            sender.sendMessage(colorize("&b/ny setup &7| &b/ny weapons &7| &b/ny rules &7| &b/ny borders &7| &b/ny saveinfo"));
            return true;
        }
        switch (args[0].toLowerCase(Locale.ROOT)) {
            case "setup" -> {
                runSetup(true);
                sender.sendMessage(colorize("&aNytherion worlds, borders, spawn and structures generated."));
            }
            case "rules"    -> sendRules(sender);
            case "saveinfo" -> sendSaveInfo(sender);
            case "borders"  -> sendBorders(sender);
            case "weapons"  -> {
                for (Relic r : Relic.values())
                    sender.sendMessage(colorize(r.name + " &7- &f" + r.ability + " &8(" + r.cd + "s)"));
            }
            case "give" -> {
                if (!(sender instanceof Player p)) { sender.sendMessage("Player only."); break; }
                if (args.length < 2) { sender.sendMessage(colorize("&cUsage: /ny give <relic-id>")); break; }
                Relic r = findRelic(args[1]);
                if (r == null) { sender.sendMessage(colorize("&cUnknown relic id.")); break; }
                p.getInventory().addItem(buildRelicItem(r));
                grantRelicAdvancement(p, r);
                sender.sendMessage(colorize("&aGiven " + r.name));
            }
            case "core" -> {
                if (!(sender instanceof Player p)) { sender.sendMessage("Player only."); break; }
                if (args.length < 2) { sender.sendMessage(colorize("&cUsage: /ny core <id>")); break; }
                p.getInventory().addItem(buildCoreItem(args[1]));
                sender.sendMessage(colorize("&aGiven core: " + args[1]));
            }
            default -> sender.sendMessage(colorize("&cUnknown sub-command."));
        }
        return true;
    }

    private void sendRules(CommandSender s) {
        s.sendMessage(colorize("&6&lNytherion SMP — Relic Rules"));
        s.sendMessage(colorize("&7• Each relic exists only once on the entire server."));
        s.sendMessage(colorize("&7• Relics cannot be destroyed, burned, or despawned."));
        s.sendMessage(colorize("&7• Relics cannot be stored in chests, barrels, hoppers, shulker boxes, ender chests, or item frames."));
        s.sendMessage(colorize("&7• Manual dropping is allowed; the relic will glow and never despawn."));
        s.sendMessage(colorize("&7• On death the relic drops and any player may pick it up."));
        s.sendMessage(colorize("&7• After crafting: 30-minute global cooldown before next relic is craftable."));
        s.sendMessage(colorize("&7• Server restarts and crashes never remove relics or player data."));
    }

    private void sendSaveInfo(CommandSender s) {
        s.sendMessage(colorize("&aNytherion Save System:"));
        s.sendMessage(colorize("&7• Paper auto-saves player inventory in world/playerdata on every quit/restart."));
        s.sendMessage(colorize("&7• Plugin force-saves all online players on shutdown."));
        s.sendMessage(colorize("&7• Relic and Core IDs live in PersistentDataContainer — restart-proof."));
        s.sendMessage(colorize("&7• Crafted states and progression index are stored in config.yml."));
        s.sendMessage(colorize("&7• Relic item entities are marked persistent and have unlimited lifetime."));
    }

    private void sendBorders(CommandSender s) {
        s.sendMessage(colorize("&6World Borders:"));
        s.sendMessage(colorize("&7• Overworld: &f18,000 × 18,000"));
        s.sendMessage(colorize("&7• Nether: &f25,000 × 25,000"));
        s.sendMessage(colorize("&7• The End: &fUnlimited"));
    }