wisxxp__

The compilation failed with this error:

code
Compilation failed with 6 error(s):

ERROR in src/main/java/com/legendaryspears/spear/Spear.java at line 34: <identifier> expected
        item.editMeta(meta -> {
                     ^

ERROR in src/main/java/com/legendaryspears/spear/Spear.java at line 34: <identifier> expected
        item.editMeta(meta -> {
                          ^

ERROR in src/main/java/com/legendaryspears/spear/Spear.java at line 36: illegal start of type
        });
         ^

ERROR in src/main/java/com/legendaryspears/spear/Spear.java at line 38: statements not expected outside of methods and initializers
        return item;
        ^

ERROR in src/main/java/com/legendaryspears/spear/Spear.java at line 56: class, interface, enum, or record expected
}
^

ERROR in src/main/java/com/legendaryspears/spear/Spear.java at line 1: compact source file should not have package declaration
package com.legendaryspears.spear;
^


=== COMPILATION ERROR ANALYSIS ===

SYNTAX ERRORS:
  - Line 34: <identifier> expected
  - Line 34: <identifier> expected
  - Line 38: statements not expected outside of methods and initializers
  - Line 56: class, interface, enum, or record expected
ACTION: Check for missing semicolons or brackets

FILES TO INVESTIGATE:
  - src/main/java/com/legendaryspears/spear/Spear.java

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

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
36 2,468
src/main/java/com/legendaryspears/LegendarySpears.java
package com.legendaryspears;

import com.legendaryspears.ability.AbilityManager;
import com.legendaryspears.ability.CooldownManager;
import com.legendaryspears.command.SpearCommand;
import com.legendaryspears.config.ConfigManager;
import com.legendaryspears.data.PlayerDataManager;
import com.legendaryspears.listener.CraftingListener;
import com.legendaryspears.listener.DroppedSpearListener;
import com.legendaryspears.listener.PassiveEffectListener;
import com.legendaryspears.listener.SpearListener;
import com.legendaryspears.listener.WardenTargetListener;
import com.legendaryspears.spear.SpearManager;
import com.legendaryspears.spear.SpearRegistry;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class LegendarySpears extends JavaPlugin {
    
    private ConfigManager configManager;
    private SpearRegistry spearRegistry;
    private SpearManager spearManager;
    private CooldownManager cooldownManager;
    private AbilityManager abilityManager;
    private PlayerDataManager playerDataManager;
    
    @Override
    public void onEnable() {
        this.configManager = new ConfigManager(this);
        this.configManager.load();
        
        this.playerDataManager = new PlayerDataManager(this);
        this.cooldownManager = new CooldownManager(this);
        this.abilityManager = new AbilityManager(this);
        this.spearRegistry = new SpearRegistry(this);
        this.spearManager = new SpearManager(this);
        
        this.spearRegistry.registerAll();
        
        Bukkit.getPluginManager().registerEvents(new SpearListener(this), this);
        Bukkit.getPluginManager().registerEvents(new PassiveEffectListener(this), this);
        Bukkit.getPluginManager().registerEvents(new CraftingListener(this), this);
        Bukkit.getPluginManager().registerEvents(new DroppedSpearListener(this), this);
        Bukkit.getPluginManager().registerEvents(new WardenTargetListener(this), this);
        
        getCommand("spear").setExecutor(new SpearCommand(this));
        
        Bukkit.getScheduler().runTaskTimer(this, () -> {
            cooldownManager.updateActionBars();
        }, 0L, 10L);
        
        getLogger().info("LegendarySpears enabled!");
    }
    
    @Override
    public void onDisable() {
        if (playerDataManager != null) {
            playerDataManager.saveAll();
        }
        if (abilityManager != null) {
            abilityManager.shutdown();
        }
        getLogger().info("LegendarySpears disabled!");
    }
}