Search in sources :

Example 6 with LanternWorldProperties

use of org.lanternpowered.server.world.LanternWorldProperties in project LanternServer by LanternPowered.

the class UserStore method deserialize.

@Override
public void deserialize(T player, DataView dataView) {
    super.deserialize(player, dataView);
    final int dimension = dataView.getInt(DIMENSION).orElse(0);
    Lantern.getWorldManager().getWorldProperties(dimension).ifPresent(worldProperties -> {
        final LanternWorldProperties worldProperties0 = (LanternWorldProperties) worldProperties;
        final Optional<LanternWorld> optWorld = worldProperties0.getWorld();
        if (optWorld.isPresent()) {
            player.setRawWorld(optWorld.get());
        } else {
            player.setUserWorld(worldProperties0);
        }
    });
}
Also used : LanternWorld(org.lanternpowered.server.world.LanternWorld) LanternWorldProperties(org.lanternpowered.server.world.LanternWorldProperties)

Aggregations

LanternWorldProperties (org.lanternpowered.server.world.LanternWorldProperties)6 ImmutableList (com.google.common.collect.ImmutableList)2 LanternWorld (org.lanternpowered.server.world.LanternWorld)2 LanternWeather (org.lanternpowered.server.world.weather.LanternWeather)2 CommandSource (org.spongepowered.api.command.CommandSource)2 WorldProperties (org.spongepowered.api.world.storage.WorldProperties)2 Vector3d (com.flowpowered.math.vector.Vector3d)1 InetSocketAddress (java.net.InetSocketAddress)1 SocketAddress (java.net.SocketAddress)1 Instant (java.time.Instant)1 DateTimeFormatter (java.time.format.DateTimeFormatter)1 List (java.util.List)1 WeatherUniverse (org.lanternpowered.api.world.weather.WeatherUniverse)1 WorldConfig (org.lanternpowered.server.config.world.WorldConfig)1 LanternPlayer (org.lanternpowered.server.entity.living.player.LanternPlayer)1 LanternGameProfile (org.lanternpowered.server.profile.LanternGameProfile)1 RuleType (org.lanternpowered.server.world.rules.RuleType)1 CommandArgs (org.spongepowered.api.command.args.CommandArgs)1 CommandContext (org.spongepowered.api.command.args.CommandContext)1 CommandElement (org.spongepowered.api.command.args.CommandElement)1