๐
pasted-code-1788013258123.txt
txt
943 lines
โถ
Yes. Since you want to **build the plugin first and make the resource pack afterward**, use this prompt in your coding AI.
I would use this as the **master plugin prompt**:
```text
You are an expert Java developer and Minecraft Paper plugin developer.
Create a COMPLETE, production-ready Minecraft custom weapons plugin called:
LagBrosWeapons
Do NOT create the resource pack yet.
The plugin must be designed so that I can create a matching resource pack later. Therefore, establish a clean and documented custom item-model ID system that the future resource pack can use.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
TARGET
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Minecraft Java Edition: 1.21.11
Server: Paper 1.21.11
Java: 21
The plugin must be server-side only.
Compatibility goals:
- Paper 1.21.11
- ViaVersion
- ViaBackwards
- GeyserMC
- Floodgate
- Grim Anticheat
- WorldGuard
ViaVersion, ViaBackwards, Geyser, Floodgate, Grim, and WorldGuard must be OPTIONAL integrations.
The plugin must still start and work if none of those plugins are installed.
Do not use exploit techniques or anti-cheat bypasses.
Prefer Paper/Bukkit API and Adventure API.
Avoid NMS unless absolutely necessary.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
IMPORTANT ARCHITECTURE
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Create a clean modular plugin.
Do NOT put everything inside one Java class.
Use a structure similar to:
com.lagbros.weapons
โโโ LagBrosWeapons.java
โ
โโโ weapon/
โ โโโ Weapon.java
โ โโโ WeaponManager.java
โ โโโ WeaponType.java
โ โโโ WeaponRegistry.java
โ
โโโ item/
โ โโโ WeaponItem.java
โ โโโ WeaponItemBuilder.java
โ โโโ WeaponIdentifier.java
โ โโโ WeaponDurability.java
โ
โโโ ability/
โ โโโ WeaponAbility.java
โ โโโ TempestBlitzAbility.java
โ โโโ VolcanicFractureAbility.java
โ โโโ OceanicVortexAbility.java
โ โโโ LeviathanWrathAbility.java
โ โโโ SingularityShotAbility.java
โ
โโโ combat/
โ โโโ DamageManager.java
โ โโโ CooldownManager.java
โ โโโ ReachManager.java
โ
โโโ recipe/
โ โโโ RecipeManager.java
โ โโโ RecipeEditor.java
โ โโโ RecipeData.java
โ
โโโ command/
โ โโโ WeaponsCommand.java
โ โโโ WeaponsTabCompleter.java
โ
โโโ listener/
โ โโโ WeaponDamageListener.java
โ โโโ WeaponInteractListener.java
โ โโโ ProjectileListener.java
โ โโโ InventoryListener.java
โ โโโ PlayerJoinListener.java
โ
โโโ compatibility/
โ โโโ ViaVersionHook.java
โ โโโ GeyserHook.java
โ โโโ FloodgateHook.java
โ โโโ WorldGuardHook.java
โ
โโโ util/
โโโ LocationUtil.java
โโโ ParticleUtil.java
โโโ SoundUtil.java
You may improve this architecture if necessary, but keep the code modular and maintainable.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
5 CUSTOM WEAPONS
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Create EXACTLY these five weapons.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
1. ZEPHYR'S EDGE
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Weapon ID:
zephyrs_edge
Display name:
Zephyr's Edge
Attack Damage:
24
Normal attack cooldown:
2.0 seconds
Reach bonus:
1.5 blocks
Durability:
6000
Future resource-pack model ID:
zephyrs_edge
Also create a clearly documented internal model identifier:
lagbrosweapons:zephyrs_edge
ABILITY:
TEMPEST BLITZ
Activation:
Right-click
Behavior:
- Dash forward up to 10 blocks.
- Damage enemies encountered along the path.
- Deal 20 true damage.
- Grant Speed IV for 5 seconds.
- Ability cooldown: 4 seconds.
- Add wind particles.
- Add appropriate sound effects.
Safety:
- Never teleport into solid blocks.
- Never teleport into the void.
- Never teleport outside world border.
- Find a safe destination.
- Respect WorldGuard protection if installed.
- Do not allow the ability to bypass protected regions.
- Prevent spam.
- Prevent repeated teleport abuse.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
2. CINDERSTRIKE
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Weapon ID:
cinderstrike
Display name:
Cinderstrike
Attack Damage:
34
Normal attack cooldown:
1.1 seconds
Reach bonus:
1.0 block
Durability:
7500
Future resource-pack model ID:
cinderstrike
Internal model identifier:
lagbrosweapons:cinderstrike
ABILITY:
VOLCANIC FRACTURE
Critical hit:
- Disable enemy shields for 10 seconds.
Special activation:
- Sneak + left-click.
Behavior:
- Create a 7x7 zone.
- Launch magma spikes from the ground.
- Each successful hit deals 18 blast damage.
- Apply burning/fire effect.
- Ability cooldown: 5 seconds.
- Create volcanic particles and sounds.
IMPORTANT:
- Do NOT permanently destroy blocks.
- Do NOT grief terrain.
- Respect WorldGuard.
- Limit entities and particles for performance.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
3. TIDECALLER'S HARPOON
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Weapon ID:
tidecallers_harpoon
Display name:
Tidecaller's Harpoon
Melee Damage:
26
Ranged Damage:
32
Normal attack cooldown:
1.4 seconds
Reach bonus:
3.0 blocks
Durability:
6500
Future resource-pack model ID:
tidecallers_harpoon
Internal model identifier:
lagbrosweapons:tidecallers_harpoon
ABILITY:
OCEANIC VORTEX
Behavior:
- Throw a harpoon projectile.
- Projectile travels forward.
- It can hit multiple entities in a line.
- Pull affected entities toward the player.
- Apply Slowness VI for 4 seconds.
- Successful activation resets the normal attack cooldown.
- Ability cooldown: 3 seconds.
Safety:
- Prevent projectile abuse.
- Prevent hitting through protected regions.
- Limit maximum affected entities.
- Clean up projectile data.
- Do not create excessive entities.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
4. ABYSSAL IMPALER
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Weapon ID:
abyssal_impaler
Display name:
Abyssal Impaler
Melee Damage:
28
Ranged Damage:
36
Normal attack cooldown:
1.2 seconds
Reach bonus:
3.5 blocks
Durability:
8000
Future resource-pack model ID:
abyssal_impaler
Internal model identifier:
lagbrosweapons:abyssal_impaler
ABILITY:
LEVIATHAN WRATH
Behavior:
- Create a geyser at impact.
- Knock affected enemies up to 12 blocks into the air.
- Remove active positive potion effects.
- Deal 15 magic damage.
- Ability cooldown: 4 seconds.
Safety:
- Safe knockback.
- Respect world border.
- Do not launch players into invalid locations.
- Respect WorldGuard.
- Limit affected entities.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
5. ECLIPSE LONGBOW
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Weapon ID:
eclipse_longbow
Display name:
Eclipse Longbow
Full-draw damage:
40
Charge time:
0.5 seconds
Reach:
Infinite
Durability:
5000
Future resource-pack model ID:
eclipse_longbow
Internal model identifier:
lagbrosweapons:eclipse_longbow
ABILITY:
SINGULARITY SHOT
Behavior:
- Fire a special arrow.
- The arrow can penetrate up to 5 blocks of solid terrain.
- Detonate at impact.
- Create a black-hole/singularity visual effect.
- Pull nearby targets toward the impact.
- Apply Wither III for 6 seconds.
- Ability cooldown must be configurable.
Safety:
- Do not permanently destroy terrain.
- Respect WorldGuard.
- Respect world border.
- Limit affected entities.
- Limit particles.
- Prevent lag.
- Prevent projectile duplication.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
CUSTOM ITEM IDENTIFICATION
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
This is extremely important.
Do NOT identify weapons using:
- display name
- lore
- vanilla material
- CustomModelData alone
Use PersistentDataContainer.
Every weapon must contain:
lagbrosweapons:weapon_id
Example:
lagbrosweapons:weapon_id = zephyrs_edge
Also store:
lagbrosweapons:weapon_version
and:
lagbrosweapons:durability
The weapon must remain identifiable after:
- renaming
- moving inventory
- dropping
- picking up
- putting into chests
- restarting the server
Do not break normal Minecraft items.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
FUTURE RESOURCE PACK COMPATIBILITY
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Do NOT generate a resource pack now.
However, prepare the plugin so I can create one later.
Every weapon must have a configurable model identifier:
weapon-model: "lagbrosweapons:zephyrs_edge"
etc.
The plugin should use the correct modern Minecraft 1.21.11 item-model API/data where appropriate.
Keep model assignment separate from gameplay identification.
Gameplay identity:
PDC weapon_id
Visual identity:
item model identifier
This separation is REQUIRED.
Create documentation explaining exactly how the future resource pack should map:
lagbrosweapons:zephyrs_edge
lagbrosweapons:cinderstrike
lagbrosweapons:tidecallers_harpoon
lagbrosweapons:abyssal_impaler
lagbrosweapons:eclipse_longbow
to their respective models.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
CUSTOM DURABILITY
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Do NOT rely only on vanilla durability.
Track custom durability using PDC.
Values:
Zephyr's Edge = 6000
Cinderstrike = 7500
Tidecaller's Harpoon = 6500
Abyssal Impaler = 8000
Eclipse Longbow = 5000
Display durability in lore:
Durability: 6000/6000
Update the lore when durability changes.
Prevent:
- negative durability
- durability overflow
- ability usage at zero durability
Make durability loss configurable.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
COMBAT
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Implement custom attack damage carefully.
Prevent:
- double damage
- duplicate projectile damage
- event recursion
- ability damage being triggered twice
Support:
- melee
- ranged
- true damage
- magic damage
- knockback
- potion effects
Make damage values configurable.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
ATTACK SPEED / COOLDOWNS
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Do NOT confuse attack speed with ability cooldown.
Keep these separate.
Example:
attack-cooldown: 2.0
ability-cooldown: 4.0
Use a proper timestamp-based cooldown manager.
Do NOT use Thread.sleep().
Do NOT block the server thread.
Optional cooldown display:
- Action bar
- Boss bar
Make configurable.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
REACH
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Implement configurable reach bonuses.
Values:
Zephyr's Edge = +1.5
Cinderstrike = +1.0
Tidecaller's Harpoon = +3.0
Abyssal Impaler = +3.5
Eclipse Longbow = infinite ranged reach
Do NOT create anti-cheat bypasses.
Do not use impossible client-side behavior.
Validate line of sight and target distance.
If a reach mechanic cannot be implemented safely using Paper API, explain the limitation and implement the safest server-side alternative.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
RECIPES
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Every weapon must have a crafting recipe.
Recipes must be stored separately:
plugins/LagBrosWeapons/recipes.yml
Create an OP-only recipe editor.
Command:
/weapons recipe set
Opening the command should open a 3x3 recipe editor GUI.
GUI:
3x3 crafting grid
Buttons:
SAVE
CANCEL
RESET
CLEAR
Admin places ingredients into the grid and clicks SAVE.
Save the recipe to recipes.yml.
Recipe changes must survive restart.
Commands:
/weapons recipe set
/weapons recipe view
/weapons recipe reset
/weapons recipe reload
Only OP or:
lagbrosweapons.recipe
can modify recipes.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
COMMANDS
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Main command:
/weapons
Implement:
/weapons give [amount]
/weapons list
/weapons info
/weapons reload
/weapons recipe set
/weapons recipe view
/weapons recipe reset
/weapons recipe reload
/weapons durability
/weapons debug
Permissions:
lagbrosweapons.admin
lagbrosweapons.give
lagbrosweapons.recipe
lagbrosweapons.reload
OP automatically has administrator access.
Implement tab completion.
Use Adventure API for messages.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
CONFIGURATION
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Create:
config.yml
weapons.yml
recipes.yml
messages.yml
Do not hard-code important values.
Example weapons.yml:
weapons:
zephyrs_edge:
display-name: "Zephyr's Edge"
material: DIAMOND_SWORD
attack-damage: 24.0
attack-cooldown: 2.0
reach: 1.5
durability: 6000
model: "lagbrosweapons:zephyrs_edge"
ability: "tempest_blitz"
etc.
Use appropriate Paper 1.21.11 material/API names.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
GEYSER / FLOODGATE
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Geyser and Floodgate are optional.
The plugin must still work without them.
Bedrock players must be able to use the weapons.
If Bedrock cannot display the future custom model:
- use a safe fallback appearance
- keep the weapon's name
- keep gameplay
- keep abilities
Do not require a Bedrock resource pack.
Do not use Java-client-only behavior for core gameplay.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
VIAVERSION / VIABACKWARDS
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
ViaVersion and ViaBackwards are optional.
Do not send unsupported packets.
Do not assume every player is on 1.21.11.
Gameplay should continue working on supported older clients where possible.
If a client cannot display the future custom model:
- fallback appearance
- preserve name/lore
- preserve gameplay
Do not kick players because of resource-pack/model incompatibility.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
GRIM ANTICHEAT
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
The plugin must be compatible with Grim Anticheat.
DO NOT attempt to bypass Grim.
Do NOT use:
- packet spoofing
- fake movement
- impossible velocity
- rotation exploits
- anti-cheat bypasses
All abilities must be legitimate server-side mechanics.
For movement abilities:
- validate destinations
- avoid repeated teleports
- check collision
- respect world border
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
WORLDGUARD
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
WorldGuard must be optional.
If installed:
- respect protected regions
- do not damage protected entities where prohibited
- do not modify protected blocks
- do not bypass region restrictions
If WorldGuard isn't installed, the plugin must still work.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
PERFORMANCE
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
The plugin must be suitable for multiplayer servers.
Avoid:
- huge area scans
- unnecessary repeating tasks
- thousands of particles
- thousands of entities
- memory leaks
- permanent Player object references
Limit:
- targets
- particles
- projectile lifetime
- ability area
Use efficient collections.
Clean cooldowns when players leave.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
FILES
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Create the complete project.
Expected:
LagBrosWeapons/
โโโ pom.xml
โโโ README.md
โโโ src/
โโโ main/
โโโ java/
โ โโโ com/lagbros/weapons/
โโโ resources/
โโโ plugin.yml
โโโ config.yml
โโโ weapons.yml
โโโ recipes.yml
โโโ messages.yml
Do NOT create resource-pack files yet.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
PLUGIN.YML
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Create a correct Paper plugin.yml for Minecraft 1.21.11.
Use the correct main class.
Define:
/weapons
permissions.
Use soft-depend/optional dependency handling for integrations where appropriate.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
README
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Create a detailed README explaining:
1. Requirements
2. Java version
3. Paper version
4. Installation
5. Commands
6. Permissions
7. Configuration
8. Weapon statistics
9. Ability mechanics
10. Recipe editor
11. PDC weapon identification
12. Future resource-pack integration
13. Model identifier system
14. ViaVersion compatibility
15. ViaBackwards compatibility
16. Geyser compatibility
17. Floodgate compatibility
18. Grim compatibility
19. WorldGuard compatibility
20. Troubleshooting
21. Testing
IMPORTANT:
Include a dedicated section:
"HOW TO CREATE THE RESOURCE PACK LATER"
Explain exactly which identifiers the resource pack must use.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
TESTING
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Before declaring the plugin complete, verify the code logically for:
[ ] Compiles with Maven
[ ] Paper 1.21.11 compatibility
[ ] Java 21
[ ] Plugin loads without errors
[ ] Exactly 5 weapons
[ ] Correct PDC IDs
[ ] Correct model identifiers
[ ] Correct damage
[ ] Correct cooldowns
[ ] Correct reach
[ ] Correct durability
[ ] All 5 abilities work
[ ] Recipes work
[ ] Recipe editor works
[ ] Recipe persistence works
[ ] OP restrictions work
[ ] Permissions work
[ ] Tab completion works
[ ] No item duplication
[ ] No cooldown bypass
[ ] No projectile duplication
[ ] No major performance issues
[ ] Geyser optional
[ ] Floodgate optional
[ ] ViaVersion optional
[ ] ViaBackwards optional
[ ] WorldGuard optional
[ ] Grim-compatible movement
[ ] No anti-cheat bypass techniques
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
CRITICAL OUTPUT RULE
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Generate the COMPLETE PLUGIN PROJECT.
Do NOT only explain how to make it.
Do NOT give pseudocode.
Do NOT leave TODOs.
Do NOT write placeholder methods such as:
// implement later
Actually implement every required system.
For every file, provide:
FILE: exact/path/to/file
followed by the COMPLETE contents.
The project must be internally consistent:
- class names match
- packages match
- imports match
- plugin.yml matches the main class
- commands match the command executor
- configuration paths match Java code
- weapon IDs match everywhere
- model identifiers match everywhere
Do NOT create the resource pack in this stage.
The resource pack will be created separately after the plugin is finished.
At the end, provide:
1. Build command
2. Output JAR location
3. Installation instructions
4. All commands
5. All permissions
6. Weapon IDs
7. Model identifiers
8. Exact information I need to use when creating the resource pack later
MOST IMPORTANT:
Build this specifically for Paper Minecraft 1.21.11, not an older Minecraft version. Verify every API you use against the 1.21.11 Paper API and avoid outdated 1.8/1.12/1.20 tutorials and APIs.
```
Create the Maven Paper 1.21.11 project and configuration files.
Add weapon identity, custom durability, item-model, cooldown, combat, and ability systems.
Add projectile handling, recipe persistence/editor GUI, commands, permissions, and optional WorldGuard checks.
Add documentation covering installation, commands, mechanics, compatibility, and future resource-pack mapping.
The core project is generated. Iโm tightening the combat path so ranged shots and reach validation use the same authoritative weapon data, while keeping the implementation server-side and bounded.1. Created a complete Maven Paper 1.21.11 / Java 21 project for LagBrosWeapons.
2. Added exactly five configurable weapons with PDC identity, custom durability, item-model identifiers, cooldowns, combat handling, and abilities.
3. Added bounded server-side ability mechanics, projectile cleanup, optional reflective WorldGuard protection checks, and optional-plugin-safe startup.
4. Added crafting recipes, persistent recipes.yml storage, recipe GUI controls, commands, permissions, and tab completion.
5. Added comprehensive README documentation, including future resource-pack model identifiers and compatibility notes.
Build:
mvn clean package
Output:
target/LagBrosWeapons.jar
Important implementation details:
Weapon identity uses:
lagbrosweapons:weapon_idlagbrosweapons:weapon_versionlagbrosweapons:durability
Resource-pack model identifiers:
lagbrosweapons:zephyrs_edgelagbrosweapons:cinderstrikelagbrosweapons:tidecallers_harpoonlagbrosweapons:abyssal_impalerlagbrosweapons:eclipse_longbow
Optional integrations do not prevent startup when absent.
No NMS, packet spoofing, exploit mechanics, or anti-cheat bypasses were used.
No resource-pack files were created.
package com.lagbros.weapons;
import com.lagbros.weapons.ability.AbilityManager;
import com.lagbros.weapons.command.WeaponsCommand;
import com.lagbros.weapons.command.WeaponsTabCompleter;
import com.lagbros.weapons.combat.CooldownManager;
import com.lagbros.weapons.combat.DamageManager;
import com.lagbros.weapons.compatibility.WorldGuardHook;
import com.lagbros.weapons.listener.PlayerJoinListener;
import com.lagbros.weapons.listener.ProjectileListener;
import com.lagbros.weapons.listener.WeaponDamageListener;
import com.lagbros.weapons.listener.WeaponInteractListener;
import com.lagbros.weapons.recipe.RecipeEditor;
import com.lagbros.weapons.recipe.RecipeManager;
import com.lagbros.weapons.weapon.WeaponManager;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.minimessage.MiniMessage;
import org.bukkit.Bukkit;
import org.bukkit.command.PluginCommand;
import org.bukkit.plugin.java.JavaPlugin;
public final class LagBrosWeapons extends JavaPlugin {
private WeaponManager weaponManager;
private CooldownManager cooldownManager;
private DamageManager damageManager;
private WorldGuardHook worldGuardHook;
private RecipeManager recipeManager;
private AbilityManager abilityManager;
@Override
public void onEnable() {
saveDefaultConfig();
saveResource("weapons.yml", false);
saveResource("recipes.yml", false);
saveResource("messages.yml", false);
cooldownManager = new CooldownManager();
worldGuardHook = new WorldGuardHook(this);
weaponManager = new WeaponManager(this);
weaponManager.reload();
damageManager = new DamageManager(this, cooldownManager);
abilityManager = new AbilityManager(this, cooldownManager, worldGuardHook);
recipeManager = new RecipeManager(this, weaponManager);
recipeManager.reload();
RecipeEditor recipeEditor = new RecipeEditor(this, recipeManager);
Bukkit.getPluginManager().registerEvents(new WeaponDamageListener(this), this);
Bukkit.getPluginManager().registerEvents(new WeaponInteractListener(this), this);
Bukkit.getPluginManager().registerEvents(new ProjectileListener(this), this);
Bukkit.getPluginManager().registerEvents(new PlayerJoinListener(this), this);
Bukkit.getPluginManager().registerEvents(recipeEditor, this);
PluginCommand command = getCommand("weapons");
if (command != null) {
command.setExecutor(new WeaponsCommand(this));
command.setTabCompleter(new WeaponsTabCompleter(this));
}
getLogger().info("Loaded " + weaponManager.getWeapons().size() + " weapons.");
getLogger().info("Optional integrations: WorldGuard=" + worldGuardHook.isAvailable()
+ ", ViaVersion=" + hasPlugin("ViaVersion") + ", Geyser=" + hasPlugin("Geyser-Spigot"));
}
public void reloadPlugin() {
reloadConfig();
weaponManager.reload();
recipeManager.reload();
}
public Component message(String path) {
String prefix = getConfig().getString("messages-prefix", "");
return MiniMessage.miniMessage().deserialize(prefix + path);
}
public Component text(String value) {
return MiniMessage.miniMessage().deserialize(value == null ? "" : value);
}
public boolean hasPlugin(String name) {
return Bukkit.getPluginManager().getPlugin(name) != null;
}
public WeaponManager getWeaponManager() { return weaponManager; }
public CooldownManager getCooldownManager() { return cooldownManager; }
public DamageManager getDamageManager() { return damageManager; }
public WorldGuardHook getWorldGuardHook() { return worldGuardHook; }
public RecipeManager getRecipeManager() { return recipeManager; }
public AbilityManager getAbilityManager() { return abilityManager; }
}