Files
src
pom.xml
README.md
Code
31 2,227
src/main/java/com/adminpanelz/AdminPanelZPlugin.java
package com.adminpanelz;
import com.adminpanelz.economy.EconomyService;
import com.adminpanelz.auction.AuctionCommand;
import com.adminpanelz.auction.AuctionListener;
import com.adminpanelz.auction.AuctionService;
import com.adminpanelz.shop.ShopCommand;
import com.adminpanelz.shop.ShopListener;
import com.adminpanelz.shop.ShopService;
import com.adminpanelz.bounty.BountyCommand;
import com.adminpanelz.bounty.BountyListener;
import com.adminpanelz.bounty.BountyService;
import com.adminpanelz.admin.AdminCommand;
import com.adminpanelz.admin.AdminPanelListener;
import com.adminpanelz.discord.DiscordCommand;
import com.adminpanelz.home.HomeListener;
import com.adminpanelz.home.HomesCommand;
import com.adminpanelz.home.HomesService;
import com.adminpanelz.spawn.SpawnCommand;
import com.adminpanelz.storage.StorageFiles;
import com.adminpanelz.util.MessageService;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;
public final class AdminPanelZPlugin extends JavaPlugin {
private EconomyService economyService;
private StorageFiles storageFiles;
private MessageService messageService;
private HomesService homesService;
private AuctionService auctionService;
private ShopService shopService;
private BountyService bountyService;
@Override
public void onEnable() {
saveDefaultConfig();
this.economyService = new EconomyService(this);
this.storageFiles = new StorageFiles(this);
this.messageService = new MessageService(this);
this.homesService = new HomesService(this);
this.auctionService = new AuctionService(this);
this.shopService = new ShopService(this);
this.bountyService = new BountyService(this);
HomesCommand homesCommand = new HomesCommand(this, homesService);
getCommand("sethome").setExecutor(homesCommand);
getCommand("home").setExecutor(homesCommand);
getCommand("spawn").setExecutor(new SpawnCommand(this));
getCommand("setspawn").setExecutor(new SpawnCommand(this));
getCommand("ah").setExecutor(new AuctionCommand(this));
getCommand("shop").setExecutor(new ShopCommand(this));
getCommand("bounty").setExecutor(new BountyCommand(this, bountyService));
getCommand("discord").setExecutor(new DiscordCommand(this));
getCommand("admin").setExecutor(new AdminCommand(this));
Bukkit.getPluginManager().registerEvents(new HomeListener(this, homesService), this);
Bukkit.getPluginManager().registerEvents(new AuctionListener(this, auctionService), this);
Bukkit.getPluginManager().registerEvents(new ShopListener(), this);
Bukkit.getPluginManager().registerEvents(new BountyListener(this, bountyService), this);
Bukkit.getPluginManager().registerEvents(new AdminPanelListener(this), this);
}
@Override
public void onDisable() {
if (storageFiles != null) {
storageFiles.saveAll();
}
}
public EconomyService economy() {
return economyService;
}
public StorageFiles storage() {
return storageFiles;
}
public MessageService messages() {
return messageService;
}
public HomesService homes() {
return homesService;
}
public AuctionService auctions() {
return auctionService;
}
public ShopService shop() {
return shopService;
}
public BountyService bounties() {
return bountyService;
}
}