package eu.univento.trashgames; import eu.univento.commons.server.ServerType; import eu.univento.core.Core; import eu.univento.core.api.server.ServerSettings; import eu.univento.trashgames.commands.Setloc; import eu.univento.trashgames.game.GameState; import eu.univento.trashgames.listeners.JoinQuit; import eu.univento.trashgames.listeners.PlayerEvents; import eu.univento.trashgames.timers.LobbyCountdown; import org.bukkit.Bukkit; import org.bukkit.GameMode; import org.bukkit.plugin.PluginManager; import org.bukkit.plugin.java.JavaPlugin; /** * @author joethei * @version 0.1 */ public class TrashGames extends JavaPlugin { private static TrashGames instance; public static TrashGames getInstance() { return instance; } private static GameState state; public static GameState getState() { return state; } public static void setState(GameState state) { TrashGames.state = state; ServerSettings.setGameState(state.getName()); } @Override public void onEnable() { instance = this; Core.getInstance().registerPlugin(this); ServerSettings.setGame(true); ServerSettings.setServerType(ServerType.SECRET_GAME_TRASHGAMES); ServerSettings.setGameMode(GameMode.ADVENTURE); PluginManager pm = Bukkit.getPluginManager(); pm.registerEvents(new JoinQuit(), this); pm.registerEvents(new PlayerEvents(), this); new Setloc(this, "setloc", "sets locations"); setState(GameState.LOBBY); Bukkit.getScheduler().scheduleSyncDelayedTask(TrashGames.getInstance(), () -> Core.getCommons().getLoggingHandler().getTrashGames().info("\n" + "\n" + "_________ _______ _______ _______ _______ _______ _______ _______ _______ _______ _ _ _________ _ _______ \n" + "\\__ __/( ____ )( ___ )( ____ \\|\\ /|( ____ \\( ___ )( )( ____ \\( ____ \\ ( ___ )( ( /|( \\ \\__ __/( ( /|( ____ \\\n" + " ) ( | ( )|| ( ) || ( \\/| ) ( || ( \\/| ( ) || () () || ( \\/| ( \\/ | ( ) || \\ ( || ( ) ( | \\ ( || ( \\/\n" + " | | | (____)|| (___) || (_____ | (___) || | | (___) || || || || (__ | (_____ | | | || \\ | || | | | | \\ | || (__ \n" + " | | | __)| ___ |(_____ )| ___ || | ____ | ___ || |(_)| || __) (_____ ) | | | || (\\ \\) || | | | | (\\ \\) || __) \n" + " | | | (\\ ( | ( ) | ) || ( ) || | \\_ )| ( ) || | | || ( ) | | | | || | \\ || | | | | | \\ || ( \n" + " | | | ) \\ \\__| ) ( |/\\____) || ) ( || (___) || ) ( || ) ( || (____/\\/\\____) | | (___) || ) \\ || (____/\\___) (___| ) \\ || (____/\\\n" + " )_( |/ \\__/|/ \\|\\_______)|/ \\|(_______)|/ \\||/ \\|(_______/\\_______) (_______)|/ )_)(_______/\\_______/|/ )_)(_______/\n" + " \n" + "\n")); new LobbyCountdown(); } @Override public void onDisable() { Core.getInstance().unregisterPlugin(this); } }