[WIP] algae, reeds, mycelium, coral working

+ lots of cleanup, reorganizing
This commit is contained in:
octarine-noise
2021-05-07 19:08:00 +02:00
parent f44d2a7a50
commit 7168caded1
29 changed files with 501 additions and 332 deletions

View File

@@ -7,6 +7,7 @@ import mods.betterfoliage.util.plus
import mods.betterfoliage.util.semiRandom
import net.minecraft.block.Block
import net.minecraft.block.BlockState
import net.minecraft.client.renderer.chunk.ChunkRenderCache
import net.minecraft.util.Direction
import net.minecraft.util.math.BlockPos
import net.minecraft.world.ILightReader
@@ -29,7 +30,9 @@ interface BlockCtx {
fun state(dir: Direction) = world.getBlockState(pos + dir.offset)
fun state(offset: Int3) = world.getBlockState(pos + offset)
val biome: Biome? get() = (world as? IWorldReader)?.getBiome(pos)
val biome: Biome? get() =
(world as? IWorldReader)?.getBiome(pos) ?:
(world as? ChunkRenderCache)?.world?.getBiome(pos)
val isNormalCube: Boolean get() = state.isNormalCube(world, pos)