This commit is contained in:
DBotThePony 2024-01-05 22:14:21 +07:00
commit 8f8fd8c8de
Signed by: DBot
GPG Key ID: DCC23B5715498507
2 changed files with 9 additions and 4 deletions

View File

@ -8,6 +8,8 @@ import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider
import ru.dbotthepony.mc.otm.block.entity.tech.AbstractPoweredFurnaceBlockEntity
import ru.dbotthepony.mc.otm.core.math.normalizeAngle
import ru.dbotthepony.mc.otm.core.math.rotateY
import ru.dbotthepony.mc.otm.core.math.yRotationNorth
import ru.dbotthepony.mc.otm.core.math.yRotationSouth
class PoweredSmokerRenderer(private val context: BlockEntityRendererProvider.Context) : BlockEntityRenderer<AbstractPoweredFurnaceBlockEntity<*, *>> {
override fun render(tile: AbstractPoweredFurnaceBlockEntity<*, *>, partialTick: Float, pose: PoseStack, buffers: MultiBufferSource, packedLight: Int, packedOverlay: Int) {
@ -19,6 +21,9 @@ class PoweredSmokerRenderer(private val context: BlockEntityRendererProvider.Con
slot.visualRotation = normalizeAngle(slot.visualRotation + diff / 400_000_000f)
pose.pushPose()
pose.translate(0.5f, 0.5f, 0.5f)
pose.rotateY(tile.blockRotation.front.yRotationNorth())
pose.translate(-0.5f, -0.5f, -0.5f)
pose.translate(0.625f, 0.5f, 0.5f)
pose.scale(0.25f, 0.25f, 0.25f)

View File

@ -679,8 +679,8 @@ fun Direction.yRotationNorth(): Float {
return when (this) {
Direction.DOWN, Direction.UP, Direction.NORTH -> 0f
Direction.SOUTH -> PIf
Direction.WEST -> -PIf / 2f
Direction.EAST -> PIf / 2f
Direction.WEST -> PIf / 2f
Direction.EAST -> -PIf / 2f
}
}
@ -688,8 +688,8 @@ fun Direction.yRotationSouth(): Float {
return when (this) {
Direction.DOWN, Direction.UP, Direction.SOUTH -> 0f
Direction.NORTH -> PIf
Direction.WEST -> PIf / 2f
Direction.EAST -> -PIf / 2f
Direction.WEST -> -PIf / 2f
Direction.EAST -> PIf / 2f
}
}