package net.minecraft.client.renderer.block; import net.fabricmc.fabric.api.client.rendering.v1.FabricRenderState; import net.minecraft.core.BlockPos; import net.minecraft.core.Holder; import net.minecraft.world.level.CardinalLighting; import net.minecraft.world.level.ColorResolver; import net.minecraft.world.level.biome.Biome; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.lighting.LevelLightEngine; import net.minecraft.world.level.material.FluidState; import org.jspecify.annotations.Nullable; public class MovingBlockRenderState implements BlockAndTintGetter, FabricRenderState { public BlockPos randomSeedPos = BlockPos.ZERO; public BlockPos blockPos = BlockPos.ZERO; public BlockState blockState = Blocks.AIR.defaultBlockState(); @Nullable public Holder biome; public CardinalLighting cardinalLighting = CardinalLighting.DEFAULT; public LevelLightEngine lightEngine = LevelLightEngine.EMPTY; @Override public CardinalLighting cardinalLighting() { return this.cardinalLighting; } public LevelLightEngine getLightEngine() { return this.lightEngine; } @Override public int getBlockTint(final BlockPos pos, final ColorResolver color) { return this.biome == null ? -1 : color.getColor((Biome)this.biome.value(), pos.getX(), pos.getZ()); } @Nullable public BlockEntity getBlockEntity(final BlockPos pos) { return null; } public BlockState getBlockState(final BlockPos pos) { return pos.equals(this.blockPos) ? this.blockState : Blocks.AIR.defaultBlockState(); } public FluidState getFluidState(final BlockPos pos) { return this.getBlockState(pos).getFluidState(); } public int getHeight() { return 1; } public int getMinY() { return this.blockPos.getY(); } }