not bad
This commit is contained in:
parent
7b284f3303
commit
d792063fd0
@ -19,7 +19,7 @@ class HoloSignRenderer(private val context: BlockEntityRendererProvider.Context)
|
|||||||
tile: HoloSignBlockEntity,
|
tile: HoloSignBlockEntity,
|
||||||
partialTick: Float,
|
partialTick: Float,
|
||||||
poseStack: PoseStack,
|
poseStack: PoseStack,
|
||||||
badSorse: MultiBufferSource,
|
bufferSource: MultiBufferSource,
|
||||||
p_112311_: Int,
|
p_112311_: Int,
|
||||||
p_112312_: Int
|
p_112312_: Int
|
||||||
) {
|
) {
|
||||||
@ -31,14 +31,12 @@ class HoloSignRenderer(private val context: BlockEntityRendererProvider.Context)
|
|||||||
poseStack.translate(0.5f, 0.5f, 0.5f)
|
poseStack.translate(0.5f, 0.5f, 0.5f)
|
||||||
poseStack.scale(0.01f, 0.01f, 0.01f)
|
poseStack.scale(0.01f, 0.01f, 0.01f)
|
||||||
|
|
||||||
val sorse = DynamicBufferSource.WORLD
|
|
||||||
|
|
||||||
val lines = tile.signText.split('\n')
|
val lines = tile.signText.split('\n')
|
||||||
val totalHeight = lines.size * font.lineHeight + (lines.size - 1) * 2f
|
val totalHeight = lines.size * font.lineHeight + (lines.size - 1) * 2f
|
||||||
var y = -totalHeight / 2f
|
var y = -totalHeight / 2f
|
||||||
|
|
||||||
for (line in lines) {
|
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
|
y += font.lineHeight + 2f
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user