agentnp

The compilation failed with this error:

code
[ERROR] Compilation failed
error: invalid flag: /workspace/src/main/java/Stellar

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

Kodari AI
KodariApr 23 at 1:10 pm 2,249 (v2)

I need to investigate the compilation error. Let me read the projectโ€™s build configuration and main class to identify the issue.

Found the issue! The root directory is named โ€œStellar Enchantmentโ€ (with a space), which causes Maven to fail compilation because the space isnโ€™t properly handled by the compiler. The error message shows itโ€™s splitting the path at the space: /workspace/src/main/java/Stellar instead of /workspace/src/main/java/Stellar Enchantment/...

Iโ€™ll move all files out of the โ€œStellar Enchantmentโ€ directory to the project root to fix this:

The compilation error is now fixed. All project files have been moved from the โ€œStellar Enchantment/โ€ directory (which had a space causing compilation issues) to the proper project root structure.

Kodari can make mistakes. Review important code before using.
Files
src
pom.xml
README.md
Code
27 1,392
src/main/java/com/agentnp/stellarenchantments/StellarEnchantments.java
package com.agentnp.stellarenchantments;

import com.agentnp.stellarenchantments.commands.StellarCommand;
import com.agentnp.stellarenchantments.commands.StellarTabCompleter;
import com.agentnp.stellarenchantments.config.ConfigManager;
import com.agentnp.stellarenchantments.enchantments.EnchantmentRegistry;
import com.agentnp.stellarenchantments.listeners.*;
import com.agentnp.stellarenchantments.utils.CooldownManager;
import org.bukkit.plugin.java.JavaPlugin;

/**
 * Stellar Enchantments - Main Plugin Class
 * Author: AgentNP (Nepal)
 */
public final class StellarEnchantments extends JavaPlugin {

    private static StellarEnchantments instance;
    private ConfigManager configManager;
    private EnchantmentRegistry enchantmentRegistry;
    private CooldownManager cooldownManager;

    @Override
    public void onLoad() {
        instance = this;
        // Register enchantments early (before server enables)
        this.enchantmentRegistry = new EnchantmentRegistry(this);
        this.enchantmentRegistry.registerAll();
    }

    @Override
    public void onEnable() {
        // Config
        saveDefaultConfig();
        this.configManager = new ConfigManager(this);
        this.configManager.load();

        // Utilities
        this.cooldownManager = new CooldownManager();

        // Listeners
        registerListeners();

        // Commands
        StellarCommand command = new StellarCommand(this);
        getCommand("stellarenchant").setExecutor(command);
        getCommand("stellarenchant").setTabCompleter(new StellarTabCompleter(this));

        getLogger().info("Stellar Enchantments v" + getDescription().getVersion() + " enabled!");
        getLogger().info("Developed by AgentNP ๐Ÿ‡ณ๐Ÿ‡ต");
    }

    @Override
    public void onDisable() {
        if (cooldownManager != null) cooldownManager.clear();
        getLogger().info("Stellar Enchantments disabled.");
    }

    private void registerListeners() {
        getServer().getPluginManager().registerEvents(new BlockBreakListener(this), this);
        getServer().getPluginManager().registerEvents(new PlayerMoveListener(this), this);
        getServer().getPluginManager().registerEvents(new EntityDamageListener(this), this);
        getServer().getPluginManager().registerEvents(new AnvilListener(this), this);
        getServer().getPluginManager().registerEvents(new EnchantTableListener(this), this);
        getServer().getPluginManager().registerEvents(new VillagerTradeListener(this), this);
    }

    public void reloadPlugin() {
        reloadConfig();
        configManager.load();
    }

    public static StellarEnchantments getInstance() { return instance; }
    public ConfigManager getConfigManager() { return configManager; }
    public EnchantmentRegistry getEnchantmentRegistry() { return enchantmentRegistry; }
    public CooldownManager getCooldownManager() { return cooldownManager; }
}