use of com.simibubi.create.foundation.tileEntity.behaviour.CenteredSideValueBoxTransform 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.CenteredSideValueBoxTransform in project Create by Creators-of-Create.
the class BrassTunnelTileEntity method addBehaviours.
@Override
public void addBehaviours(List<TileEntityBehaviour> behaviours) {
super.addBehaviours(behaviours);
behaviours.add(selectionMode = new ScrollOptionBehaviour<>(SelectionMode.class, Lang.translate("logistics.when_multiple_outputs_available"), this, new CenteredSideValueBoxTransform((state, d) -> d == Direction.UP)));
selectionMode.requiresWrench();
// Propagate settings across connected tunnels
selectionMode.withCallback(setting -> {
for (boolean side : Iterate.trueAndFalse) {
if (!isConnected(side))
continue;
BrassTunnelTileEntity adjacent = getAdjacent(side);
if (adjacent != null)
adjacent.selectionMode.setValue(setting);
}
});
}
use of com.simibubi.create.foundation.tileEntity.behaviour.CenteredSideValueBoxTransform 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);
}
use of com.simibubi.create.foundation.tileEntity.behaviour.CenteredSideValueBoxTransform in project Create by Creators-of-Create.
the class ChassisTileEntity method addBehaviours.
@Override
public void addBehaviours(List<TileEntityBehaviour> behaviours) {
int max = AllConfigs.SERVER.kinetics.maxChassisRange.get();
range = new BulkScrollValueBehaviour(Lang.translate("generic.range"), this, new CenteredSideValueBoxTransform(), te -> ((ChassisTileEntity) te).collectChassisGroup());
range.requiresWrench();
range.between(1, max);
range.withClientCallback(i -> DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () -> ChassisRangeDisplay.display(this)));
range.value = max / 2;
behaviours.add(range);
}
Aggregations