aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/moe/nea/notenoughupdates/util/render
diff options
context:
space:
mode:
authornea <nea@nea.moe>2023-05-07 12:22:36 +0200
committernea <nea@nea.moe>2023-05-08 00:17:34 +0200
commit942dd629efbf12183b1c5f5a966c36d4b0647a6b (patch)
tree407e8d2cdcfefa77673c768e5126857a86ddb89a /src/main/kotlin/moe/nea/notenoughupdates/util/render
parent229f724ef4a0a4cbc426f31e27f9a57e9b1307c9 (diff)
downloadfirmament-942dd629efbf12183b1c5f5a966c36d4b0647a6b.tar.gz
firmament-942dd629efbf12183b1c5f5a966c36d4b0647a6b.tar.bz2
firmament-942dd629efbf12183b1c5f5a966c36d4b0647a6b.zip
Add fishing particle highlighter
Currently does not work when sneaking or when the bobber moves too much, since the position desyncs with the server
Diffstat (limited to 'src/main/kotlin/moe/nea/notenoughupdates/util/render')
-rw-r--r--src/main/kotlin/moe/nea/notenoughupdates/util/render/block.kt13
1 files changed, 12 insertions, 1 deletions
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 5fc70ef..0d6c63b 100644
--- a/src/main/kotlin/moe/nea/notenoughupdates/util/render/block.kt
+++ b/src/main/kotlin/moe/nea/notenoughupdates/util/render/block.kt
@@ -11,6 +11,7 @@ import net.minecraft.client.render.VertexFormat
import net.minecraft.client.render.VertexFormats
import net.minecraft.client.util.math.MatrixStack
import net.minecraft.util.math.BlockPos
+import net.minecraft.util.math.Vec3d
class RenderBlockContext private constructor(private val tesselator: Tessellator, private val matrixStack: MatrixStack) {
private val buffer = tesselator.buffer
@@ -21,7 +22,16 @@ class RenderBlockContext private constructor(private val tesselator: Tessellator
fun block(blockPos: BlockPos) {
matrixStack.push()
matrixStack.translate(blockPos.x.toFloat(), blockPos.y.toFloat(), blockPos.z.toFloat())
- RenderSystem.setShader(GameRenderer::getPositionColorProgram)
+ buildCube(matrixStack.peek().positionMatrix, buffer)
+ tesselator.draw()
+ matrixStack.pop()
+ }
+
+ fun tinyBlock(vec3d: Vec3d, size: Float) {
+ matrixStack.push()
+ matrixStack.translate(vec3d.x, vec3d.y, vec3d.z)
+ matrixStack.scale(size, size, size)
+ matrixStack.translate(-.5, -.5, -.5)
buildCube(matrixStack.peek().positionMatrix, buffer)
tesselator.draw()
matrixStack.pop()
@@ -74,6 +84,7 @@ class RenderBlockContext private constructor(private val tesselator: Tessellator
RenderSystem.disableDepthTest()
RenderSystem.enableBlend()
RenderSystem.defaultBlendFunc()
+ RenderSystem.setShader(GameRenderer::getPositionColorProgram)
matrices.push()
matrices.translate(-camera.pos.x, -camera.pos.y, -camera.pos.z)