use of net.minecraft.network.protocol.game.ClientboundRespawnPacket in project SpongeCommon by SpongePowered.
the class ServerPlayerMixin method impl$prepareForPortalTeleport.
@Override
protected final void impl$prepareForPortalTeleport(final ServerLevel currentWorld, final ServerLevel targetWorld) {
final LevelData levelData = targetWorld.getLevelData();
this.connection.send(new ClientboundRespawnPacket(targetWorld.dimensionType(), targetWorld.dimension(), BiomeManager.obfuscateSeed(targetWorld.getSeed()), this.gameMode.getGameModeForPlayer(), this.gameMode.getPreviousGameModeForPlayer(), targetWorld.isDebug(), targetWorld.isFlat(), true));
this.connection.send(new ClientboundChangeDifficultyPacket(levelData.getDifficulty(), levelData.isDifficultyLocked()));
final PlayerList playerlist = this.server.getPlayerList();
playerlist.sendPlayerPermissionLevel((net.minecraft.server.level.ServerPlayer) (Object) this);
currentWorld.removePlayerImmediately((net.minecraft.server.level.ServerPlayer) (Object) this);
this.removed = false;
}
Aggregations