Skip to content

Commit 680826e

Browse files
committed
Merge branch '2.x-buildscript' into 2.x
Signed-off-by: Sychic <[email protected]>
2 parents f3dce22 + 01e757e commit 680826e

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

mod/src/main/kotlin/gg/skytils/skytilsmod/utils/RenderUtil.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ object RenderUtil {
250250
shadow: Boolean = true, scale: Float = 1f, background: Boolean = true
251251
) {
252252
matrixStack.push()
253-
DrawHelper.setupCameraTransformations(matrixStack)
253+
DrawHelper.cameraOffset(matrixStack)
254254
DrawHelper.drawNametag(matrixStack, str, x, y, z, shadow, scale, background)
255255
matrixStack.pop()
256256
}

mod/src/main/kotlin/gg/skytils/skytilsmod/utils/rendering/DrawHelper.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,10 @@ object DrawHelper {
189189
buffer.pos(matrices, x2, y, 0.0).tex(u2, v1).color(color).endVertex()
190190
}
191191

192+
/**
193+
* Draws a nametag at the given position.
194+
* This method will apply the camera rotation for you, but not the camera offset.
195+
*/
192196
fun drawNametag(matrices: UMatrixStack, text: String, x: Double, y: Double, z: Double, shadow: Boolean = true, scale: Float = 1f, background: Boolean = true, throughWalls: Boolean = false) {
193197
matrices.push()
194198
matrices.translate(x, y + 0.5, z)

0 commit comments

Comments
 (0)