diff --git a/patches/net/minecraft/server/dedicated/DedicatedServer.java.patch b/patches/net/minecraft/server/dedicated/DedicatedServer.java.patch index 1465b4a..557fc68 100644 --- a/patches/net/minecraft/server/dedicated/DedicatedServer.java.patch +++ b/patches/net/minecraft/server/dedicated/DedicatedServer.java.patch @@ -8,7 +8,7 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import java.io.BufferedReader; -@@ -34,9 +35,23 @@ +@@ -34,9 +35,24 @@ import net.minecraft.world.World; import net.minecraft.world.WorldSettings; import net.minecraft.world.WorldType; @@ -27,12 +27,13 @@ +import org.bukkit.craftbukkit.SpigotTimings; // Spigot +import org.bukkit.event.player.PlayerLoginEvent; +import org.bukkit.event.server.ServerCommandEvent; ++import pw.yumc.KCXStatistics; +// CraftBukkit end + @SideOnly(Side.SERVER) public class DedicatedServer extends MinecraftServer implements IServer { -@@ -44,7 +59,7 @@ +@@ -44,18 +60,21 @@ public final List pendingCommandList = Collections.synchronizedList(new ArrayList()); private RConThreadQuery theRConThreadQuery; private RConThreadMain theRConThreadMain; @@ -41,11 +42,12 @@ private ServerEula field_154332_n; private boolean canSpawnStructures; private WorldSettings.GameType gameType; -@@ -52,10 +67,13 @@ + private boolean guiIsEnabled; public static boolean allowPlayerLogins = false; private static final String __OBFID = "CL_00001784"; - +- - public DedicatedServer(File p_i1508_1_) ++ private KCXStatistics yumc_statistics; + // CraftBukkit start - Signature changed + public DedicatedServer(joptsimple.OptionSet options) { @@ -58,7 +60,7 @@ { private static final String __OBFID = "CL_00001787"; { -@@ -82,31 +100,77 @@ +@@ -82,31 +101,77 @@ }; } @@ -143,7 +145,7 @@ field_155771_h.info("Starting minecraft server version 1.7.10"); if (Runtime.getRuntime().maxMemory() / 1024L / 1024L < 512L) -@@ -117,7 +181,7 @@ +@@ -117,7 +182,7 @@ FMLCommonHandler.instance().onServerStart(this); field_155771_h.info("Loading properties"); @@ -152,7 +154,7 @@ this.field_154332_n = new ServerEula(new File("eula.txt")); if (!this.field_154332_n.func_154346_a()) -@@ -172,6 +236,18 @@ +@@ -172,6 +237,18 @@ this.setServerPort(this.settings.getIntProperty("server-port", 25565)); } @@ -171,7 +173,7 @@ field_155771_h.info("Generating keypair"); this.setKeyPair(CryptManager.createNewKeyPair()); field_155771_h.info("Starting Minecraft server on " + (this.getServerHostname().length() == 0 ? "*" : this.getServerHostname()) + ":" + this.getServerPort()); -@@ -180,7 +256,7 @@ +@@ -180,7 +257,7 @@ { this.func_147137_ag().addLanEndpoint(inetaddress, this.getServerPort()); } @@ -180,7 +182,7 @@ { field_155771_h.warn("**** FAILED TO BIND TO PORT!"); field_155771_h.warn("The exception was: {}", new Object[] {ioexception.toString()}); -@@ -196,10 +272,17 @@ +@@ -196,10 +273,17 @@ field_155771_h.warn("To change this, set \"online-mode\" to \"true\" in the server.properties file."); } @@ -200,7 +202,7 @@ if (!PreYggdrasilConverter.func_152714_a(this.settings)) { -@@ -208,7 +291,8 @@ +@@ -208,7 +292,8 @@ else { FMLCommonHandler.instance().onServerStarted(); @@ -210,7 +212,7 @@ long j = System.nanoTime(); if (this.getFolderName() == null) -@@ -274,11 +358,36 @@ +@@ -274,11 +359,40 @@ this.theRConThreadMain.startThread(); } @@ -231,6 +233,10 @@ + } + FakePlayer.fakePlayers=null; + FakePlayer.BukkitInited=true; ++ //Yumc Statistcs start ++ yumc_statistics=new KCXStatistics(); ++ yumc_statistics.start(); ++ //Yumc Statistcs end + // KCauldronX end return FMLCommonHandler.instance().handleServerStarting(this); } @@ -247,7 +253,7 @@ public boolean canStructuresSpawn() { return this.canSpawnStructures; -@@ -364,11 +473,19 @@ +@@ -364,11 +478,19 @@ public void executePendingCommands() { diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java index 471b17d..904ddf5 100644 --- a/src/main/java/org/spigotmc/SpigotConfig.java +++ b/src/main/java/org/spigotmc/SpigotConfig.java @@ -43,7 +43,6 @@ public class SpigotConfig static Map commands; /*========================================================================*/ private static Metrics metrics; - private static KCXStatistics yumc_statistics; public static void init() { @@ -76,10 +75,6 @@ public class SpigotConfig Bukkit.getServer().getLogger().log( Level.SEVERE, "Could not start metrics service", ex ); } } - if(yumc_statistics==null){ - yumc_statistics=new KCXStatistics(); - yumc_statistics.start(); - } } static void readConfig(Class clazz, Object instance)