Files
src
build.gradle
settings.gradle
Code
40 2,285
src/main/java/de/pengusmp/PenguSMPPlugin.java
package de.pengusmp;
import org.bukkit.Bukkit;
import org.bukkit.command.PluginCommand;
import org.bukkit.plugin.java.JavaPlugin;
public class PenguSMPPlugin extends JavaPlugin {
private ConfigManager configManager;
private PlayerDataManager playerDataManager;
private EconomyService economyService;
private RankManager rankManager;
private CombatManager combatManager;
private ScoreboardService scoreboardService;
private RtpService rtpService;
private CrateManager crateManager;
private NpcManager npcManager;
private HomeService homeService;
private AuctionService auctionService;
private OrderService orderService;
private GuiManager guiManager;
private TeleportService teleportService;
private TpaService tpaService;
@Override
public void onEnable() {
saveDefaultConfig();
configManager = new ConfigManager(this);
playerDataManager = new PlayerDataManager(this);
economyService = new EconomyService(this);
rankManager = new RankManager(this);
combatManager = new CombatManager(this);
scoreboardService = new ScoreboardService(this);
rtpService = new RtpService(this);
crateManager = new CrateManager(this);
npcManager = new NpcManager(this);
homeService = new HomeService(this);
auctionService = new AuctionService(this);
orderService = new OrderService(this);
guiManager = new GuiManager(this);
teleportService = new TeleportService(this);
tpaService = new TpaService(this);
PenguCommand command = new PenguCommand(this);
String[] commands = {"balance", "pay", "setmoney", "addmoney", "removemoney", "sell", "shop", "ah", "order",
"sethome", "home", "homes", "delhome", "rtp", "spawn", "tpa", "tpahere", "tpaccept", "invsee", "ec", "ecsee", "craft", "leaderboard", "crate", "npc", "pengusmp"};
for (String name : commands) {
PluginCommand pluginCommand = getCommand(name);
if (pluginCommand != null) {
pluginCommand.setExecutor(command);
pluginCommand.setTabCompleter(command);
}
}
Bukkit.getPluginManager().registerEvents(new PenguListener(this), this);
scoreboardService.start();
getLogger().info("PenguSMP wurde aktiviert.");
}
@Override
public void onDisable() {
if (playerDataManager != null) {
playerDataManager.saveAll();
}
if (scoreboardService != null) {
scoreboardService.stop();
}
if (auctionService != null) auctionService.save();
if (orderService != null) orderService.save();
if (teleportService != null) teleportService.shutdown();
if (tpaService != null) tpaService.shutdown();
}
public ConfigManager getConfigManager() { return configManager; }
public PlayerDataManager getPlayerDataManager() { return playerDataManager; }
public EconomyService getEconomyService() { return economyService; }
public RankManager getRankManager() { return rankManager; }
public CombatManager getCombatManager() { return combatManager; }
public ScoreboardService getScoreboardService() { return scoreboardService; }
public RtpService getRtpService() { return rtpService; }
public CrateManager getCrateManager() { return crateManager; }
public NpcManager getNpcManager() { return npcManager; }
public HomeService getHomeService() { return homeService; }
public AuctionService getAuctionService() { return auctionService; }
public OrderService getOrderService() { return orderService; }
public GuiManager getGuiManager() { return guiManager; }
public TeleportService getTeleportService() { return teleportService; }
public TpaService getTpaService() { return tpaService; }
}