Compare commits
2 Commits
aa9c6039dc
...
3624690456
Author | SHA1 | Date | |
---|---|---|---|
3624690456 | |||
d792063fd0 |
@ -19,7 +19,7 @@ class HoloSignRenderer(private val context: BlockEntityRendererProvider.Context)
|
||||
tile: HoloSignBlockEntity,
|
||||
partialTick: Float,
|
||||
poseStack: PoseStack,
|
||||
badSorse: MultiBufferSource,
|
||||
bufferSource: MultiBufferSource,
|
||||
p_112311_: Int,
|
||||
p_112312_: Int
|
||||
) {
|
||||
@ -31,14 +31,12 @@ class HoloSignRenderer(private val context: BlockEntityRendererProvider.Context)
|
||||
poseStack.translate(0.5f, 0.5f, 0.5f)
|
||||
poseStack.scale(0.01f, 0.01f, 0.01f)
|
||||
|
||||
val sorse = DynamicBufferSource.WORLD
|
||||
|
||||
val lines = tile.signText.split('\n')
|
||||
val totalHeight = lines.size * font.lineHeight + (lines.size - 1) * 2f
|
||||
var y = -totalHeight / 2f
|
||||
|
||||
for (line in lines) {
|
||||
font.draw(poseStack = poseStack, buffer = sorse, text = line, gravity = RenderGravity.TOP_CENTER, y = y, color = RGBAColor(tile.textRed, tile.textGreen, tile.textBlue, tile.textAlpha))
|
||||
font.draw(poseStack = poseStack, buffer = bufferSource, text = line, gravity = RenderGravity.TOP_CENTER, y = y, color = RGBAColor(tile.textRed, tile.textGreen, tile.textBlue, tile.textAlpha))
|
||||
y += font.lineHeight + 2f
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user