Search in sources :

Example 1 with WorldTemplate

use of org.spongepowered.api.world.server.WorldTemplate in project SpongeCommon by SpongePowered.

the class SpongeWorldManager method saveProperties.

@Override
public CompletableFuture<Boolean> saveProperties(final ServerWorldProperties properties) {
    final net.minecraft.resources.ResourceKey<Level> registryKey = SpongeWorldManager.createRegistryKey(Objects.requireNonNull(properties, "properties").key());
    if (this.worlds.get(registryKey) != null) {
        return CompletableFuture.completedFuture(false);
    }
    final ResourceKey key = properties.key();
    final boolean isVanillaWorld = this.isVanillaWorld(key);
    final String directoryName = this.getDirectoryName(key);
    final LevelStorageSource.LevelStorageAccess storageSource;
    try {
        if (isVanillaWorld) {
            storageSource = LevelStorageSource.createDefault(this.defaultWorldDirectory).createAccess(directoryName);
        } else {
            storageSource = LevelStorageSource.createDefault(this.customWorldsDirectory).createAccess(key.namespace() + File.separator + key.value());
        }
    } catch (final IOException e) {
        return FutureUtil.completedWithException(e);
    }
    try {
        try {
            storageSource.saveDataTag(BootstrapProperties.registries, (WorldData) properties, null);
        } catch (final Exception ex) {
            return FutureUtil.completedWithException(ex);
        }
    } finally {
        try {
            storageSource.close();
        } catch (final IOException ex) {
            return FutureUtil.completedWithException(ex);
        }
    }
    // Properties doesn't have everything we need...namely the generator, load the template and set values we actually got
    return this.loadTemplate(key).thenCompose(r -> {
        final WorldTemplate template = r.orElse(null);
        if (template != null) {
            final LevelStem scratch = ((SpongeWorldTemplate) template).asDimension();
            ((LevelStemBridge) (Object) scratch).bridge$populateFromLevelData((PrimaryLevelData) properties);
            return this.saveTemplate(((LevelStemBridge) (Object) scratch).bridge$asTemplate());
        }
        return CompletableFuture.completedFuture(true);
    });
}
Also used : LevelStorageSource(net.minecraft.world.level.storage.LevelStorageSource) IOException(java.io.IOException) IOException(java.io.IOException) ExecutionException(java.util.concurrent.ExecutionException) ReportedException(net.minecraft.ReportedException) ResourceKey(org.spongepowered.api.ResourceKey) LevelStem(net.minecraft.world.level.dimension.LevelStem) LevelStemBridge(org.spongepowered.common.bridge.world.level.dimension.LevelStemBridge) Level(net.minecraft.world.level.Level) ServerLevel(net.minecraft.server.level.ServerLevel) JsonObject(com.google.gson.JsonObject) WorldTemplate(org.spongepowered.api.world.server.WorldTemplate)

Example 2 with WorldTemplate

use of org.spongepowered.api.world.server.WorldTemplate in project SpongeCommon by SpongePowered.

the class SpongeWorldManager method loadWorld.

@Override
public CompletableFuture<org.spongepowered.api.world.server.ServerWorld> loadWorld(final ResourceKey key) {
    final net.minecraft.resources.ResourceKey<Level> registryKey = SpongeWorldManager.createRegistryKey(Objects.requireNonNull(key, "key"));
    if (Level.OVERWORLD.equals(registryKey)) {
        FutureUtil.completedWithException(new IllegalArgumentException("The default world cannot be told to load!"));
    }
    final ServerLevel world = this.worlds.get(registryKey);
    if (world != null) {
        return CompletableFuture.completedFuture((org.spongepowered.api.world.server.ServerWorld) world);
    }
    return this.loadTemplate(key).thenCompose(r -> {
        WorldTemplate loadedTemplate = r.orElse(null);
        if (loadedTemplate == null) {
            final LevelStem scratch = BootstrapProperties.worldGenSettings.dimensions().get(net.minecraft.resources.ResourceKey.create(net.minecraft.core.Registry.LEVEL_STEM_REGISTRY, (ResourceLocation) (Object) key));
            if (scratch != null) {
                ((ResourceKeyBridge) (Object) scratch).bridge$setKey(key);
                loadedTemplate = new SpongeWorldTemplate(scratch);
            }
            if (loadedTemplate == null) {
                return FutureUtil.completedWithException(new IOException(String.format("Failed to load a template for '%s'!", key)));
            }
            this.saveTemplate(loadedTemplate);
        }
        return this.loadWorld0(registryKey, ((SpongeWorldTemplate) loadedTemplate).asDimension(), ((WorldGenSettings) loadedTemplate.generationConfig()));
    });
}
Also used : ServerLevel(net.minecraft.server.level.ServerLevel) IOException(java.io.IOException) WorldGenSettings(net.minecraft.world.level.levelgen.WorldGenSettings) LevelStem(net.minecraft.world.level.dimension.LevelStem) ResourceLocation(net.minecraft.resources.ResourceLocation) Level(net.minecraft.world.level.Level) ServerLevel(net.minecraft.server.level.ServerLevel) WorldTemplate(org.spongepowered.api.world.server.WorldTemplate) ResourceKeyBridge(org.spongepowered.common.bridge.ResourceKeyBridge)

Example 3 with WorldTemplate

use of org.spongepowered.api.world.server.WorldTemplate in project SpongeCommon by SpongePowered.

the class WorldTest method createRandomCheckerboardWorld.

private CommandResult createRandomCheckerboardWorld(final CommandContext context) {
    final WorldManager wm = Sponge.server().worldManager();
    final ServerPlayer player = (ServerPlayer) context.cause().root();
    final String owner = player.name();
    final Random random = player.world().random();
    final List<RegistryReference<Biome>> allBiomes = Sponge.server().registry(RegistryTypes.BIOME).streamEntries().map(RegistryEntry::asReference).collect(Collectors.toList());
    final List<RegistryReference<Biome>> biomes = IntStream.range(0, random.nextInt(allBiomes.size())).mapToObj(i -> allBiomes.get(random.nextInt(allBiomes.size()))).collect(Collectors.toList());
    final List<Structure> allStructures = RegistryTypes.STRUCTURE.get().stream().collect(Collectors.toList());
    final Map<Structure, SeparatedStructureConfig> abundantStructures = IntStream.range(0, random.nextInt(allStructures.size())).mapToObj(i -> allStructures.get(random.nextInt(allStructures.size()))).distinct().collect(Collectors.toMap(s -> s, s -> SeparatedStructureConfig.of(random.nextInt(3) + 2, 1, random.nextInt(10))));
    final Map<Structure, SeparatedStructureConfig> rareStructures = IntStream.range(0, random.nextInt(8) + 2).mapToObj(i -> allStructures.get(random.nextInt(allStructures.size()))).distinct().collect(Collectors.toMap(s -> s, s -> SeparatedStructureConfig.of(random.nextInt(10) + 6, 5, random.nextInt(10))));
    final StructureGenerationConfig structureConfig = StructureGenerationConfig.builder().addStructures(abundantStructures).addStructures(rareStructures).build();
    final NoiseConfig noiseConfig = NoiseConfig.builder().height(256).build();
    final NoiseGeneratorConfig noiseGenConfig = NoiseGeneratorConfig.builder().structureConfig(structureConfig).noiseConfig(noiseConfig).seaLevel(// 2 rolls
    random.nextInt(61 - 1) + 1 + random.nextInt(30)).build();
    final ResourceKey worldKey = ResourceKey.of(this.plugin, owner.toLowerCase());
    final WorldTemplate customTemplate = WorldTemplate.builder().from(WorldTemplate.overworld()).key(worldKey).worldType(WorldTypes.OVERWORLD).serializationBehavior(SerializationBehavior.NONE).loadOnStartup(false).performsSpawnLogic(true).displayName(Component.text("Custom world by " + owner)).generator(ChunkGenerator.noise(BiomeProvider.checkerboard(CheckerboardBiomeConfig.builder().addBiomes(biomes).scale(random.nextInt(16 - 2) + 2).build()), noiseGenConfig)).build();
    if (player.world().key().equals(worldKey)) {
        player.setLocation(ServerLocation.of(wm.defaultWorld(), wm.defaultWorld().properties().spawnPosition()));
    }
    context.sendMessage(Identity.nil(), Component.text("Generating your world..."));
    wm.deleteWorld(worldKey).thenCompose(b -> wm.loadWorld(customTemplate)).thenAccept(w -> this.transportToWorld(player, w)).exceptionally(e -> {
        context.sendMessage(Identity.nil(), Component.text("Failed to teleport!", NamedTextColor.DARK_RED));
        e.printStackTrace();
        return null;
    });
    return CommandResult.success();
}
Also used : IntStream(java.util.stream.IntStream) RegistryEntry(org.spongepowered.api.registry.RegistryEntry) PortalType(org.spongepowered.api.world.portal.PortalType) Command(org.spongepowered.api.command.Command) ServerWorld(org.spongepowered.api.world.server.ServerWorld) Game(org.spongepowered.api.Game) SerializationBehavior(org.spongepowered.api.world.SerializationBehavior) WorldType(org.spongepowered.api.world.WorldType) Inject(com.google.inject.Inject) Random(java.util.Random) Biome(org.spongepowered.api.world.biome.Biome) Title(net.kyori.adventure.title.Title) WorldTemplate(org.spongepowered.api.world.server.WorldTemplate) BiomeProvider(org.spongepowered.api.world.biome.provider.BiomeProvider) Parameter(org.spongepowered.api.command.parameter.Parameter) Component(net.kyori.adventure.text.Component) Map(java.util.Map) NoiseGeneratorConfig(org.spongepowered.api.world.generation.config.NoiseGeneratorConfig) ResourceKey(org.spongepowered.api.ResourceKey) ChunkGenerator(org.spongepowered.api.world.generation.ChunkGenerator) NoSuchElementException(java.util.NoSuchElementException) CommonParameters(org.spongepowered.api.command.parameter.CommonParameters) RegisterCommandEvent(org.spongepowered.api.event.lifecycle.RegisterCommandEvent) CommandResult(org.spongepowered.api.command.CommandResult) RegistryKey(org.spongepowered.api.registry.RegistryKey) Plugin(org.spongepowered.plugin.builtin.jvm.Plugin) WorldTypes(org.spongepowered.api.world.WorldTypes) WorldManager(org.spongepowered.api.world.server.WorldManager) Structure(org.spongepowered.api.world.generation.structure.Structure) Identity(net.kyori.adventure.identity.Identity) CheckerboardBiomeConfig(org.spongepowered.api.world.biome.provider.CheckerboardBiomeConfig) Sponge(org.spongepowered.api.Sponge) Axis(org.spongepowered.api.util.Axis) TypeToken(io.leangen.geantyref.TypeToken) RegistryTypes(org.spongepowered.api.registry.RegistryTypes) Collectors(java.util.stream.Collectors) NamedTextColor(net.kyori.adventure.text.format.NamedTextColor) SeparatedStructureConfig(org.spongepowered.api.world.generation.config.structure.SeparatedStructureConfig) List(java.util.List) RegistryReference(org.spongepowered.api.registry.RegistryReference) Vector3d(org.spongepowered.math.vector.Vector3d) PluginContainer(org.spongepowered.plugin.PluginContainer) StructureGenerationConfig(org.spongepowered.api.world.generation.config.structure.StructureGenerationConfig) CommandContext(org.spongepowered.api.command.parameter.CommandContext) Listener(org.spongepowered.api.event.Listener) ServerPlayer(org.spongepowered.api.entity.living.player.server.ServerPlayer) NoiseConfig(org.spongepowered.api.world.generation.config.noise.NoiseConfig) ServerLocation(org.spongepowered.api.world.server.ServerLocation) NoiseGeneratorConfig(org.spongepowered.api.world.generation.config.NoiseGeneratorConfig) RegistryReference(org.spongepowered.api.registry.RegistryReference) NoiseConfig(org.spongepowered.api.world.generation.config.noise.NoiseConfig) WorldManager(org.spongepowered.api.world.server.WorldManager) ResourceKey(org.spongepowered.api.ResourceKey) StructureGenerationConfig(org.spongepowered.api.world.generation.config.structure.StructureGenerationConfig) Random(java.util.Random) ServerPlayer(org.spongepowered.api.entity.living.player.server.ServerPlayer) SeparatedStructureConfig(org.spongepowered.api.world.generation.config.structure.SeparatedStructureConfig) Structure(org.spongepowered.api.world.generation.structure.Structure) WorldTemplate(org.spongepowered.api.world.server.WorldTemplate)

Example 4 with WorldTemplate

use of org.spongepowered.api.world.server.WorldTemplate in project SpongeCommon by SpongePowered.

the class WorldTest method onRegisterCommand.

@Listener
public void onRegisterCommand(final RegisterCommandEvent<Command.Parameterized> event) {
    final Parameter.Value<ServerPlayer> optPlayerParameter = Parameter.player().optional().key("player").build();
    final Parameter.Value<ResourceKey> worldKeyParameter = Parameter.resourceKey().key("world").build();
    final Parameter.Value<ServerWorld> optWorldParameter = Parameter.world().optional().key("world").build();
    final Parameter.Value<Vector3d> optPositionParameter = Parameter.vector3d().optional().key("position").build();
    final Parameter.Value<PortalType> portalTypeParameter = Parameter.registryElement(TypeToken.get(PortalType.class), RegistryTypes.PORTAL_TYPE, "minecraft", "sponge").key("portal_type").build();
    final Parameter.Value<WorldType> worldTypeParameter = Parameter.registryElement(TypeToken.get(WorldType.class), RegistryTypes.WORLD_TYPE, "minecraft", "sponge").key("world_type").build();
    final Parameter.Value<ResourceKey> copyWorldKeyParameter = Parameter.resourceKey().key("copy_world").build();
    final Parameter.Value<ResourceKey> moveWorldKeyParameter = Parameter.resourceKey().key("move_world").build();
    event.register(this.plugin, Command.builder().addParameters(CommonParameters.LOCATION_ONLINE_ONLY, portalTypeParameter).permission(this.plugin.metadata().id() + ".command.portal.create").executor(context -> {
        final ServerLocation location = context.requireOne(CommonParameters.LOCATION_ONLINE_ONLY);
        final PortalType portalType = context.requireOne(portalTypeParameter);
        portalType.generatePortal(location, Axis.X);
        return CommandResult.success();
    }).build(), "cp", "createportal").register(this.plugin, Command.builder().addParameters(optPlayerParameter, CommonParameters.LOCATION_ONLINE_ONLY, portalTypeParameter).permission(this.plugin.metadata().id() + ".command.portal.use").executor(context -> {
        final ServerPlayer player = context.one(optPlayerParameter).orElse(this.getSourcePlayer(context));
        final ServerLocation location = context.requireOne(CommonParameters.LOCATION_ONLINE_ONLY);
        final PortalType portalType = context.requireOne(portalTypeParameter);
        return portalType.teleport(player, location, true) ? CommandResult.success() : CommandResult.error(Component.text("Could not teleport!"));
    }).build(), "up", "useportal").register(this.plugin, Command.builder().addParameters(optPlayerParameter, worldTypeParameter).permission(this.plugin.metadata().id() + ".command.environment.change").executor(context -> {
        final ServerPlayer player = context.one(optPlayerParameter).orElse(this.getSourcePlayer(context));
        final WorldType worldType = context.requireOne(worldTypeParameter);
        player.sendWorldType(worldType);
        return CommandResult.success();
    }).build(), "ce", "changeenvironment").register(this.plugin, Command.builder().addParameters(CommonParameters.WORLD, worldTypeParameter).permission(this.plugin.metadata().id() + ".command.worldtype.change").executor(context -> {
        final ServerWorld world = context.requireOne(CommonParameters.WORLD);
        final WorldType worldType = context.requireOne(worldTypeParameter);
        world.properties().setWorldType(worldType);
        return CommandResult.success();
    }).build(), "cwt", "changeworldtype").register(this.plugin, Command.builder().addParameters(optPlayerParameter, optWorldParameter, optPositionParameter).permission(this.plugin.metadata().id() + ".command.location.change").executor(context -> {
        final ServerPlayer player = context.one(optPlayerParameter).orElse(this.getSourcePlayer(context));
        final ServerWorld world = context.one(optWorldParameter).orElse(player.world());
        final Vector3d position = context.one(optPositionParameter).orElse(world.properties().spawnPosition().toDouble());
        return player.setLocation(ServerLocation.of(world, position)) ? CommandResult.success() : CommandResult.error(Component.text("Could not teleport!"));
    }).build(), "cl", "changelocation").register(this.plugin, Command.builder().addParameter(worldKeyParameter).permission(this.plugin.metadata().id() + ".command.world.load").executor(context -> {
        final ResourceKey key = context.requireOne(worldKeyParameter);
        this.game.server().worldManager().loadWorld(key).whenComplete((r, t) -> {
            if (t != null) {
                context.cause().audience().sendMessage(Identity.nil(), Component.text(t.getMessage()));
            } else {
                if (r != null) {
                    context.cause().audience().sendMessage(Identity.nil(), Component.text("World loaded successfully!"));
                } else {
                    context.cause().audience().sendMessage(Identity.nil(), Component.text("World failed to load!"));
                }
            }
        });
        return CommandResult.success();
    }).build(), "lw", "loadworld").register(this.plugin, Command.builder().addParameters(worldKeyParameter, worldTypeParameter).permission(this.plugin.metadata().id() + ".command.world.create").executor(context -> {
        final ResourceKey key = context.requireOne(worldKeyParameter);
        final ResourceKey worldType = RegistryTypes.WORLD_TYPE.get().valueKey(context.requireOne(worldTypeParameter));
        final WorldTemplate template = WorldTemplate.builder().from(WorldTemplate.overworld()).key(key).worldType(RegistryKey.of(RegistryTypes.WORLD_TYPE, worldType).asReference()).performsSpawnLogic(true).build();
        this.game.server().worldManager().loadWorld(template).whenComplete((r, t) -> {
            if (t != null) {
                context.cause().audience().sendMessage(Identity.nil(), Component.text(t.getMessage()));
            } else {
                if (r != null) {
                    context.cause().audience().sendMessage(Identity.nil(), Component.text("World created successfully!"));
                } else {
                    context.cause().audience().sendMessage(Identity.nil(), Component.text("World failed to create!"));
                }
            }
        });
        return CommandResult.success();
    }).build(), "cw", "createworld").register(this.plugin, Command.builder().addParameter(CommonParameters.WORLD).executor(context -> {
        final ServerWorld world = context.requireOne(CommonParameters.WORLD);
        this.game.server().worldManager().unloadWorld(world).whenComplete((r, t) -> {
            if (t != null) {
                context.cause().audience().sendMessage(Identity.nil(), Component.text(t.getMessage()));
            } else {
                if (r) {
                    context.cause().audience().sendMessage(Identity.nil(), Component.text("World unloaded successfully!"));
                } else {
                    context.cause().audience().sendMessage(Identity.nil(), Component.text("World failed to unload!"));
                }
            }
        });
        return CommandResult.success();
    }).build(), "uw", "unloadworld").register(this.plugin, Command.builder().addParameters(worldKeyParameter, copyWorldKeyParameter).executor(context -> {
        final ResourceKey key = context.requireOne(worldKeyParameter);
        final ResourceKey copyWorldKey = context.requireOne(copyWorldKeyParameter);
        this.game.server().worldManager().copyWorld(key, copyWorldKey).whenComplete((r, t) -> {
            if (t != null) {
                context.cause().audience().sendMessage(Identity.nil(), Component.text(t.getMessage()));
            } else {
                if (r) {
                    context.cause().audience().sendMessage(Identity.nil(), Component.text("World copied successfully!"));
                } else {
                    context.cause().audience().sendMessage(Identity.nil(), Component.text("World failed to copy!"));
                }
            }
        });
        return CommandResult.success();
    }).build(), "cpw", "copyworld").register(this.plugin, Command.builder().addParameters(worldKeyParameter, moveWorldKeyParameter).executor(context -> {
        final ResourceKey key = context.requireOne(worldKeyParameter);
        final ResourceKey moveWorldKey = context.requireOne(moveWorldKeyParameter);
        this.game.server().worldManager().moveWorld(key, moveWorldKey).whenComplete((r, t) -> {
            if (t != null) {
                context.cause().audience().sendMessage(Identity.nil(), Component.text(t.getMessage()));
            } else {
                if (r) {
                    context.cause().audience().sendMessage(Identity.nil(), Component.text("World moved successfully!"));
                } else {
                    context.cause().audience().sendMessage(Identity.nil(), Component.text("World failed to move!"));
                }
            }
        });
        return CommandResult.success();
    }).build(), "mw", "moveworld").register(this.plugin, Command.builder().addParameters(worldKeyParameter).executor(context -> {
        final ResourceKey key = context.requireOne(worldKeyParameter);
        this.game.server().worldManager().deleteWorld(key).whenComplete((r, t) -> {
            if (t != null) {
                context.cause().audience().sendMessage(Identity.nil(), Component.text(t.getMessage()));
            } else {
                if (r) {
                    context.cause().audience().sendMessage(Identity.nil(), Component.text("World deleted successfully!"));
                } else {
                    context.cause().audience().sendMessage(Identity.nil(), Component.text("World failed to delete!"));
                }
            }
        });
        return CommandResult.success();
    }).build(), "dw", "deleteworld").register(this.plugin, Command.builder().addParameter(optPlayerParameter).executor(context -> {
        final ServerPlayer player = context.one(optPlayerParameter).orElse(this.getSourcePlayer(context));
        player.sendMessage(Identity.nil(), Component.text("You are in World ").append(player.world().properties().displayName().orElseGet(() -> Component.text(player.world().key().toString(), NamedTextColor.AQUA))).append(Component.text(" at (" + player.position().floorX() + ", " + player.position().floorY() + ", " + player.position().floorZ() + ")")));
        return CommandResult.success();
    }).build(), "wai", "whereami").register(this.plugin, Command.builder().executor(this::createRandomCheckerboardWorld).build(), "createrandomworld", "crw");
}
Also used : IntStream(java.util.stream.IntStream) RegistryEntry(org.spongepowered.api.registry.RegistryEntry) PortalType(org.spongepowered.api.world.portal.PortalType) Command(org.spongepowered.api.command.Command) ServerWorld(org.spongepowered.api.world.server.ServerWorld) Game(org.spongepowered.api.Game) SerializationBehavior(org.spongepowered.api.world.SerializationBehavior) WorldType(org.spongepowered.api.world.WorldType) Inject(com.google.inject.Inject) Random(java.util.Random) Biome(org.spongepowered.api.world.biome.Biome) Title(net.kyori.adventure.title.Title) WorldTemplate(org.spongepowered.api.world.server.WorldTemplate) BiomeProvider(org.spongepowered.api.world.biome.provider.BiomeProvider) Parameter(org.spongepowered.api.command.parameter.Parameter) Component(net.kyori.adventure.text.Component) Map(java.util.Map) NoiseGeneratorConfig(org.spongepowered.api.world.generation.config.NoiseGeneratorConfig) ResourceKey(org.spongepowered.api.ResourceKey) ChunkGenerator(org.spongepowered.api.world.generation.ChunkGenerator) NoSuchElementException(java.util.NoSuchElementException) CommonParameters(org.spongepowered.api.command.parameter.CommonParameters) RegisterCommandEvent(org.spongepowered.api.event.lifecycle.RegisterCommandEvent) CommandResult(org.spongepowered.api.command.CommandResult) RegistryKey(org.spongepowered.api.registry.RegistryKey) Plugin(org.spongepowered.plugin.builtin.jvm.Plugin) WorldTypes(org.spongepowered.api.world.WorldTypes) WorldManager(org.spongepowered.api.world.server.WorldManager) Structure(org.spongepowered.api.world.generation.structure.Structure) Identity(net.kyori.adventure.identity.Identity) CheckerboardBiomeConfig(org.spongepowered.api.world.biome.provider.CheckerboardBiomeConfig) Sponge(org.spongepowered.api.Sponge) Axis(org.spongepowered.api.util.Axis) TypeToken(io.leangen.geantyref.TypeToken) RegistryTypes(org.spongepowered.api.registry.RegistryTypes) Collectors(java.util.stream.Collectors) NamedTextColor(net.kyori.adventure.text.format.NamedTextColor) SeparatedStructureConfig(org.spongepowered.api.world.generation.config.structure.SeparatedStructureConfig) List(java.util.List) RegistryReference(org.spongepowered.api.registry.RegistryReference) Vector3d(org.spongepowered.math.vector.Vector3d) PluginContainer(org.spongepowered.plugin.PluginContainer) StructureGenerationConfig(org.spongepowered.api.world.generation.config.structure.StructureGenerationConfig) CommandContext(org.spongepowered.api.command.parameter.CommandContext) Listener(org.spongepowered.api.event.Listener) ServerPlayer(org.spongepowered.api.entity.living.player.server.ServerPlayer) NoiseConfig(org.spongepowered.api.world.generation.config.noise.NoiseConfig) ServerLocation(org.spongepowered.api.world.server.ServerLocation) ServerLocation(org.spongepowered.api.world.server.ServerLocation) ResourceKey(org.spongepowered.api.ResourceKey) ServerWorld(org.spongepowered.api.world.server.ServerWorld) WorldType(org.spongepowered.api.world.WorldType) Vector3d(org.spongepowered.math.vector.Vector3d) ServerPlayer(org.spongepowered.api.entity.living.player.server.ServerPlayer) Parameter(org.spongepowered.api.command.parameter.Parameter) WorldTemplate(org.spongepowered.api.world.server.WorldTemplate) PortalType(org.spongepowered.api.world.portal.PortalType) Listener(org.spongepowered.api.event.Listener)

Aggregations

WorldTemplate (org.spongepowered.api.world.server.WorldTemplate)4 ResourceKey (org.spongepowered.api.ResourceKey)3 Inject (com.google.inject.Inject)2 TypeToken (io.leangen.geantyref.TypeToken)2 List (java.util.List)2 Map (java.util.Map)2 NoSuchElementException (java.util.NoSuchElementException)2 Random (java.util.Random)2 Collectors (java.util.stream.Collectors)2 IntStream (java.util.stream.IntStream)2 Identity (net.kyori.adventure.identity.Identity)2 Component (net.kyori.adventure.text.Component)2 NamedTextColor (net.kyori.adventure.text.format.NamedTextColor)2 Title (net.kyori.adventure.title.Title)2 Game (org.spongepowered.api.Game)2 Sponge (org.spongepowered.api.Sponge)2 Command (org.spongepowered.api.command.Command)2 CommandResult (org.spongepowered.api.command.CommandResult)2 CommandContext (org.spongepowered.api.command.parameter.CommandContext)2 CommonParameters (org.spongepowered.api.command.parameter.CommonParameters)2