#Adding a new rail block

1 messages · Page 1 of 1 (latest)

west hinge
#

I want to add a type of powered rail that has a direction, relative of the rail's shape. This would allow for propelling stationary minecarts and more strict railway systems. Currently, I have added the block, and minecarts can travel on it, but it does not propel the rail like a powered rail block.

class DirectionalPoweredRailBlock(properties: Properties) : PoweredRailBlock(properties) {
    companion object {
        val FORWARD: BooleanProperty = BooleanProperty.create("forward")
    }

    init {
        this.registerDefaultState(this.defaultBlockState().setValue(FORWARD, true))
    }

    override fun createBlockStateDefinition(builder: StateDefinition.Builder<Block, BlockState>) {
        super.createBlockStateDefinition(builder)
        builder.add(FORWARD)
    }
}
west hinge
#

bump

willow jay
#

you have to mixin into the minecart controller

#

twice probably, once the normal one and then the experimental one

west hinge
#

the movement method in the minecart behaviour is massive