96 lines
2.3 KiB
Java
96 lines
2.3 KiB
Java
package eu.univento.core.api.server;
|
|
|
|
import eu.univento.cloud.commons.server.ServerType;
|
|
import eu.univento.core.Core;
|
|
import eu.univento.core.commands.Build;
|
|
import eu.univento.core.listeners.Blocks;
|
|
import org.bukkit.Bukkit;
|
|
import org.bukkit.GameMode;
|
|
import org.bukkit.plugin.PluginManager;
|
|
|
|
/**
|
|
* @author joethei
|
|
* @version 0.1
|
|
*/
|
|
public class ServerSettings {
|
|
|
|
private static boolean build;
|
|
private static boolean lobby;
|
|
private static boolean debug;
|
|
private static boolean mute;
|
|
private static boolean game;
|
|
private static ServerType serverType;
|
|
private static GameMode gameMode;
|
|
private static String gameState;
|
|
|
|
public static ServerType getServerType() {
|
|
return serverType;
|
|
}
|
|
|
|
public static void setServerType(ServerType serverType) {
|
|
ServerSettings.serverType = serverType;
|
|
}
|
|
|
|
public static GameMode getGameMode() {
|
|
return gameMode;
|
|
}
|
|
|
|
public static void setGameMode(GameMode gameMode) {
|
|
ServerSettings.gameMode = gameMode;
|
|
}
|
|
|
|
public static boolean isGame() {
|
|
return game;
|
|
}
|
|
|
|
public static void setGame(boolean game) {
|
|
ServerSettings.game = game;
|
|
}
|
|
|
|
public static boolean isBuild() {
|
|
return build;
|
|
}
|
|
|
|
public static void setBuild(boolean build) {
|
|
ServerSettings.build = build;
|
|
Core.getCommons().getLoggingHandler().getCore().info("Build ist " + build);
|
|
if(build) {
|
|
PluginManager pm = Bukkit.getPluginManager();
|
|
new Build(Core.getInstance(), "build", "Bau Modus an/ausschalten", "b");
|
|
pm.registerEvents(new Blocks(), Core.getInstance());
|
|
Core.getCommons().getLoggingHandler().getCore().info("Build Modus aktiviert");
|
|
}
|
|
}
|
|
|
|
public static boolean isLobby() {
|
|
return lobby;
|
|
}
|
|
|
|
public static void setLobby() {
|
|
ServerSettings.lobby = true;
|
|
}
|
|
|
|
public static boolean isDebug() {
|
|
return debug;
|
|
}
|
|
|
|
public static void setDebug() {
|
|
ServerSettings.debug = true;
|
|
}
|
|
|
|
public static boolean isMute() {
|
|
return mute;
|
|
}
|
|
|
|
public static void setMute(boolean mute) {
|
|
ServerSettings.mute = mute;
|
|
}
|
|
|
|
public static String getGameState() {
|
|
return gameState;
|
|
}
|
|
|
|
public static void setGameState(String gameState) {
|
|
ServerSettings.gameState = gameState;
|
|
}
|
|
} |