Files
src
build.gradle
Code
13 1,683
src/main/java/com/customapples/CustomApplesPlugin.java
package com.customapples;
import com.customapples.apple.AppleType;
import com.customapples.command.GiveAppleCommand;
import com.customapples.listener.AppleCombatListener;
import com.customapples.listener.AppleConsumeListener;
import com.customapples.listener.PlayerJoinListener;
import com.customapples.manager.AppleManager;
import com.customapples.manager.CooldownManager;
import com.customapples.manager.JoinRewardManager;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;
/**
* Custom Golden Apples Plugin
*
* A comprehensive PvP plugin featuring 12 custom golden apples
* with unique abilities, particle effects, cooldowns, and a
* spectacular first-join reward system.
*
* @author YourName
* @version 1.0.0
*/
@Getter
public class CustomApplesPlugin extends JavaPlugin {
private AppleManager appleManager;
private CooldownManager cooldownManager;
private JoinRewardManager joinRewardManager;
@Override
public void onEnable() {
// Save default config
saveDefaultConfig();
// Initialize managers
this.appleManager = new AppleManager(this);
this.cooldownManager = new CooldownManager();
this.joinRewardManager = new JoinRewardManager(this);
// Register listeners
registerListeners();
// Register commands
registerCommands();
// Register crafting recipes
if (getConfig().getBoolean("crafting.enabled", true)) {
appleManager.registerRecipes();
}
getLogger().info("CustomGoldenApples has been enabled!");
getLogger().info("Loaded " + AppleType.values().length + " custom apples.");
}
@Override
public void onDisable() {
// Cancel all running tasks
Bukkit.getScheduler().cancelTasks(this);
getLogger().info("CustomGoldenApples has been disabled!");
}
/**
* Register all event listeners
*/
private void registerListeners() {
AppleConsumeListener consumeListener = new AppleConsumeListener(this);
Bukkit.getPluginManager().registerEvents(consumeListener, this);
Bukkit.getPluginManager().registerEvents(new AppleCombatListener(this, consumeListener), this);
Bukkit.getPluginManager().registerEvents(new PlayerJoinListener(this), this);
}
/**
* Register all commands
*/
private void registerCommands() {
getCommand("giveapple").setExecutor(new GiveAppleCommand(this));
}
}