package net.minecraft.world.level.dimension;

import net.minecraft.world.level.border.WorldBorder;
import javax.annotation.Nullable;
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.ChunkPos;
import net.minecraft.world.level.biome.BiomeSource;
import net.minecraft.world.level.biome.Biomes;
import net.minecraft.world.level.biome.FixedBiomeSourceSettings;
import net.minecraft.world.level.biome.BiomeSourceType;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.chunk.ChunkGeneratorType;
import net.minecraft.world.level.levelgen.NetherGeneratorSettings;
import net.minecraft.world.level.chunk.ChunkGenerator;
import net.minecraft.world.level.Level;
import net.minecraft.world.phys.Vec3;

public class NetherDimension extends Dimension {
    private static final Vec3 NETHER_FOG_COLOR;
    
    public NetherDimension(final Level bjw, final DimensionType cbi) {
        super(bjw, cbi, 0.1f);
        this.ultraWarm = true;
        this.hasCeiling = true;
    }
    
    @Override
    public Vec3 getFogColor(final float float1, final float float2) {
        return NetherDimension.NETHER_FOG_COLOR;
    }
    
    @Override
    public ChunkGenerator<?> createRandomLevelGenerator() {
        final NetherGeneratorSettings cbw2 = ChunkGeneratorType.CAVES.createSettings();
        cbw2.setDefaultBlock(Blocks.NETHERRACK.defaultBlockState());
        cbw2.setDefaultFluid(Blocks.LAVA.defaultBlockState());
        return ChunkGeneratorType.CAVES.create(this.level, BiomeSourceType.FIXED.create(BiomeSourceType.FIXED.createSettings(this.level.getLevelData()).setBiome(Biomes.NETHER)), cbw2);
    }
    
    @Override
    public boolean isNaturalDimension() {
        return false;
    }
    
    @Nullable
    @Override
    public BlockPos getSpawnPosInChunk(final ChunkPos bjh, final boolean boolean2) {
        return null;
    }
    
    @Nullable
    @Override
    public BlockPos getValidSpawnPosition(final int integer1, final int integer2, final boolean boolean3) {
        return null;
    }
    
    @Override
    public float getTimeOfDay(final long long1, final float float2) {
        return 0.5f;
    }
    
    @Override
    public boolean mayRespawn() {
        return false;
    }
    
    @Override
    public boolean isFoggyAt(final int integer1, final int integer2) {
        return true;
    }
    
    @Override
    public WorldBorder createWorldBorder() {
        return new WorldBorder() {
            @Override
            public double getCenterX() {
                return super.getCenterX() / 8.0;
            }
            
            @Override
            public double getCenterZ() {
                return super.getCenterZ() / 8.0;
            }
        };
    }
    
    @Override
    public DimensionType getType() {
        return DimensionType.NETHER;
    }
    
    static {
        NETHER_FOG_COLOR = new Vec3(0.20000000298023224, 0.029999999329447746, 0.029999999329447746);
    }
}
