mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-17 19:35:00 -04:00
world border: don't render if more than 1000 blocks away
This commit is contained in:
parent
a6347fe859
commit
304df9d189
@ -98,7 +98,7 @@ class BlockSectionDataProvider(
|
||||
return false
|
||||
}
|
||||
|
||||
private fun BlockState?.isSolid(): Boolean {
|
||||
private inline fun BlockState?.isSolid(): Boolean {
|
||||
if (this == null) {
|
||||
return false
|
||||
}
|
||||
|
@ -42,6 +42,8 @@ class WorldBorderRenderer(
|
||||
private val border = renderWindow.connection.world.border
|
||||
private lateinit var texture: AbstractTexture
|
||||
private var offsetReset = TimeUtil.millis
|
||||
override val skipTranslucent: Boolean
|
||||
get() = border.getDistanceTo(renderWindow.connection.player.position) > MAX_DISTANCE
|
||||
|
||||
override fun init(latch: CountUpAndDownLatch) {
|
||||
shader.load()
|
||||
@ -102,6 +104,7 @@ class WorldBorderRenderer(
|
||||
val SHRINKING_COLOR = "#FF3030".asColor()
|
||||
val STATIC_COLOR = "#20A0FF".asColor()
|
||||
const val ANIMATION_SPEED = 2000
|
||||
const val MAX_DISTANCE = 1000
|
||||
|
||||
private val TEXTURE = "minecraft:misc/forcefield".toResourceLocation().texture()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user