Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Method local inner record decompiled into wrong location #131

Open
Machine-Maker opened this issue Dec 13, 2022 · 0 comments
Open

Method local inner record decompiled into wrong location #131

Machine-Maker opened this issue Dec 13, 2022 · 0 comments

Comments

@Machine-Maker
Copy link

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);
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant