diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityGravitationStabilizer.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityGravitationStabilizer.kt index a02b9577a..3e33669c4 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityGravitationStabilizer.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityGravitationStabilizer.kt @@ -8,11 +8,13 @@ import net.minecraft.world.entity.player.Player import net.minecraft.world.level.Level import net.minecraft.world.level.block.Block import net.minecraft.world.level.block.state.BlockState +import net.minecraft.world.phys.AABB import ru.dbotthepony.mc.otm.OverdriveThatMatters import ru.dbotthepony.mc.otm.Registry import ru.dbotthepony.mc.otm.block.BlockMatteryRotatable import ru.dbotthepony.mc.otm.block.entity.blackhole.BlockEntityBlackHole import ru.dbotthepony.mc.otm.block.entity.worker.WorkerState +import ru.dbotthepony.mc.otm.core.minus import ru.dbotthepony.mc.otm.core.plus import ru.dbotthepony.mc.otm.core.times @@ -62,7 +64,12 @@ class BlockEntityGravitationStabilizer(p_155229_: BlockPos, p_155230_: BlockStat blackHole?.stabilizerDetached(this) } + override fun getRenderBoundingBox(): AABB { + return AABB(blockPos.offset(-RANGE, -RANGE, -RANGE), blockPos.offset(RANGE, RANGE, RANGE)) + } + companion object { + private val minBBox = BlockPos(1, 1, 1) const val RANGE = 64 private val NAME = TranslatableComponent("block.overdrive_that_matters.gravitation_stabilizer") } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/blackhole/BlockEntityBlackHole.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/blackhole/BlockEntityBlackHole.kt index 7f5fd9634..0a9375fac 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/blackhole/BlockEntityBlackHole.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/blackhole/BlockEntityBlackHole.kt @@ -75,6 +75,10 @@ class BlockEntityBlackHole(p_155229_: BlockPos, p_155230_: BlockState) : BlockEn affectedBoundsAABB = AABB.of(affectedBounds) } + override fun getRenderBoundingBox(): AABB { + return AABB(blockPos.offset(-BlockEntityGravitationStabilizer.RANGE, -BlockEntityGravitationStabilizer.RANGE, -BlockEntityGravitationStabilizer.RANGE), blockPos.offset(BlockEntityGravitationStabilizer.RANGE, BlockEntityGravitationStabilizer.RANGE, BlockEntityGravitationStabilizer.RANGE)) + } + var gravitationStrength = 1.0 private set diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/GravitationStabilizerRenderer.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/GravitationStabilizerRenderer.kt index b6a1db565..847240c06 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/GravitationStabilizerRenderer.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/GravitationStabilizerRenderer.kt @@ -84,6 +84,7 @@ class GravitationStabilizerRenderer(private val context: BlockEntityRendererProv } override fun shouldRenderOffScreen(p_112306_: BlockEntityGravitationStabilizer) = true + override fun getViewDistance() = 96 companion object { private val OUTER_COLOR = RGBAColor(140, 140, 255, 110)