Files
src
build.gradle
settings.gradle
Code
8 832
src/main/java/com/kodari/prismarineeconomy/PrismarineEconomyPlugin.java
package com.kodari.prismarineeconomy;
import net.milkbowl.vault.economy.Economy;
import org.bukkit.command.PluginCommand;
import org.bukkit.plugin.ServicePriority;
import org.bukkit.plugin.java.JavaPlugin;
public final class PrismarineEconomyPlugin extends JavaPlugin {
private EconomyService economyService;
private MarineEconomyProvider economyProvider;
@Override
public void onEnable() {
economyService = new EconomyService();
economyProvider = new MarineEconomyProvider(economyService);
getServer().getServicesManager().register(Economy.class, economyProvider, this, ServicePriority.Highest);
PluginCommand command = getCommand("marine");
if (command == null) {
throw new IllegalStateException("The marine command is missing from plugin.yml");
}
MarineCommand marineCommand = new MarineCommand(economyService);
command.setExecutor(marineCommand);
command.setTabCompleter(marineCommand);
}
@Override
public void onDisable() {
if (economyProvider != null) {
getServer().getServicesManager().unregister(economyProvider);
}
}
public EconomyService getEconomyService() {
return economyService;
}
public MarineEconomyProvider getEconomyProvider() {
return economyProvider;
}
}