@Override public Builder from(RespawnLocation value) { checkNotNull(value, "RespawnLocation cannot be null!"); this.world = value.getWorldUniqueId(); this.position = value.getPosition(); this.forced = value.isForced(); return this; }
/** * Gets this spawn position as a {@link Location} object, if the world is * available. * * @return The position object, if available. */ public Optional<Location<World>> asLocation() { Optional<World> world = Sponge.getServer().getWorld(getWorldUniqueId()); if (!world.isPresent()) { return Optional.empty(); } return Optional.of(new Location<>(world.get(), getPosition())); }
@Override public DataContainer toContainer() { return DataContainer.createNew() .set(Queries.CONTENT_VERSION, getContentVersion()) .set(Queries.POSITION_X, getPosition().getX()) .set(Queries.POSITION_Y, getPosition().getY()) .set(Queries.POSITION_Z, getPosition().getZ()) .set(Queries.FORCED_SPAWN, isForced()) .set(Queries.WORLD_ID, getWorldUniqueId().toString()); }
@Override public Builder from(RespawnLocation value) { checkNotNull(value, "RespawnLocation cannot be null!"); this.world = value.getWorldUniqueId(); this.position = value.getPosition(); this.forced = value.isForced(); return this; }
/** * Gets this spawn position as a {@link Location} object, if the world is * available. * * @return The position object, if available. */ public Optional<Location<World>> asLocation() { Optional<World> world = Sponge.getServer().getWorld(getWorldUniqueId()); if (!world.isPresent()) { return Optional.empty(); } return Optional.of(new Location<>(world.get(), getPosition())); }
@Override public DataContainer toContainer() { return new MemoryDataContainer() .set(Queries.CONTENT_VERSION, getContentVersion()) .set(Queries.POSITION_X, getPosition().getX()) .set(Queries.POSITION_Y, getPosition().getY()) .set(Queries.POSITION_Z, getPosition().getZ()) .set(Queries.FORCED_SPAWN, isForced()) .set(Queries.WORLD_ID, getWorldUniqueId().toString()); }