Mark star chair as having description
This commit is contained in:
parent
f922df53be
commit
1a50ecd6af
@ -12,6 +12,7 @@ import net.minecraft.world.phys.BlockHitResult
|
|||||||
import net.minecraft.world.phys.shapes.CollisionContext
|
import net.minecraft.world.phys.shapes.CollisionContext
|
||||||
import net.minecraft.world.phys.shapes.VoxelShape
|
import net.minecraft.world.phys.shapes.VoxelShape
|
||||||
import ru.dbotthepony.mc.otm.block.RotatableMatteryBlock
|
import ru.dbotthepony.mc.otm.block.RotatableMatteryBlock
|
||||||
|
import ru.dbotthepony.mc.otm.block.addSimpleDescription
|
||||||
import ru.dbotthepony.mc.otm.block.getShapeForEachState
|
import ru.dbotthepony.mc.otm.block.getShapeForEachState
|
||||||
import ru.dbotthepony.mc.otm.core.AABB
|
import ru.dbotthepony.mc.otm.core.AABB
|
||||||
import ru.dbotthepony.mc.otm.core.get
|
import ru.dbotthepony.mc.otm.core.get
|
||||||
@ -23,6 +24,10 @@ import ru.dbotthepony.mc.otm.shapes.BlockShapes
|
|||||||
class StarChairBlock(val color: DyeColor?) : RotatableMatteryBlock(DEFAULT_PROPERTIES.mapColor(color?.mapColor ?: MapColor.COLOR_LIGHT_BLUE)) {
|
class StarChairBlock(val color: DyeColor?) : RotatableMatteryBlock(DEFAULT_PROPERTIES.mapColor(color?.mapColor ?: MapColor.COLOR_LIGHT_BLUE)) {
|
||||||
override fun rotationFreedom(): BlockRotationFreedom = BlockRotationFreedom.HORIZONTAL
|
override fun rotationFreedom(): BlockRotationFreedom = BlockRotationFreedom.HORIZONTAL
|
||||||
|
|
||||||
|
init {
|
||||||
|
addSimpleDescription()
|
||||||
|
}
|
||||||
|
|
||||||
private val shapes = getShapeForEachState(rotationProperty) { BlockShapes.STAR_CHAIR.rotateFromNorth(it[rotationProperty]).computeShape() }
|
private val shapes = getShapeForEachState(rotationProperty) { BlockShapes.STAR_CHAIR.rotateFromNorth(it[rotationProperty]).computeShape() }
|
||||||
override fun getShape(state: BlockState, blockGetter: BlockGetter, pos: BlockPos, context: CollisionContext): VoxelShape = shapes[state]!!
|
override fun getShape(state: BlockState, blockGetter: BlockGetter, pos: BlockPos, context: CollisionContext): VoxelShape = shapes[state]!!
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user