Noble Adikwu
📎 1 file 20,743 chars
đź“„
pasted-code-1790870811557.txt
txt 1368 lines
â–¶
# TalesAbilities — Complete Minecraft Plugin Specification

Create a complete, polished Minecraft Java plugin called **TalesAbilities** for the **Tales SMP** Minecraft server.

The plugin is designed for **Paper 26.2** and should be compatible with **Geyser/Floodgate** so Java and Bedrock players can use the abilities normally.

The plugin should be production-quality, well-organized, configurable, optimized, and designed specifically for multiplayer PvP.

---

# 1. CORE ABILITY SYSTEM

Every player can have **one equipped ability**.

Each ability must have:

* Unique internal ID
* Display name
* Rarity
* Full description
* Passive ability
* Active ability
* Cooldown
* Duration where applicable
* Range where applicable
* Damage where applicable
* Particle effects
* Sound effects
* Activation item
* Configurable values

Abilities must be saved permanently.

Players keep their ability when:

* Logging out
* Restarting the server
* Dying
* Changing worlds

Do not randomly change a player's ability unless they intentionally use a reroll.

---

# 2. RARITIES

There are six rarities:

* Common
* Uncommon
* Rare
* Mythic
* Legendary
* Divine

Default rarity chances:

* Common: 40%
* Uncommon: 27%
* Rare: 18%
* Mythic: 9%
* Legendary: 5%
* Divine: 1%

The percentages must be configurable in `config.yml`.

Validate the configuration so invalid rarity probabilities cannot break the plugin.

---

# 3. ABILITY ACTIVATION

Players should activate their ability using a configurable item.

Default activation:

**Right-click with a Nether Star.**

However, the plugin must distinguish between:

* Ability activation items
* Ability Reroll Nether Stars

Do not accidentally consume a reroll item when trying to activate an ability.

The activation item should be configurable.

When an ability is activated:

1. Check that the player has an ability.
2. Check the ability cooldown.
3. Check whether the world is disabled.
4. Check whether the player is allowed to use abilities.
5. Activate the ability.
6. Play particles.
7. Play sounds.
8. Apply effects.
9. Start the cooldown.
10. Display cooldown information.

Prevent double activation caused by Minecraft's interaction events firing multiple times.

Support both main-hand and off-hand interaction correctly.

---

# 4. COOLDOWNS

Every active ability has its own cooldown.

Cooldowns must:

* Be configurable
* Be saved safely when necessary
* Prevent repeated activation
* Display remaining time
* Support decimals where appropriate

Display cooldowns through the action bar.

Example:

`Ability ready!`

or

`Ability cooldown: 12.4s`

Do not allow players to bypass cooldowns by reconnecting.

---

# 5. PLAYER ABILITY GUI

Create a polished `/abilities` GUI.

The GUI should show:

* Current ability
* Ability icon
* Rarity
* Full description
* Passive ability
* Active ability
* Cooldown
* Reroll balance

The GUI should have a button for using a reroll.

Use different item appearances for different rarities.

Suggested rarity colors:

Common = White

Uncommon = Green

Rare = Blue

Mythic = Purple

Legendary = Gold

Divine = Dark Purple / special animated appearance

Do not use excessive item flashing that could cause performance problems.

---

# 6. REROLL SYSTEM

Players can obtain **Ability Rerolls** from special Nether Stars.

A reroll is stored as a number in the player's persistent data.

Example:

`Rerolls: 3`

Rerolls survive:

* Death
* Relogging
* Server restarts

---

# 7. REROLL NETHER STAR

Create a special custom Nether Star item.

Name:

**Ability Reroll**

Example lore:

`Right-click to claim an Ability Reroll.`

The item must have a unique persistent data identifier.

Normal Nether Stars must NOT work as reroll items.

When a player right-clicks an actual Ability Reroll:

1. Consume exactly one star.
2. Add one reroll to the player's balance.
3. Send a private chat message.

Example:

`✦ TalesAbilities`

`You have received 1 Ability Reroll!`

`Your total rerolls: 3`

Prevent:

* Duplication
* Double activation
* Offhand duplication
* Dropping exploits
* Inventory desync
* Multiple rewards from one click

---

# 8. STRUCTURE REROLLS

Add Ability Reroll Nether Stars to generated structure loot.

Support:

* Ancient Cities
* Bastion Remnants
* Trial Chambers
* Woodland Mansions
* End Cities
* Nether Fortresses
* Strongholds
* Desert Pyramids

Default configurable chances:

Ancient City: 12%

Bastion: 10%

Trial Chamber: 8%

Woodland Mansion: 12%

End City: 15%

Nether Fortress: 7%

Stronghold: 10%

Desert Pyramid: 5%

These are plugin configuration values and must not overwrite normal Minecraft loot.

The plugin should safely add the special item to eligible generated loot.

Do not repeatedly add rerolls every time a chest is opened.

A chest should be processed only once.

---

# 9. FIRST JOIN

When a player joins the server for the first time:

1. Give them a random ability.
2. Give them the TalesAbilities Guide Book.
3. Explain their ability.
4. Send a welcome message.

The player should not receive another random ability every time they reconnect.

---

# 10. GUIDE BOOK

Every player should receive a special **TalesAbilities Guide** book on first join.

The book should contain several pages.

## Page 1 — Welcome

`TalesAbilities`

Welcome to the Tales SMP ability system!

Every player can obtain a unique ability with a passive effect and an active PvP ability.

Discover powerful abilities, find Ability Rerolls, and become stronger through combat.

## Page 2 — Your Ability

Explain:

* Players have one equipped ability.
* Each ability has a passive effect.
* Each ability has an active ability.
* Active abilities have cooldowns.

## Page 3 — Activation

Explain the default activation method:

`Right-click your ability activation item to use your active ability.`

Mention that the exact activation item can be configured.

## Page 4 — Rerolls

Explain:

`Ability Rerolls are special Nether Stars found inside structures.`

`Right-click an Ability Reroll to add it to your reroll balance.`

## Page 5 — Rarity

List:

Common
Uncommon
Rare
Mythic
Legendary
Divine

Explain that higher rarities are generally less common.

## Page 6 — Commands

Show:

`/abilities`

`/ability`

`/ability info`

Explain what each command does.

## Page 7 — Fair Play

Explain that abilities are designed for PvP and that cooldowns prevent constant ability spam.

The guide should be written professionally and be easy for younger players to understand.

---

# 11. ABILITY ROSTER

Implement ALL of the following abilities.

Every ability must have a proper player-facing description.

---

## COMMON

### Gust

Description:

Harness the power of wind to push nearby enemies away.

Passive:

Slightly reduced fall damage.

Active:

Create a powerful gust that knocks nearby enemies backwards.

Cooldown:

25 seconds.

---

### Stoneguard

Description:

Channel the strength of stone to withstand incoming attacks.

Passive:

Small defensive bonus after taking damage.

Active:

Briefly gain increased protection against incoming damage.

Cooldown:

35 seconds.

---

### Ember

Description:

Control a small burst of flame to pressure enemies.

Passive:

Reduced fire damage.

Active:

Release a short-range flame attack.

Cooldown:

30 seconds.

---

### Spring

Description:

Use enhanced mobility to leap over enemies and escape dangerous situations.

Passive:

Small jump boost.

Active:

Perform a powerful vertical leap.

Cooldown:

25 seconds.

---

### Bulwark

Description:

Become difficult to knock back for a short period.

Passive:

Reduced knockback.

Active:

Gain strong knockback resistance temporarily.

Cooldown:

40 seconds.

---

### Swiftstep

Description:

Temporarily increase your movement speed.

Passive:

Small movement bonus.

Active:

Gain Speed II for 5 seconds.

Cooldown:

30 seconds.

---

### Skybound

Description:

Leap higher than normal and use the air to reposition during combat.

Passive:

Small jump boost.

Active:

Gain Jump Boost III for 6 seconds.

Cooldown:

35 seconds.

---

### Featherfall

Description:

Temporarily become lighter, reducing the danger of falling.

Passive:

Reduced fall damage.

Active:

Gain Slow Falling for 8 seconds.

Cooldown:

40 seconds.

---

# 12. UNCOMMON ABILITIES

### Venom

Description:

Use poisonous energy to weaken your opponents.

Passive:

Reduced poison duration.

Active:

Create a small poison cloud around the target area.

Cooldown:

40 seconds.

---

### Tidal

Description:

Command the force of water to push enemies away.

Passive:

Improved underwater movement.

Active:

Release a wave that knocks enemies backwards.

Cooldown:

35 seconds.

---

### Smokeveil

Description:

Disappear into a cloud of smoke to confuse your enemies.

Passive:

Brief speed boost after taking damage.

Active:

Create a temporary smoke screen.

Cooldown:

40 seconds.

---

### Heartsteel

Description:

Surround yourself with protective energy.

Passive:

Small regeneration outside combat.

Active:

Gain temporary absorption hearts.

Cooldown:

50 seconds.

---

### Volt

Description:

Turn electrical energy into a rapid burst of movement.

Passive:

Small speed bonus after certain combat actions.

Active:

Dash forward quickly.

Cooldown:

30 seconds.

---

### Berserker

Description:

Enter a short state of increased melee power.

Passive:

Gain a small combat bonus when below half health.

Active:

Gain Strength I for 6 seconds.

Cooldown:

45 seconds.

---

### Ironhide

Description:

Temporarily harden your body against incoming attacks.

Passive:

Slightly reduced incoming damage.

Active:

Gain Resistance I for 5 seconds.

Cooldown:

50 seconds.

---

### Nightstalker

Description:

Use enhanced vision to dominate fights in dark areas.

Passive:

Improved visibility in darkness.

Active:

Gain Night Vision for 15 seconds.

Cooldown:

45 seconds.

---

### Aqua Surge

Description:

Move through water with incredible speed.

Passive:

Improved underwater movement.

Active:

Gain enhanced underwater movement for 10 seconds.

Cooldown:

45 seconds.

---

# 13. RARE ABILITIES

### Glacier

Description:

Freeze the battlefield and slow enemies caught inside your icy zone.

Passive:

Reduced slowing effects.

Active:

Create an area that slows nearby enemies.

Cooldown:

45 seconds.

---

### Bloodrush

Description:

Become faster and more dangerous when your health is low.

Passive:

Movement bonus below a configurable health threshold.

Active:

Gain a temporary combat speed boost.

Cooldown:

40 seconds.

---

### Riftwalker

Description:

Bend space to instantly reposition yourself.

Passive:

Reduced teleport-related damage.

Active:

Teleport a configurable distance in the direction you are looking.

Cooldown:

35 seconds.

---

### Thorn

Description:

Nature itself retaliates against those who attack you.

Passive:

Attackers receive a small retaliation effect.

Active:

Briefly root nearby enemies.

Cooldown:

45 seconds.

---

### Resonance

Description:

Release a powerful sonic wave that disrupts nearby enemies.

Passive:

Reduced explosion knockback.

Active:

Send a directional sonic shockwave.

Cooldown:

40 seconds.

---

### Phantom Veil

Description:

Disappear from sight and strike from the shadows.

Passive:

Small movement bonus while sneaking.

Active:

Gain Invisibility for 5 seconds.

Attacking immediately removes the invisibility.

Cooldown:

55 seconds.

---

### Rejuvenation

Description:

Rapidly restore your health during a dangerous fight.

Passive:

Small natural regeneration bonus.

Active:

Gain Regeneration II for 4 seconds.

Cooldown:

65 seconds.

---

### Infernal Blood

Description:

Harness the power of fire and become temporarily immune to flames.

Passive:

Reduced fire damage.

Active:

Gain Fire Resistance for 8 seconds.

Cooldown:

60 seconds.

---

### Overdrive

Description:

Push yourself beyond normal limits for a short period.

Passive:

Small mining-speed bonus.

Active:

Gain Haste II for 8 seconds.

Cooldown:

50 seconds.

---

# 14. MYTHIC ABILITIES

### Void

Description:

Create a gravitational force that pulls enemies toward a central point.

Passive:

Reduced projectile knockback.

Active:

Pull nearby enemies toward the targeted location.

Cooldown:

55 seconds.

---

### Phoenix

Description:

Channel the power of a phoenix to survive dangerous encounters.

Passive:

Fire Resistance.

Active:

Release a fiery burst and gain temporary absorption.

Cooldown:

70 seconds.

---

### Tempest

Description:

Summon a violent storm around your target.

Passive:

Small movement bonus during rain.

Active:

Create multiple controlled lightning effects around a target area.

Cooldown:

60 seconds.

---

### Inferno

Description:

Turn the battlefield into a dangerous ring of flames.

Passive:

Reduced fire damage.

Active:

Create a temporary fire-based combat zone.

Cooldown:

60 seconds.

---

### Golden Soul

Description:

Create a powerful golden barrier around yourself.

Passive:

Small resistance while above a health threshold.

Active:

Gain 4 temporary absorption hearts for 8 seconds.

Cooldown:

75 seconds.

---

# 15. LEGENDARY ABILITIES

### Aether

Description:

Channel celestial energy into a powerful protective shockwave.

Passive:

Defensive bonus while above 75% health.

Active:

Release a radiant shockwave and briefly protect yourself.

Cooldown:

65 seconds.

---

### Chronos

Description:

Manipulate the flow of time around your enemies.

Passive:

Reduced duration of slowing effects.

Active:

Briefly slow nearby enemies.

Cooldown:

75 seconds.

---

### Soul Reaper

Description:

Channel dark soul energy into a powerful targeted strike.

Passive:

Temporary speed boost after a PvP elimination.

Active:

Launch a soul-energy attack at a target.

Cooldown:

65 seconds.

---

### Draconic

Description:

Harness the destructive power of the Ender Dragon.

Passive:

Reduced explosion knockback.

Active:

Fire a dragon-breath-inspired projectile.

Cooldown:

70 seconds.

---

# 16. DIVINE ABILITIES

### Celestia

Description:

Channel celestial energy to protect yourself and nearby allies.

Passive:

Small permanent movement bonus.

Active:

Create a radiant field that grants nearby allies a temporary defensive buff.

Cooldown:

90 seconds.

Special effects:

Golden beams, stars, light particles, and celestial sounds.

---

### Eclipse

Description:

Create a cosmic gravitational field that controls the battlefield.

Passive:

Gain temporary defensive power when falling below half health.

Active:

Create a dark gravitational field that pulls nearby enemies inward and briefly slows them.

Cooldown:

100 seconds.

Special effects:

Dark purple particles, stars, smoke, and a cosmic explosion effect.

---

# 17. BALANCING

Do NOT make Divine abilities capable of instantly killing players.

No ability should permanently stun players.

No ability should permanently remove another player's ability.

No ability should bypass:

* Spawn protection
* WorldGuard
* PvPManager restrictions
* Disabled worlds
* Server protection systems

Damage, range, duration, cooldowns, and effect strengths must all be configurable.

Prevent abilities from becoming infinitely stackable.

Prevent players from abusing multiple effects to create unintended permanent buffs.

---

# 18. COMMANDS

Create:

`/abilities`

Open the ability GUI.

`/ability`

Show the player's current ability.

`/ability info`

Show the player's complete ability information.

`/ability rerolls`

Show the player's reroll balance.

Admin commands should include:

`/abilityadmin set  `

`/abilityadmin give-reroll  `

`/abilityadmin reset `

`/abilityadmin reload`

Protect admin commands with a permission such as:

`talesabilities.admin`

---

# 19. CONFIGURATION

Create a detailed `config.yml`.

Allow configuration of:

* Rarity probabilities
* Every ability cooldown
* Every ability damage value
* Every ability range
* Every ability duration
* Potion effect amplifiers
* Activation item
* Reroll item
* Structure loot chances
* Disabled worlds
* Messages
* GUI titles
* GUI sounds
* Particle effects
* Ability restrictions
* PvP restrictions

---

# 20. PERFORMANCE

The plugin must be optimized for an SMP server.

Do not create unnecessary repeating tasks.

Do not run expensive scans every tick.

Use Bukkit/Paper events wherever possible.

Clean up temporary effects and cooldowns properly.

Prevent memory leaks.

Do not repeatedly scan every online player.

---

# 21. DATA STORAGE

Store player data safely.

Store:

* Current ability
* Reroll balance
* First-join status
* Any other required persistent information

Use YAML or another lightweight persistent storage system.

Data must survive server restarts.

Save data safely when players leave.

---

# 22. BUG PREVENTION

Make sure:

* Abilities cannot activate twice from one click.
* Offhand events do not duplicate effects.
* Reroll stars cannot give multiple rerolls.
* Normal Nether Stars cannot act as rerolls.
* Rerolls cannot become negative.
* Cooldowns cannot become negative.
* Players cannot receive multiple first-join abilities.
* Dead players cannot abuse ability activation.
* Abilities do not activate in disabled worlds.
* Reloading the plugin does not wipe player data.
* Invalid configuration values do not crash the server.
* Missing configuration values use safe defaults.
* Unknown abilities do not crash the plugin.
* Removing an ability from config does not corrupt player data.
* Players cannot bypass cooldowns by reconnecting.
* GUI clicks cannot accidentally move or duplicate special items.
* The plugin handles server shutdown safely.

---

# 23. MESSAGES

Use professional Tales SMP styling.

Example:

`✦ TalesAbilities`

`Your ability: Stormcaller`

`Rarity: Legendary`

`Use your ability activation item to unleash your power.`

Cooldown:

`✦ Ability on cooldown: 12s`

Reroll:

`✦ You received an Ability Reroll!`

New ability:

`✦ Your new ability is: Phantom Veil`

---

# 24. Geyser / BEDROCK SUPPORT

Do not depend on Java-only controls.

Make all important functionality accessible through:

* Right-click
* Inventory GUI
* Commands
* Normal Minecraft interactions

Ensure Bedrock players can use the ability GUI through Geyser.

---

# 25. FINAL QUALITY REQUIREMENTS

The plugin should feel like a polished premium SMP plugin rather than a basic collection of commands.

Use clean code architecture.

Separate:

* Ability management
* Ability definitions
* Cooldown management
* Player data
* GUI
* Rerolls
* Structure loot
* Commands
* Guide book
* Configuration
* Listeners

Use meaningful class and method names.

Add comments where complicated Minecraft/Paper behaviour is involved.

Do not use placeholder methods.

Do not leave TODO sections.

Do not provide pseudocode.

Every listed ability must actually function.

Every GUI button must function.

Every command must function.

The final project must compile successfully against **Paper 26.2**.

Provide:

* Complete Java source
* `plugin.yml`
* `config.yml`
* Maven or Gradle build files
* README installation instructions
* Permissions
* Default configuration
* Complete ability implementation

The final output should be a complete, buildable **TalesAbilities** plugin ready for testing on a Paper 26.2 Tales SMP server.
Kodari AI
KodariOct 1 at 4:27 pm 5
TalesAbilities
A comprehensive Paper 26.2 SMP plugin granting every player one persistent ability with passive and active effects. Players receive a random ability on first join, view it in a polished GUI, and activate it by right-clicking a configurable item. The plugin implements 38 abilities across six rarities, each with configurable cooldowns, damage, ranges, and durations. A reroll system uses special Nether Stars found in structure loot to let players re-roll abilities. Includes a multi-page guide book, admin commands, YAML data storage, Geyser/Bedrock compatibility, and full config.yml customization for rarity chances, messages, and world restrictions.
  1. Create the Gradle/Paper project scaffold and complete default configuration.

  2. Implement the ability roster, persistent player data, cooldowns, and protected activation/passive effects.

  3. Add rerolls, structure loot, first-join guide, commands, and the Bedrock-friendly GUI.

  4. Register everything in the plugin entry point and add installation documentation.

Created the TalesAbilities Paper 26.2 project with 37 abilities across six rarities, persistent player data and cooldowns, configurable activation and rerolls, structure loot, first-join guide, player/admin commands, and a Geyser-friendly GUI. WorldGuard is optional and targeted abilities check its PvP flag.

Build with gradle build, then install build/libs/TalesAbilities-1.0.0.jar in the server’s plugins folder. Configuration and installation notes are in config.yml and README.md.

Noble Adikwu

how do u use them

Kodari AI
KodariOct 1 at 4:32 pm 1

What do you mean by “them”—the plugin’s features, XSeries, or third-party libraries?

Noble Adikwu

the abilites how to activate

Kodari AI
KodariOct 1 at 4:35 pm 1

The generation was stopped before any content could be produced.

Noble Adikwu

HOW DO U USE IT

Kodari AI
KodariOct 1 at 4:36 pm 1

The generation was stopped before any content could be produced.

Noble Adikwu

make it so all you have to is right click any sword to use it and add more info about how to use the plugin and add a second book explaining every ability

Kodari AI
KodariOct 1 at 4:43 pm 1
  1. Make sword right-click activate abilities.

  2. Improve the plugin’s usage guide.

  3. Add a second book documenting every ability.

  • Right-clicking any sword now activates your assigned ability; the configured activation item still works too.

  • Updated the guide book with clearer instructions for using the plugin and activating abilities.

  • Added an ability compendium covering every ability’s rarity, description, passive, active power, and cooldown. Players receive it on join, including existing players.

Noble Adikwu

make it so everyone gets a breeze rod with enchantment glint that can be used to active your ability instead of using sword and make it so when people die they get it and can oly hold one and make it so i can give physical rerolls and virtual ones also add a command i can give everyone and choose an amount and also buff someo abilities and make them better and also give everyone a book compendium when they die as well

Kodari AI
KodariOct 5 at 7:36 pm 2
  1. Add a glinting Breeze Rod ability item, issued on respawn and limited to one per player.

  2. Add physical and virtual rerolls, including a command to grant everyone a chosen amount.

  3. Improve selected abilities’ power.

  4. Give players the ability compendium when they respawn.

  • Everyone receives a glinting Ability Rod on join and respawn. Right-click it to activate your ability. It can’t be dropped or stored, and extra marked rods are removed.

  • Reroll commands:

    • /abilityadmin give-reroll <player> <amount> — virtual rerolls.

    • /abilityadmin give-reroll-item <player> <amount> — physical reroll items for an online player.

    • /abilityadmin giveall <physical|virtual> <amount> — grant rerolls to everyone online. Physical amounts are limited to 64; virtual amounts to 1,000,000.

  • Buffed Ember, Venom, Resonance, and Rejuvenation with longer effects, increased range or damage, and/or shorter cooldowns.

  • Players receive the ability compendium again each time they respawn.

Noble Adikwu

fix th bug for players in survival saying abilitys cant be usd in this world and buff all abilitis and rwrok th ui to be better also make it so i can /give abilities

Kodari AI
KodariOct 7 at 8:54 pm 2
  1. Fix ability activation being rejected in Survival.

  2. Buff every ability.

  3. Improve the ability UI.

  4. Add a command to give abilities.

  1. Survival activation: removed the default PvP-world restriction; this was causing the denial.

  2. Buff every ability.

  3. Improve the ability UI.

  4. Add a command to give abilities.

1–2. Fixed Survival activation and buffed every ability by shortening cooldowns and improving effects, reach, or damage as applicable. 3. Improve the ability UI. 4. Add a command to give abilities.

  1. Reworked /abilities into a framed menu with separate passive/active details, activation instructions, current cooldown status, and a reroll button.

  2. Add a command to give abilities.

  • Fixed the Survival-world denial by removing the requirement for PvP to be enabled. Explicitly disabled worlds and Creative/Spectator restrictions still apply.

  • Buffed every ability: cooldowns are shorter, with stronger effects, longer durations, increased range, or more damage where applicable.

  • Redesigned /abilities with a clearer layout, passive and active details, activation instructions, cooldown status, and a reroll button.

  • Added /abilityadmin give <player> <ability> to assign an ability by its ID, such as /abilityadmin give Steve ember. Requires talesabilities.admin permission.

Noble Adikwu

fix the tidal ability passive and ability not working and same for chronos draconic and any other that wont work bro and the passives

Kodari AI
KodariOct 11 at 3:59 pm 1
  1. Fix the shared target logic so Tidal, Chronos, Draconic, and other enemy-targeting abilities can affect living mobs as well as players.

  2. Keep PvP/WorldGuard protections for player targets.

  3. Refresh movement- and water-based passives reliably, including while players stay in the same block.

Enemy-targeting abilities now work on living mobs as well as players, including Tidal, Chronos, and Draconic. Movement-based passives—including Tidal’s water passive—are refreshed regularly so they don’t lapse when players stay in one spot. PvP and WorldGuard protections still apply to player targets.

Noble Adikwu

make the draconic do dragon breath like it said bro

Kodari AI
KodariOct 11 at 4:10 pm 1
  1. Replace Draconic’s single-target strike with a forward dragon-breath cone.

  2. Render the breath with dragon-breath particles and affect valid targets in its path.

Draconic now fires a visible dragon-breath stream that damages and weakens multiple targets in a forward cone, while respecting line of sight and player-protection rules.

Noble Adikwu

now you cant even use the rod broo

Kodari AI
KodariOct 11 at 4:20 pm 1
  1. Keep reroll activation main-hand only.

  2. Let the ability rod activate from either hand, including right-clicks on blocks.

Fixed rod activation: right-clicks now activate the ability rod in either hand, including when clicking a block. Physical rerolls still only activate from the main hand.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
manifest.kod
README.md
settings.gradle
Code
24 1,397
src/main/java/com/tales/abilities/TalesAbilitiesPlugin.java
package com.tales.abilities;

import org.bukkit.Bukkit;
import org.bukkit.command.PluginCommand;
import org.bukkit.plugin.java.JavaPlugin;

public final class TalesAbilitiesPlugin extends JavaPlugin {
    private DataManager dataManager;
    private AbilityService abilityService;
    private RerollManager rerollManager;
    private AbilityGui abilityGui;

    @Override public void onEnable() {
        saveDefaultConfig();
        dataManager = new DataManager(this);
        abilityService = new AbilityService(this, dataManager);
        rerollManager = new RerollManager(this, dataManager, abilityService);
        abilityGui = new AbilityGui(this, dataManager, abilityService, rerollManager);
        Bukkit.getPluginManager().registerEvents(new AbilityListener(this, dataManager, abilityService, rerollManager, abilityGui), this);
        Bukkit.getPluginManager().registerEvents(new StructureLootListener(this, rerollManager), this);
        Bukkit.getScheduler().runTaskTimer(this, () -> Bukkit.getOnlinePlayers().forEach(abilityService::onMove), 20L, 20L);
        registerCommand("ability", new AbilityCommand(this, dataManager, abilityService));
        registerCommand("abilities", new AbilitiesCommand(abilityGui));
        registerCommand("abilityadmin", new AbilityAdminCommand(this, dataManager, rerollManager, abilityService));
        getLogger().info("TalesAbilities enabled with " + AbilityCatalog.all().size() + " abilities.");
    }
    @Override public void onDisable() { if (dataManager != null) dataManager.save(); }
    private void registerCommand(String name, org.bukkit.command.CommandExecutor executor) {
        PluginCommand command = getCommand(name);
        if (command == null) throw new IllegalStateException("Missing command declaration: " + name);
        command.setExecutor(executor);
    }
}