mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-10 10:17:38 +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
@ -287,7 +287,7 @@ public final class CraftServer implements Server {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// See if the server can process this command
|
// 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() {
|
public void reload() {
|
||||||
@ -366,10 +366,11 @@ public final class CraftServer implements Server {
|
|||||||
converter.convert(name, new ConvertProgressUpdater(console));
|
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.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.addIWorldAccess((IWorldAccess)new WorldManager(console, internal));
|
||||||
internal.spawnMonsters = 1;
|
internal.spawnMonsters = 1;
|
||||||
internal.setSpawnFlags(true, true);
|
internal.setSpawnFlags(true, true);
|
||||||
|
@ -173,11 +173,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|||||||
|
|
||||||
if (oldWorld != newWorld) {
|
if (oldWorld != newWorld) {
|
||||||
entity.dimension = newWorld.dimension;
|
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);
|
oldWorld.removeEntity(entity);
|
||||||
entity.dead = false;
|
entity.dead = false;
|
||||||
|
|
||||||
|
entity.setPositionRotation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch());
|
||||||
if (entity.Q()) {
|
if (entity.Q()) {
|
||||||
|
oldWorld.entityJoinedWorld(entity, false);
|
||||||
newWorld.addEntity(entity);
|
newWorld.addEntity(entity);
|
||||||
entity.setPositionRotation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch());
|
entity.setPositionRotation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch());
|
||||||
newWorld.entityJoinedWorld(entity, false);
|
newWorld.entityJoinedWorld(entity, false);
|
||||||
|
Loading…
Reference in New Issue
Block a user