Files
src
build.gradle
settings.gradle
Code
8 282
src/main/java/com/bountyplugin/BountyPlugin.java
package com.bountyplugin;
import com.bountyplugin.command.BountyCommand;
import com.bountyplugin.listener.BountyListener;
import com.bountyplugin.manager.BountyManager;
import org.bukkit.plugin.java.JavaPlugin;
public class BountyPlugin extends JavaPlugin {
private BountyManager bountyManager;
@Override
public void onEnable() {
saveDefaultConfig();
this.bountyManager = new BountyManager(this);
bountyManager.loadBounties();
getServer().getPluginManager().registerEvents(new BountyListener(this), this);
BountyCommand command = new BountyCommand(this);
getCommand("bounty").setExecutor(command);
getCommand("bounty").setTabCompleter(command);
getLogger().info("BountyPlugin enabled.");
}
@Override
public void onDisable() {
if (bountyManager != null) {
bountyManager.saveBounties();
}
getLogger().info("BountyPlugin disabled.");
}
public BountyManager getBountyManager() {
return bountyManager;
}
}