robert1_123dfjs

here i want to complie it

Kodari AI
KodariAug 15 at 3:58 pm 2
  1. Locate the Java source and determine whether the project is missing only its build configuration or also source/resources.

  2. Add the smallest suitable Gradle setup for a Paper/Spigot 1.21 plugin, then provide the compile command.

The project was missing Gradle files, and the decompiled sources also contain invalid BukkitRunnable(this) constructor calls. I’m correcting those compile blockers and making the main class explicitly implement the command executor it registers.

Added a Gradle build configuration and fixed compile blockers in the decompiled source:

  • Added build.gradle for Paper API 1.21.4 and Java 21.

  • Added settings.gradle.

  • Configured the existing root-level Java source files and YAML resources.

  • Fixed invalid BukkitRunnable(this) constructors.

  • Made CustomWeaponsSMP implement CommandExecutor.

Compile from the project folder with:

Shell
gradle clean build

The compiled plugin will be created at:

Plain Text
build/libs/CustomWeaponsSMP-1.0.0.jar

Copy that JAR into your server’s plugins folder. You need JDK 21 and Gradle installed.

robert1_123dfjs

/* * Decompiled with CFR 0.152. * * Could not load the following classes: * org.bukkit.ChatColor * org.bukkit.Effect * org.bukkit.Location * org.bukkit.Material * org.bukkit.NamespacedKey * org.bukkit.Particle * org.bukkit.Sound * org.bukkit.enchantments.Enchantment * org.bukkit.entity.Entity * org.bukkit.entity.LivingEntity * org.bukkit.entity.Player * org.bukkit.event.EventHandler * org.bukkit.event.Listener * org.bukkit.event.block.Action * org.bukkit.event.entity.EntityDamageByEntityEvent * org.bukkit.event.player.PlayerInteractEvent * org.bukkit.inventory.ItemStack * org.bukkit.inventory.Recipe * org.bukkit.inventory.ShapedRecipe * org.bukkit.inventory.meta.ItemMeta * org.bukkit.plugin.Plugin * org.bukkit.plugin.java.JavaPlugin * org.bukkit.potion.PotionEffect * org.bukkit.potion.PotionEffectType * org.bukkit.scheduler.BukkitRunnable * org.bukkit.util.Vector */

can you remove these type of thing from each every file and the code is so messed up

Kodari AI
KodariAug 15 at 4:01 pm 4
  1. Remove CFR decompiler artifacts and normalize the source files without changing behavior.

  2. Fix the compile errors revealed by the damaged/decompiled code, while preserving the existing plugin features.

  3. Leave the project with a clean source layout ready for Gradle compilation.

The Could not load... blocks are CFR comments, not required code; the actual imports below them are valid source. I’m removing those blocks from every Java file first, then I’ll clean the clearly generated casts/temporary variables that make the code hard to maintain.

The decompiler headers are now gone from all nine Java files. I’m fixing the remaining obvious CFR output in the weapon and ritual classes—temporary var100xx variables, redundant casts, and the recipe-key bug that only removed the Sonic Crossbow recipe.

Removed the CFR decompiler artifacts from all 9 Java files:

  • Removed Decompiled with CFR comments.

  • Removed all Could not load the following classes blocks.

  • Removed generated var10001/var10004 temporary variables.

  • Removed unnecessary decompiler casts.

  • Cleaned recipe registration code.

  • Fixed Doom Hammer recipe enable/disable methods.

  • Fixed the ritual recipe key handling.

  • Cleaned several generated particle, broadcast, and scheduler calls.

The source is now much cleaner and no longer contains decompiler markers or temporary var... identifiers.

Compile it with:

Shell
gradle clean build

The JAR should be generated at:

Plain Text
build/libs/CustomWeaponsSMP-1.0.0.jar

Note: the project still uses old Bukkit-style APIs such as ChatColor, Material, Particle, and Sound. Those are valid for Paper 1.21.4, so I did not replace them with MiniMessage or XSeries unnecessarily.

Kodari can make mistakes. Review important code before using.
Files
org
build.gradle
config.yml
plugin.yml
settings.gradle
Code
13 2,703
org/kakashi/customweaponssmp/CustomWeaponsSMP.java
package org.kakashi.customweaponssmp;

import java.util.ArrayList;
import java.util.List;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabCompleter;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.java.JavaPlugin;
import org.kakashi.customweaponssmp.features.CraftingRituals;
import org.kakashi.customweaponssmp.features.OneTime;
import org.kakashi.customweaponssmp.weapons.AutoBow;
import org.kakashi.customweaponssmp.weapons.DoomHammer;
import org.kakashi.customweaponssmp.weapons.DragonBlade;
import org.kakashi.customweaponssmp.weapons.FireBlade;
import org.kakashi.customweaponssmp.weapons.SonicCrossBow;
import org.kakashi.customweaponssmp.weapons.TitanBlade;

public final class CustomWeaponsSMP
extends JavaPlugin
implements CommandExecutor {
    private AutoBow autoBow;
    private FireBlade fireBlade;
    private DragonBlade dragonBlade;
    private DoomHammer doomHammer;
    private TitanBlade titanBlade;
    private SonicCrossBow sonicCrossBow;
    private CraftingRituals craftingRituals;

    public void onEnable() {
        this.autoBow = new AutoBow(this);
        this.fireBlade = new FireBlade(this);
        this.dragonBlade = new DragonBlade(this);
        this.doomHammer = new DoomHammer(this);
        this.titanBlade = new TitanBlade(this);
        this.sonicCrossBow = new SonicCrossBow(this);
        this.craftingRituals = new CraftingRituals(this, this.autoBow, this.fireBlade, this.dragonBlade, this.doomHammer, this.titanBlade, this.sonicCrossBow);
        this.saveDefaultConfig();
        OneTime.applyRecipeLocks(this);
        this.getCommand("glorysmp").setExecutor((CommandExecutor)this);
        this.getCommand("glorysmp").setTabCompleter((TabCompleter)new GlorySMPTabCompleter());
        this.getLogger().info("CustomWeaponsSMP has been enabled!");
    }

    public void onDisable() {
        if (this.autoBow != null) {
            this.autoBow.onDisable();
        }
        if (this.fireBlade != null) {
            this.fireBlade.onDisable();
        }
        if (this.dragonBlade != null) {
            this.dragonBlade.onDisable();
        }
        if (this.doomHammer != null) {
            this.doomHammer.onDisable();
        }
        if (this.titanBlade != null) {
            this.titanBlade.onDisable();
        }
        if (this.sonicCrossBow != null) {
            this.sonicCrossBow.onDisable();
        }
        if (this.craftingRituals != null) {
            this.craftingRituals.onDisable();
        }
        this.getLogger().info("CustomWeaponsSMP has been disabled!");
    }

    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (command.getName().equalsIgnoreCase("glorysmp")) {
            if (args.length < 1) {
                sender.sendMessage("\u00a7cUsage: /glorysmp <give|recipe> <args>");
                sender.sendMessage("\u00a7e/glorysmp give <player> <weapon>");
                sender.sendMessage("\u00a7e/glorysmp recipe <enable|disable> <weapon>");
                return true;
            }
            if (args[0].equalsIgnoreCase("give")) {
                String weapon;
                if (args.length < 3) {
                    sender.sendMessage("\u00a7cUsage: /glorysmp give <player> <weapon>");
                    return true;
                }
                if (!sender.hasPermission("glorysmp.give")) {
                    sender.sendMessage("\u00a7cYou don't have permission to use this command!");
                    return true;
                }
                Player target = this.getServer().getPlayer(args[1]);
                if (target == null) {
                    sender.sendMessage("\u00a7cPlayer not found!");
                    return true;
                }
                if (args.length < 3) {
                    sender.sendMessage("\u00a7cAvailable weapons: autobow, fireblade, dragonblade, doomhammer, titanblade, soniccrossbow");
                    return true;
                }
                switch (weapon = args[2].toLowerCase()) {
                    case "autobow": {
                        target.getInventory().addItem(new ItemStack[]{this.autoBow.getAutoBowItem()});
                        sender.sendMessage("\u00a7aGave Auto Bow to " + target.getName());
                        target.sendMessage("\u00a7aYou received an Auto Bow!");
                        break;
                    }
                    case "fireblade": {
                        target.getInventory().addItem(new ItemStack[]{this.fireBlade.getFireBladeItem()});
                        sender.sendMessage("\u00a7aGave Fire Blade to " + target.getName());
                        target.sendMessage("\u00a7aYou received a Fire Blade!");
                        break;
                    }
                    case "dragonblade": {
                        target.getInventory().addItem(new ItemStack[]{this.dragonBlade.getDragonBladeItem()});
                        sender.sendMessage("\u00a7aGave Dragon Blade to " + target.getName());
                        target.sendMessage("\u00a7aYou received a Dragon Blade!");
                        break;
                    }
                    case "doomhammer": {
                        target.getInventory().addItem(new ItemStack[]{this.doomHammer.getDoomHammerItem()});
                        sender.sendMessage("\u00a7aGave Doom Hammer to " + target.getName());
                        target.sendMessage("\u00a7aYou received a Doom Hammer!");
                        break;
                    }
                    case "titanblade": {
                        target.getInventory().addItem(new ItemStack[]{this.titanBlade.getTitanBladeItem()});
                        sender.sendMessage("\u00a7aGave Titan Blade to " + target.getName());
                        target.sendMessage("\u00a7aYou received a Titan Blade!");
                        break;
                    }
                    case "soniccrossbow": {
                        target.getInventory().addItem(new ItemStack[]{this.sonicCrossBow.getSonicCrossBowItem()});
                        sender.sendMessage("\u00a7aGave Sonic Crossbow to " + target.getName());
                        target.sendMessage("\u00a7aYou received a Sonic Crossbow!");
                        break;
                    }
                    default: {
                        sender.sendMessage("\u00a7cUnknown weapon! Available: autobow, fireblade, dragonblade, doomhammer, titanblade, soniccrossbow");
                        break;
                    }
                }
            } else if (args[0].equalsIgnoreCase("recipe")) {
                if (!sender.hasPermission("glorysmp.admin")) {
                    sender.sendMessage("\u00a7cYou don't have permission to use this command!");
                    return true;
                }
                if (args.length < 3) {
                    sender.sendMessage("\u00a7cUsage: /glorysmp recipe <enable|disable> <weapon>");
                    sender.sendMessage("\u00a7eAvailable weapons: autobow, fireblade, dragonblade, doomhammer, titanblade, soniccrossbow");
                    return true;
                }
                String action = args[1].toLowerCase();
                String weapon = args[2].toLowerCase();
                if (!action.equals("enable") && !action.equals("disable")) {
                    sender.sendMessage("\u00a7cAction must be 'enable' or 'disable'!");
                    return true;
                }
                switch (weapon) {
                    case "autobow": {
                        if (action.equals("enable")) {
                            this.autoBow.enableRecipe();
                            sender.sendMessage("\u00a7aAuto Bow recipe enabled!");
                            break;
                        }
                        this.autoBow.disableRecipe();
                        sender.sendMessage("\u00a7cAuto Bow recipe disabled!");
                        break;
                    }
                    case "fireblade": {
                        if (action.equals("enable")) {
                            this.fireBlade.enableRecipe();
                            sender.sendMessage("\u00a7aFire Blade recipe enabled!");
                            break;
                        }
                        this.fireBlade.disableRecipe();
                        sender.sendMessage("\u00a7cFire Blade recipe disabled!");
                        break;
                    }
                    case "dragonblade": {
                        if (action.equals("enable")) {
                            this.dragonBlade.enableRecipe();
                            sender.sendMessage("\u00a7aDragon Blade recipe enabled!");
                            break;
                        }
                        this.dragonBlade.disableRecipe();
                        sender.sendMessage("\u00a7cDragon Blade recipe disabled!");
                        break;
                    }
                    case "doomhammer": {
                        if (action.equals("enable")) {
                            this.doomHammer.enableRecipe();
                            sender.sendMessage("\u00a7aDoom Hammer recipe enabled!");
                            break;
                        }
                        this.doomHammer.disableRecipe();
                        sender.sendMessage("\u00a7cDoom Hammer recipe disabled!");
                        break;
                    }
                    case "titanblade": {
                        if (action.equals("enable")) {
                            this.titanBlade.enableRecipe();