annonyoiounmus

I want the "darkness soul" to have a little change but dont change the fundamental shit i only wanna add stuff to it

Shadow floor state: i want it to be able to move up walls example a mountain that i cant climb i go into the shadow floor state and i go up dont change anything else on it

in the menu of spawning stuff add next to the pages the following:

Guarding (mobs guard the block im standing at and their gonna surround it in a 10 block radius this only works on Hostile mobs and they attack any mob or any player)

I should be able to whitelist players example i go to the player tab that you will add next to the page that allows me to check them with a check mark and my mobs will not attack them even tho they might hit me but i can un check mark them and my mobs will attack them

then i want you to add next to that a Hunt button i will be able to press on a player that they will hunt down (even if that player is 10k blocks away until that player dies or the mobs they wont stop if the mobs die i will be notified

then another new thing if i get attacked by someone who isnt whitelisted ofc the mobs attack that player if its two they split if its three hostile players attacking me they will split to attack them

and a fix when summoning a warden or a wither im stuck on those hearts (the penalty from spawning them) i want it to be after i die they come back (the hearts come back) and over time it takes 5-7 min of them coming back (again over time the hearts come back after 5 mi)

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
52 3,657
src/main/java/com/example/soulsystem/SoulSystem.java
package com.example.soulsystem;

import com.example.soulsystem.abilities.AbilityItemListener;
import com.example.soulsystem.abilities.AbilityItemManager;
import com.example.soulsystem.abilities.AbilityManager;
import com.example.soulsystem.commands.SoulAdminCommand;
import com.example.soulsystem.commands.SoulCommand;
import com.example.soulsystem.combat.CombatManager;
import com.example.soulsystem.cooldown.CooldownManager;
import com.example.soulsystem.darkness.MobKillTracker;
import com.example.soulsystem.darkness.MobTargetingListener;
import com.example.soulsystem.darkness.ShadowStateManager;
import com.example.soulsystem.darkness.WardenPenaltyListener;
import com.example.soulsystem.gui.GUIListener;
import com.example.soulsystem.gui.GUIManager;
import com.example.soulsystem.guardian.GuardianManager;
import com.example.soulsystem.keybind.KeybindListener;
import com.example.soulsystem.keybind.KeybindManager;
import com.example.soulsystem.playerdata.PlayerDataManager;
import com.example.soulsystem.souls.SoulRegistry;
import com.example.soulsystem.souls.impl.DarknessSoul;
import com.example.soulsystem.souls.impl.GuardianSoul;
import com.example.soulsystem.souls.impl.StormSoul;
import com.example.soulsystem.storm.StormManager;
import com.example.soulsystem.whitelist.WhitelistManager;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class SoulSystem extends JavaPlugin {
    private SoulRegistry soulRegistry;
    private PlayerDataManager playerDataManager;
    private GUIManager guiManager;
    private KeybindManager keybindManager;
    private WhitelistManager whitelistManager;
    private CooldownManager cooldownManager;
    private AbilityManager abilityManager;
    private AbilityItemManager abilityItemManager;
    private CombatManager combatManager;
    private ShadowStateManager shadowStateManager;
    private MobKillTracker mobKillTracker;
    private MobTargetingListener mobTargetingListener;
    private GuardianManager guardianManager;
    private StormManager stormManager;
    private WardenPenaltyListener wardenPenaltyListener;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        this.soulRegistry = new SoulRegistry();
        this.playerDataManager = new PlayerDataManager(this);
        this.guiManager = new GUIManager();
        this.keybindManager = new KeybindManager(this);
        this.whitelistManager = new WhitelistManager(this);
        this.cooldownManager = new CooldownManager();
        this.abilityManager = new AbilityManager(this);
        this.abilityItemManager = new AbilityItemManager(this);
        this.combatManager = new CombatManager(this);
        this.shadowStateManager = new ShadowStateManager(this);
        this.mobKillTracker = new MobKillTracker(this);
        this.mobTargetingListener = new MobTargetingListener(this);
        this.guardianManager = new GuardianManager(this);
        this.stormManager = new StormManager(this);
        this.wardenPenaltyListener = new WardenPenaltyListener(this);
        
        registerSouls();
        registerCommands();
        registerListeners();
        
        getLogger().info("SoulSystem enabled successfully!");
        getLogger().info("Item-based ability system active!");
    }

    @Override
    public void onDisable() {
        if (shadowStateManager != null) {
            shadowStateManager.cleanup();
        }
        if (playerDataManager != null) {
            playerDataManager.saveAll();
        }
        if (whitelistManager != null) {
            whitelistManager.saveAll();
        }
        if (keybindManager != null) {
            keybindManager.saveKeybinds();
        }
        getLogger().info("SoulSystem disabled!");
    }

    private void registerSouls() {
        DarknessSoul darknessSoul = new DarknessSoul();
        darknessSoul.initialize(this);
        soulRegistry.registerSoul(darknessSoul);

        GuardianSoul guardianSoul = new GuardianSoul();
        guardianSoul.initialize(this);
        soulRegistry.registerSoul(guardianSoul);

        StormSoul stormSoul = new StormSoul();
        stormSoul.initialize(this);
        soulRegistry.registerSoul(stormSoul);
    }

    private void registerCommands() {
        getCommand("soul").setExecutor(new SoulCommand(this));
        getCommand("souladmin").setExecutor(new SoulAdminCommand(this));
    }

    private void registerListeners() {
        Bukkit.getPluginManager().registerEvents(new GUIListener(guiManager), this);
        Bukkit.getPluginManager().registerEvents(new AbilityItemListener(this), this);
        Bukkit.getPluginManager().registerEvents(new KeybindListener(this), this);
    }

    public void reload() {
        reloadConfig();
        playerDataManager.saveAll();
        whitelistManager.saveAll();
        keybindManager.saveKeybinds();
        getLogger().info("Configuration reloaded!");
    }
}