move stuff around

This commit is contained in:
DBotThePony 2022-10-06 16:52:20 +07:00
parent b09ba07735
commit 4801ff01ad
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -1,3 +1,4 @@
package ru.dbotthepony.mc.otm.client.render.blockentity
import com.mojang.blaze3d.vertex.*
@ -20,17 +21,15 @@ import ru.dbotthepony.mc.otm.client.render.*
import ru.dbotthepony.mc.otm.core.*
import kotlin.math.PI
private val BEAM_RENDER_TYPE_INNER = RenderType.beaconBeam(BeaconRenderer.BEAM_LOCATION, false)
private val BEAM_RENDER_TYPE_OUTER = RenderType.beaconBeam(BeaconRenderer.BEAM_LOCATION, true)
@Suppress("PrivatePropertyName")
class GravitationStabilizerRenderer(private val context: BlockEntityRendererProvider.Context) : BlockEntityRenderer<GravitationStabilizerBlockEntity> {
override fun render(
tile: GravitationStabilizerBlockEntity,
p_112308_: Float,
partialTick: Float,
poseStack: PoseStack,
p_112310_: MultiBufferSource,
p_112311_: Int,
p_112312_: Int
bufferSource: MultiBufferSource,
packedLight: Int,
overlayLight: Int
) {
if (tile.blockState.getValue(WorkerState.SEMI_WORKER_STATE) != WorkerState.WORKING)
return
@ -101,7 +100,7 @@ class GravitationStabilizerRenderer(private val context: BlockEntityRendererProv
val halfStep = normal * 0.3
run {
val consumer = p_112310_.getBuffer(BEAM_RENDER_TYPE_INNER)
val consumer = bufferSource.getBuffer(BEAM_RENDER_TYPE_INNER)
poseStack.pushPose()
@ -117,7 +116,7 @@ class GravitationStabilizerRenderer(private val context: BlockEntityRendererProv
}
run {
val consumer = p_112310_.getBuffer(BEAM_RENDER_TYPE_OUTER)
val consumer = bufferSource.getBuffer(BEAM_RENDER_TYPE_OUTER)
poseStack.pushPose()
@ -157,6 +156,9 @@ class GravitationStabilizerRenderer(private val context: BlockEntityRendererProv
override fun getViewDistance() = 96
companion object {
private val BEAM_RENDER_TYPE_INNER = RenderType.beaconBeam(BeaconRenderer.BEAM_LOCATION, false)
private val BEAM_RENDER_TYPE_OUTER = RenderType.beaconBeam(BeaconRenderer.BEAM_LOCATION, true)
private val OUTER_COLOR_A = RGBAColor(37, 255, 129, 110)
private val OUTER_COLOR_B = RGBAColor(37, 255, 129, 110)
private val OUTER_COLOR_C = RGBAColor(37, 255, 129, 110)