ForgeFlower
ForgeFlower copied to clipboard
Method local inner record decompiled into wrong location
In the vanilla minecraft server source (1.19.3), in net.minecraft.world.level.levelgen.WorldDimensions (mojang mappings) the following happens when decompiling

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);
}