diff options
author | nea <nea@nea.moe> | 2023-05-03 20:02:10 +0200 |
---|---|---|
committer | nea <nea@nea.moe> | 2023-05-03 20:02:10 +0200 |
commit | e9f9ad1ac087066c1e597054fafc55e95f2ccb1e (patch) | |
tree | 2e17d890a4bf661e83ee262245c8af3c4222eb2b /src/main/kotlin/moe/nea/notenoughupdates/util | |
parent | f844feba1b874a946f020574fee06c5926d042f8 (diff) | |
download | firmament-e9f9ad1ac087066c1e597054fafc55e95f2ccb1e.tar.gz firmament-e9f9ad1ac087066c1e597054fafc55e95f2ccb1e.tar.bz2 firmament-e9f9ad1ac087066c1e597054fafc55e95f2ccb1e.zip |
Fix color not being reset after block highlights
Diffstat (limited to 'src/main/kotlin/moe/nea/notenoughupdates/util')
-rw-r--r-- | src/main/kotlin/moe/nea/notenoughupdates/util/MC.kt | 5 | ||||
-rw-r--r-- | src/main/kotlin/moe/nea/notenoughupdates/util/render/block.kt | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/main/kotlin/moe/nea/notenoughupdates/util/MC.kt b/src/main/kotlin/moe/nea/notenoughupdates/util/MC.kt index da06c68..36aa726 100644 --- a/src/main/kotlin/moe/nea/notenoughupdates/util/MC.kt +++ b/src/main/kotlin/moe/nea/notenoughupdates/util/MC.kt @@ -1,7 +1,12 @@ package moe.nea.notenoughupdates.util +import io.github.moulberry.repo.data.Coordinate import net.minecraft.client.MinecraftClient +import net.minecraft.util.math.BlockPos object MC { inline val player get() = MinecraftClient.getInstance().player } + +val Coordinate.blockPos: BlockPos + get() = BlockPos(x, y, z) diff --git a/src/main/kotlin/moe/nea/notenoughupdates/util/render/block.kt b/src/main/kotlin/moe/nea/notenoughupdates/util/render/block.kt index 487a264..5fc70ef 100644 --- a/src/main/kotlin/moe/nea/notenoughupdates/util/render/block.kt +++ b/src/main/kotlin/moe/nea/notenoughupdates/util/render/block.kt @@ -12,7 +12,7 @@ import net.minecraft.client.render.VertexFormats import net.minecraft.client.util.math.MatrixStack import net.minecraft.util.math.BlockPos -class RenderBlockContext(private val tesselator: Tessellator, private val matrixStack: MatrixStack) { +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) @@ -83,6 +83,7 @@ class RenderBlockContext(private val tesselator: Tessellator, private val matrix matrices.pop() + RenderSystem.setShaderColor(1F,1F,1F,1F) VertexBuffer.unbind() RenderSystem.enableDepthTest() RenderSystem.disableBlend() |