Search in sources :

Example 1 with BulkScrollValueBehaviour

use of com.simibubi.create.foundation.tileEntity.behaviour.scrollvalue.BulkScrollValueBehaviour 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);
}
Also used : Direction(net.minecraft.core.Direction) BlockState(net.minecraft.world.level.block.state.BlockState) ArrayList(java.util.ArrayList) Dist(net.minecraftforge.api.distmarker.Dist) HashSet(java.util.HashSet) SmartTileEntity(com.simibubi.create.foundation.tileEntity.SmartTileEntity) Axis(net.minecraft.core.Direction.Axis) AxisDirection(net.minecraft.core.Direction.AxisDirection) AllConfigs(com.simibubi.create.foundation.config.AllConfigs) Lang(com.simibubi.create.foundation.utility.Lang) LinkedList(java.util.LinkedList) AllBlocks(com.simibubi.create.AllBlocks) CenteredSideValueBoxTransform(com.simibubi.create.foundation.tileEntity.behaviour.CenteredSideValueBoxTransform) BlockMovementChecks(com.simibubi.create.content.contraptions.components.structureMovement.BlockMovementChecks) BlockStateProperties(net.minecraft.world.level.block.state.properties.BlockStateProperties) Iterate(com.simibubi.create.foundation.utility.Iterate) TileEntityBehaviour(com.simibubi.create.foundation.tileEntity.TileEntityBehaviour) BulkScrollValueBehaviour(com.simibubi.create.foundation.tileEntity.behaviour.scrollvalue.BulkScrollValueBehaviour) Set(java.util.Set) BlockEntity(net.minecraft.world.level.block.entity.BlockEntity) DistExecutor(net.minecraftforge.fml.DistExecutor) List(java.util.List) BlockPos(net.minecraft.core.BlockPos) BlockEntityType(net.minecraft.world.level.block.entity.BlockEntityType) Queue(java.util.Queue) ScrollValueBehaviour(com.simibubi.create.foundation.tileEntity.behaviour.scrollvalue.ScrollValueBehaviour) Collections(java.util.Collections) BulkScrollValueBehaviour(com.simibubi.create.foundation.tileEntity.behaviour.scrollvalue.BulkScrollValueBehaviour) CenteredSideValueBoxTransform(com.simibubi.create.foundation.tileEntity.behaviour.CenteredSideValueBoxTransform)

Aggregations

AllBlocks (com.simibubi.create.AllBlocks)1 BlockMovementChecks (com.simibubi.create.content.contraptions.components.structureMovement.BlockMovementChecks)1 AllConfigs (com.simibubi.create.foundation.config.AllConfigs)1 SmartTileEntity (com.simibubi.create.foundation.tileEntity.SmartTileEntity)1 TileEntityBehaviour (com.simibubi.create.foundation.tileEntity.TileEntityBehaviour)1 CenteredSideValueBoxTransform (com.simibubi.create.foundation.tileEntity.behaviour.CenteredSideValueBoxTransform)1 BulkScrollValueBehaviour (com.simibubi.create.foundation.tileEntity.behaviour.scrollvalue.BulkScrollValueBehaviour)1 ScrollValueBehaviour (com.simibubi.create.foundation.tileEntity.behaviour.scrollvalue.ScrollValueBehaviour)1 Iterate (com.simibubi.create.foundation.utility.Iterate)1 Lang (com.simibubi.create.foundation.utility.Lang)1 ArrayList (java.util.ArrayList)1 Collections (java.util.Collections)1 HashSet (java.util.HashSet)1 LinkedList (java.util.LinkedList)1 List (java.util.List)1 Queue (java.util.Queue)1 Set (java.util.Set)1 BlockPos (net.minecraft.core.BlockPos)1 Direction (net.minecraft.core.Direction)1 Axis (net.minecraft.core.Direction.Axis)1