package net.minecraft.world.level;

import net.minecraft.world.level.levelgen.Heightmap;
import net.minecraft.world.phys.shapes.VoxelShape;
import java.util.stream.Stream;
import java.util.function.Predicate;
import net.minecraft.world.phys.AABB;
import net.minecraft.world.entity.Entity;
import net.minecraft.core.particles.ParticleOptions;
import net.minecraft.sounds.SoundSource;
import net.minecraft.sounds.SoundEvent;
import javax.annotation.Nullable;
import net.minecraft.world.entity.player.Player;
import java.util.Random;
import net.minecraft.world.level.chunk.ChunkSource;
import net.minecraft.world.Difficulty;
import net.minecraft.world.DifficultyInstance;
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.storage.LevelData;
import net.minecraft.world.level.material.Fluid;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.dimension.DimensionType;

public interface LevelAccessor extends EntityGetter, LevelReader, LevelSimulatedRW {
    default float getMoonBrightness() {
        return DimensionType.MOON_BRIGHTNESS_PER_PHASE[this.dimensionType().moonPhase(this.getLevelData().getDayTime())];
    }
    
    default float getTimeOfDay(final float float1) {
        return this.dimensionType().timeOfDay(this.getLevelData().getDayTime());
    }
    
    default int getMoonPhase() {
        return this.dimensionType().moonPhase(this.getLevelData().getDayTime());
    }
    
    TickList<Block> getBlockTicks();
    
    TickList<Fluid> getLiquidTicks();
    
    Level getLevel();
    
    LevelData getLevelData();
    
    DifficultyInstance getCurrentDifficultyAt(final BlockPos fu);
    
    default Difficulty getDifficulty() {
        return this.getLevelData().getDifficulty();
    }
    
    ChunkSource getChunkSource();
    
    default boolean hasChunk(final int integer1, final int integer2) {
        return this.getChunkSource().hasChunk(integer1, integer2);
    }
    
    Random getRandom();
    
    default void blockUpdated(final BlockPos fu, final Block bvr) {
    }
    
    void playSound(@Nullable final Player bec, final BlockPos fu, final SoundEvent ack, final SoundSource acm, final float float5, final float float6);
    
    void addParticle(final ParticleOptions hf, final double double2, final double double3, final double double4, final double double5, final double double6, final double double7);
    
    void levelEvent(@Nullable final Player bec, final int integer2, final BlockPos fu, final int integer4);
    
    default int getHeight() {
        return this.dimensionType().logicalHeight();
    }
    
    default void levelEvent(final int integer1, final BlockPos fu, final int integer3) {
        this.levelEvent(null, integer1, fu, integer3);
    }
    
    default Stream<VoxelShape> getEntityCollisions(@Nullable final Entity aom, final AABB deg, final Predicate<Entity> predicate) {
        return super.getEntityCollisions(aom, deg, predicate);
    }
    
    default boolean isUnobstructed(@Nullable final Entity aom, final VoxelShape dfg) {
        return super.isUnobstructed(aom, dfg);
    }
    
    default BlockPos getHeightmapPos(final Heightmap.Types a, final BlockPos fu) {
        return super.getHeightmapPos(a, fu);
    }
}
