Finally, ocean liquids

This commit is contained in:
DBotThePony 2024-04-25 23:44:41 +07:00
parent 7efa39bb47
commit 2e5214ef12
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -630,12 +630,13 @@ class ServerChunk(world: ServerWorld, pos: ChunkPos) : Chunk<ServerWorld, Server
if (!state.foreground.material.isEmptyTile) {
state.liquid.reset()
} else if (y < info.oceanLiquidLevel && info.oceanLiquid.isPresent && !info.oceanLiquid.value!!.isMeta) {
val pressure = (info.oceanLiquidLevel - y).toFloat()
} else if (y + pos.tileY < info.oceanLiquidLevel && info.oceanLiquid.isPresent && !info.oceanLiquid.value!!.isMeta) {
val pressure = (info.oceanLiquidLevel - y - pos.tileY).toFloat()
if (state.background.material.isEmptyTile) {
state.liquid.pressure = pressure
state.liquid.isInfinite = true
state.liquid.level = 1f
state.liquid.state = info.oceanLiquid.entry!!
} else if (info.encloseLiquids) {
state.liquid.pressure = pressure