jousts

Can you compile this for me

Kodari AI
KodariNov 9 at 10:32 am 1

To compile it in Kodari:

  1. Click Compile in the top bar. On mobile, tap ⋮ → Compile Project.

  2. Click Compile in the window that opens.

  3. Once it succeeds, click Download on the build.

If it fails, click Auto-fix in the chat or Fix in the build window.

jousts

The compilation failed with this error:

code
Compilation failed with 3 error(s):

ERROR in src/main/java/java/me/yochran/lunarsoup/utils/XMaterial.java at line 8: package org.apache.commons.lang does not exist
import org.apache.commons.lang.StringUtils;
                              ^

ERROR in src/main/java/java/me/yochran/lunarsoup/utils/XMaterial.java at line 9: package org.apache.commons.lang does not exist
import org.apache.commons.lang.Validate;
                              ^

ERROR in src/main/java/java/me/yochran/lunarsoup/utils/XMaterial.java at line 10: package org.apache.commons.lang does not exist
import org.apache.commons.lang.WordUtils;
                              ^


=== COMPILATION ERROR ANALYSIS ===

FILES TO INVESTIGATE:
  - src/main/java/java/me/yochran/lunarsoup/utils/XMaterial.java

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

Kodari AI
KodariNov 9 at 10:32 am 2

I’ll remove the unavailable Commons Lang calls from XMaterial and replace them with Java equivalents.

Replaced the missing Commons Lang calls with Java equivalents in XMaterial.java.

Click Compile again to create a new build. I can’t run the compilation from here.

jousts

[11:33:30 ERROR]: Could not load 'plugins\LunarSoup.jar' in folder 'plugins' org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:152) ~[patched_1.8.8.jar:git-PaperSpigot-445] at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:136) ~[patched_1.8.8.jar:git-PaperSpigot-445] at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugins(CraftServer.java:293) ~[patched_1.8.8.jar:git-PaperSpigot-445] at net.minecraft.server.v1_8_R3.DedicatedServer.init(DedicatedServer.java:202) ~[patched_1.8.8.jar:git-PaperSpigot-445] at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:563) ~[patched_1.8.8.jar:git-PaperSpigot-445] at java.lang.Thread.run(Thread.java:1583) [?:?] Caused by: java.io.FileNotFoundException: Jar does not contain plugin.yml ... 6 more

Kodari AI
KodariNov 9 at 10:35 am 1

I’ll put the plugin resources where the build can package them, then make the descriptor compatible with your 1.8.8 server.

Moved the plugin resources to the standard build location and updated plugin.yml for the 1.8.8 server.

Compile again, then replace the old jar with the new download.

Kodari can make mistakes. Review important code before using.
Files
java
src
README.md
Code
36 4,339
java/me/yochran/lunarsoup/LunarSoup.java
package me.yochran.lunarsoup;

import me.yochran.lunarsoup.commands.*;
import me.yochran.lunarsoup.configuration.Config;
import me.yochran.lunarsoup.configuration.ConfigManagement;
import me.yochran.lunarsoup.kits.KitManagement;
import me.yochran.lunarsoup.listener.*;
import me.yochran.lunarsoup.runnables.CombatTagRunnable;
import me.yochran.lunarsoup.runnables.SpawnRunnable;
import me.yochran.lunarsoup.utils.Utils;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;

import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;

public final class LunarSoup extends JavaPlugin {

    private static LunarSoup instance;
    public static LunarSoup getInstance() { return instance; }

    public FileConfiguration pluginConfig;
    public FileConfiguration playerConfig;

    public final PluginManager pluginManager = getServer().getPluginManager();

    @Override
    public void onEnable() {
        // Plugin startup logic
        Bukkit.getConsoleSender().sendMessage(Utils.translate("LunarSoup v1.0 by Yochran is loading..."));

        instance = this;
        saveDefaultConfig();
        setupConfiguration();
        registerListeners();
        registerCommands();
        runRunnables();

        KitManagement.registerKits();

        Bukkit.getConsoleSender().sendMessage(Utils.translate("LunarSoup v1.0 by Yochran has successfully loaded."));
    }

    /*
     * Maps & Lists
     */
    public Map<UUID, Integer> spawnTimer = new HashMap<>();
    public Map<UUID, Double[]> playerCoords = new HashMap<>();
    public Map<UUID, Integer> combatTag = new HashMap<>();

    /**
     * Function to set up all file configuration.
     */
    private void setupConfiguration() {
        Arrays.asList(
                new Config("players.yml")
        ).forEach(config -> {
            Config.setup(config);
            Config.save(config);
            Config.reload(config);
        });

        pluginConfig = getConfig();
        playerConfig = ConfigManagement.getConfig("players.yml").getConfig();
    }

    /**
     * Function to register listeners.
     */
    private void registerListeners() {
        Arrays.asList(
                new InventoryClickListener(),
                new PlayerJoinListener(),
                new PlayerInteractListener(),
                new PlayerDeathListener(),
                new PlayerMoveListener(),
                new PlayerDamageListener()
        ).forEach(listener -> pluginManager.registerEvents(listener, this));
    }

    /**
     * Function to start runnables.
     */
    private void runRunnables() {
        new SpawnRunnable().runTaskTimer(this, 0, 20);
        new CombatTagRunnable().runTaskTimer(this, 0, 20);
    }

    /**
     * Function to register commands.
     */
    private void registerCommands() {
        getCommand("Kit").setExecutor(new KitCommand());
        getCommand("Stats").setExecutor(new StatsCommand());
        getCommand("Balance").setExecutor(new BalanceCommand());
        getCommand("GiveCredits").setExecutor(new CreditManagementCommands());
        getCommand("TakeCredits").setExecutor(new CreditManagementCommands());
        getCommand("Bounty").setExecutor(new BountyCommand());
        getCommand("Bounties").setExecutor(new BountiesCommand());
        getCommand("Spawn").setExecutor(new SpawnCommand());
        getCommand("CombatTag").setExecutor(new CombatTagCommand());
    }
}