Move block entity renderers to their subpackage
This commit is contained in:
parent
011fb340c0
commit
7b45fe3903
@ -1,4 +1,4 @@
|
|||||||
package ru.dbotthepony.mc.otm.client.render
|
package ru.dbotthepony.mc.otm.client.render.blockentity
|
||||||
|
|
||||||
import com.mojang.blaze3d.systems.RenderSystem
|
import com.mojang.blaze3d.systems.RenderSystem
|
||||||
import com.mojang.blaze3d.vertex.*
|
import com.mojang.blaze3d.vertex.*
|
||||||
@ -15,6 +15,7 @@ import ru.dbotthepony.mc.otm.TranslatableComponent
|
|||||||
import ru.dbotthepony.mc.otm.block.entity.GravitationStabilizerBlockEntity
|
import ru.dbotthepony.mc.otm.block.entity.GravitationStabilizerBlockEntity
|
||||||
import ru.dbotthepony.mc.otm.block.entity.blackhole.BlackHoleBlockEntity
|
import ru.dbotthepony.mc.otm.block.entity.blackhole.BlackHoleBlockEntity
|
||||||
import ru.dbotthepony.mc.otm.capability.android
|
import ru.dbotthepony.mc.otm.capability.android
|
||||||
|
import ru.dbotthepony.mc.otm.client.render.*
|
||||||
import ru.dbotthepony.mc.otm.core.*
|
import ru.dbotthepony.mc.otm.core.*
|
||||||
import ru.dbotthepony.mc.otm.registry.MItems
|
import ru.dbotthepony.mc.otm.registry.MItems
|
||||||
import kotlin.math.PI
|
import kotlin.math.PI
|
@ -1,4 +1,4 @@
|
|||||||
package ru.dbotthepony.mc.otm.client.render
|
package ru.dbotthepony.mc.otm.client.render.blockentity
|
||||||
|
|
||||||
import com.mojang.blaze3d.vertex.PoseStack
|
import com.mojang.blaze3d.vertex.PoseStack
|
||||||
import net.minecraft.client.Minecraft
|
import net.minecraft.client.Minecraft
|
||||||
@ -9,6 +9,7 @@ import net.minecraft.core.Direction
|
|||||||
import ru.dbotthepony.mc.otm.TranslatableComponent
|
import ru.dbotthepony.mc.otm.TranslatableComponent
|
||||||
import ru.dbotthepony.mc.otm.block.EnergyCounterBlock
|
import ru.dbotthepony.mc.otm.block.EnergyCounterBlock
|
||||||
import ru.dbotthepony.mc.otm.block.entity.EnergyCounterBlockEntity
|
import ru.dbotthepony.mc.otm.block.entity.EnergyCounterBlockEntity
|
||||||
|
import ru.dbotthepony.mc.otm.client.render.*
|
||||||
import ru.dbotthepony.mc.otm.core.RGBAColor
|
import ru.dbotthepony.mc.otm.core.RGBAColor
|
||||||
import ru.dbotthepony.mc.otm.core.asAngle
|
import ru.dbotthepony.mc.otm.core.asAngle
|
||||||
import ru.dbotthepony.mc.otm.core.formatPower
|
import ru.dbotthepony.mc.otm.core.formatPower
|
||||||
@ -53,13 +54,15 @@ class EnergyCounterRenderer(private val context: BlockEntityRendererProvider.Con
|
|||||||
poseStack.pushPose()
|
poseStack.pushPose()
|
||||||
poseStack.translate(-0.1, -0.1, -0.1)
|
poseStack.translate(-0.1, -0.1, -0.1)
|
||||||
font.drawAligned(poseStack, tile.lastTick.toString(0), TextAlign.CENTER_RIGHT, finalX.toFloat(), y, RGBAColor.WHITE)
|
font.drawAligned(poseStack, tile.lastTick.toString(0), TextAlign.CENTER_RIGHT, finalX.toFloat(), y, RGBAColor.WHITE)
|
||||||
font.drawAligned(poseStack, tile.sumHistory(20).toString(0), TextAlign.CENTER_RIGHT, finalX.toFloat(), y + font.lineHeight, RGBAColor.WHITE)
|
font.drawAligned(poseStack, tile.sumHistory(20).toString(0),
|
||||||
|
TextAlign.CENTER_RIGHT, finalX.toFloat(), y + font.lineHeight, RGBAColor.WHITE)
|
||||||
poseStack.popPose()
|
poseStack.popPose()
|
||||||
|
|
||||||
y += font.lineHeight * 3
|
y += font.lineHeight * 3
|
||||||
|
|
||||||
font.drawAligned(poseStack, TOTAL, TextAlign.CENTER_CENTER, 0f, y, RGBAColor.WHITE)
|
font.drawAligned(poseStack, TOTAL, TextAlign.CENTER_CENTER, 0f, y, RGBAColor.WHITE)
|
||||||
font.drawAligned(poseStack, tile.passed.formatPower(), TextAlign.CENTER_CENTER, 0f, y + font.lineHeight, RGBAColor.WHITE)
|
font.drawAligned(poseStack, tile.passed.formatPower(),
|
||||||
|
TextAlign.CENTER_CENTER, 0f, y + font.lineHeight, RGBAColor.WHITE)
|
||||||
|
|
||||||
poseStack.popPose()
|
poseStack.popPose()
|
||||||
}
|
}
|
@ -1,4 +1,4 @@
|
|||||||
package ru.dbotthepony.mc.otm.client.render
|
package ru.dbotthepony.mc.otm.client.render.blockentity
|
||||||
|
|
||||||
import com.mojang.blaze3d.vertex.*
|
import com.mojang.blaze3d.vertex.*
|
||||||
import com.mojang.math.Matrix4f
|
import com.mojang.math.Matrix4f
|
||||||
@ -16,6 +16,7 @@ import ru.dbotthepony.mc.otm.block.RotatableMatteryBlock
|
|||||||
import ru.dbotthepony.mc.otm.block.entity.GravitationStabilizerBlockEntity
|
import ru.dbotthepony.mc.otm.block.entity.GravitationStabilizerBlockEntity
|
||||||
import ru.dbotthepony.mc.otm.block.entity.blackhole.BlackHoleBlockEntity
|
import ru.dbotthepony.mc.otm.block.entity.blackhole.BlackHoleBlockEntity
|
||||||
import ru.dbotthepony.mc.otm.block.entity.worker.WorkerState
|
import ru.dbotthepony.mc.otm.block.entity.worker.WorkerState
|
||||||
|
import ru.dbotthepony.mc.otm.client.render.*
|
||||||
import ru.dbotthepony.mc.otm.core.*
|
import ru.dbotthepony.mc.otm.core.*
|
||||||
import kotlin.math.PI
|
import kotlin.math.PI
|
||||||
|
|
||||||
@ -143,8 +144,10 @@ class GravitationStabilizerRenderer(private val context: BlockEntityRendererProv
|
|||||||
poseStack.scale(0.01f, 0.01f, 0.01f)
|
poseStack.scale(0.01f, 0.01f, 0.01f)
|
||||||
|
|
||||||
val font = Minecraft.getInstance().font
|
val font = Minecraft.getInstance().font
|
||||||
font.drawAligned(poseStack, TranslatableComponent("otm.3d2d.gravitation_stabilizer.mass", bhTile.mass.formatMatter()), TextAlign.TOP_CENTER, 0f, -font.lineHeight.toFloat() / 2f, 0xFFFFFF)
|
font.drawAligned(poseStack, TranslatableComponent("otm.3d2d.gravitation_stabilizer.mass", bhTile.mass.formatMatter()),
|
||||||
font.drawAligned(poseStack, TranslatableComponent("otm.3d2d.gravitation_stabilizer.strength", "%.2f".format(bhTile.gravitationStrength)), TextAlign.TOP_CENTER, 0f, font.lineHeight.toFloat() / 2f, 0xFFFFFF)
|
TextAlign.TOP_CENTER, 0f, -font.lineHeight.toFloat() / 2f, 0xFFFFFF)
|
||||||
|
font.drawAligned(poseStack, TranslatableComponent("otm.3d2d.gravitation_stabilizer.strength", "%.2f".format(bhTile.gravitationStrength)),
|
||||||
|
TextAlign.TOP_CENTER, 0f, font.lineHeight.toFloat() / 2f, 0xFFFFFF)
|
||||||
|
|
||||||
poseStack.popPose()
|
poseStack.popPose()
|
||||||
}
|
}
|
@ -14,7 +14,7 @@ import ru.dbotthepony.mc.otm.block.entity.blackhole.BlockEntitySphereDebugger
|
|||||||
import ru.dbotthepony.mc.otm.block.entity.matter.*
|
import ru.dbotthepony.mc.otm.block.entity.matter.*
|
||||||
import ru.dbotthepony.mc.otm.block.entity.storage.*
|
import ru.dbotthepony.mc.otm.block.entity.storage.*
|
||||||
import ru.dbotthepony.mc.otm.client.render.BlackHoleRenderer
|
import ru.dbotthepony.mc.otm.client.render.BlackHoleRenderer
|
||||||
import ru.dbotthepony.mc.otm.client.render.EnergyCounterRenderer
|
import ru.dbotthepony.mc.otm.client.render.blockentity.EnergyCounterRenderer
|
||||||
import ru.dbotthepony.mc.otm.client.render.GravitationStabilizerRenderer
|
import ru.dbotthepony.mc.otm.client.render.GravitationStabilizerRenderer
|
||||||
|
|
||||||
object MBlockEntities {
|
object MBlockEntities {
|
||||||
|
Loading…
Reference in New Issue
Block a user