diff --git a/build.gradle b/build.gradle index e018ef9..a1a3468 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ -apply plugin: 'java' +apply plugin: 'java' apply plugin: 'eclipse' sourceCompatibility = '1.6' @@ -6,53 +6,54 @@ repositories { - maven - { - name 'forge' - url 'http://files.minecraftforge.net/maven' - } - mavenCentral() - maven - { - name 'sonatypeSnapshot' - url 'https://oss.sonatype.org/content/repositories/snapshots/' - } - maven - { - name 'minecraft' - url 'https://libraries.minecraft.net/' - } + maven + { + name 'forge' + url 'http://files.minecraftforge.net/maven' + } + mavenCentral() + maven + { + name 'sonatypeSnapshot' + url 'https://oss.sonatype.org/content/repositories/snapshots/' + } + maven + { + name 'minecraft' + url 'https://libraries.minecraft.net/' + } } dependencies { - compile 'net.minecraft:launchwrapper:1.9' - compile 'org.ow2.asm:asm-debug-all:4.1' - compile 'org.scala-lang:scala-library:2.10.2' - compile 'org.scala-lang:scala-compiler:2.10.2' - compile 'net.sf.jopt-simple:jopt-simple:4.5' - compile 'java3d:vecmath:1.3.1' - compile 'net.sf.trove4j:trove4j:3.0.3' - compile 'com.ibm.icu:icu4j-core-mojang:51.2' - compile 'net.sf.jopt-simple:jopt-simple:4.5' - compile 'lzma:lzma:0.0.1' - compile 'com.paulscode:codecjorbis:20101023' - compile 'com.paulscode:codecwav:20101023' - compile 'com.paulscode:libraryjavasound:20101123' - compile 'com.paulscode:librarylwjglopenal:20100824' - compile 'com.paulscode:soundsystem:20120107' - compile 'io.netty:netty-all:4.0.10.Final' - compile 'com.google.guava:guava:15.0' - compile 'org.apache.commons:commons-lang3:3.1' - compile 'commons-io:commons-io:2.4' - compile 'net.java.jinput:jinput:2.0.5' - compile 'net.java.jutils:jutils:1.0.0' - compile 'com.google.code.gson:gson:2.2.4' - compile 'com.mojang:authlib:1.3' - compile 'org.apache.logging.log4j:log4j-api:2.0-beta9' - compile 'org.apache.logging.log4j:log4j-core:2.0-beta9' - compile 'org.lwjgl.lwjgl:lwjgl:2.9.0' - compile 'org.lwjgl.lwjgl:lwjgl_util:2.9.0' + compile 'net.minecraft:launchwrapper:1.9' + compile 'org.ow2.asm:asm-debug-all:4.1' + compile 'org.scala-lang:scala-library:2.10.2' + compile 'org.scala-lang:scala-compiler:2.10.2' + compile 'net.sf.jopt-simple:jopt-simple:4.5' + compile 'java3d:vecmath:1.3.1' + compile 'net.sf.trove4j:trove4j:3.0.3' + compile 'com.ibm.icu:icu4j-core-mojang:51.2' + compile 'net.sf.jopt-simple:jopt-simple:4.5' + compile 'lzma:lzma:0.0.1' + compile 'com.paulscode:codecjorbis:20101023' + compile 'com.paulscode:codecwav:20101023' + compile 'com.paulscode:libraryjavasound:20101123' + compile 'com.paulscode:librarylwjglopenal:20100824' + compile 'com.paulscode:soundsystem:20120107' + compile 'io.netty:netty-all:4.0.10.Final' + compile 'com.google.guava:guava:15.0' + compile 'org.apache.commons:commons-lang3:3.1' + compile 'commons-io:commons-io:2.4' + compile 'net.java.jinput:jinput:2.0.5' + compile 'net.java.jutils:jutils:1.0.0' + compile 'com.google.code.gson:gson:2.2.4' + compile 'com.mojang:authlib:1.3' + compile 'org.apache.logging.log4j:log4j-api:2.0-beta9' + compile 'org.apache.logging.log4j:log4j-core:2.0-beta9' + compile 'org.lwjgl.lwjgl:lwjgl:2.9.0' + compile 'org.lwjgl.lwjgl:lwjgl_util:2.9.0' + compile 'org.yaml:snakeyaml:1.13' - testCompile 'junit:junit:4.5' + testCompile 'junit:junit:4.5' } diff --git a/src/main/java/net/minecraft/network/rcon/RConThreadClient.java b/src/main/java/net/minecraft/network/rcon/RConThreadClient.java index 74cc342..13de3fe 100644 --- a/src/main/java/net/minecraft/network/rcon/RConThreadClient.java +++ b/src/main/java/net/minecraft/network/rcon/RConThreadClient.java @@ -2,14 +2,17 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; + import java.io.BufferedInputStream; import java.io.ByteArrayOutputStream; import java.io.DataOutputStream; import java.io.IOException; import java.net.Socket; import java.net.SocketTimeoutException; + import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import org.ultramine.server.ConfigurationHandler; @SideOnly(Side.SERVER) public class RConThreadClient extends RConThreadBase @@ -35,7 +38,7 @@ this.running = false; } - this.rconPassword = par1IServer.getStringProperty("rcon.password", ""); + this.rconPassword = ConfigurationHandler.getServerConfig().vanilla.rconPassword; this.logInfo("Rcon connection from: " + par2Socket.getInetAddress()); } diff --git a/src/main/java/net/minecraft/network/rcon/RConThreadMain.java b/src/main/java/net/minecraft/network/rcon/RConThreadMain.java index da9827b..46c011a 100644 --- a/src/main/java/net/minecraft/network/rcon/RConThreadMain.java +++ b/src/main/java/net/minecraft/network/rcon/RConThreadMain.java @@ -2,6 +2,7 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; + import java.io.IOException; import java.net.InetAddress; import java.net.ServerSocket; @@ -12,6 +13,8 @@ import java.util.Map; import java.util.Map.Entry; +import org.ultramine.server.ConfigurationHandler; + @SideOnly(Side.SERVER) public class RConThreadMain extends RConThreadBase { @@ -26,8 +29,8 @@ public RConThreadMain(IServer par1IServer) { super(par1IServer, "RCON Listener"); - this.rconPort = par1IServer.getIntProperty("rcon.port", 0); - this.rconPassword = par1IServer.getStringProperty("rcon.password", ""); + this.rconPort = ConfigurationHandler.getServerConfig().vanilla.rconPort; + this.rconPassword = ConfigurationHandler.getServerConfig().vanilla.rconPassword; this.hostname = par1IServer.getHostname(); this.serverPort = par1IServer.getPort(); @@ -35,14 +38,7 @@ { this.rconPort = this.serverPort + 10; this.logInfo("Setting default rcon port to " + this.rconPort); - par1IServer.setProperty("rcon.port", Integer.valueOf(this.rconPort)); - - if (0 == this.rconPassword.length()) - { - par1IServer.setProperty("rcon.password", ""); - } - - par1IServer.saveProperties(); + ConfigurationHandler.getServerConfig().vanilla.rconPort = rconPort; } if (0 == this.hostname.length()) diff --git a/src/main/java/net/minecraft/network/rcon/RConThreadQuery.java b/src/main/java/net/minecraft/network/rcon/RConThreadQuery.java index 6491ad3..c1d37e9 100644 --- a/src/main/java/net/minecraft/network/rcon/RConThreadQuery.java +++ b/src/main/java/net/minecraft/network/rcon/RConThreadQuery.java @@ -2,6 +2,7 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; + import java.io.IOException; import java.net.DatagramPacket; import java.net.DatagramSocket; @@ -17,6 +18,9 @@ import java.util.Map; import java.util.Random; import java.util.Map.Entry; + +import org.ultramine.server.ConfigurationHandler; + import net.minecraft.server.MinecraftServer; @SideOnly(Side.SERVER) @@ -43,7 +47,7 @@ public RConThreadQuery(IServer par1IServer) { super(par1IServer, "Query Listener"); - this.queryPort = par1IServer.getIntProperty("query.port", 0); + this.queryPort = ConfigurationHandler.getServerConfig().vanilla.queryPort; this.serverHostname = par1IServer.getHostname(); this.serverPort = par1IServer.getPort(); this.serverMotd = par1IServer.getMotd(); @@ -75,9 +79,7 @@ { this.queryPort = this.serverPort; this.logInfo("Setting default query port to " + this.queryPort); - par1IServer.setProperty("query.port", Integer.valueOf(this.queryPort)); - par1IServer.setProperty("debug", Boolean.valueOf(false)); - par1IServer.saveProperties(); + ConfigurationHandler.getServerConfig().vanilla.queryPort = queryPort; } this.field_72644_p = new HashMap(); diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedPlayerList.java b/src/main/java/net/minecraft/server/dedicated/DedicatedPlayerList.java index 9511f5a..ad681ec 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedPlayerList.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedPlayerList.java @@ -2,16 +2,20 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; + import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.FileWriter; import java.io.PrintWriter; import java.util.Iterator; + import net.minecraft.server.MinecraftServer; import net.minecraft.server.management.ServerConfigurationManager; + import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import org.ultramine.server.ConfigurationHandler; @SideOnly(Side.SERVER) public class DedicatedPlayerList extends ServerConfigurationManager @@ -26,9 +30,9 @@ super(par1DedicatedServer); this.opsList = par1DedicatedServer.getFile("ops.txt"); this.whiteList = par1DedicatedServer.getFile("white-list.txt"); - this.viewDistance = par1DedicatedServer.getIntProperty("view-distance", 10); - this.maxPlayers = par1DedicatedServer.getIntProperty("max-players", 20); - this.setWhiteListEnabled(par1DedicatedServer.getBooleanProperty("white-list", false)); + this.viewDistance = ConfigurationHandler.getServerConfig().vanilla.viewDistance; + this.maxPlayers = ConfigurationHandler.getServerConfig().vanilla.maxPlayers; + this.setWhiteListEnabled(ConfigurationHandler.getServerConfig().vanilla.whiteList); if (!par1DedicatedServer.isSinglePlayer()) { @@ -53,8 +57,7 @@ public void setWhiteListEnabled(boolean par1) { super.setWhiteListEnabled(par1); - this.getServerInstance().setProperty("white-list", Boolean.valueOf(par1)); - this.getServerInstance().saveProperties(); + ConfigurationHandler.getServerConfig().vanilla.whiteList = par1; } public void addOp(String par1Str) diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java index 83a2805..c304bc6 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java @@ -38,6 +38,7 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.ultramine.server.ConfigurationHandler; +import org.ultramine.server.UltramineServerConfig.VanillaConfig; @SideOnly(Side.SERVER) public class DedicatedServer extends MinecraftServer implements IServer @@ -118,7 +119,8 @@ FMLCommonHandler.instance().onServerStart(this); field_155771_h.info("Loading properties"); - this.settings = new PropertyManager(new File(ConfigurationHandler.getSettingDir(), "server.properties")); + //this.settings = new PropertyManager(new File(ConfigurationHandler.getSettingDir(), "server.properties")); + VanillaConfig vconfig = ConfigurationHandler.getServerConfig().vanilla; if (this.isSinglePlayer()) { @@ -126,30 +128,30 @@ } else { - this.setOnlineMode(this.settings.getBooleanProperty("online-mode", true)); - this.setHostname(this.settings.getStringProperty("server-ip", "")); + this.setOnlineMode(vconfig.onlineMode); + this.setHostname(vconfig.serverIp); } - this.setCanSpawnAnimals(this.settings.getBooleanProperty("spawn-animals", true)); - this.setCanSpawnNPCs(this.settings.getBooleanProperty("spawn-npcs", true)); - this.setAllowPvp(this.settings.getBooleanProperty("pvp", true)); - this.setAllowFlight(this.settings.getBooleanProperty("allow-flight", false)); - this.func_155759_m(this.settings.getStringProperty("resource-pack", "")); - this.setMOTD(this.settings.getStringProperty("motd", "A Minecraft Server")); - this.setForceGamemode(this.settings.getBooleanProperty("force-gamemode", false)); - this.func_143006_e(this.settings.getIntProperty("player-idle-timeout", 0)); + this.setCanSpawnAnimals(vconfig.spawnAnimals); + this.setCanSpawnNPCs(vconfig.spawnNPCs); + this.setAllowPvp(vconfig.pvp); + this.setAllowFlight(vconfig.allowFlight); + this.func_155759_m(vconfig.resourcePack); + this.setMOTD(vconfig.motd); + this.setForceGamemode(vconfig.forceGamemode); + this.func_143006_e(vconfig.playerIdleTimeout); - if (this.settings.getIntProperty("difficulty", 1) < 0) + if (vconfig.difficulty < 0) { - this.settings.setProperty("difficulty", Integer.valueOf(0)); + vconfig.difficulty = 0; } - else if (this.settings.getIntProperty("difficulty", 1) > 3) + else if (vconfig.difficulty > 3) { - this.settings.setProperty("difficulty", Integer.valueOf(3)); + vconfig.difficulty = 3; } - this.canSpawnStructures = this.settings.getBooleanProperty("generate-structures", true); - int i = this.settings.getIntProperty("gamemode", WorldSettings.GameType.SURVIVAL.getID()); + this.canSpawnStructures = vconfig.generateStructures; + int i = vconfig.gamemode; this.gameType = WorldSettings.getGameTypeById(i); field_155771_h.info("Default game type: " + this.gameType); InetAddress inetaddress = null; @@ -161,7 +163,7 @@ if (this.getServerPort() < 0) { - this.setServerPort(this.settings.getIntProperty("server-port", 25565)); + this.setServerPort(vconfig.serverPort); } field_155771_h.info("Generating keypair"); @@ -195,12 +197,12 @@ if (this.getFolderName() == null) { - this.setFolderName(this.settings.getStringProperty("level-name", "world")); + this.setFolderName(vconfig.levelName); } - String s = this.settings.getStringProperty("level-seed", ""); - String s1 = this.settings.getStringProperty("level-type", "DEFAULT"); - String s2 = this.settings.getStringProperty("generator-settings", ""); + String s = vconfig.levelSeed; + String s1 = vconfig.levelType; + String s2 = vconfig.generatorSettings; long k = (new Random()).nextLong(); if (s.length() > 0) @@ -231,10 +233,10 @@ this.isCommandBlockEnabled(); this.getOpPermissionLevel(); this.isSnooperEnabled(); - this.setBuildLimit(this.settings.getIntProperty("max-build-height", 256)); + this.setBuildLimit(vconfig.maxBuildHeight); this.setBuildLimit((this.getBuildLimit() + 8) / 16 * 16); this.setBuildLimit(MathHelper.clamp_int(this.getBuildLimit(), 64, 256)); - this.settings.setProperty("max-build-height", Integer.valueOf(this.getBuildLimit())); + vconfig.maxBuildHeight = this.getBuildLimit(); if (!FMLCommonHandler.instance().handleServerAboutToStart(this)) { return false; } field_155771_h.info("Preparing level \"" + this.getFolderName() + "\""); this.loadAllWorlds(this.getFolderName(), this.getFolderName(), k, worldtype, s2); @@ -242,14 +244,14 @@ String s3 = String.format("%.3fs", new Object[] {Double.valueOf((double)i1 / 1.0E9D)}); field_155771_h.info("Done (" + s3 + ")! For help, type \"help\" or \"?\""); - if (this.settings.getBooleanProperty("enable-query", false)) + if (vconfig.enableQuery) { field_155771_h.info("Starting GS4 status listener"); this.theRConThreadQuery = new RConThreadQuery(this); this.theRConThreadQuery.startThread(); } - if (this.settings.getBooleanProperty("enable-rcon", false)) + if (vconfig.enableRcon) { field_155771_h.info("Starting remote control listener"); this.theRConThreadMain = new RConThreadMain(this); @@ -272,12 +274,12 @@ public EnumDifficulty func_147135_j() { - return EnumDifficulty.getDifficultyEnum(this.settings.getIntProperty("difficulty", 1)); + return EnumDifficulty.getDifficultyEnum(ConfigurationHandler.getServerConfig().vanilla.difficulty); } public boolean isHardcore() { - return this.settings.getBooleanProperty("hardcore", false); + return ConfigurationHandler.getServerConfig().vanilla.hardcore; } protected void finalTick(CrashReport par1CrashReport) @@ -333,12 +335,12 @@ public boolean getAllowNether() { - return this.settings.getBooleanProperty("allow-nether", true); + return ConfigurationHandler.getServerConfig().vanilla.allowNether; } public boolean allowSpawnMonsters() { - return this.settings.getBooleanProperty("spawn-monsters", true); + return ConfigurationHandler.getServerConfig().vanilla.spawnMonsters; } public void addServerStatsToSnooper(PlayerUsageSnooper par1PlayerUsageSnooper) @@ -350,7 +352,7 @@ public boolean isSnooperEnabled() { - return this.settings.getBooleanProperty("snooper-enabled", true); + return ConfigurationHandler.getServerConfig().vanilla.snooperEnabled; } public void addPendingCommand(String par1Str, ICommandSender par2ICommandSender) @@ -399,13 +401,13 @@ public void saveProperties() { - this.settings.saveProperties(); + ConfigurationHandler.saveServerConfig(); + //this.settings.saveProperties(); } public String getSettingsFilename() { - File file1 = this.settings.getPropertiesFile(); - return file1 != null ? file1.getAbsolutePath() : "No settings file"; + return "server.yml"; } public void setGuiEnabled() @@ -426,12 +428,12 @@ public boolean isCommandBlockEnabled() { - return this.settings.getBooleanProperty("enable-command-block", false); + return ConfigurationHandler.getServerConfig().vanilla.enableCommandBlock; } public int getSpawnProtectionSize() { - return this.settings.getIntProperty("spawn-protection", super.getSpawnProtectionSize()); + return 0; } public boolean isBlockProtected(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer) @@ -464,18 +466,18 @@ public int getOpPermissionLevel() { - return this.settings.getIntProperty("op-permission-level", 4); + return 4; } public void func_143006_e(int par1) { + ConfigurationHandler.getServerConfig().vanilla.playerIdleTimeout = par1; super.func_143006_e(par1); - this.settings.setProperty("player-idle-timeout", Integer.valueOf(par1)); - this.saveProperties(); + //this.saveProperties(); } public boolean func_147136_ar() { - return this.settings.getBooleanProperty("announce-player-achievements", true); + return ConfigurationHandler.getServerConfig().vanilla.announcePlayerAchievements; } } \ No newline at end of file diff --git a/src/main/java/org/ultramine/server/ConfigurationHandler.java b/src/main/java/org/ultramine/server/ConfigurationHandler.java index e13facb..76d305e 100644 --- a/src/main/java/org/ultramine/server/ConfigurationHandler.java +++ b/src/main/java/org/ultramine/server/ConfigurationHandler.java @@ -1,13 +1,23 @@ package org.ultramine.server; import java.io.File; +import java.io.FileReader; +import java.io.FileWriter; +import java.io.IOException; + +import org.yaml.snakeyaml.Yaml; import cpw.mods.fml.relauncher.FMLLaunchHandler; public class ConfigurationHandler { + private static final Yaml YAML = new Yaml(); + private static File settingsDir = new File(FMLLaunchHandler.getMinecraftHome(), "settings"); private static File worldsDir = new File(FMLLaunchHandler.getMinecraftHome(), "worlds"); + private static File serverConfigFile = new File(getSettingDir(), "server.yml"); + + private static UltramineServerConfig serverConfig; static { @@ -15,6 +25,11 @@ if(!worldsDir.exists()) worldsDir.mkdir(); } + public static void load() + { + serverConfig = getOrCreateConfig(serverConfigFile, UltramineServerConfig.class); + } + public static File getSettingDir() { return settingsDir; @@ -24,4 +39,79 @@ { return worldsDir; } + + public static UltramineServerConfig getServerConfig() + { + return serverConfig; + } + + public static void saveServerConfig() + { + saveConfig(serverConfigFile, serverConfig); + } + + + + private static T getOrCreateConfig(File configFile, Class clazz) + { + T ret; + + if(!configFile.exists()) + { + try + { + ret = clazz.newInstance(); + } catch (Exception e) + { + throw new RuntimeException("impossible exception", e); + } + + saveConfig(configFile, ret); + } + else + { + FileReader reader = null; + try + { + reader = new FileReader(configFile); + ret = YAML.loadAs(reader, clazz); + } catch (IOException e) + { + throw new RuntimeException("Failed to read config: " + configFile.getPath(), e); + } + finally + { + try + { + reader.close(); + } catch (IOException ignored) {} + } + } + + return ret; + } + + private static void saveConfig(File configFile, Object o) + { + if(!configFile.exists()) + { + FileWriter writer = null; + try + { + configFile.createNewFile(); + writer = new FileWriter(configFile); + writer.write(YAML.dumpAsMap(0)); + } catch (IOException e) + { + throw new RuntimeException("Failed to save default config: " + configFile.getPath(), e); + } + finally + { + try + { + writer.close(); + } catch (IOException ignored) {} + } + } + } } diff --git a/src/main/java/org/ultramine/server/UltramineServerConfig.java b/src/main/java/org/ultramine/server/UltramineServerConfig.java new file mode 100644 index 0000000..b23626b --- /dev/null +++ b/src/main/java/org/ultramine/server/UltramineServerConfig.java @@ -0,0 +1,52 @@ +package org.ultramine.server; + +public class UltramineServerConfig +{ + public WatchdogThreadConfig watchdogThread = new WatchdogThreadConfig(); + public VanillaConfig vanilla = new VanillaConfig(); + + + public static class WatchdogThreadConfig + { + public int timeout = 120; + public boolean restart = true; + } + + public static class VanillaConfig + { + public String generatorSettings = ""; + public int opPermissionLevel = 4; + public boolean allowNether = true; + public String levelName = "world"; + public boolean enableQuery = false; + public int queryPort = 25565; + public boolean allowFlight = false; + public boolean announcePlayerAchievements = true; + public int serverPort = 25565; + public String levelType = "DEFAULT"; + public boolean enableRcon = false; + public int rconPort = 0; + public String rconPassword = ""; + public boolean forceGamemode = false; + public String levelSeed = ""; + public String serverIp = ""; + public int maxBuildHeight = 256; + public boolean spawnNPCs = true; + public boolean whiteList = false; + public boolean spawnAnimals = true; + public boolean snooperEnabled = true; + public boolean hardcore = false; + public boolean onlineMode = true; + public String resourcePack = ""; + public boolean pvp = true; + public int difficulty = 1; + public boolean enableCommandBlock = false; + public int playerIdleTimeout = 0; + public int gamemode = 0; + public int maxPlayers = 20; + public boolean spawnMonsters = true; + public int viewDistance = 10; + public boolean generateStructures = true; + public String motd = "A Minecraft Server"; + } +} diff --git a/src/main/java/org/ultramine/server/UltramineServerMod.java b/src/main/java/org/ultramine/server/UltramineServerMod.java new file mode 100644 index 0000000..55e6369 --- /dev/null +++ b/src/main/java/org/ultramine/server/UltramineServerMod.java @@ -0,0 +1,36 @@ +package org.ultramine.server; + +import java.util.Map; + +import cpw.mods.fml.common.Mod; +import cpw.mods.fml.common.event.FMLPostInitializationEvent; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import cpw.mods.fml.common.network.NetworkCheckHandler; +import cpw.mods.fml.relauncher.Side; + +@Mod +( + modid = "UltramineServer", + name = "Ultramine Server", + version = "1.0" +) +public class UltramineServerMod +{ + @Mod.EventHandler + public void preInit(FMLPreInitializationEvent e) + { + ConfigurationHandler.load(); + } + + @Mod.EventHandler + public void postInit(FMLPostInitializationEvent e) + { + ConfigurationHandler.saveServerConfig(); + } + + @NetworkCheckHandler + public boolean networkCheck(Map map, Side side) + { + return true; + } +}