Search in sources :

Example 1 with CreativeMotorTileEntity

use of com.simibubi.create.content.contraptions.components.motor.CreativeMotorTileEntity in project Create by Creators-of-Create.

the class SpeedControllerTileEntity method addBehaviours.

@Override
public void addBehaviours(List<TileEntityBehaviour> behaviours) {
    super.addBehaviours(behaviours);
    Integer max = AllConfigs.SERVER.kinetics.maxRotationSpeed.get();
    targetSpeed = new ScrollValueBehaviour(Lang.translate("generic.speed"), this, new ControllerValueBoxTransform());
    targetSpeed.between(-max, max);
    targetSpeed.value = DEFAULT_SPEED;
    targetSpeed.moveText(new Vec3(9, 0, 10));
    targetSpeed.withUnit(i -> Lang.translate("generic.unit.rpm"));
    targetSpeed.withCallback(i -> this.updateTargetRotation());
    targetSpeed.withStepFunction(CreativeMotorTileEntity::step);
    behaviours.add(targetSpeed);
}
Also used : Vec3(net.minecraft.world.phys.Vec3) CreativeMotorTileEntity(com.simibubi.create.content.contraptions.components.motor.CreativeMotorTileEntity) ScrollValueBehaviour(com.simibubi.create.foundation.tileEntity.behaviour.scrollvalue.ScrollValueBehaviour)

Aggregations

CreativeMotorTileEntity (com.simibubi.create.content.contraptions.components.motor.CreativeMotorTileEntity)1 ScrollValueBehaviour (com.simibubi.create.foundation.tileEntity.behaviour.scrollvalue.ScrollValueBehaviour)1 Vec3 (net.minecraft.world.phys.Vec3)1