/*
 * This file is part of Sponge, licensed under the MIT License (MIT).
 *
 * Copyright (c) SpongePowered <https://www.spongepowered.org>
 * Copyright (c) contributors
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
package org.spongepowered.common.mixin.api.mcp.world.gen;

import net.minecraft.world.gen.DimensionSettings;
import net.minecraft.world.gen.settings.DimensionStructuresSettings;
import org.spongepowered.api.block.BlockState;
import org.spongepowered.api.world.generation.config.NoiseGeneratorConfig;
import org.spongepowered.api.world.generation.config.noise.NoiseConfig;
import org.spongepowered.api.world.generation.config.structure.StructureGenerationConfig;
import org.spongepowered.asm.mixin.Implements;
import org.spongepowered.asm.mixin.Interface;
import org.spongepowered.asm.mixin.Intrinsic;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;

@Mixin(DimensionSettings.class)
@Implements(@Interface(iface = NoiseGeneratorConfig.class, prefix = "noiseGeneratorConfig$"))
public abstract class DimensionSettingsMixin_API implements NoiseGeneratorConfig {

    // @formatter:off
    @Shadow public abstract DimensionStructuresSettings shadow$structureSettings();
    @Shadow public abstract net.minecraft.world.gen.settings.NoiseSettings shadow$noiseSettings();
    @Shadow public abstract int shadow$getBedrockRoofPosition();
    @Shadow public abstract int shadow$getBedrockFloorPosition();
    @Shadow public abstract int shadow$seaLevel();
    // @formatter:on

    @Override
    public StructureGenerationConfig structureConfig() {
        return (StructureGenerationConfig) this.shadow$structureSettings();
    }

    @Override
    public NoiseConfig noiseConfig() {
        return (NoiseConfig) this.shadow$noiseSettings();
    }

    @Intrinsic
    public BlockState noiseGeneratorConfig$defaultBlock() {
        return this.defaultBlock();
    }

    @Intrinsic
    public BlockState noiseGeneratorConfig$defaultFluid() {
        return this.defaultFluid();
    }

    @Override
    public int bedrockRoofY() {
        return this.shadow$getBedrockRoofPosition();
    }

    @Override
    public int bedrockFloorY() {
        return this.shadow$getBedrockFloorPosition();
    }

    @Intrinsic
    public int noiseGeneratorConfig$seaLevel() {
        return this.shadow$seaLevel();
    }
}

@@ -2521,24 +2521,194 @@
 seaLevel();%0A
+    @Shadow public abstract net.minecraft.block.BlockState shadow$getDefaultBlock();%0A    @Shadow public abstract net.minecraft.block.BlockState shadow$getDefaultFluid();%0A
     // @form
@@ -2990,33 +2990,32 @@
     %7D%0A%0A    @
-Intrinsic
+Override
 %0A    public 
@@ -3025,37 +3025,16 @@
 ckState 
-noiseGeneratorConfig$
 defaultB
@@ -3053,30 +3053,53 @@
      return 
-this.d
+(BlockState) this.shadow$getD
 efaultBlock(
@@ -3109,33 +3109,32 @@
     %7D%0A%0A    @
-Intrinsic
+Override
 %0A    public 
@@ -3144,37 +3144,16 @@
 ckState 
-noiseGeneratorConfig$
 defaultF
@@ -3180,14 +3180,37 @@
 urn 
-this.d
+(BlockState) this.shadow$getD
 efau

fix DimensionSettingsMixin_API