diff --git a/src/main/java/net/minecraft/world/World.java b/src/main/java/net/minecraft/world/World.java index 7395ebf..8875158 100644 --- a/src/main/java/net/minecraft/world/World.java +++ b/src/main/java/net/minecraft/world/World.java @@ -230,7 +230,7 @@ this.lightUpdateBlockList = new int[32768]; this.saveHandler = p_i45369_1_; this.theProfiler = p_i45369_5_; - this.mapStorage = getMapStorage(p_i45369_1_); + this.mapStorage = getMapStorage(p_i45369_1_, p_i45369_4_ != null ? p_i45369_4_.dimensionId : 0); this.worldInfo = p_i45369_1_.loadWorldInfo(); if (p_i45369_4_ != null) @@ -315,9 +315,9 @@ private static ISaveHandler s_savehandler; //Provides a solution for different worlds getting different copies of the same data, potentially rewriting the data or causing race conditions/stale data //Buildcraft has suffered from the issue this fixes. If you load the same data from two different worlds they can get two different copies of the same object, thus the last saved gets final say. - private MapStorage getMapStorage(ISaveHandler savehandler) + private MapStorage getMapStorage(ISaveHandler savehandler, int dim) { - if (s_savehandler != savehandler || s_mapStorage == null) + if (dim == 0 && s_savehandler != savehandler || s_mapStorage == null) { s_mapStorage = new MapStorage(savehandler); s_savehandler = savehandler; diff --git a/src/main/java/net/minecraft/world/WorldServer.java b/src/main/java/net/minecraft/world/WorldServer.java index 689a3e5..4fcde66 100644 --- a/src/main/java/net/minecraft/world/WorldServer.java +++ b/src/main/java/net/minecraft/world/WorldServer.java @@ -135,7 +135,7 @@ this.mapStorage.setData("scoreboard", scoreboardsavedata); } - if (!(this instanceof WorldServerMulti)) //Forge: We fix the global mapStorage, which causes us to share scoreboards early. So don't associate the save data with the temporary scoreboard + if (provider.dimensionId == 0) //Forge: We fix the global mapStorage, which causes us to share scoreboards early. So don't associate the save data with the temporary scoreboard { scoreboardsavedata.func_96499_a(this.worldScoreboard); } diff --git a/src/main/java/org/ultramine/server/BackupManager.java b/src/main/java/org/ultramine/server/BackupManager.java index c0c5515..c76d156 100644 --- a/src/main/java/org/ultramine/server/BackupManager.java +++ b/src/main/java/org/ultramine/server/BackupManager.java @@ -272,9 +272,17 @@ @Override public String apply(String name) { + boolean contains = false; for(String s : moveOnly) - if(!name.startsWith(s)) - return null; + { + if(name.startsWith(s)) + { + contains = true; + break; + } + } + if(!contains) + return null; if(name.endsWith("/session.lock")) return null; if(!movePlayers && name.contains("/playerdata/")) @@ -341,7 +349,8 @@ WorldServer world = server.getMultiWorld().getWorldByID(dim); for(EntityPlayerMP player : it.value()) { - player.setWorld(world); + if(player.worldObj == null) + player.setWorld(world); if(movePlayers) { if(server.getMultiWorld().getIsolatedDataDims().contains(dim)) diff --git a/src/main/java/org/ultramine/server/MultiWorld.java b/src/main/java/org/ultramine/server/MultiWorld.java index fb0f14d..0dc2ea1 100644 --- a/src/main/java/org/ultramine/server/MultiWorld.java +++ b/src/main/java/org/ultramine/server/MultiWorld.java @@ -31,6 +31,7 @@ import gnu.trove.set.TIntSet; import gnu.trove.set.hash.TIntHashSet; import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.scoreboard.ScorePlayerTeam; import net.minecraft.server.MinecraftServer; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.WorldManager; @@ -353,9 +354,13 @@ } @SideOnly(Side.SERVER) + @SuppressWarnings("unchecked") public List destroyWorld(WorldServer world) { - @SuppressWarnings("unchecked") + if(world.provider.dimensionId == 0) + for(ScorePlayerTeam team : new ArrayList(world.getScoreboard().getTeams())) + world.getScoreboard().removeTeam(team); + List players = new ArrayList(world.playerEntities); for(EntityPlayerMP player : players) {