use of com.simibubi.create.foundation.tileEntity.SmartTileEntity in project Create by Creators-of-Create.
the class ScrollValueRenderer method tick.
public static void tick() {
Minecraft mc = Minecraft.getInstance();
HitResult target = mc.hitResult;
if (target == null || !(target instanceof BlockHitResult))
return;
BlockHitResult result = (BlockHitResult) target;
ClientLevel world = mc.level;
BlockPos pos = result.getBlockPos();
Direction face = result.getDirection();
ScrollValueBehaviour behaviour = TileEntityBehaviour.get(world, pos, ScrollValueBehaviour.TYPE);
if (behaviour == null)
return;
if (!behaviour.isActive())
return;
if (behaviour.needsWrench && !AllItems.WRENCH.isIn(mc.player.getMainHandItem()))
return;
boolean highlight = behaviour.testHit(target.getLocation());
if (behaviour instanceof BulkScrollValueBehaviour && AllKeys.ctrlDown()) {
BulkScrollValueBehaviour bulkScrolling = (BulkScrollValueBehaviour) behaviour;
for (SmartTileEntity smartTileEntity : bulkScrolling.getBulk()) {
ScrollValueBehaviour other = smartTileEntity.getBehaviour(ScrollValueBehaviour.TYPE);
if (other != null)
addBox(world, smartTileEntity.getBlockPos(), face, other, highlight);
}
} else
addBox(world, pos, face, behaviour, highlight);
}
Aggregations