Skip to content

Method local inner record decompiled into wrong location #131

@Machine-Maker

Description

@Machine-Maker

In the vanilla minecraft server source (1.19.3), in net.minecraft.world.level.levelgen.WorldDimensions (mojang mappings) the following happens when decompiling
image

public WorldDimensions.Complete bake(Registry<LevelStem> existingRegistry) {
        Stream<ResourceKey<LevelStem>> stream = Stream.concat(existingRegistry.registryKeySet().stream(), this.dimensions.registryKeySet().stream()).distinct();
        List<Entry> list = new ArrayList<>();
        keysInOrder(stream).forEach((key) -> {
            existingRegistry.getOptional(key).or(() -> {
                return this.dimensions.getOptional(key);
            }).ifPresent((dimensionOptions) -> {
                record Entry(ResourceKey<LevelStem> key, LevelStem value) {
                    Lifecycle lifecycle() {
                        return WorldDimensions.checkStability(this.key, this.value);
                    }
                }

                list.add(new Entry(key, dimensionOptions));
            });
        });
        Lifecycle lifecycle = list.size() == VANILLA_DIMENSION_COUNT ? Lifecycle.stable() : Lifecycle.experimental();
        WritableRegistry<LevelStem> writableRegistry = new MappedRegistry<>(Registries.LEVEL_STEM, lifecycle);
        list.forEach((entry) -> {
            writableRegistry.register(entry.key, entry.value, entry.lifecycle());
        });
        Registry<LevelStem> registry = writableRegistry.freeze();
        PrimaryLevelData.SpecialWorldProperty specialWorldProperty = specialWorldProperty(registry);
        return new WorldDimensions.Complete(registry.freeze(), specialWorldProperty);
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions