mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-02 17:32:03 +01:00
Fixed a bunch of multiworld issues (entity tracking etc)
By: Dinnerbone <dinnerbone@dinnerbone.com>
This commit is contained in:
parent
7cf235f516
commit
95eebbac72
2 changed files with 7 additions and 4 deletions
|
@ -287,7 +287,7 @@ public final class CraftServer implements Server {
|
|||
}
|
||||
|
||||
// See if the server can process this command
|
||||
return console.consoleCommandHandler.handle(new ServerCommand(commandLine, new ServerCommandListener(sender)));
|
||||
return console.consoleCommandHandler.handle(new ServerCommand(commandLine, (ICommandListener)new ServerCommandListener(sender)));
|
||||
}
|
||||
|
||||
public void reload() {
|
||||
|
@ -366,10 +366,11 @@ public final class CraftServer implements Server {
|
|||
converter.convert(name, new ConvertProgressUpdater(console));
|
||||
}
|
||||
|
||||
WorldServer internal = new WorldServer(console, new ServerNBTManager(new File("."), name, true), name, environment.getId(), seed);
|
||||
int dimension = environment.getId() + 200 + console.worlds.size();
|
||||
WorldServer internal = new WorldServer(console, new ServerNBTManager(new File("."), name, true), name, dimension, seed);
|
||||
internal.z = console.worlds.get(0).z;
|
||||
|
||||
internal.tracker = new EntityTracker(console, environment.getId());
|
||||
internal.tracker = new EntityTracker(console, dimension);
|
||||
internal.addIWorldAccess((IWorldAccess)new WorldManager(console, internal));
|
||||
internal.spawnMonsters = 1;
|
||||
internal.setSpawnFlags(true, true);
|
||||
|
|
|
@ -173,11 +173,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|||
|
||||
if (oldWorld != newWorld) {
|
||||
entity.dimension = newWorld.dimension;
|
||||
entity.netServerHandler.sendPacket(new Packet9Respawn((byte) entity.dimension));
|
||||
entity.netServerHandler.sendPacket(new Packet9Respawn((byte) location.getWorld().getEnvironment().getId()));
|
||||
oldWorld.removeEntity(entity);
|
||||
entity.dead = false;
|
||||
|
||||
entity.setPositionRotation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch());
|
||||
if (entity.Q()) {
|
||||
oldWorld.entityJoinedWorld(entity, false);
|
||||
newWorld.addEntity(entity);
|
||||
entity.setPositionRotation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch());
|
||||
newWorld.entityJoinedWorld(entity, false);
|
||||
|
|
Loading…
Reference in a new issue