use of com.simibubi.create.foundation.tileEntity.behaviour.scrollvalue.ScrollValueBehaviour in project Create by Creators-of-Create.
the class CreativeMotorTileEntity method addBehaviours.
@Override
public void addBehaviours(List<TileEntityBehaviour> behaviours) {
super.addBehaviours(behaviours);
Integer max = AllConfigs.SERVER.kinetics.maxMotorSpeed.get();
CenteredSideValueBoxTransform slot = new CenteredSideValueBoxTransform((motor, side) -> motor.getValue(CreativeMotorBlock.FACING) == side.getOpposite());
generatedSpeed = new ScrollValueBehaviour(Lang.translate("generic.speed"), this, slot);
generatedSpeed.between(-max, max);
generatedSpeed.value = DEFAULT_SPEED;
generatedSpeed.scrollableValue = DEFAULT_SPEED;
generatedSpeed.withUnit(i -> Lang.translate("generic.unit.rpm"));
generatedSpeed.withCallback(i -> this.updateGeneratedRotation());
generatedSpeed.withStepFunction(CreativeMotorTileEntity::step);
behaviours.add(generatedSpeed);
}
use of com.simibubi.create.foundation.tileEntity.behaviour.scrollvalue.ScrollValueBehaviour 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);
}
use of com.simibubi.create.foundation.tileEntity.behaviour.scrollvalue.ScrollValueBehaviour in project Create by Creators-of-Create.
the class EjectorTileEntity method addBehaviours.
@Override
public void addBehaviours(List<TileEntityBehaviour> behaviours) {
super.addBehaviours(behaviours);
behaviours.add(depotBehaviour = new DepotBehaviour(this));
maxStackSize = new ScrollValueBehaviour(Lang.translate("weighted_ejector.stack_size"), this, new EjectorSlot()).between(0, 64).withFormatter(i -> i == 0 ? "*" : String.valueOf(i)).onlyActiveWhen(() -> state == State.CHARGED).requiresWrench();
behaviours.add(maxStackSize);
depotBehaviour.maxStackSize = () -> maxStackSize.getValue();
depotBehaviour.canAcceptItems = () -> state == State.CHARGED;
depotBehaviour.canFunnelsPullFrom = side -> side != getFacing();
depotBehaviour.enableMerging();
depotBehaviour.addSubBehaviours(behaviours);
}
use of com.simibubi.create.foundation.tileEntity.behaviour.scrollvalue.ScrollValueBehaviour in project Create_Aeronautics by Eriksonnaren.
the class TorsionSpringTileEntity method addBehaviours.
@Override
public void addBehaviours(List<TileEntityBehaviour> behaviours) {
super.addBehaviours(behaviours);
// Integer max = AllConfigs.SERVER.kinetics.maxRotationSpeed.get();
maxAngle = new ScrollValueBehaviour(new StringTextComponent("Angle"), this, new TorsionSpringValueBoxTransform());
maxAngle.between(1, 360);
maxAngle.value = 90;
maxAngle.withStepFunction(TorsionSpringTileEntity::step);
behaviours.add(maxAngle);
movementMode = new ScrollOptionBehaviour<>(MovementMode.class, Lang.translate("contraptions.movement_mode"), this, new TorsionSpringValueBoxTransform2());
// behaviours.add(movementMode);
Pair<ValueBoxTransform, ValueBoxTransform> slots = ValueBoxTransform.Dual.makeSlots(RedstoneLinkFrequencySlot::new);
SpringBehaviour b = new SpringBehaviour(this, slots);
// behaviours.add(b);
}
use of com.simibubi.create.foundation.tileEntity.behaviour.scrollvalue.ScrollValueBehaviour in project createaddition by mrh0.
the class ElectricMotorTileEntity method addBehaviours.
@Override
public void addBehaviours(List<TileEntityBehaviour> behaviours) {
super.addBehaviours(behaviours);
CenteredSideValueBoxTransform slot = new CenteredSideValueBoxTransform((motor, side) -> motor.getValue(ElectricMotorBlock.FACING) == side.getOpposite());
generatedSpeed = new ScrollValueBehaviour(Lang.translate("generic.speed"), this, slot);
generatedSpeed.between(-RPM_RANGE, RPM_RANGE);
generatedSpeed.value = DEFAULT_SPEED;
generatedSpeed.scrollableValue = DEFAULT_SPEED;
generatedSpeed.withUnit(i -> Lang.translate("generic.unit.rpm"));
generatedSpeed.withCallback(i -> this.updateGeneratedRotation(i));
generatedSpeed.withStepFunction(ElectricMotorTileEntity::step);
behaviours.add(generatedSpeed);
}
Aggregations