Archiviert
13
0

Possible Player.dat fixes to address issues with switching between Vanilla and Bukkit or vice versa.

Dieser Commit ist enthalten in:
Rigby 2011-06-16 04:24:31 +01:00 committet von EvilSeph
Ursprung 7aadc3d666
Commit 0c56bfb62f
2 geänderte Dateien mit 18 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -980,7 +980,17 @@ public abstract class Entity {
// CraftBukkit end // CraftBukkit end
// CraftBukkit Start - reset world // CraftBukkit Start - reset world
org.bukkit.World world = Bukkit.getServer().getWorld(nbttagcompound.getString("World")); org.bukkit.World world = null;
if (this instanceof EntityPlayer) {
EntityPlayer entityPlayer = (EntityPlayer) this;
String worldName = nbttagcompound.getString("World");
if (worldName == "") {
world = (org.bukkit.World) ((CraftServer) Bukkit.getServer()).getServer().a(entityPlayer.dimension);
} else {
world = Bukkit.getServer().getWorld(worldName);
}
}
a(world == null ? null : ((CraftWorld) world).getHandle()); a(world == null ? null : ((CraftWorld) world).getHandle());
// CraftBukkit End // CraftBukkit End
} }

Datei anzeigen

@ -341,7 +341,13 @@ public abstract class EntityHuman extends EntityLiving {
this.a(true, true, false); this.a(true, true, false);
} }
this.spawnWorld = nbttagcompound.getString("SpawnWorld"); // CraftBukkit // CraftBukkit - Start
this.spawnWorld = nbttagcompound.getString("SpawnWorld");
if (this.spawnWorld == "") {
CraftServer server = ((WorldServer) world).getServer();
this.spawnWorld = server.getWorlds().get(0).getName();
}
// CraftBukkit - End
if (nbttagcompound.hasKey("SpawnX") && nbttagcompound.hasKey("SpawnY") && nbttagcompound.hasKey("SpawnZ")) { if (nbttagcompound.hasKey("SpawnX") && nbttagcompound.hasKey("SpawnY") && nbttagcompound.hasKey("SpawnZ")) {
this.b = new ChunkCoordinates(nbttagcompound.e("SpawnX"), nbttagcompound.e("SpawnY"), nbttagcompound.e("SpawnZ")); this.b = new ChunkCoordinates(nbttagcompound.e("SpawnX"), nbttagcompound.e("SpawnY"), nbttagcompound.e("SpawnZ"));