Search in sources :

Example 36 with ChunkSection

use of net.minecraft.world.chunk.ChunkSection in project lithium-fabric by CaffeineMC.

the class WorldChunkMixin method getFluidState.

/**
 * @reason Reduce method size to help the JVM inline
 * @author JellySquid, Maity
 */
@Overwrite
public FluidState getFluidState(int x, int y, int z) {
    int chunkY = this.getSectionIndex(y);
    ChunkSection[] sectionArray = this.getSectionArray();
    if (chunkY >= 0 && chunkY < sectionArray.length) {
        ChunkSection section = sectionArray[chunkY];
        return section.getFluidState(x & 15, y & 15, z & 15);
    }
    return DEFAULT_FLUID_STATE;
}
Also used : ChunkSection(net.minecraft.world.chunk.ChunkSection) Overwrite(org.spongepowered.asm.mixin.Overwrite)

Aggregations

ChunkSection (net.minecraft.world.chunk.ChunkSection)36 Chunk (net.minecraft.world.chunk.Chunk)11 BlockState (net.minecraft.block.BlockState)10 BlockPos (net.minecraft.util.math.BlockPos)8 Overwrite (org.spongepowered.asm.mixin.Overwrite)8 WorldChunk (net.minecraft.world.chunk.WorldChunk)5 Inject (org.spongepowered.asm.mixin.injection.Inject)5 TileEntity (net.minecraft.tileentity.TileEntity)3 BiomeContainer (net.minecraft.world.biome.BiomeContainer)3 ArrayList (java.util.ArrayList)2 Block (net.minecraft.block.Block)2 ITileEntityProvider (net.minecraft.block.ITileEntityProvider)2 PathNodeType (net.minecraft.entity.ai.pathing.PathNodeType)2 FluidState (net.minecraft.fluid.FluidState)2 CompoundNBT (net.minecraft.nbt.CompoundNBT)2 NBTUtil (net.minecraft.nbt.NBTUtil)2 ServerPlayerEntity (net.minecraft.server.network.ServerPlayerEntity)2 ChunkPos (net.minecraft.util.math.ChunkPos)2 PalettedContainer (net.minecraft.util.palette.PalettedContainer)2 CollisionView (net.minecraft.world.CollisionView)2