Files
CatServer/patches/net/minecraft/server/integrated/IntegratedServer.java.patch

90 lines
4.0 KiB
Diff

--- ../src-base/minecraft/net/minecraft/server/integrated/IntegratedServer.java
+++ ../src-work/minecraft/net/minecraft/server/integrated/IntegratedServer.java
@@ -18,17 +18,12 @@
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.profiler.Snooper;
import net.minecraft.server.MinecraftServer;
+import net.minecraft.server.dedicated.PropertyManager;
import net.minecraft.server.management.PlayerProfileCache;
import net.minecraft.util.CryptManager;
import net.minecraft.util.HttpUtil;
import net.minecraft.util.Util;
-import net.minecraft.world.EnumDifficulty;
-import net.minecraft.world.GameType;
-import net.minecraft.world.ServerWorldEventHandler;
-import net.minecraft.world.WorldServer;
-import net.minecraft.world.WorldServerMulti;
-import net.minecraft.world.WorldSettings;
-import net.minecraft.world.WorldType;
+import net.minecraft.world.*;
import net.minecraft.world.demo.DemoWorldServer;
import net.minecraft.world.storage.ISaveHandler;
import net.minecraft.world.storage.WorldInfo;
@@ -49,7 +44,8 @@
public IntegratedServer(Minecraft clientIn, String folderNameIn, String worldNameIn, WorldSettings worldSettingsIn, YggdrasilAuthenticationService authServiceIn, MinecraftSessionService sessionServiceIn, GameProfileRepository profileRepoIn, PlayerProfileCache profileCacheIn)
{
- super(new File(clientIn.mcDataDir, "saves"), clientIn.getProxy(), clientIn.getDataFixer(), authServiceIn, sessionServiceIn, profileRepoIn, profileCacheIn);
+ //super(new File(clientIn.mcDataDir, "saves"), clientIn.getProxy(), clientIn.getDataFixer(), authServiceIn, sessionServiceIn, profileRepoIn, profileCacheIn);
+ super(null, clientIn.getProxy(), clientIn.getDataFixer(), authServiceIn, sessionServiceIn, profileRepoIn, profileCacheIn);
this.setServerOwner(clientIn.getSession().getUsername());
this.setFolderName(folderNameIn);
this.setWorldName(worldNameIn);
@@ -83,11 +79,11 @@
}
WorldServer overWorld = (isDemo() ? (WorldServer)(new DemoWorldServer(this, isavehandler, worldinfo, 0, this.theProfiler)).init() :
- (WorldServer)(new WorldServer(this, isavehandler, worldinfo, 0, this.theProfiler)).init());
+ (WorldServer)(new WorldServer(this, isavehandler, worldinfo, 0, this.theProfiler, null, null)).init());
overWorld.initialize(this.theWorldSettings);
for (int dim : net.minecraftforge.common.DimensionManager.getStaticDimensionIDs())
{
- WorldServer world = (dim == 0 ? overWorld : (WorldServer)(new WorldServerMulti(this, isavehandler, dim, overWorld, this.theProfiler)).init());
+ WorldServer world = (dim == 0 ? overWorld : (WorldServer)(new WorldServerMulti(this, isavehandler, dim, overWorld, this.theProfiler, null, null, null)).init());
world.addEventListener(new ServerWorldEventHandler(this, world));
if (!this.isSinglePlayer())
{
@@ -122,8 +118,7 @@
return net.minecraftforge.fml.common.FMLCommonHandler.instance().handleServerStarting(this);
}
- public void tick()
- {
+ public void tick() throws MinecraftException {
boolean flag = this.isGamePaused;
this.isGamePaused = Minecraft.getMinecraft().getConnection() != null && Minecraft.getMinecraft().isGamePaused();
@@ -213,7 +208,11 @@
public void saveAllWorlds(boolean isSilent)
{
- super.saveAllWorlds(isSilent);
+ try {
+ super.saveAllWorlds(isSilent);
+ } catch (MinecraftException e) {
+ e.printStackTrace();
+ }
}
public File getDataDirectory()
@@ -323,8 +322,7 @@
}
}
- public void stopServer()
- {
+ public void stopServer() throws MinecraftException {
super.stopServer();
if (this.lanServerPing != null)
@@ -394,4 +392,9 @@
});
}
}
+
+ @Override
+ public PropertyManager getPropertyManager() {
+ return null;
+ }
}