narsondagoat
๐Ÿ“Ž 1 file 19,291 chars
๐Ÿ“„
pasted-code-1788268127487.txt
txt 1069 lines
โ–ถ
# ๐Ÿ”ฅ FIRE SWORD PLUGIN โ€” MINECRAFT 1.21.11 PAPER

Create a complete, production-ready **Minecraft Java Edition Paper plugin specifically for Minecraft 1.21.11**.

This plugin is for my SMP and adds a powerful custom **Fire Sword** with a passive ability, two active abilities, custom particles, sounds, cooldown BossBars, temporary terrain effects, anvil renaming support, and strong SMP-safe protections.

---

# โš™๏ธ DEVELOPMENT REQUIREMENTS

* Minecraft Java Edition **1.21.11**
* **Paper 1.21.11**
* Java **21**
* Use modern Paper/Bukkit APIs appropriate for 1.21.11.
* Do NOT write the plugin for an older Minecraft version.
* Do NOT use outdated/deprecated APIs when a modern 1.21.11 API exists.
* Make sure the project compiles cleanly.
* Do not provide pseudocode.
* Provide every required Java class.
* Provide `plugin.yml`.
* Provide `config.yml`.
* Provide the complete Gradle or Maven build configuration.
* The finished project must be ready to compile into a `.jar`.

Use a clean package structure such as:

`com.example.firesword`

---

# โš”๏ธ FIRE SWORD

Create a custom weapon based on:

`Material.NETHERITE_SWORD`

Default display name:

**๐Ÿ”ฅ Fire Sword**

Suggested formatting:

`ยงcยงl๐Ÿ”ฅ Fire Sword`

The name should look powerful and fiery.

The sword must have:

* **Fire Aspect V**
* **Unbreakable**
* Custom lore
* Custom PersistentDataContainer identifier

Use a `NamespacedKey` and `PersistentDataContainer` to identify the Fire Sword.

For example:

`firesword:is_fire_sword = true`

## IMPORTANT โ€” NEVER IDENTIFY THE SWORD BY NAME

The plugin must **NOT** determine whether an item is the Fire Sword by checking its display name.

Do NOT use:

```java
item.getItemMeta().getDisplayName().equals("๐Ÿ”ฅ Fire Sword")
```

The sword must remain functional even if its name is changed.

Use the PDC/custom item data as the authoritative identifier.

This must continue working when the sword is:

* Renamed
* Moved between inventory slots
* Put in the offhand
* Dropped
* Picked up
* Stored in containers
* Moved between players

Normal Netherite Swords must never be treated as Fire Swords.

---

# ๐Ÿ”จ ANVIL RENAMING

The Fire Sword **MUST be fully compatible with normal Minecraft anvils**.

Players must be able to place the Fire Sword inside an anvil and rename it to whatever they want.

Example:

`๐Ÿ”ฅ Fire Sword` โ†’ `Hellbringer`

or:

`๐Ÿ”ฅ Fire Sword` โ†’ `Inferno`

or:

`๐Ÿ”ฅ Fire Sword` โ†’ `My Legendary Sword`

Renaming the sword must **NOT break or remove any functionality**.

The following must remain intact after anvil renaming:

* Fire Aspect V
* Unbreakable status
* Fire Resistance passive
* Inferno Beam
* Inferno Ring
* Cooldown system
* PDC identifier
* Custom item data
* Ability functionality
* Lore

The plugin must preserve the custom PDC when the item passes through an anvil.

Do **not** force the sword back to `๐Ÿ”ฅ Fire Sword` after it has been renamed.

Do **not** continuously reset the item's name from a scheduled task.

The player's chosen name should remain.

## ANVIL LORE

The default ability lore should remain when the player renames the sword.

For example:

**Hellbringer**

`ยง7Forged in the heart of the Nether.`

`ยงcPassive: Inferno's Resistance`
`ยง7Fire Resistance while in your inventory.`

`ยง6Ability I: Inferno Beam`
`ยง7Shift + Left Click`

`ยง4Ability II: Inferno Ring`
`ยง7Shift + Right Click`

The player changing the name must not remove the ability lore.

## ANVIL ENCHANTMENTS

Renaming the sword must preserve:

* Fire Aspect V
* Unbreakable
* Any other legitimate enchantments on the sword

Do not cancel normal anvil renaming.

Use the normal Minecraft anvil mechanics and XP costs.

## ANVIL TEST

The finished plugin must pass this test:

1. Use `/firesword give `.
2. Put the Fire Sword into an anvil.
3. Rename it to `Hellbringer`.
4. Take the renamed sword out.
5. Put it into the player's inventory.
6. Fire Resistance still works.
7. Fire Aspect V still works.
8. Shift + Left Click still activates Inferno Beam.
9. Shift + Right Click still activates Inferno Ring.
10. Cooldowns still work.
11. The item is still recognized as the Fire Sword.
12. The name remains `Hellbringer`.

---

# ๐Ÿ“œ ITEM LORE

Give the default Fire Sword clean lore similar to:

**๐Ÿ”ฅ Fire Sword**

`ยง7Forged in the heart of the Nether.`

`ยงcPassive: Inferno's Resistance`
`ยง7Fire Resistance while in your inventory.`

`ยง6Ability I: Inferno Beam`
`ยง7Shift + Left Click`

`ยง4Ability II: Inferno Ring`
`ยง7Shift + Right Click`

Make the lore configurable through `config.yml` if practical.

---

# ๐Ÿ›ก๏ธ PASSIVE โ€” INFERNO'S RESISTANCE

As long as a player has the Fire Sword anywhere in their inventory, give them:

**Fire Resistance**

Use:

`PotionEffectType.FIRE_RESISTANCE`

The effect should work when the sword is:

* In the hotbar
* In the main inventory
* In the offhand

The player does **not** need to hold the sword.

The passive should remain active continuously while the Fire Sword is present.

When the player no longer has the Fire Sword:

* Remove the Fire Sword's Fire Resistance.
* Do not accidentally remove Fire Resistance supplied by another plugin, potion, beacon, or other source.

Do not constantly stack potion effects every tick.

Use an efficient scheduled check or another optimized system.

---

# โ˜„๏ธ ABILITY I โ€” INFERNO BEAM

## Activation

Activate using:

**Shift + Left Click**

Only activate when:

* The player has the Fire Sword.
* The player is holding the Fire Sword.
* The player is sneaking.
* The ability is not on cooldown.

Use the appropriate Paper/Bukkit event for Minecraft 1.21.11.

Make sure normal gameplay isn't unnecessarily broken.

---

# โฑ๏ธ COOLDOWN

Cooldown:

**60 seconds**

Use a server-side cooldown manager.

Store cooldowns using player UUIDs.

For example:

```java
Map infernoBeamCooldowns;
```

Do not use Bukkit metadata as the primary cooldown system.

Cooldowns must not be bypassable by:

* Relogging
* Switching worlds
* Switching inventory slots
* Dropping the sword
* Picking the sword back up

Use timestamps to calculate remaining cooldown time.

---

# ๐Ÿ”ฅ PROJECTILE

When activated, create a powerful fiery projectile that travels in the direction the player is looking.

It should look like a:

**massive concentrated beam/fireball of fire**

Do not simply use a vanilla fireball with no customization.

The projectile should:

* Start approximately from the player's hand/body.
* Travel forward.
* Have a visible fire trail.
* Detect blocks.
* Detect players.
* Detect mobs.
* Explode on impact.
* Disappear after reaching a maximum distance.
* Never remain permanently in the world.

A custom scheduled projectile system is acceptable and may be preferable for precise behavior.

---

# โœจ PROJECTILE PARTICLES

Create a visually impressive fiery trail using combinations of:

* `Particle.FLAME`
* `Particle.LAVA`
* `Particle.SMOKE`
* `Particle.LARGE_SMOKE`
* `Particle.SOUL_FIRE_FLAME`
* `Particle.EXPLOSION`
* `Particle.FIREWORK`

Add small ember particles trailing behind the projectile.

Optimize particle counts to prevent server lag.

---

# ๐Ÿ’ฅ INFERNO BEAM EXPLOSION

When the projectile hits a:

* Player
* Mob
* Block

create a large fiery explosion.

Damage:

**4 hearts = 8.0 health points**

The damage MUST ignore armor.

Do not use ordinary damage behavior if it causes armor to reduce the damage.

Apply exactly **8.0 damage** while respecting appropriate Minecraft protections such as:

* Invulnerability
* Spectator
* Creative mode where appropriate
* Server/plugin protection systems

---

# ๐ŸŒ‹ TEMPORARY INFERNO TERRAIN

At the explosion location, create a temporary fiery area containing:

* Fire
* Lava
* Magma Blocks

Default radius:

**4 blocks**

The effect must look like the ground has been temporarily transformed into a Nether inferno.

## CRITICAL SMP WORLD PROTECTION

DO NOT permanently grief the world.

Before changing any block:

1. Check whether it is safe to modify.
2. Save its original state.
3. Change it temporarily.
4. Schedule restoration.
5. Restore the original state.

Avoid modifying:

* Chests
* Shulker Boxes
* Ender Chests
* Furnaces
* Crafting Tables
* Enchanting Tables
* Beds
* Redstone components
* Nether portals
* Player-built containers
* Important structures

Prefer modifying:

* Air
* Replaceable blocks
* Safe natural terrain

If a block cannot safely be modified, skip it.

Do not permanently overwrite player builds.

If restoring a block could destroy something a player placed during the ability, prioritize player-built terrain and avoid damaging it.

---

# ๐Ÿ’ฅ EXPLOSION VISUALS

Create a large fiery particle burst using:

* `Particle.EXPLOSION`
* `Particle.FLAME`
* `Particle.LAVA`
* `Particle.SMOKE`
* `Particle.LARGE_SMOKE`
* `Particle.FIREWORK`

Add:

* Expanding fiery shockwave
* Outward-flying embers
* Rising smoke
* Vertical flame burst
* Magma-style particles

Make the effect last roughly 1โ€“2 seconds.

---

# ๐Ÿ”Š INFERNO BEAM SOUNDS

Use appropriate vanilla Minecraft sounds such as:

* Blaze shoot
* Fire charge
* Lava
* Explosion
* Nether-related sounds

Use separate sounds for:

1. Ability activation
2. Projectile launch
3. Projectile impact
4. Explosion
5. Cooldown ready

Keep the volume powerful but not obnoxious.

---

# ๐ŸŒ‹ ABILITY II โ€” INFERNO RING

## Activation

Activate using:

**Shift + Right Click**

Only activate when:

* Player has Fire Sword.
* Player is holding Fire Sword.
* Player is sneaking.
* Ability is not on cooldown.

Cooldown:

**120 seconds**

Duration:

**8 seconds**

Radius:

**6 blocks**

---

# ๐Ÿ”ฅ RING CREATION

Create a large circular ring of fire around the player.

Radius:

**6 blocks**

The ring must follow the player as they move.

It should not remain at the original activation location.

The ring lasts exactly **8 seconds**.

---

# โœจ RING PARTICLES

Make the ring extremely impressive.

Create multiple particle layers.

### Outer Ring

Radius:

**6 blocks**

Use:

* Flame
* Lava
* Smoke

### Inner Ring

Radius:

**5.5 blocks**

Use:

* Flame
* Embers

### Clockwise Layer

Create a rotating circle of particles.

Use:

`x = centerX + cos(angle) * radius`

`z = centerZ + sin(angle) * radius`

Increase the angle each update.

### Counter-Clockwise Layer

Create another rotating particle circle moving in the opposite direction.

Use different heights for each layer.

### Rising Fire

Spawn flames rising upward around the perimeter.

### Center Effects

Occasionally spawn embers and flame particles around the owner.

The finished effect should look like a **magical inferno barrier**.

---

# ๐Ÿšซ INFERNO RING โ€” ENEMY TRAP

The 6-block perimeter acts as a fiery barrier.

Track nearby entities.

When a player or mob attempts to cross the perimeter from outside to inside:

1. Knock them toward the center.
2. Set them on fire.
3. Prevent easy traversal through the barrier.

The knockback should feel powerful but fair.

Do not affect the ring owner.

Do not repeatedly knock an entity back every tick.

Give each affected entity a short internal knockback cooldown.

Suggested:

**0.5โ€“1 second**

The ability should work against:

* Players
* Hostile mobs
* Passive mobs
* Other living entities where appropriate

---

# ๐Ÿ”ฅ ENEMY FIRE

Entities crossing/touching the perimeter should be set on fire.

Default:

**3 seconds**

Make this configurable.

Do not reset the fire timer every tick.

---

# ๐Ÿ’ช RING OWNER BUFF

While the Fire Sword owner is inside their active Inferno Ring, give:

**Speed I**

and

**Strength II**

Use:

`PotionEffectType.SPEED`

`PotionEffectType.STRENGTH`

These effects remain active while the owner is inside the ring.

Remove the plugin's effects when:

* Ring expires
* Player leaves the ring
* Player dies
* Player disconnects
* Ability is cancelled

Do not accidentally remove effects originating from other sources.

Track plugin-applied effects separately.

---

# โฑ๏ธ COOLDOWN BOSSBARS

Create a custom cooldown display using the Paper/Bukkit BossBar API.

Display the cooldown near the bottom of the screen.

## Inferno Beam

Cooldown:

`๐Ÿ”ฅ Inferno Beam โ€” 47s`

Ready:

`๐Ÿ”ฅ Inferno Beam โ€” READY`

## Inferno Ring

Cooldown:

`๐ŸŒ‹ Inferno Ring โ€” 102s`

Ready:

`๐ŸŒ‹ Inferno Ring โ€” READY`

Use an appropriate fiery BossBar color.

For example:

`BarColor.RED`

Use:

`BarStyle.SEGMENTED_10`

or another polished style.

Each player must have their own BossBars.

Do not create duplicate BossBars.

Update the progress smoothly.

When ready:

* Display READY
* Play a subtle fire sound
* Spawn small flame/ember particles around the player

If both abilities are on cooldown, make sure each cooldown is independently visible.

---

# ๐Ÿ”” COOLDOWN BEHAVIOR

Cooldowns must be completely independent.

Inferno Beam:

**60 seconds**

Inferno Ring:

**120 seconds**

Activating one must NOT reset or affect the other.

Cooldowns should be calculated using timestamps.

---

# ๐Ÿงน CLEANUP

Properly clean up:

* Scheduled tasks
* BossBars
* Active rings
* Temporary blocks
* Potion effects
* Projectile tasks
* Entity cooldowns
* Player cooldown data

Clean up when:

* Plugin disables
* Player dies
* Player disconnects
* Ring expires
* Projectile hits
* Projectile reaches maximum distance

---

# ๐Ÿ›ก๏ธ ANTI-DUPLICATION

Use:

`PersistentDataContainer`

with:

`NamespacedKey(plugin, "fire_sword")`

Create methods such as:

```java
createFireSword()
isFireSword(ItemStack item)
hasFireSword(Player player)
```

The PDC identifier must survive:

* Anvil renaming
* Inventory movement
* Dropping
* Picking up
* Container storage

Never rely on the display name.

---

# ๐Ÿ”ฅ FIRE/LAVA PROTECTION

The Fire Sword itself must never be destroyed by:

* Fire
* Lava

Make sure dropped Fire Swords cannot burn.

Only protect the Fire Sword item.

Do not interfere with unrelated item entities.

---

# ๐Ÿ“ฆ COMMANDS

Add:

`/firesword give `

Permission:

`firesword.admin`

Add:

`/firesword reload`

Reloads the configuration.

Add:

`/firesword cooldown  reset`

Resets both Fire Sword cooldowns.

Add:

`/firesword remove`

Removes Fire Swords where practical.

Commands must support tab completion.

---

# โš™๏ธ CONFIG.YML

Create a complete working configuration.

Example:

```yaml
fire-sword:
  name: "&c&l๐Ÿ”ฅ Fire Sword"
  fire-aspect: 5
  unbreakable: true

passive:
  fire-resistance: true

inferno-beam:
  enabled: true
  cooldown: 60
  damage: 8.0
  armor-ignore: true
  explosion-radius: 4.0
  projectile-speed: 1.0
  max-distance: 40
  temporary-block-duration: 5

inferno-ring:
  enabled: true
  cooldown: 120
  duration: 8
  radius: 6.0
  knockback: 1.5
  fire-duration: 3

cooldown-bars:
  enabled: true
  update-interval: 2
  show-ready: true

particles:
  enabled: true
  quality: high

sounds:
  enabled: true
  volume: 1.0

world-protection:
  enabled: true
  protect-containers: true
  restore-blocks: true
```

Every setting included in the configuration must actually be used by the plugin.

---

# ๐ŸŒŽ SMP PERFORMANCE & WORLD SAFETY

This plugin will run on an SMP, so optimize everything.

Do NOT:

* Spawn thousands of particles every tick.
* Spawn unnecessary entities.
* Create infinite scheduled tasks.
* Leave BossBars behind.
* Leave potion effects behind.
* Leave projectiles behind.
* Create permanent fire.
* Create permanent lava.
* Permanently replace blocks.
* Scan entire worlds unnecessarily.

Only check entities within relevant ability radii.

Cancel scheduled tasks immediately when abilities finish.

---

# ๐Ÿ“„ PLUGIN.YML

Create a correct `plugin.yml` for Paper/Minecraft 1.21.11.

Include:

* Plugin name
* Version
* Main class
* Appropriate API version
* Commands
* Permissions

Do not use an API version intended for an older Minecraft version.

---

# ๐Ÿงฉ PROJECT STRUCTURE

Use a clean architecture such as:

```text
src/
 โ””โ”€โ”€ main/
     โ”œโ”€โ”€ java/
     โ”‚   โ””โ”€โ”€ com/example/firesword/
     โ”‚       โ”œโ”€โ”€ FireSwordPlugin.java
     โ”‚       โ”‚
     โ”‚       โ”œโ”€โ”€ item/
     โ”‚       โ”‚   โ””โ”€โ”€ FireSwordItem.java
     โ”‚       โ”‚
     โ”‚       โ”œโ”€โ”€ ability/
     โ”‚       โ”‚   โ”œโ”€โ”€ InfernoBeam.java
     โ”‚       โ”‚   โ””โ”€โ”€ InfernoRing.java
     โ”‚       โ”‚
     โ”‚       โ”œโ”€โ”€ cooldown/
     โ”‚       โ”‚   โ””โ”€โ”€ CooldownManager.java
     โ”‚       โ”‚
     โ”‚       โ”œโ”€โ”€ effects/
     โ”‚       โ”‚   โ””โ”€โ”€ FireEffects.java
     โ”‚       โ”‚
     โ”‚       โ”œโ”€โ”€ listener/
     โ”‚       โ”‚   โ”œโ”€โ”€ AbilityListener.java
     โ”‚       โ”‚   โ”œโ”€โ”€ PlayerListener.java
     โ”‚       โ”‚   โ””โ”€โ”€ ItemProtectionListener.java
     โ”‚       โ”‚
     โ”‚       โ”œโ”€โ”€ command/
     โ”‚       โ”‚   โ””โ”€โ”€ FireSwordCommand.java
     โ”‚       โ”‚
     โ”‚       โ””โ”€โ”€ util/
     โ”‚           โ””โ”€โ”€ FireSwordUtils.java
     โ”‚
     โ””โ”€โ”€ resources/
         โ”œโ”€โ”€ plugin.yml
         โ””โ”€โ”€ config.yml
```

You may improve the architecture if necessary.

---

# ๐Ÿงช FINAL TESTING REQUIREMENTS

Before giving the final source code, verify every feature.

## Item

* Netherite Sword
* Fire Aspect V
* Unbreakable
* Custom PDC
* Cannot burn
* Can be renamed in an anvil
* Renaming does not break functionality

## Passive

* Fire Resistance works anywhere in inventory
* Fire Resistance disappears when sword is removed
* Does not constantly stack effects

## Inferno Beam

* Shift + Left Click works
* 60-second cooldown works
* Projectile follows player's direction
* Fiery trail works
* Projectile disappears correctly
* Explosion works
* Deals exactly 8.0 damage
* Damage ignores armor
* Temporary fire/lava/magma effects work
* Terrain restoration works
* No permanent grief
* No excessive lag

## Inferno Ring

* Shift + Right Click works
* 120-second cooldown works
* Lasts 8 seconds
* Radius is 6 blocks
* Follows player
* Multiple particle layers rotate
* Enemies are knocked toward center
* Enemies are set on fire
* Owner gets Speed I
* Owner gets Strength II
* Effects are removed correctly
* Cannot create infinite rings

## Anvil

Test:

**Fire Sword โ†’ Anvil โ†’ Rename to Hellbringer โ†’ Take out**

Verify:

* Name stays `Hellbringer`
* PDC remains
* Fire Aspect V remains
* Unbreakable remains
* Lore remains
* Passive remains
* Inferno Beam remains functional
* Inferno Ring remains functional

## Cooldowns

* Both cooldowns work independently
* BossBars update correctly
* READY state works
* Cooldowns cannot be bypassed by reconnecting
* BossBars don't duplicate

## Cleanup

* No leaked tasks
* No leaked BossBars
* No lingering potion effects
* No permanent terrain changes
* No lingering projectiles

---

# ๐ŸŽฏ FINAL DESIGN GOAL

Make this feel like a **rare legendary SMP weapon**, not a basic plugin.

The visual theme should be:

**๐Ÿ”ฅ INFERNO + NETHER + MAGMA + LEGENDARY FIRE**

The **Inferno Beam** should feel like a devastating concentrated blast of Nether fire.

The **Inferno Ring** should feel like a powerful magical barrier of swirling flames.

The plugin should prioritize:

**Polished visuals โ†’ reliable mechanics โ†’ smooth gameplay โ†’ SMP safety โ†’ performance.**

Return the **complete source code for every file**.

Do not return pseudocode.

Do not leave TODO sections.

Do not omit required classes.

Also provide exact instructions for:

1. Compiling the plugin.
2. Where the compiled `.jar` is located.
3. Which Java version to use.
4. Which Paper 1.21.11 server version to use.
5. Installing the plugin.
6. Using `/firesword give`.
7. Configuring the plugin.
8. Troubleshooting common startup/compilation errors.
Kodari AI
KodariSep 1 at 1:13 pm 14
InfernoBlade
A legendary Fire Sword plugin for Paper 1.21.11 SMP servers. Creates a custom Netherite Sword with PersistentDataContainer identification, granting Fire Resistance passively while in inventory. Features two active abilities: Inferno Beam (Shift+Left Click, 60s cooldown) firing a fiery projectile with armor-ignoring 8.0 damage and temporary terrain transformation, and Inferno Ring (Shift+Right Click, 120s cooldown) creating a rotating 6-block particle barrier that traps and burns enemies while buffing the owner. Includes independent cooldown BossBars, anvil renaming compatibility, fire/lava protection, configurable settings, and robust SMP-safe world protection with automatic block restoration.
  1. Create the Paper 1.21.11 Gradle project, descriptor, and complete configuration.

  2. Implement PDC-backed Fire Sword creation, anvil preservation, inventory passive, and lava/fire item protection.

  3. Implement cooldown BossBars, Inferno Beam, temporary terrain restoration, and Inferno Ring effects.

  4. Register commands, listeners, lifecycle cleanup, and installation/build documentation.

Created the complete Fire Sword Paper plugin project.

  • Gradle Kotlin build targeting Java 21 and Paper 1.21.11-R0.1-SNAPSHOT

  • PDC-backed, anvil-safe Netherite Fire Sword with configurable lore/enchantments

  • Inventory-wide Fire Resistance passive and dropped-item fire/lava protection

  • Inferno Beam projectile, armor-bypassing damage, visuals, temporary protected terrain, and cleanup

  • Inferno Ring with rotating particle layers, moving perimeter, enemy knockback/fire, and owner buffs

  • Independent timestamp cooldowns with per-player BossBars and ready effects

  • /firesword give, reload, cooldown <player> reset, and remove commands with completion

  • plugin.yml, complete config.yml, and build/install troubleshooting in README.md

Build with JDK 21 using Gradle; the jar is produced at:

Plain Text
build/libs/FireSword-1.0.0.jar
Kodari can make mistakes. Review important code before using.
Files
src
build.gradle.kts
README.md
settings.gradle.kts
Code
16 956
src/main/java/com/example/firesword/FireSwordPlugin.java
package com.example.firesword;

import com.example.firesword.ability.InfernoBeam;
import com.example.firesword.ability.InfernoRing;
import com.example.firesword.command.FireSwordCommand;
import com.example.firesword.cooldown.CooldownManager;
import com.example.firesword.effects.FireEffects;
import com.example.firesword.item.FireSwordItem;
import com.example.firesword.listener.AbilityListener;
import com.example.firesword.listener.ItemProtectionListener;
import com.example.firesword.listener.PlayerListener;
import org.bukkit.command.PluginCommand;
import org.bukkit.plugin.java.JavaPlugin;

public final class FireSwordPlugin extends JavaPlugin {
    private FireSwordItem fireSwordItem;
    private FireEffects fireEffects;
    private CooldownManager cooldownManager;
    private InfernoBeam infernoBeam;
    private InfernoRing infernoRing;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        fireSwordItem = new FireSwordItem(this);
        fireEffects = new FireEffects(this);
        cooldownManager = new CooldownManager(this, fireEffects);
        infernoRing = new InfernoRing(this, fireEffects);
        infernoBeam = new InfernoBeam(this, fireEffects);

        getServer().getPluginManager().registerEvents(new AbilityListener(this), this);
        getServer().getPluginManager().registerEvents(new PlayerListener(this), this);
        getServer().getPluginManager().registerEvents(new ItemProtectionListener(this), this);

        FireSwordCommand command = new FireSwordCommand(this);
        PluginCommand fireSwordCommand = getCommand("firesword");
        if (fireSwordCommand != null) {
            fireSwordCommand.setExecutor(command);
            fireSwordCommand.setTabCompleter(command);
        }
        cooldownManager.start();
    }

    @Override
    public void onDisable() {
        if (infernoBeam != null) infernoBeam.shutdown();
        if (infernoRing != null) infernoRing.shutdown();
        if (cooldownManager != null) cooldownManager.shutdown();
    }

    public void reloadPluginConfig() {
        reloadConfig();
        cooldownManager.restart();
    }

    public FireSwordItem getFireSwordItem() { return fireSwordItem; }
    public FireEffects getFireEffects() { return fireEffects; }
    public CooldownManager getCooldownManager() { return cooldownManager; }
    public InfernoBeam getInfernoBeam() { return infernoBeam; }
    public InfernoRing getInfernoRing() { return infernoRing; }
}