_ph4ze_
πŸ“Ž 1 file 20,141 chars
πŸ“„
pasted-code-1790953139274.txt
txt 1304 lines
β–Ά
Create a complete, production-ready Minecraft **Paper 1.21.11** plugin called **Persona Hearts**.

The plugin is a Hearts + Personas SMP system. Build the entire plugin from scratch or fully modify the existing plugin if source code is provided.

The final project MUST compile successfully on Paper 1.21.11 with no compilation errors.

---

# 1. CORE HEART SYSTEM

Every player starts with:

**11 hearts**

Minecraft health conversion:

* 9 hearts = 18 HP
* 10 hearts = 20 HP
* 11 hearts = 22 HP
* 12 hearts = 24 HP
* 13 hearts = 26 HP
* 14 hearts = 28 HP
* 15 hearts = 30 HP

Default settings:

```yaml
starting-hearts: 11
maximum-hearts: 15
minimum-hearts: 9
```

The actual Minecraft maximum-health attribute must always match the player's stored heart amount.

Use the correct Paper 1.21.11 API.

---

# 2. PVP HEART LOSS

When Player A kills Player B:

If Player B has more than 9 hearts:

* Remove exactly 1 heart from Player B.
* Update Player B's maximum health.
* Save the new heart count.
* Drop exactly 1 physical Heart item at the death location.
* Player A can pick up the Heart item.
* Player B respawns with the reduced heart count.

Example:

Player B:

```text
12 hearts
↓
Player killed
↓
11 hearts
↓
1 Heart item drops
```

If the victim has exactly 9 hearts:

```text
9 hearts
↓
Player killed
↓
9 hearts
↓
No Heart item
```

A player can NEVER lose a heart below 9 hearts.

---

# 3. NATURAL DEATH

Natural deaths must NEVER remove hearts.

No heart should be removed when dying from:

* Fall damage
* Lava
* Fire
* Drowning
* Mobs
* Void
* Suffocation
* Explosion
* Environmental damage
* Any other non-player death

The player keeps the exact same heart count after respawning.

Only a valid player-versus-player kill can remove a heart.

Prevent duplicate death-event processing.

---

# 4. HEART ITEM

Create a custom physical Heart item.

Default:

```text
❀ Heart
A heart lost in battle.
Use this to increase your hearts.
```

The Heart item MUST use `PersistentDataContainer`.

Do NOT identify it only by:

* Name
* Lore
* Material

A renamed ordinary item must NOT become a Heart.

When a valid Heart is consumed:

1. Verify the PersistentDataContainer.
2. Check the player's current hearts.
3. Check maximum hearts.
4. Add exactly 1 heart.
5. Update maximum health.
6. Remove exactly 1 Heart item.
7. Save the player data.
8. Refresh all GUIs.
9. Update heart displays.

If the player already has 15 hearts, the item must not be consumed.

---

# 5. HEART WITHDRAWAL

Players must be able to withdraw their own hearts as physical Heart items.

Commands:

```text
/hearts withdraw
/hearts withdraw 
```

Example:

```text
/hearts withdraw
```

Withdraws 1 heart.

Example:

```text
/hearts withdraw 3
```

Withdraws 3 hearts.

Rules:

* Player cannot go below 9 hearts.
* If the player has 9 hearts, withdrawal is disabled.
* Each withdrawn heart becomes one physical Heart item.
* Update maximum health immediately.
* Save the new heart count immediately.
* Update all GUIs immediately.

Example:

```text
12 hearts
/hearts withdraw 2
↓
10 hearts
↓
2 Heart items
```

Prevent duplication and negative amounts.

---

# 6. HEART WITHDRAWAL GUI

Inside `/persona`, add a clickable:

**WITHDRAW HEART**

Display:

```text
Withdraw 1 Heart
Click to convert one of your hearts into a physical Heart item.
```

When clicked:

* Check the player's current hearts.
* Check minimum hearts.
* Remove 1 heart.
* Give 1 Heart item.
* Update health.
* Save data.
* Refresh GUI.
* Play a sound.
* Send confirmation.

At 9 hearts:

```text
You cannot withdraw any more hearts.
Minimum hearts: 9
```

---

# 7. HEART GUI MUST ALWAYS BE ACCURATE

This is extremely important.

Whenever a player gains or loses hearts, the GUI must immediately update.

Example:

Before:

```text
❀ 15 Hearts
```

Player gets killed:

```text
❀ 14 Hearts
```

The GUI MUST NOT continue showing 15.

Update the GUI after:

* PvP heart loss
* Heart pickup
* Heart consumption
* Heart withdrawal
* `/hearts give`
* `/hearts remove`
* `/hearts set`
* `/hearts take`
* Admin GUI changes
* Any other heart modification

Do not require the player to reconnect or reopen the GUI.

---

# 8. CENTRAL HEART MANAGER

Create a central:

`HeartManager`

ALL heart modifications must go through it.

Implement methods similar to:

```java
getHearts(Player player)

setHearts(Player player, int amount)

addHearts(Player player, int amount)

removeHearts(Player player, int amount)

withdrawHearts(Player player, int amount)

updatePlayerHealth(Player player)

savePlayerData(Player player)

refreshHeartDisplays(Player player)
```

Do NOT duplicate heart-changing logic across commands and listeners.

The HeartManager should be the single source of truth.

---

# 9. PERSONA SYSTEM

There are exactly 6 Personas:

1. Trapper Persona
2. Dash Persona
3. Vanish Persona
4. Glide Persona
5. Frost Persona
6. Trader Persona

Every player receives one random Persona on their **first-ever join**.

The Persona must be permanently saved.

Players do NOT receive a new Persona when reconnecting.

Every Persona has an equal chance of being selected.

---

# 10. PERSONA UNLOCK REQUIREMENT

Persona abilities can only be activated when the player has:

**15 hearts**

The Persona remains assigned if the player drops below 15 hearts.

However:

```text
15 hearts = Persona unlocked
14 hearts = Persona locked
13 hearts = Persona locked
...
```

When the player returns to 15 hearts, the ability becomes available again.

Display:

```text
Persona Status:
UNLOCKED
```

or:

```text
Persona Status:
LOCKED
Required: 15 Hearts
Current: 14 Hearts
```

---

# 11. TRAPPER PERSONA

## Trapper Persona

Ability:

* Target a nearby player.
* Freeze them for 10 seconds.
* The target cannot normally move.
* The target CAN eat Golden Apples.
* The target CAN eat Enchanted Golden Apples.
* Do not disable necessary inventory interaction for eating.
* Do not permanently modify the player's movement.

Default:

```yaml
cooldown: 180
freeze-duration: 10
```

Cooldown:

**3 minutes**

Add:

* Freeze particles
* Freeze sound
* Action bar indicator
* Target feedback

Make range configurable.

---

# 12. DASH PERSONA

## Dash Persona

Ability:

* Gives 2 dash charges.
* Each dash travels approximately 6 blocks.
* Dash follows the direction the player is looking.
* Check collision before moving.
* Never teleport the player inside a wall.
* Prevent dangerous teleportation.
* Player receives no fall damage from the dash.

Default:

```yaml
cooldown: 120
distance: 6
charges: 2
```

Cooldown:

**2 minutes**

After both dash charges are used, the ability enters cooldown.

Show remaining charges.

---

# 13. VANISH PERSONA

## Vanish Persona

Ability:

* Gives 2 teleport charges.
* Each teleport moves the player randomly within a 4-block radius.
* Teleport destination must be safe.
* Never teleport into:

  * Solid blocks
  * Lava
  * Fire
  * Dangerous locations

Default:

```yaml
cooldown: 60
radius: 4
charges: 2
```

Cooldown:

**1 minute**

Add:

* Teleport particles
* Sound
* Cooldown display

---

# 14. GLIDE PERSONA

## Glide Persona

Ability:

* One activation.
* Player can fly/glide for 20 seconds.
* Flight automatically ends after 20 seconds.
* Player receives no fall damage from the ability.

Default:

```yaml
cooldown: 300
duration: 20
```

Cooldown:

**5 minutes**

Add:

* Particles
* Sound
* Action-bar countdown

Make sure the player's original flight state is restored afterward.

---

# 15. FROST PERSONA

## Frost Persona

When the Persona owner hits another player:

* Apply freezing effect.
* Apply Slowness.
* Deal an additional 0.5 damage.
* Duration: 10 seconds.

Default:

```yaml
cooldown: 240
duration: 10
bonus-damage: 0.5
slowness-level: configurable
```

Cooldown:

**4 minutes**

Prevent the ability from repeatedly triggering during cooldown.

Add:

* Snow particles
* Ice/frost sound
* Visual feedback

---

# 16. TRADER PERSONA

## Trader Persona

Ability:

* Give the player Hero of the Village level 5.
* Effect should remain effectively permanent while the Persona is active/unlocked.
* Persist correctly through reconnects and server restarts.
* Do not spam potion-effect updates.

Default:

```yaml
hero-village-level: 5
cooldown: 60
```

Cooldown:

**1 minute**

### Ore Bonus

When the Trader Persona player mines ores:

* Give a configurable chance of extra ore drops.
* Respect Fortune appropriately.
* Do not create infinite duplication.
* Do not repeatedly trigger from the same block.
* Make bonus chance and amount configurable.

---

# 17. PERSONA GUI

Command:

```text
/persona
```

Create a polished GUI.

Show:

* Player name
* Current hearts
* Maximum hearts
* Current Persona
* Persona icon
* Ability
* Cooldown
* Unlock status
* Required hearts
* Withdraw Heart button

Example:

```text
╔════════════════════════════╗
β•‘      PERSONA PROFILE       β•‘
β•‘                            β•‘
β•‘ ❀ Hearts: 14 / 15         β•‘
β•‘                            β•‘
β•‘ βš” Persona: TRAPPER         β•‘
β•‘                            β•‘
β•‘ Freeze a player for 10s    β•‘
β•‘ Cooldown: 3 minutes        β•‘
β•‘                            β•‘
β•‘ πŸ”’ LOCKED                  β•‘
β•‘ Requires 15 Hearts         β•‘
β•‘                            β•‘
β•‘ [ WITHDRAW HEART ]          β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•
```

The GUI must dynamically update.

---

# 18. PERSONA ITEMS

Create unique item icons for each Persona:

* Trapper
* Dash
* Vanish
* Glide
* Frost
* Trader

Each should have:

* Unique name
* Lore
* Ability description
* Required hearts
* Cooldown
* PersistentDataContainer identifier
* CustomModelData support

The plugin must work without a resource pack.

---

# 19. PERSONA IMAGES / ICONS

Add Persona icons inside the GUI.

Use Minecraft item icons by default.

Recommended themes:

### Trapper

Bear trap / ice trap

### Dash

Lightning / boots

### Vanish

Purple fading eye

### Glide

Feather / wings

### Frost

Ice crystal

### Trader

Emerald / enchanted trading emblem

---

# 20. RESOURCE PACK SUPPORT

Create support for a custom resource pack.

If possible, provide a companion resource pack containing textures for:

* Heart
* Trapper
* Dash
* Vanish
* Glide
* Frost
* Trader

Use Minecraft-style pixel art.

The plugin should use CustomModelData or the appropriate modern item-model system supported by Paper/Minecraft 1.21.11.

The plugin must still function without the resource pack.

---

# 21. HEART CRAFTING RECIPE

Create a difficult Heart crafting recipe.

Use rare/end-game materials.

The recipe MUST be configurable.

Example configuration:

```yaml
heart-recipe:
  enabled: true
  shape:
    - "ABA"
    - "CDC"
    - "ABA"
  ingredients:
    A: NETHERITE_INGOT
    B: DIAMOND_BLOCK
    C: GOLD_BLOCK
    D: NETHER_STAR
```

The exact default recipe can be balanced by the developer.

Server owners must be able to change the recipe.

---

# 22. PERSONA RECIPES

Create difficult crafting recipes for:

* Trapper Persona
* Dash Persona
* Vanish Persona
* Glide Persona
* Frost Persona
* Trader Persona

Every recipe must be configurable.

Allow:

```yaml
enabled: true
```

and configurable:

* Shape
* Materials
* Recipe result

---

# 23. RANDOM PERSONA REVEAL

On first join:

1. Give player 11 hearts.
2. Generate random Persona.
3. Save Persona.
4. Show a reveal animation.

Example:

```text
Your Persona is awakening...
```

Then:

```text
⚑ DASH PERSONA ⚑
```

Use:

* Title
* Subtitle
* Sound
* Particles
* Chat message

The animation should not be excessively long.

---

# 24. ADMIN PERSONA COMMANDS

Operators/admins can change Personas.

Command:

```text
/persona set  
```

Valid:

```text
TRAPPER
DASH
VANISH
GLIDE
FROST
TRADER
```

Save the change permanently.

---

# 25. HEART COMMANDS

Implement all of these commands and make sure they ACTUALLY WORK:

```text
/hearts
/hearts withdraw
/hearts withdraw 

/hearts give  
/hearts remove  
/hearts set  
/hearts take  
/hearts giveitem  

/hearts reload
```

`/hearts` should show:

```text
You currently have 14 hearts.
Maximum: 15
Minimum: 9
```

---

# 26. PERSONA COMMANDS

Implement:

```text
/persona
/persona info
/persona set  
/persona reload
```

All commands must have tab completion.

---

# 27. COMMAND REGISTRATION

IMPORTANT:

Commands currently must not be broken.

Make sure commands are registered in:

`plugin.yml`

and properly connected to:

* CommandExecutor
* TabCompleter
* Permission checks
* Argument validation

Do NOT only put commands into plugin.yml.

Actually implement every command.

Test every command before final delivery.

---

# 28. ADMIN HEART MANAGEMENT

Operators can:

* Give hearts
* Remove hearts
* Set hearts
* Take hearts
* Give physical Heart items

Examples:

```text
/hearts give Steve 2
/hearts remove Steve 1
/hearts set Steve 15
/hearts take Steve 3
/hearts giveitem Steve 2
```

All changes must immediately update:

* Database
* Minecraft max health
* GUI
* Action bar
* Heart display

---

# 29. CREATIVE MODE

Operators must be able to manage hearts while in Creative mode.

Normal players must NOT be able to exploit Creative mode to generate Hearts.

Prevent:

* Heart duplication
* Inventory duplication
* Creative cloning exploits
* Fake Heart creation

---

# 30. PERMISSIONS

Create:

```text
personas.use
personas.admin
personas.admin.set
personas.admin.reload

hearts.use
hearts.withdraw

hearts.admin
hearts.admin.give
hearts.admin.remove
hearts.admin.set
hearts.admin.take
hearts.admin.giveitem
```

Operators automatically have administrative access.

---

# 31. DATABASE

Use SQLite for persistent storage.

Store:

* UUID
* Username if useful
* Hearts
* Persona
* First-join status
* Relevant cooldown data

Save immediately after important changes.

Data must survive:

* Server restart
* Player reconnect
* Plugin reload where possible

Do not use memory as the only storage.

---

# 32. COOLDOWN SYSTEM

Create a centralized cooldown manager.

Cooldowns must not be bypassable through:

* Relogging
* Death
* Reopening GUI
* Reconnecting
* Plugin abuse

Display cooldowns clearly.

Example:

```text
Ability ready!
```

or:

```text
Ability available in 1m 24s
```

---

# 33. CONFIG.YML

Create a comprehensive configuration.

Example:

```yaml
hearts:
  starting: 11
  maximum: 15
  minimum: 9
  pvp-loss: 1

persona:
  required-hearts: 15

trapper:
  cooldown: 180
  duration: 10
  range: 10

dash:
  cooldown: 120
  distance: 6
  charges: 2

vanish:
  cooldown: 60
  radius: 4
  charges: 2

glide:
  cooldown: 300
  duration: 20

frost:
  cooldown: 240
  duration: 10
  bonus-damage: 0.5
  slowness-level: 1

trader:
  cooldown: 60
  hero-village-level: 5
  ore-bonus-chance: 25
  ore-bonus-amount: 1
```

Make messages configurable as well.

---

# 34. MESSAGES

Allow customization of:

* Heart lost
* Heart gained
* Heart withdrawn
* Maximum hearts reached
* Minimum hearts reached
* Persona unlocked
* Persona locked
* Ability activated
* Ability cooldown
* Invalid command
* No permission
* Invalid Persona
* Player not found

---

# 35. ANTI-EXPLOIT

The plugin MUST contain:

**NO BACKDOORS.**

Absolutely no:

* Hidden OP commands
* Remote command execution
* Webhooks
* Token collection
* Password collection
* Unauthorized network connections
* Hidden admin accounts
* Malicious code
* Obfuscated code

Prevent:

* Heart duplication
* Persona duplication
* Heart-item spoofing
* Death-event duplication
* Cooldown bypass
* Creative duplication
* Command permission bypass
* Reload exploits
* Relog exploits

---

# 36. PERFORMANCE

Optimize the plugin for an SMP.

Avoid unnecessary:

* Repeating tasks
* Player scanning
* Database queries
* Particle spam
* Memory usage

Use asynchronous SQLite operations where appropriate.

Never access Bukkit/Paper API from an unsafe asynchronous thread.

---

# 37. PROJECT STRUCTURE

Use a clean structure such as:

```text
src/main/java/
  your/package/

    PersonaPlugin.java

    persona/
      Persona.java
      PersonaType.java
      PersonaManager.java
      TrapperPersona.java
      DashPersona.java
      VanishPersona.java
      GlidePersona.java
      FrostPersona.java
      TraderPersona.java

    hearts/
      HeartManager.java
      HeartItem.java
      HeartListener.java

    commands/
      PersonaCommand.java
      HeartsCommand.java

    gui/
      PersonaGUI.java
      HeartGUI.java

    listeners/
      PlayerJoinListener.java
      PlayerDeathListener.java
      PlayerRespawnListener.java
      PlayerDamageListener.java
      PlayerInteractListener.java
      OreBreakListener.java

    storage/
      DatabaseManager.java
      PlayerData.java

    util/
      CooldownManager.java
      ItemUtil.java
      MessageUtil.java
```

---

# 38. PAPER 1.21.11

Target exactly:

**Paper 1.21.11**

Provide:

* `pom.xml` OR `build.gradle`
* `plugin.yml`
* `config.yml`
* Complete Java source
* Resource pack files if possible
* README

Use the correct Java version and Paper API for 1.21.11.

Do not use APIs from older Minecraft versions if they are incompatible with 1.21.11.

---

# 39. FINAL TESTING REQUIREMENT

Before saying the plugin is finished, compile it.

Run the equivalent of:

```text
mvn clean package
```

or the appropriate Gradle build command.

Fix EVERY compilation error.

Then verify:

### Hearts

* First join = 11
* Maximum = 15
* Minimum = 9
* PvP loss works
* Natural death doesn't remove hearts
* 9-heart protection works
* Heart item drops
* Heart item can be consumed
* Heart withdrawal works
* GUI updates
* Minecraft health updates

### Commands

Test every command:

```text
/persona
/persona info
/persona set
/persona reload

/hearts
/hearts withdraw
/hearts withdraw 
/hearts give
/hearts remove
/hearts set
/hearts take
/hearts giveitem
/hearts reload
```

### Personas

Test:

* Trapper
* Dash
* Vanish
* Glide
* Frost
* Trader

Test all cooldowns.

Test the 15-heart unlock requirement.

### Persistence

Test:

* Server restart
* Player reconnect
* Plugin reload

### Security

Verify there are no backdoors or unauthorized external connections.

---

# 40. FINAL OUTPUT

Provide:

1. Complete source code
2. Maven/Gradle build file
3. `plugin.yml`
4. `config.yml`
5. SQLite database implementation
6. README
7. Resource pack if possible
8. All Persona textures if possible
9. Exact build instructions
10. Exact installation instructions
11. All commands
12. All permissions
13. Explanation of all six Personas
14. Successfully compiled `.jar`

DO NOT say the plugin is finished if it does not compile.

DO NOT leave commands as placeholders.

DO NOT leave TODO implementations.

DO NOT provide pseudo-code where actual Java code is required.

Every requested feature must be implemented and connected to the final plugin.
Kodari AI
KodariOct 2 at 3:05 pm 3
PersonaHearts
A comprehensive Paper 1.21.11 SMP plugin combining a persistent heart system with six unique player personas. Players start with 11 hearts, lose hearts in PvP combat, and can withdraw or craft heart items. Each player receives a random permanent persona (Trapper, Dash, Vanish, Glide, Frost, or Trader) on first join, with abilities unlocking at 15 hearts. Features a centralized HeartManager, SQLite persistence, configurable cooldowns, admin commands, a dynamic persona GUI, custom heart crafting recipes, anti-exploit protections, and full resource pack support with CustomModelData.
  1. Create the Paper 1.21.11 build, configuration, and persistent player/heart/persona foundation.

  2. Add working commands, dynamic persona GUI, recipes, and all six persona abilities.

  3. Include setup documentation and check the generated project with the platform verifier.

Created the Persona Hearts project with a Paper 1.21.11 Gradle setup, SQLite persistence, heart management and tagged Heart items, commands, a live Persona GUI, configurable recipes, and implementations for all six Personas.

The project includes vanilla item icons and configurable CustomModelData, but no companion resource pack. I did not run a Gradle build or produce a JAR here, so compilation is unverified; I can’t claim the requested compiled deliverable. Build instructions are in README.md (gradle clean build, Java 21).

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
manifest.kod
README.md
settings.gradle
Code
18 1,369
src/main/java/com/kodari/personahearts/PersonaHeartsPlugin.java
package com.kodari.personahearts;

import com.cryptomorin.xseries.XSound;
import com.kodari.personahearts.ability.AbilityManager;
import com.kodari.personahearts.commands.HeartsCommand;
import com.kodari.personahearts.commands.PersonaCommand;
import com.kodari.personahearts.gui.PersonaGUI;
import com.kodari.personahearts.hearts.HeartManager;
import com.kodari.personahearts.listeners.GameListener;
import com.kodari.personahearts.persona.PersonaType;
import com.kodari.personahearts.storage.DatabaseManager;
import com.kodari.personahearts.util.Items;
import net.kyori.adventure.text.Component;
import org.bukkit.Bukkit;
import org.bukkit.NamespacedKey;
import org.bukkit.entity.Player;
import org.bukkit.persistence.PersistentDataType;
import org.bukkit.plugin.java.JavaPlugin;

import java.sql.SQLException;
import java.util.Map;

public final class PersonaHeartsPlugin extends JavaPlugin {
    private DatabaseManager database;
    private HeartManager hearts;
    private AbilityManager abilities;
    private PersonaGUI personaGui;
    private NamespacedKey heartKey;
    private NamespacedKey personaItemKey;

    @Override public void onEnable() {
        saveDefaultConfig();
        heartKey = new NamespacedKey(this, "heart_item");
        personaItemKey = new NamespacedKey(this, "persona_item");
        try { database = new DatabaseManager(this); }
        catch (SQLException exception) {
            getLogger().severe("Unable to initialize SQLite storage: " + exception.getMessage());
            getServer().getPluginManager().disablePlugin(this);
            return;
        }
        hearts = new HeartManager(this);
        abilities = new AbilityManager(this);
        personaGui = new PersonaGUI(this);
        getServer().getPluginManager().registerEvents(new GameListener(this), this);
        getServer().getPluginManager().registerEvents(personaGui, this);
        HeartsCommand heartsCommand = new HeartsCommand(this);
        PersonaCommand personaCommand = new PersonaCommand(this);
        getCommand("hearts").setExecutor(heartsCommand);
        getCommand("hearts").setTabCompleter(heartsCommand);
        getCommand("persona").setExecutor(personaCommand);
        getCommand("persona").setTabCompleter(personaCommand);
        new RecipeManager(this).register();
        for (Player player : Bukkit.getOnlinePlayers()) {
            hearts.load(player);
            abilities.load(player);
        }
    }

    @Override public void onDisable() {
        if (hearts != null) for (Player player : Bukkit.getOnlinePlayers()) {
            if (abilities != null) abilities.cleanup(player);
            hearts.unload(player);
        }
        if (database != null) try { database.close(); }
        catch (SQLException exception) { getLogger().warning("Could not close SQLite database: " + exception.getMessage()); }
    }

    public void reloadPluginConfig() {
        reloadConfig();
        new RecipeManager(this).register();
        for (Player player : Bukkit.getOnlinePlayers()) {
            hearts.setHearts(player, hearts.getHearts(player));
            abilities.updateTrader(player);
        }
    }

    public void refreshPlayerUi(Player player) {
        if (personaGui != null) personaGui.refresh(player);
        player.sendActionBar(Component.text("§c❀ " + hearts.getHearts(player) + " Hearts  §7|  " + (hearts.getHearts(player) >= getConfig().getInt("persona.required-hearts", 15) ? "§aPersona Unlocked" : "§cPersona Locked")));
    }

    public void revealPersona(Player player, PersonaType persona) {
        Bukkit.getScheduler().runTaskLater(this, () -> {
            player.sendTitle("Β§dYour Persona is awakening...", "Β§7A new power stirs within you", 5, 25, 5);
            XSound.matchXSound("BLOCK_AMETHYST_BLOCK_CHIME").ifPresent(sound -> player.playSound(player.getLocation(), sound.get(), 1f, 1f));
            Bukkit.getScheduler().runTaskLater(this, () -> {
                if (!player.isOnline()) return;
                player.sendTitle("§d✦ " + persona.name() + " PERSONA ✦", "§f" + persona.description(), 5, 45, 10);
                player.sendMessage(Items.color("&dYour Persona is " + persona.displayName() + "!"));
                XSound.matchXSound("ENTITY_PLAYER_LEVELUP").ifPresent(sound -> player.playSound(player.getLocation(), sound.get(), 1f, 1f));
                com.cryptomorin.xseries.particles.XParticle.of("TOTEM_OF_UNDYING").ifPresent(particle -> player.getWorld().spawnParticle(particle.get(), player.getLocation().add(0, 1, 0), 25, 0.5, 0.8, 0.5, 0.05));
            }, 25L);
        }, 5L);
    }

    public void message(org.bukkit.command.CommandSender sender, String key, Map<String, String> placeholders) {
        String prefix = getConfig().getString("messages.prefix", "&8[PersonaHearts] &r");
        String text = getConfig().getString("messages." + key, "&c" + key);
        for (var entry : placeholders.entrySet()) text = text.replace("%" + entry.getKey() + "%", entry.getValue());
        sender.sendMessage(Items.color(prefix + text));
    }

    public void playSound(Player player, String name) { XSound.matchXSound(name).ifPresent(sound -> player.playSound(player.getLocation(), sound.get(), 1f, 1f)); }
    public DatabaseManager database() { return database; }
    public HeartManager hearts() { return hearts; }
    public AbilityManager abilities() { return abilities; }
    public PersonaGUI personaGui() { return personaGui; }
    public NamespacedKey heartKey() { return heartKey; }
    public NamespacedKey personaItemKey() { return personaItemKey; }
}