Fix bug in WFixedPanel and use WScrollPanel + WBox for config
This commit is contained in:
@@ -31,7 +31,9 @@ object MC {
|
||||
get() = MinecraftClient.getInstance().currentScreen
|
||||
set(value) = MinecraftClient.getInstance().setScreen(value)
|
||||
inline val handledScreen: HandledScreen<*>? get() = MinecraftClient.getInstance().currentScreen as? HandledScreen<*>
|
||||
inline val window get() = MinecraftClient.getInstance().window
|
||||
}
|
||||
|
||||
|
||||
val Coordinate.blockPos: BlockPos
|
||||
get() = BlockPos(x, y, z)
|
||||
|
||||
@@ -23,11 +23,18 @@ import kotlin.time.ExperimentalTime
|
||||
import kotlin.time.TimeSource
|
||||
|
||||
@OptIn(ExperimentalTime::class)
|
||||
class TimeMark private constructor(private val timeMark: TimeSource.Monotonic.ValueTimeMark?) {
|
||||
class TimeMark private constructor(private val timeMark: TimeSource.Monotonic.ValueTimeMark?) : Comparable<TimeMark> {
|
||||
fun passedTime() = timeMark?.elapsedNow() ?: Duration.INFINITE
|
||||
|
||||
companion object {
|
||||
fun now() = TimeMark(TimeSource.Monotonic.markNow())
|
||||
fun farPast() = TimeMark(null)
|
||||
}
|
||||
|
||||
override fun compareTo(other: TimeMark): Int {
|
||||
if (this.timeMark == other.timeMark) return 0
|
||||
if (this.timeMark == null) return -1
|
||||
if (other.timeMark == null) return -1
|
||||
return this.timeMark.compareTo(other.timeMark)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,9 @@ import net.minecraft.client.gl.VertexBuffer
|
||||
import net.minecraft.client.render.BufferBuilder
|
||||
import net.minecraft.client.render.Camera
|
||||
import net.minecraft.client.render.GameRenderer
|
||||
import net.minecraft.client.render.RenderLayer
|
||||
import net.minecraft.client.render.Tessellator
|
||||
import net.minecraft.client.render.VertexConsumerProvider
|
||||
import net.minecraft.client.render.VertexFormat
|
||||
import net.minecraft.client.render.VertexFormats
|
||||
import net.minecraft.client.util.math.MatrixStack
|
||||
@@ -33,6 +35,7 @@ import net.minecraft.util.math.Vec3d
|
||||
|
||||
class RenderBlockContext private constructor(private val tesselator: Tessellator, private val matrixStack: MatrixStack) {
|
||||
private val buffer = tesselator.buffer
|
||||
|
||||
fun color(red: Float, green: Float, blue: Float, alpha: Float) {
|
||||
RenderSystem.setShaderColor(red, green, blue, alpha)
|
||||
}
|
||||
@@ -55,6 +58,10 @@ class RenderBlockContext private constructor(private val tesselator: Tessellator
|
||||
matrixStack.pop()
|
||||
}
|
||||
|
||||
fun line(vararg points: Vec3d, size: Double = 2.0) {
|
||||
|
||||
}
|
||||
|
||||
companion object {
|
||||
private fun buildCube(matrix: Matrix4f, buf: BufferBuilder) {
|
||||
buf.begin(VertexFormat.DrawMode.TRIANGLES, VertexFormats.POSITION_COLOR)
|
||||
|
||||
Reference in New Issue
Block a user