Search in sources :

Example 1 with Difficulty

use of net.minecraft.world.Difficulty in project SpongeCommon by SpongePowered.

the class DifficultyCommandMixin method setDifficulty.

// @formatter:on
/**
 * @author Zidane
 * @reason Only apply difficulty for the world the command was ran in (as in Sponge, all worlds have difficulties)
 */
@Overwrite
public static int setDifficulty(CommandSourceStack source, Difficulty difficulty) throws CommandSyntaxException {
    if (source.getLevel().getDifficulty() == difficulty) {
        throw DifficultyCommandMixin.ERROR_ALREADY_DIFFICULT.create(difficulty.getKey());
    } else {
        final LevelData levelData = source.getLevel().getLevelData();
        ((ServerWorldProperties) levelData).setDifficulty((org.spongepowered.api.world.difficulty.Difficulty) (Object) difficulty);
        source.getLevel().setSpawnSettings(((MinecraftServerAccessor) SpongeCommon.server()).invoker$isSpawningMonsters(), SpongeCommon.server().isSpawningAnimals());
        source.getLevel().getPlayers(p -> true).forEach(p -> p.connection.send(new ClientboundChangeDifficultyPacket(levelData.getDifficulty(), levelData.isDifficultyLocked())));
        source.sendSuccess(new TranslatableComponent("commands.difficulty.success", difficulty.getDisplayName()), true);
        return 0;
    }
}
Also used : CommandSourceStack(net.minecraft.commands.CommandSourceStack) MinecraftServerAccessor(org.spongepowered.common.accessor.server.MinecraftServerAccessor) Overwrite(org.spongepowered.asm.mixin.Overwrite) SpongeCommon(org.spongepowered.common.SpongeCommon) Final(org.spongepowered.asm.mixin.Final) ServerWorldProperties(org.spongepowered.api.world.server.storage.ServerWorldProperties) LevelData(net.minecraft.world.level.storage.LevelData) Mixin(org.spongepowered.asm.mixin.Mixin) DynamicCommandExceptionType(com.mojang.brigadier.exceptions.DynamicCommandExceptionType) Shadow(org.spongepowered.asm.mixin.Shadow) ClientboundChangeDifficultyPacket(net.minecraft.network.protocol.game.ClientboundChangeDifficultyPacket) DifficultyCommand(net.minecraft.server.commands.DifficultyCommand) CommandSyntaxException(com.mojang.brigadier.exceptions.CommandSyntaxException) Difficulty(net.minecraft.world.Difficulty) TranslatableComponent(net.minecraft.network.chat.TranslatableComponent) ServerWorldProperties(org.spongepowered.api.world.server.storage.ServerWorldProperties) TranslatableComponent(net.minecraft.network.chat.TranslatableComponent) ClientboundChangeDifficultyPacket(net.minecraft.network.protocol.game.ClientboundChangeDifficultyPacket) LevelData(net.minecraft.world.level.storage.LevelData) Overwrite(org.spongepowered.asm.mixin.Overwrite)

Example 2 with Difficulty

use of net.minecraft.world.Difficulty in project SpongeCommon by SpongePowered.

the class PrimaryLevelDataMixin method impl$updateWorldForDifficultyChange.

void impl$updateWorldForDifficultyChange(final ServerLevel world, final boolean isLocked) {
    if (world == null) {
        return;
    }
    final MinecraftServer server = world.getServer();
    final Difficulty difficulty = ((LevelData) this).getDifficulty();
    if (difficulty == Difficulty.HARD) {
        world.setSpawnSettings(true, true);
    } else if (server.isSingleplayer()) {
        world.setSpawnSettings(difficulty != Difficulty.PEACEFUL, true);
    } else {
        world.setSpawnSettings(((MinecraftServerAccessor) server).invoker$isSpawningMonsters(), server.isSpawningAnimals());
    }
    world.players().forEach(player -> player.connection.send(new ClientboundChangeDifficultyPacket(difficulty, isLocked)));
}
Also used : MinecraftServerAccessor(org.spongepowered.common.accessor.server.MinecraftServerAccessor) Difficulty(net.minecraft.world.Difficulty) ClientboundChangeDifficultyPacket(net.minecraft.network.protocol.game.ClientboundChangeDifficultyPacket) PrimaryLevelData(net.minecraft.world.level.storage.PrimaryLevelData) ServerLevelData(net.minecraft.world.level.storage.ServerLevelData) LevelData(net.minecraft.world.level.storage.LevelData) MinecraftServer(net.minecraft.server.MinecraftServer)

Example 3 with Difficulty

use of net.minecraft.world.Difficulty in project SpongeCommon by SpongePowered.

the class SpongeWorldManager method loadWorld0.

private CompletableFuture<org.spongepowered.api.world.server.ServerWorld> loadWorld0(final net.minecraft.resources.ResourceKey<Level> registryKey, final LevelStem template, final WorldGenSettings generatorSettings) {
    final PrimaryLevelData defaultLevelData = (PrimaryLevelData) this.server.getWorldData();
    final LevelSettings defaultLevelSettings = ((PrimaryLevelDataAccessor) defaultLevelData).accessor$settings();
    final LevelStemBridge templateBridge = (LevelStemBridge) (Object) template;
    final ResourceKey worldKey = ((ResourceKeyBridge) templateBridge).bridge$getKey();
    final WorldType worldType = (WorldType) template.type();
    final ResourceKey worldTypeKey = RegistryTypes.WORLD_TYPE.get().valueKey((WorldType) template.type());
    MinecraftServerAccessor.accessor$LOGGER().info("Loading world '{}' ({})", worldKey, worldTypeKey);
    final String directoryName = this.getDirectoryName(worldKey);
    final boolean isVanillaSubLevel = this.isVanillaSubWorld(directoryName);
    final LevelStorageSource.LevelStorageAccess storageSource;
    try {
        if (isVanillaSubLevel) {
            storageSource = LevelStorageSource.createDefault(this.defaultWorldDirectory).createAccess(directoryName);
        } else {
            storageSource = LevelStorageSource.createDefault(this.customWorldsDirectory).createAccess(worldKey.namespace() + File.separator + worldKey.value());
        }
    } catch (final IOException e) {
        e.printStackTrace();
        return FutureUtil.completedWithException(new RuntimeException(String.format("Failed to create level data for world '%s'!", worldKey), e));
    }
    PrimaryLevelData levelData;
    levelData = (PrimaryLevelData) storageSource.getDataTag((DynamicOps<Tag>) BootstrapProperties.worldSettingsAdapter, defaultLevelSettings.getDataPackConfig());
    if (levelData == null) {
        final LevelSettings levelSettings;
        final WorldGenSettings generationSettings;
        if (this.server.isDemo()) {
            levelSettings = MinecraftServer.DEMO_SETTINGS;
            generationSettings = WorldGenSettings.demoSettings(BootstrapProperties.registries);
        } else {
            levelSettings = new LevelSettings(directoryName, (GameType) (Object) BootstrapProperties.gameMode.get(Sponge.game()), templateBridge.bridge$hardcore().orElse(BootstrapProperties.hardcore), (Difficulty) (Object) BootstrapProperties.difficulty.get(Sponge.game()), templateBridge.bridge$commands().orElse(BootstrapProperties.commands), new GameRules(), defaultLevelData.getDataPackConfig());
            generationSettings = generatorSettings;
        }
        levelData = new PrimaryLevelData(levelSettings, generationSettings, Lifecycle.stable());
    }
    ((PrimaryLevelDataBridge) levelData).bridge$populateFromDimension(template);
    final InheritableConfigHandle<WorldConfig> configAdapter = SpongeGameConfigs.createWorld(worldTypeKey, worldKey);
    ((PrimaryLevelDataBridge) levelData).bridge$configAdapter(configAdapter);
    levelData.setModdedInfo(this.server.getServerModName(), this.server.getModdedStatus().isPresent());
    final boolean isDebugGeneration = levelData.worldGenSettings().isDebug();
    final long seed = BiomeManager.obfuscateSeed(levelData.worldGenSettings().seed());
    final ChunkProgressListener chunkStatusListener = ((MinecraftServerAccessor) this.server).accessor$progressListenerFactory().create(11);
    final ServerLevel world = new ServerLevel(this.server, ((MinecraftServerAccessor) this.server).accessor$executor(), storageSource, levelData, registryKey, (DimensionType) worldType, chunkStatusListener, template.generator(), isDebugGeneration, seed, ImmutableList.of(), true);
    this.worlds.put(registryKey, world);
    return SpongeCommon.asyncScheduler().submit(() -> this.prepareWorld(world, isDebugGeneration)).thenApply(w -> {
        ((MinecraftServerAccessor) this.server).invoker$forceDifficulty();
        return w;
    }).thenCompose(w -> this.postWorldLoad(w, false)).thenApply(w -> (org.spongepowered.api.world.server.ServerWorld) w);
}
Also used : MinecraftServerAccessor(org.spongepowered.common.accessor.server.MinecraftServerAccessor) ServerLevelBridge(org.spongepowered.common.bridge.server.level.ServerLevelBridge) SpongeGameConfigs(org.spongepowered.common.config.SpongeGameConfigs) WorldConfig(org.spongepowered.common.config.inheritable.WorldConfig) DimensionGeneratorSettingsAccessor(org.spongepowered.common.accessor.world.gen.DimensionGeneratorSettingsAccessor) MinecraftServer(net.minecraft.server.MinecraftServer) FutureUtil(org.spongepowered.common.util.FutureUtil) Map(java.util.Map) Path(java.nio.file.Path) WanderingTraderSpawner(net.minecraft.world.entity.npc.WanderingTraderSpawner) BootstrapProperties(org.spongepowered.common.server.BootstrapProperties) WorldManager(org.spongepowered.api.world.server.WorldManager) ForcedChunksSavedData(net.minecraft.world.level.ForcedChunksSavedData) InheritableConfigHandle(org.spongepowered.common.config.inheritable.InheritableConfigHandle) RegistryAccess(net.minecraft.core.RegistryAccess) FileVisitResult(java.nio.file.FileVisitResult) PlatformHooks(org.spongepowered.common.hooks.PlatformHooks) Stream(java.util.stream.Stream) TicketType(net.minecraft.server.level.TicketType) MappedRegistry(net.minecraft.core.MappedRegistry) GameType(net.minecraft.world.level.GameType) CrashReport(net.minecraft.CrashReport) CustomSpawner(net.minecraft.world.level.CustomSpawner) RegistryEntry(org.spongepowered.api.registry.RegistryEntry) LevelStorageSource_LevelStorageAccessAccessor(org.spongepowered.common.accessor.world.level.storage.LevelStorageSource_LevelStorageAccessAccessor) Registry(org.spongepowered.api.registry.Registry) WorldGenSettings(net.minecraft.world.level.levelgen.WorldGenSettings) PrimaryLevelDataBridge(org.spongepowered.common.bridge.world.level.storage.PrimaryLevelDataBridge) JsonParser(com.google.gson.JsonParser) StandardCopyOption(java.nio.file.StandardCopyOption) ArrayList(java.util.ArrayList) VillageSiege(net.minecraft.world.entity.ai.village.VillageSiege) ResourceKey(org.spongepowered.api.ResourceKey) Server(org.spongepowered.api.Server) DataResult(com.mojang.serialization.DataResult) Difficulty(net.minecraft.world.Difficulty) Files(java.nio.file.Files) BufferedWriter(java.io.BufferedWriter) SpongeEventFactory(org.spongepowered.api.event.SpongeEventFactory) IOException(java.io.IOException) Lifecycle(com.mojang.serialization.Lifecycle) PhaseTracker(org.spongepowered.common.event.tracking.PhaseTracker) Decoder(com.mojang.serialization.Decoder) RegistryTypes(org.spongepowered.api.registry.RegistryTypes) InputStreamReader(java.io.InputStreamReader) Pair(com.mojang.datafixers.util.Pair) File(java.io.File) ChunkPos(net.minecraft.world.level.ChunkPos) ExecutionException(java.util.concurrent.ExecutionException) RegistryReadOps(net.minecraft.resources.RegistryReadOps) DataPackSerializer(org.spongepowered.common.datapack.DataPackSerializer) LevelStem(net.minecraft.world.level.dimension.LevelStem) LevelResource(net.minecraft.world.level.storage.LevelResource) ResourceLocation(net.minecraft.resources.ResourceLocation) JsonObject(com.google.gson.JsonObject) SpongeServer(org.spongepowered.common.SpongeServer) MinecraftServerAccessor(org.spongepowered.common.accessor.server.MinecraftServerAccessor) PrimaryLevelDataAccessor(org.spongepowered.common.accessor.world.level.storage.PrimaryLevelDataAccessor) JsonOps(com.mojang.serialization.JsonOps) DynamicOps(com.mojang.serialization.DynamicOps) PatrolSpawner(net.minecraft.world.level.levelgen.PatrolSpawner) SimpleFileVisitor(java.nio.file.SimpleFileVisitor) WorldData(net.minecraft.world.level.storage.WorldData) BiomeManager(net.minecraft.world.level.biome.BiomeManager) WorldTypes(org.spongepowered.api.world.WorldTypes) ChunkProgressListener(net.minecraft.server.level.progress.ChunkProgressListener) PrimaryLevelData(net.minecraft.world.level.storage.PrimaryLevelData) Collection(java.util.Collection) Launch(org.spongepowered.common.launch.Launch) GameRules(net.minecraft.world.level.GameRules) Sponge(org.spongepowered.api.Sponge) UUID(java.util.UUID) Collectors(java.util.stream.Collectors) PhantomSpawner(net.minecraft.world.level.levelgen.PhantomSpawner) Objects(java.util.Objects) Util(net.minecraft.Util) List(java.util.List) CommandStorage(net.minecraft.world.level.storage.CommandStorage) BlockPos(net.minecraft.core.BlockPos) Optional(java.util.Optional) Level(net.minecraft.world.level.Level) LevelStemBridge(org.spongepowered.common.bridge.world.level.dimension.LevelStemBridge) FilenameUtils(org.apache.commons.io.FilenameUtils) Tag(net.minecraft.nbt.Tag) ServerChunkCache(net.minecraft.server.level.ServerChunkCache) Constants(org.spongepowered.common.util.Constants) WorldType(org.spongepowered.api.world.WorldType) CompletableFuture(java.util.concurrent.CompletableFuture) DimensionType(net.minecraft.world.level.dimension.DimensionType) ServerLevel(net.minecraft.server.level.ServerLevel) ServerWorldProperties(org.spongepowered.api.world.server.storage.ServerWorldProperties) OptionalInt(java.util.OptionalInt) JsonElement(com.google.gson.JsonElement) WorldTemplate(org.spongepowered.api.world.server.WorldTemplate) ImmutableList(com.google.common.collect.ImmutableList) LongIterator(it.unimi.dsi.fastutil.longs.LongIterator) Task(org.spongepowered.api.scheduler.Task) ResourceKeyBridge(org.spongepowered.common.bridge.ResourceKeyBridge) LevelStorageSource(net.minecraft.world.level.storage.LevelStorageSource) Features(net.minecraft.data.worldgen.Features) ReportedException(net.minecraft.ReportedException) SpongeUserManager(org.spongepowered.common.user.SpongeUserManager) SpongeCommon(org.spongepowered.common.SpongeCommon) BasicFileAttributes(java.nio.file.attribute.BasicFileAttributes) CatSpawner(net.minecraft.world.entity.npc.CatSpawner) WorldGenSettingsBridge(org.spongepowered.common.bridge.world.level.levelgen.WorldGenSettingsBridge) TimeUnit(java.util.concurrent.TimeUnit) LevelSettings(net.minecraft.world.level.LevelSettings) Comparator(java.util.Comparator) Collections(java.util.Collections) RegistryWriteOps(net.minecraft.resources.RegistryWriteOps) InputStream(java.io.InputStream) ServerLevel(net.minecraft.server.level.ServerLevel) ChunkProgressListener(net.minecraft.server.level.progress.ChunkProgressListener) Difficulty(net.minecraft.world.Difficulty) WorldConfig(org.spongepowered.common.config.inheritable.WorldConfig) GameType(net.minecraft.world.level.GameType) PrimaryLevelData(net.minecraft.world.level.storage.PrimaryLevelData) WorldGenSettings(net.minecraft.world.level.levelgen.WorldGenSettings) WorldType(org.spongepowered.api.world.WorldType) LevelStemBridge(org.spongepowered.common.bridge.world.level.dimension.LevelStemBridge) ResourceKeyBridge(org.spongepowered.common.bridge.ResourceKeyBridge) GameRules(net.minecraft.world.level.GameRules) LevelStorageSource(net.minecraft.world.level.storage.LevelStorageSource) IOException(java.io.IOException) PrimaryLevelDataBridge(org.spongepowered.common.bridge.world.level.storage.PrimaryLevelDataBridge) ResourceKey(org.spongepowered.api.ResourceKey) LevelSettings(net.minecraft.world.level.LevelSettings) Tag(net.minecraft.nbt.Tag) PrimaryLevelDataAccessor(org.spongepowered.common.accessor.world.level.storage.PrimaryLevelDataAccessor)

Example 4 with Difficulty

use of net.minecraft.world.Difficulty in project SpongeCommon by SpongePowered.

the class SpongeWorldManager method loadLevel.

public void loadLevel() {
    final PrimaryLevelData defaultLevelData = (PrimaryLevelData) this.server.getWorldData();
    final WorldGenSettings defaultGenerationSettings = defaultLevelData.worldGenSettings();
    final LevelSettings defaultLevelSettings = ((PrimaryLevelDataAccessor) defaultLevelData).accessor$settings();
    final MappedRegistry<LevelStem> templates = defaultGenerationSettings.dimensions();
    final boolean multiworldEnabled = this.server.isSingleplayer() || this.server.isNetherEnabled();
    if (!multiworldEnabled) {
        SpongeCommon.logger().warn("The option 'allow-nether' has been set to 'false' in the server.properties. " + "Multi-World support has been disabled and no worlds besides the default world will be loaded.");
    }
    for (final RegistryEntry<LevelStem> entry : ((Registry<LevelStem>) (Object) templates).streamEntries().collect(Collectors.toList())) {
        final ResourceKey worldKey = entry.key();
        final LevelStem template = entry.value();
        final LevelStemBridge templateBridge = (LevelStemBridge) (Object) template;
        ((ResourceKeyBridge) templateBridge).bridge$setKey(worldKey);
        final boolean isDefaultWorld = this.isDefaultWorld(worldKey);
        if (!isDefaultWorld && !multiworldEnabled) {
            continue;
        }
        final WorldType worldType = (WorldType) template.type();
        final ResourceKey worldTypeKey = RegistryTypes.WORLD_TYPE.get().valueKey((WorldType) template.type());
        MinecraftServerAccessor.accessor$LOGGER().info("Loading world '{}' ({})", worldKey, worldTypeKey);
        if (!isDefaultWorld && !templateBridge.bridge$loadOnStartup()) {
            SpongeCommon.logger().warn("World '{}' has been disabled from loading at startup. Skipping...", worldKey);
            continue;
        }
        final String directoryName = this.getDirectoryName(worldKey);
        final boolean isVanillaSubLevel = this.isVanillaSubWorld(directoryName);
        final LevelStorageSource.LevelStorageAccess storageSource;
        if (isDefaultWorld) {
            storageSource = ((MinecraftServerAccessor) this.server).accessor$storageSource();
        } else {
            try {
                if (isVanillaSubLevel) {
                    storageSource = LevelStorageSource.createDefault(this.defaultWorldDirectory).createAccess(directoryName);
                } else {
                    storageSource = LevelStorageSource.createDefault(this.customWorldsDirectory).createAccess(worldKey.namespace() + File.separator + worldKey.value());
                }
            } catch (final IOException e) {
                throw new RuntimeException(String.format("Failed to create level data for world '%s'!", worldKey), e);
            }
        }
        PrimaryLevelData levelData;
        final boolean isDebugGeneration;
        if (isDefaultWorld) {
            levelData = defaultLevelData;
            isDebugGeneration = defaultGenerationSettings.isDebug();
        } else {
            levelData = (PrimaryLevelData) storageSource.getDataTag((DynamicOps<Tag>) BootstrapProperties.worldSettingsAdapter, defaultLevelSettings.getDataPackConfig());
            if (levelData == null) {
                final LevelSettings levelSettings;
                final WorldGenSettings generationSettings;
                if (this.server.isDemo()) {
                    levelSettings = MinecraftServer.DEMO_SETTINGS;
                    generationSettings = WorldGenSettings.demoSettings(BootstrapProperties.registries);
                } else {
                    levelSettings = new LevelSettings(directoryName, (GameType) (Object) BootstrapProperties.gameMode.get(Sponge.game()), templateBridge.bridge$hardcore().orElse(BootstrapProperties.hardcore), (Difficulty) (Object) BootstrapProperties.difficulty.get(Sponge.game()), templateBridge.bridge$commands().orElse(BootstrapProperties.commands), new GameRules(), defaultLevelData.getDataPackConfig());
                    generationSettings = ((WorldGenSettingsBridge) defaultLevelData.worldGenSettings()).bridge$copy();
                }
                isDebugGeneration = generationSettings.isDebug();
                ((DimensionGeneratorSettingsAccessor) generationSettings).accessor$dimensions(new MappedRegistry<>(net.minecraft.core.Registry.LEVEL_STEM_REGISTRY, Lifecycle.stable()));
                levelData = new PrimaryLevelData(levelSettings, generationSettings, Lifecycle.stable());
            } else {
                isDebugGeneration = levelData.worldGenSettings().isDebug();
            }
        }
        ((PrimaryLevelDataBridge) levelData).bridge$populateFromDimension(template);
        final InheritableConfigHandle<WorldConfig> configAdapter = SpongeGameConfigs.createWorld(worldTypeKey, worldKey);
        ((PrimaryLevelDataBridge) levelData).bridge$configAdapter(configAdapter);
        levelData.setModdedInfo(this.server.getServerModName(), this.server.getModdedStatus().isPresent());
        final long seed = BiomeManager.obfuscateSeed(levelData.worldGenSettings().seed());
        final net.minecraft.resources.ResourceKey<Level> registryKey = SpongeWorldManager.createRegistryKey(worldKey);
        final ChunkProgressListener chunkStatusListener = ((MinecraftServerAccessor) this.server).accessor$progressListenerFactory().create(11);
        final List<CustomSpawner> spawners;
        if (isDefaultWorld) {
            spawners = ImmutableList.of(new PhantomSpawner(), new PatrolSpawner(), new CatSpawner(), new VillageSiege(), new WanderingTraderSpawner(levelData));
        } else {
            spawners = ImmutableList.of();
        }
        final ServerLevel world = new ServerLevel(this.server, ((MinecraftServerAccessor) this.server).accessor$executor(), storageSource, levelData, registryKey, (DimensionType) worldType, chunkStatusListener, template.generator(), isDebugGeneration, seed, spawners, true);
        // Ensure that the world border is registered.
        world.getWorldBorder().applySettings(levelData.getWorldBorder());
        this.worlds.put(registryKey, world);
        this.prepareWorld(world, isDebugGeneration);
    }
    ((MinecraftServerAccessor) this.server).invoker$forceDifficulty();
    for (final Map.Entry<net.minecraft.resources.ResourceKey<Level>, ServerLevel> entry : this.worlds.entrySet()) {
        try {
            this.postWorldLoad(entry.getValue(), true).get();
        } catch (final InterruptedException | ExecutionException e) {
            throw new IllegalStateException(e);
        }
    }
    ((SpongeUserManager) Sponge.server().userManager()).init();
    ((SpongeServer) SpongeCommon.server()).getPlayerDataManager().load();
}
Also used : DimensionGeneratorSettingsAccessor(org.spongepowered.common.accessor.world.gen.DimensionGeneratorSettingsAccessor) MinecraftServerAccessor(org.spongepowered.common.accessor.server.MinecraftServerAccessor) Difficulty(net.minecraft.world.Difficulty) GameType(net.minecraft.world.level.GameType) PrimaryLevelData(net.minecraft.world.level.storage.PrimaryLevelData) WorldGenSettings(net.minecraft.world.level.levelgen.WorldGenSettings) WanderingTraderSpawner(net.minecraft.world.entity.npc.WanderingTraderSpawner) WorldType(org.spongepowered.api.world.WorldType) VillageSiege(net.minecraft.world.entity.ai.village.VillageSiege) LevelStorageSource(net.minecraft.world.level.storage.LevelStorageSource) PrimaryLevelDataBridge(org.spongepowered.common.bridge.world.level.storage.PrimaryLevelDataBridge) ResourceKey(org.spongepowered.api.ResourceKey) JsonObject(com.google.gson.JsonObject) Level(net.minecraft.world.level.Level) ServerLevel(net.minecraft.server.level.ServerLevel) LevelSettings(net.minecraft.world.level.LevelSettings) Map(java.util.Map) ServerLevel(net.minecraft.server.level.ServerLevel) ChunkProgressListener(net.minecraft.server.level.progress.ChunkProgressListener) WorldConfig(org.spongepowered.common.config.inheritable.WorldConfig) PatrolSpawner(net.minecraft.world.level.levelgen.PatrolSpawner) CustomSpawner(net.minecraft.world.level.CustomSpawner) CatSpawner(net.minecraft.world.entity.npc.CatSpawner) LevelStemBridge(org.spongepowered.common.bridge.world.level.dimension.LevelStemBridge) ExecutionException(java.util.concurrent.ExecutionException) SpongeUserManager(org.spongepowered.common.user.SpongeUserManager) ResourceKeyBridge(org.spongepowered.common.bridge.ResourceKeyBridge) GameRules(net.minecraft.world.level.GameRules) IOException(java.io.IOException) LevelStem(net.minecraft.world.level.dimension.LevelStem) Tag(net.minecraft.nbt.Tag) PrimaryLevelDataAccessor(org.spongepowered.common.accessor.world.level.storage.PrimaryLevelDataAccessor) PhantomSpawner(net.minecraft.world.level.levelgen.PhantomSpawner)

Aggregations

Difficulty (net.minecraft.world.Difficulty)4 MinecraftServerAccessor (org.spongepowered.common.accessor.server.MinecraftServerAccessor)4 PrimaryLevelData (net.minecraft.world.level.storage.PrimaryLevelData)3 JsonObject (com.google.gson.JsonObject)2 IOException (java.io.IOException)2 Map (java.util.Map)2 ExecutionException (java.util.concurrent.ExecutionException)2 Tag (net.minecraft.nbt.Tag)2 ClientboundChangeDifficultyPacket (net.minecraft.network.protocol.game.ClientboundChangeDifficultyPacket)2 ServerLevel (net.minecraft.server.level.ServerLevel)2 ChunkProgressListener (net.minecraft.server.level.progress.ChunkProgressListener)2 VillageSiege (net.minecraft.world.entity.ai.village.VillageSiege)2 CatSpawner (net.minecraft.world.entity.npc.CatSpawner)2 WanderingTraderSpawner (net.minecraft.world.entity.npc.WanderingTraderSpawner)2 CustomSpawner (net.minecraft.world.level.CustomSpawner)2 GameRules (net.minecraft.world.level.GameRules)2 GameType (net.minecraft.world.level.GameType)2 Level (net.minecraft.world.level.Level)2 LevelSettings (net.minecraft.world.level.LevelSettings)2 LevelStem (net.minecraft.world.level.dimension.LevelStem)2