Search in sources :

Example 26 with Selection

use of com.simibubi.create.foundation.ponder.Selection in project Create by Creators-of-Create.

the class ArmScenes method redstone.

public static void redstone(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("mechanical_arm_redstone", "Controlling Mechanical Arms with Redstone");
    scene.configureBasePlate(0, 0, 5);
    scene.world.showSection(util.select.layer(0), Direction.UP);
    scene.idle(5);
    scene.world.showSection(util.select.fromTo(1, 1, 3, 2, 1, 4), Direction.DOWN);
    scene.idle(5);
    scene.world.showSection(util.select.fromTo(3, 1, 5, 4, 1, 3), Direction.WEST);
    scene.idle(5);
    scene.world.showSection(util.select.position(4, 1, 2), Direction.SOUTH);
    scene.idle(5);
    scene.world.showSection(util.select.fromTo(2, 1, 1, 4, 1, 1), Direction.EAST);
    scene.idle(10);
    Selection redstone = util.select.fromTo(1, 1, 0, 1, 1, 2);
    scene.world.showSection(redstone, Direction.SOUTH);
    BlockPos armPos = util.grid.at(1, 1, 3);
    BlockPos leverPos = util.grid.at(1, 1, 0);
    ItemStack item = new ItemStack(Items.REDSTONE_ORE);
    scene.world.createItemOnBeltLike(util.grid.at(4, 1, 1), Direction.SOUTH, item);
    for (int i = 0; i < 3; i++) {
        scene.idle(12);
        if (i == 1) {
            scene.world.toggleRedstonePower(redstone);
            scene.effects.indicateRedstone(leverPos);
            scene.idle(10);
            scene.overlay.showText(60).colored(PonderPalette.RED).attachKeyFrame().pointAt(util.vector.topOf(armPos.above())).placeNearTarget().text("When powered by Redstone, Mechanical Arms will not activate");
            scene.idle(70);
            scene.world.toggleRedstonePower(redstone);
        }
        if (i == 2) {
            scene.idle(60);
            scene.world.toggleRedstonePower(redstone);
            scene.idle(3);
            scene.world.toggleRedstonePower(redstone);
            scene.effects.indicateRedstone(leverPos);
        }
        scene.world.instructArm(armPos, Phase.MOVE_TO_INPUT, ItemStack.EMPTY, 0);
        scene.idle(18);
        scene.world.instructArm(armPos, Phase.SEARCH_OUTPUTS, item, -1);
        scene.world.removeItemsFromBelt(util.grid.at(3, 1, 1));
        scene.idle(5);
        if (i == 1) {
            scene.world.toggleRedstonePower(redstone);
            scene.effects.indicateRedstone(leverPos);
            scene.overlay.showText(60).pointAt(util.vector.topOf(armPos.above())).placeNearTarget().text("Before stopping, it will finish any started cycles");
        }
        scene.idle(10);
        if (i == 2) {
            scene.overlay.showText(100).colored(PonderPalette.GREEN).attachKeyFrame().pointAt(util.vector.topOf(armPos.above())).placeNearTarget().text("Thus, a negative pulse can be used to trigger exactly one activation cycle");
        }
        scene.world.instructArm(armPos, Phase.MOVE_TO_OUTPUT, item, 0);
        scene.world.createItemOnBeltLike(util.grid.at(4, 1, 1), Direction.SOUTH, item);
        scene.idle(18);
        scene.world.instructArm(armPos, Phase.SEARCH_INPUTS, ItemStack.EMPTY, -1);
        scene.world.createItemOnBelt(util.grid.at(3, 1, 3), Direction.UP, item);
    }
    scene.idle(5);
}
Also used : Selection(com.simibubi.create.foundation.ponder.Selection) BlockPos(net.minecraft.core.BlockPos) ItemStack(net.minecraft.world.item.ItemStack)

Example 27 with Selection

use of com.simibubi.create.foundation.ponder.Selection in project Create by Creators-of-Create.

the class BearingScenes method clockwork.

public static void clockwork(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("clockwork_bearing", "Animating Structures using Clockwork Bearings");
    scene.configureBasePlate(1, 1, 5);
    scene.setSceneOffsetY(-1);
    Selection kinetics = util.select.fromTo(3, 3, 4, 3, 1, 6);
    Selection largeCog = util.select.position(2, 0, 6);
    BlockPos bearingPos = util.grid.at(3, 3, 3);
    scene.world.showSection(util.select.layer(0), Direction.UP);
    scene.idle(5);
    scene.world.showSection(kinetics, Direction.DOWN);
    scene.idle(10);
    scene.world.showSection(util.select.position(bearingPos), Direction.DOWN);
    scene.idle(10);
    scene.overlay.showSelectionWithText(util.select.position(bearingPos.north()), 60).colored(PonderPalette.GREEN).pointAt(util.vector.blockSurface(bearingPos, Direction.WEST)).placeNearTarget().attachKeyFrame().text("Clockwork Bearings attach to blocks in front of them");
    scene.idle(50);
    ElementLink<WorldSectionElement> plank = scene.world.showIndependentSection(util.select.position(2, 3, 2), Direction.SOUTH);
    scene.world.moveSection(plank, util.vector.of(1, 0, 0), 0);
    scene.idle(20);
    scene.world.rotateSection(plank, 0, 0, 60, 25);
    scene.world.rotateBearing(bearingPos, 60, 25);
    scene.world.setKineticSpeed(kinetics, 8);
    scene.world.setKineticSpeed(largeCog, -4);
    scene.idle(25);
    scene.overlay.showText(80).pointAt(util.vector.blockSurface(bearingPos.north(), Direction.NORTH)).placeNearTarget().attachKeyFrame().text("Upon receiving Rotational Force, the structure will be rotated according to the hour of the day");
    scene.idle(90);
    scene.overlay.showText(30).pointAt(util.vector.blockSurface(bearingPos.north(), Direction.NORTH)).placeNearTarget().text("3:00");
    scene.world.rotateSection(plank, 0, 0, 30, 12);
    scene.world.rotateBearing(bearingPos, 30, 12);
    scene.idle(42);
    scene.overlay.showText(30).pointAt(util.vector.blockSurface(bearingPos.north(), Direction.NORTH)).placeNearTarget().text("4:00");
    scene.world.rotateSection(plank, 0, 0, 30, 12);
    scene.world.rotateBearing(bearingPos, 30, 12);
    scene.idle(42);
    InputWindowElement clickTheBearing = new InputWindowElement(util.vector.topOf(bearingPos), Pointing.DOWN);
    InputWindowElement clickTheBearingSide = new InputWindowElement(util.vector.blockSurface(bearingPos, Direction.WEST), Pointing.LEFT);
    scene.overlay.showControls(clickTheBearing.rightClick(), 60);
    scene.idle(7);
    scene.world.rotateSection(plank, 0, 0, -120, 0);
    scene.world.rotateBearing(bearingPos, -120, 0);
    scene.overlay.showText(60).pointAt(util.vector.blockSurface(bearingPos, Direction.WEST)).placeNearTarget().attachKeyFrame().text("Right-Click the bearing to start or stop animating the structure");
    scene.idle(70);
    scene.world.hideIndependentSection(plank, Direction.NORTH);
    scene.idle(15);
    ElementLink<WorldSectionElement> hourHand = scene.world.showIndependentSection(util.select.fromTo(3, 3, 1, 3, 5, 2), Direction.SOUTH);
    scene.world.configureCenterOfRotation(hourHand, util.vector.centerOf(bearingPos));
    scene.idle(15);
    scene.overlay.showSelectionWithText(util.select.fromTo(3, 3, 1, 3, 4, 2), 80).placeNearTarget().attachKeyFrame().sharedText("movement_anchors");
    scene.idle(90);
    scene.overlay.showControls(clickTheBearingSide.rightClick(), 20);
    scene.idle(7);
    scene.world.rotateSection(hourHand, 0, 0, 120, 50);
    scene.world.rotateBearing(bearingPos, 120, 50);
    scene.idle(60);
    scene.overlay.showSelectionWithText(util.select.position(bearingPos.north(3)), 80).placeNearTarget().colored(PonderPalette.BLUE).attachKeyFrame().text("In front of the Hour Hand, a second structure can be added");
    scene.idle(90);
    scene.overlay.showControls(clickTheBearingSide.rightClick(), 20);
    scene.idle(7);
    scene.world.rotateSection(hourHand, 0, 0, -120, 0);
    scene.world.rotateBearing(bearingPos, -120, 0);
    scene.idle(10);
    ElementLink<WorldSectionElement> minuteHand = scene.world.showIndependentSection(util.select.fromTo(3, 3, 0, 3, 6, 0), Direction.SOUTH);
    scene.world.configureCenterOfRotation(minuteHand, util.vector.centerOf(bearingPos));
    scene.idle(30);
    scene.overlay.showOutline(PonderPalette.BLUE, minuteHand, util.select.fromTo(3, 3, 0, 3, 6, 0), 85);
    scene.overlay.showSelectionWithText(util.select.fromTo(3, 3, 1, 3, 4, 2), 80).placeNearTarget().colored(PonderPalette.GREEN).text("Ensure the two Structures are not attached to each other through super glue or similar");
    scene.idle(90);
    scene.overlay.showControls(clickTheBearingSide.rightClick(), 20);
    scene.idle(7);
    scene.world.rotateSection(hourHand, 0, 0, 120, 50);
    scene.world.rotateSection(minuteHand, 0, 0, 180, 75);
    scene.world.rotateBearing(bearingPos, 120, 50);
    scene.idle(90);
    scene.world.rotateSection(minuteHand, 0, 0, 6, 3);
    scene.overlay.showText(80).placeNearTarget().pointAt(util.vector.blockSurface(bearingPos.north(3), Direction.NORTH)).colored(PonderPalette.GREEN).text("The Second Structure will now rotate as the Minute Hand");
    scene.markAsFinished();
    for (int i = 0; i < 40; i++) {
        scene.idle(23);
        scene.world.rotateSection(minuteHand, 0, 0, 6, 3);
        if (i == 29)
            scene.world.rotateSection(hourHand, 0, 0, 30, 20);
    }
}
Also used : Selection(com.simibubi.create.foundation.ponder.Selection) InputWindowElement(com.simibubi.create.foundation.ponder.element.InputWindowElement) BlockPos(net.minecraft.core.BlockPos) WorldSectionElement(com.simibubi.create.foundation.ponder.element.WorldSectionElement)

Example 28 with Selection

use of com.simibubi.create.foundation.ponder.Selection in project Create by Creators-of-Create.

the class BeltScenes method depot.

public static void depot(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("depot", "Using Depots");
    scene.configureBasePlate(0, 0, 5);
    scene.showBasePlate();
    scene.idle(5);
    scene.world.setBlock(util.grid.at(3, 2, 2), Blocks.WATER.defaultBlockState(), false);
    BlockPos depotPos = util.grid.at(2, 1, 2);
    scene.world.showSection(util.select.position(2, 1, 2), Direction.DOWN);
    Vec3 topOf = util.vector.topOf(depotPos);
    scene.overlay.showText(60).attachKeyFrame().text("Depots can serve as 'stationary' belt elements").placeNearTarget().pointAt(topOf);
    scene.idle(70);
    scene.overlay.showControls(new InputWindowElement(topOf, Pointing.DOWN).rightClick().withItem(new ItemStack(Items.COPPER_BLOCK)), 20);
    scene.idle(7);
    scene.world.createItemOnBeltLike(depotPos, Direction.NORTH, new ItemStack(Items.COPPER_BLOCK));
    scene.idle(10);
    scene.overlay.showText(70).attachKeyFrame().text("Right-Click to manually place or remove Items from it").placeNearTarget().pointAt(topOf);
    scene.idle(80);
    scene.overlay.showControls(new InputWindowElement(topOf, Pointing.DOWN).rightClick(), 20);
    scene.idle(7);
    scene.world.removeItemsFromBelt(depotPos);
    scene.effects.indicateSuccess(depotPos);
    scene.idle(20);
    scene.world.showSection(util.select.position(depotPos.above(2)), Direction.SOUTH);
    scene.overlay.showText(70).attachKeyFrame().text("Just like Mechanical Belts, it can provide items to processing").placeNearTarget().pointAt(util.vector.blockSurface(depotPos.above(2), Direction.WEST));
    ItemStack bottle = new ItemStack(Items.BUCKET);
    scene.world.createItemOnBeltLike(depotPos, Direction.NORTH, bottle);
    scene.idle(20);
    scene.world.modifyTileNBT(util.select.position(depotPos.above(2)), SpoutTileEntity.class, nbt -> nbt.putInt("ProcessingTicks", 20));
    scene.idle(20);
    scene.world.removeItemsFromBelt(depotPos);
    scene.world.createItemOnBeltLike(depotPos, Direction.UP, new ItemStack(Items.WATER_BUCKET));
    scene.world.modifyTileNBT(util.select.position(depotPos.above(2)), SpoutTileEntity.class, nbt -> nbt.putBoolean("Splash", true));
    scene.idle(30);
    scene.world.removeItemsFromBelt(depotPos);
    scene.world.hideSection(util.select.position(depotPos.above(2)), Direction.SOUTH);
    scene.idle(20);
    ElementLink<WorldSectionElement> spout = scene.world.showIndependentSection(util.select.position(depotPos.above(2).west()), Direction.SOUTH);
    scene.world.moveSection(spout, util.vector.of(1, 0, 0), 0);
    BlockPos pressPos = depotPos.above(2).west();
    ItemStack copper = new ItemStack(Items.COPPER_INGOT);
    scene.world.createItemOnBeltLike(depotPos, Direction.NORTH, copper);
    Vec3 depotCenter = util.vector.centerOf(depotPos);
    scene.idle(10);
    Class<MechanicalPressTileEntity> type = MechanicalPressTileEntity.class;
    scene.world.modifyTileEntity(pressPos, type, pte -> pte.start(Mode.BELT));
    scene.idle(15);
    scene.world.modifyTileEntity(pressPos, type, pte -> pte.makePressingParticleEffect(depotCenter.add(0, 8 / 16f, 0), copper));
    scene.world.removeItemsFromBelt(depotPos);
    ItemStack sheet = AllItems.COPPER_SHEET.asStack();
    scene.world.createItemOnBeltLike(depotPos, Direction.UP, sheet);
    scene.idle(20);
    scene.world.hideIndependentSection(spout, Direction.SOUTH);
    scene.idle(10);
    Selection fanSelect = util.select.fromTo(4, 1, 3, 5, 2, 2).add(util.select.position(3, 1, 2)).add(util.select.position(5, 0, 2));
    scene.world.showSection(fanSelect, Direction.SOUTH);
    ElementLink<WorldSectionElement> water = scene.world.showIndependentSection(util.select.position(3, 1, 0), Direction.SOUTH);
    scene.world.moveSection(water, util.vector.of(0, 1, 2), 0);
    scene.idle(30);
    scene.world.hideSection(fanSelect, Direction.SOUTH);
    scene.world.hideIndependentSection(water, Direction.SOUTH);
    scene.idle(30);
    scene.world.showSection(util.select.fromTo(2, 1, 4, 2, 1, 5).add(util.select.position(2, 0, 5)), Direction.DOWN);
    BlockPos armPos = util.grid.at(2, 1, 4);
    scene.overlay.showText(70).attachKeyFrame().text("...as well as provide Items to Mechanical Arms").placeNearTarget().pointAt(util.vector.blockSurface(armPos, Direction.WEST));
    scene.idle(20);
    scene.world.instructArm(armPos, Phase.MOVE_TO_INPUT, ItemStack.EMPTY, 0);
    scene.idle(37);
    scene.world.removeItemsFromBelt(depotPos);
    scene.world.instructArm(armPos, Phase.SEARCH_OUTPUTS, sheet, -1);
}
Also used : Selection(com.simibubi.create.foundation.ponder.Selection) Vec3(net.minecraft.world.phys.Vec3) InputWindowElement(com.simibubi.create.foundation.ponder.element.InputWindowElement) BlockPos(net.minecraft.core.BlockPos) WorldSectionElement(com.simibubi.create.foundation.ponder.element.WorldSectionElement) ItemStack(net.minecraft.world.item.ItemStack) MechanicalPressTileEntity(com.simibubi.create.content.contraptions.components.press.MechanicalPressTileEntity)

Example 29 with Selection

use of com.simibubi.create.foundation.ponder.Selection in project Create by Creators-of-Create.

the class CartAssemblerScenes method dual.

public static void dual(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("cart_assembler_dual", "Assembling Carriage Contraptions");
    scene.configureBasePlate(0, 0, 6);
    scene.scaleSceneView(.9f);
    scene.world.showSection(util.select.layer(0), Direction.UP);
    scene.idle(5);
    for (int z = 0; z < 5; z++) {
        scene.world.showSection(util.select.position(1, 1, z), Direction.DOWN);
        scene.idle(2);
    }
    for (int x = 2; x < 6; x++) {
        scene.world.showSection(util.select.position(x, 1, 4), Direction.DOWN);
        scene.idle(2);
    }
    BlockPos assembler1 = util.grid.at(2, 1, 4);
    BlockPos assembler2 = util.grid.at(5, 1, 4);
    Selection chassis = util.select.fromTo(5, 2, 4, 2, 2, 4);
    scene.idle(5);
    scene.world.showSection(util.select.fromTo(2, 1, 3, 2, 1, 2), Direction.SOUTH);
    scene.idle(5);
    ElementLink<MinecartElement> cart = scene.special.createCart(util.vector.topOf(assembler1.below()), 0, Minecart::new);
    ElementLink<MinecartElement> cart2 = scene.special.createCart(util.vector.topOf(assembler2.below()), 0, MinecartChest::new);
    scene.idle(15);
    scene.world.setBlock(assembler1, AllBlocks.CART_ASSEMBLER.getDefaultState().setValue(CartAssemblerBlock.RAIL_SHAPE, RailShape.EAST_WEST).setValue(CartAssemblerBlock.RAIL_TYPE, CartAssembleRailType.CONTROLLER_RAIL), true);
    scene.idle(5);
    scene.world.setBlock(assembler2, AllBlocks.CART_ASSEMBLER.getDefaultState().setValue(CartAssemblerBlock.RAIL_SHAPE, RailShape.EAST_WEST).setValue(CartAssemblerBlock.RAIL_TYPE, CartAssembleRailType.REGULAR), true);
    scene.idle(5);
    ElementLink<WorldSectionElement> contraption = scene.world.showIndependentSection(chassis, Direction.DOWN);
    scene.idle(15);
    scene.overlay.showOutline(PonderPalette.GREEN, new Object(), util.select.position(assembler2), 60);
    scene.overlay.showSelectionWithText(util.select.position(assembler1), 60).colored(PonderPalette.GREEN).pointAt(util.vector.blockSurface(util.grid.at(2, 2, 4), Direction.NORTH)).placeNearTarget().text("Whenever two Cart Assembers share an attached structure...").attachKeyFrame();
    scene.idle(70);
    scene.overlay.showText(60).pointAt(util.vector.blockSurface(util.grid.at(2, 1, 4), Direction.NORTH)).placeNearTarget().text("Powering either of them will create a Carriage Contraption");
    scene.idle(70);
    scene.effects.indicateRedstone(util.grid.at(2, 1, 2));
    scene.world.toggleRedstonePower(util.select.fromTo(2, 1, 2, 2, 1, 4));
    ElementLink<WorldSectionElement> anchors = scene.world.showIndependentSectionImmediately(util.select.fromTo(assembler1.south(), assembler2.south()));
    scene.world.moveSection(anchors, util.vector.of(0, 0, -1), 0);
    scene.world.configureCenterOfRotation(anchors, util.vector.centerOf(util.grid.at(2, 2, 5)));
    scene.world.configureCenterOfRotation(contraption, util.vector.centerOf(util.grid.at(2, 2, 4)));
    scene.idle(5);
    Vec3 m = util.vector.of(-0.5, 0, 0);
    scene.special.moveCart(cart, m, 5);
    scene.special.moveCart(cart2, m, 5);
    scene.world.moveSection(contraption, m, 5);
    scene.world.moveSection(anchors, m, 5);
    scene.idle(5);
    scene.special.rotateCart(cart, -45, 2);
    scene.special.moveCart(cart2, util.vector.of(-.3, 0, 0), 8);
    m = util.vector.of(-.5, 0, -.5);
    scene.special.moveCart(cart, m, 8);
    scene.world.moveSection(anchors, m, 8);
    scene.world.moveSection(contraption, m, 8);
    scene.world.rotateSection(anchors, 0, -10, 0, 8);
    scene.world.rotateSection(contraption, 0, -10, 0, 8);
    scene.idle(8);
    scene.special.rotateCart(cart, -45, 2);
    scene.special.moveCart(cart2, util.vector.of(-.4, 0, 0), 5);
    m = util.vector.of(0, 0, -3.5);
    scene.special.moveCart(cart, m, 25);
    scene.world.moveSection(anchors, m, 25);
    scene.world.moveSection(contraption, m, 25);
    scene.world.rotateSection(anchors, 0, -33, 0, 10);
    scene.world.rotateSection(contraption, 0, -33, 0, 10);
    scene.idle(5);
    scene.special.moveCart(cart2, util.vector.of(-0.8, 0, 0), 5);
    scene.idle(5);
    scene.special.moveCart(cart2, util.vector.of(-1.5, 0, 0), 9);
    scene.world.rotateSection(anchors, 0, -42, 0, 9);
    scene.world.rotateSection(contraption, 0, -42, 0, 9);
    scene.idle(9);
    m = util.vector.of(-.5, 0, -.5);
    scene.special.moveCart(cart2, m, 2);
    scene.special.rotateCart(cart2, -45, 2);
    scene.world.rotateSection(anchors, 0, -5, 0, 5);
    scene.world.rotateSection(contraption, 0, -5, 0, 5);
    scene.idle(2);
    scene.special.moveCart(cart2, util.vector.of(0, 0, -.5), 5);
    scene.special.rotateCart(cart2, -45, 2);
    scene.idle(10);
    scene.overlay.showText(70).attachKeyFrame().pointAt(util.vector.blockSurface(util.grid.at(1, 1, 3), Direction.WEST)).placeNearTarget().text("The carts will behave like those connected via Minecart Coupling");
    scene.idle(80);
}
Also used : MinecartElement(com.simibubi.create.foundation.ponder.element.MinecartElement) Selection(com.simibubi.create.foundation.ponder.Selection) Vec3(net.minecraft.world.phys.Vec3) Minecart(net.minecraft.world.entity.vehicle.Minecart) MinecartChest(net.minecraft.world.entity.vehicle.MinecartChest) BlockPos(net.minecraft.core.BlockPos) WorldSectionElement(com.simibubi.create.foundation.ponder.element.WorldSectionElement)

Example 30 with Selection

use of com.simibubi.create.foundation.ponder.Selection in project Create by Creators-of-Create.

the class KineticsScenes method sequencedGearshift.

public static void sequencedGearshift(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("sequenced_gearshift", "Controlling Rotational Speed using Sequenced Gearshifts");
    scene.configureBasePlate(1, 0, 5);
    scene.showBasePlate();
    Selection redstone = util.select.fromTo(3, 1, 0, 3, 1, 1);
    scene.world.showSection(util.select.position(6, 0, 3).add(redstone), Direction.UP);
    scene.idle(5);
    scene.world.showSection(util.select.fromTo(6, 1, 2, 4, 1, 2), Direction.DOWN);
    BlockPos gearshiftPos = util.grid.at(3, 1, 2);
    Selection gearshiftSelection = util.select.position(gearshiftPos);
    BlockPos bearingPos = util.grid.at(1, 1, 2);
    BlockPos buttonPos = util.grid.at(3, 1, 0);
    Selection outputKinetics = util.select.fromTo(3, 1, 2, 1, 1, 2);
    scene.world.setKineticSpeed(gearshiftSelection, 0);
    scene.idle(10);
    scene.world.showSection(gearshiftSelection, Direction.DOWN);
    scene.idle(10);
    scene.world.showSection(util.select.fromTo(2, 1, 2, 1, 1, 2), Direction.EAST);
    scene.idle(10);
    Vec3 top = util.vector.topOf(gearshiftPos);
    scene.overlay.showText(60).text("Seq. Gearshifts relay rotation by following a timed list of instructions").attachKeyFrame().pointAt(top).placeNearTarget();
    scene.idle(80);
    scene.overlay.showControls(new InputWindowElement(top, Pointing.DOWN).rightClick(), 40);
    scene.idle(7);
    scene.overlay.showSelectionWithText(gearshiftSelection, 50).colored(PonderPalette.BLUE).text("Right-click it to open the Configuration UI").pointAt(top).placeNearTarget();
    scene.idle(60);
    ElementLink<WorldSectionElement> contraption = scene.world.showIndependentSection(util.select.fromTo(0, 3, 2, 0, 0, 2), Direction.EAST);
    scene.world.configureCenterOfRotation(contraption, util.vector.centerOf(bearingPos));
    scene.idle(20);
    scene.world.toggleRedstonePower(redstone);
    scene.effects.indicateRedstone(buttonPos);
    scene.world.cycleBlockProperty(gearshiftPos, SequencedGearshiftBlock.STATE);
    scene.world.setKineticSpeed(outputKinetics, 16);
    scene.world.rotateBearing(bearingPos, 90, 40);
    scene.world.rotateSection(contraption, 90, 0, 0, 40);
    scene.effects.rotationDirectionIndicator(gearshiftPos.west());
    scene.idle(20);
    scene.world.toggleRedstonePower(redstone);
    scene.idle(20);
    scene.overlay.showText(80).text("Upon receiving a Redstone Signal, it will start running its configured sequence").attachKeyFrame().pointAt(top);
    scene.world.cycleBlockProperty(gearshiftPos, SequencedGearshiftBlock.STATE);
    scene.world.setKineticSpeed(outputKinetics, -32);
    scene.world.rotateBearing(bearingPos, -180, 40);
    scene.world.rotateSection(contraption, -180, 0, 0, 40);
    scene.effects.rotationDirectionIndicator(gearshiftPos.west());
    scene.idle(40);
    scene.world.cycleBlockProperty(gearshiftPos, SequencedGearshiftBlock.STATE);
    scene.world.setKineticSpeed(outputKinetics, 0);
    scene.idle(20);
    scene.world.cycleBlockProperty(gearshiftPos, SequencedGearshiftBlock.STATE);
    scene.world.setKineticSpeed(outputKinetics, 16);
    scene.world.rotateBearing(bearingPos, 90, 40);
    scene.world.rotateSection(contraption, 90, 0, 0, 40);
    scene.effects.rotationDirectionIndicator(gearshiftPos.west());
    scene.idle(40);
    scene.world.cycleBlockProperty(gearshiftPos, SequencedGearshiftBlock.STATE);
    scene.world.cycleBlockProperty(gearshiftPos, SequencedGearshiftBlock.STATE);
    scene.world.setKineticSpeed(outputKinetics, 0);
    scene.idle(20);
    scene.overlay.showText(70).text("Once finished, it waits for the next Redstone Signal and starts over").pointAt(util.vector.topOf(util.grid.at(3, 0, 1)));
    scene.idle(80);
    scene.idle(20);
    scene.world.toggleRedstonePower(redstone);
    scene.effects.indicateRedstone(buttonPos);
    scene.world.cycleBlockProperty(gearshiftPos, SequencedGearshiftBlock.STATE);
    scene.world.setKineticSpeed(outputKinetics, 16);
    scene.world.rotateBearing(bearingPos, 90, 40);
    scene.world.rotateSection(contraption, 90, 0, 0, 40);
    scene.effects.rotationDirectionIndicator(gearshiftPos.west());
    scene.idle(20);
    scene.overlay.showText(60).text("A redstone comparator can be used to read the current progress").attachKeyFrame().pointAt(util.vector.topOf(util.grid.at(3, 0, 1)));
    scene.world.hideSection(redstone, Direction.NORTH);
    scene.idle(15);
    BlockPos wire = util.grid.at(5, 1, 0);
    Selection nixie = util.select.position(4, 1, 0);
    ElementLink<WorldSectionElement> comparator = scene.world.showIndependentSection(util.select.fromTo(5, 1, 1, 4, 1, 0), Direction.SOUTH);
    scene.world.moveSection(comparator, util.vector.of(-2, 0, 0), 0);
    scene.world.toggleRedstonePower(util.select.position(5, 1, 1));
    scene.world.cycleBlockProperty(wire, RedStoneWireBlock.POWER);
    scene.world.modifyTileNBT(nixie, NixieTubeTileEntity.class, nbt -> nbt.putInt("RedstoneStrength", 1));
    scene.idle(5);
    scene.world.cycleBlockProperty(gearshiftPos, SequencedGearshiftBlock.STATE);
    scene.world.setKineticSpeed(outputKinetics, -32);
    scene.world.rotateBearing(bearingPos, -180, 40);
    scene.world.rotateSection(contraption, -180, 0, 0, 40);
    scene.effects.rotationDirectionIndicator(gearshiftPos.west());
    scene.world.cycleBlockProperty(wire, RedStoneWireBlock.POWER);
    scene.world.modifyTileNBT(nixie, NixieTubeTileEntity.class, nbt -> nbt.putInt("RedstoneStrength", 2));
    scene.idle(40);
    scene.world.cycleBlockProperty(gearshiftPos, SequencedGearshiftBlock.STATE);
    scene.world.setKineticSpeed(outputKinetics, 0);
    scene.world.cycleBlockProperty(wire, RedStoneWireBlock.POWER);
    scene.world.modifyTileNBT(nixie, NixieTubeTileEntity.class, nbt -> nbt.putInt("RedstoneStrength", 3));
    scene.idle(20);
    scene.world.cycleBlockProperty(gearshiftPos, SequencedGearshiftBlock.STATE);
    scene.world.setKineticSpeed(outputKinetics, 16);
    scene.world.rotateBearing(bearingPos, 90, 40);
    scene.world.rotateSection(contraption, 90, 0, 0, 40);
    scene.effects.rotationDirectionIndicator(gearshiftPos.west());
    scene.world.cycleBlockProperty(wire, RedStoneWireBlock.POWER);
    scene.world.modifyTileNBT(nixie, NixieTubeTileEntity.class, nbt -> nbt.putInt("RedstoneStrength", 4));
    scene.idle(40);
    scene.world.cycleBlockProperty(gearshiftPos, SequencedGearshiftBlock.STATE);
    scene.world.cycleBlockProperty(gearshiftPos, SequencedGearshiftBlock.STATE);
    scene.world.modifyBlock(wire, s -> s.setValue(RedStoneWireBlock.POWER, 0), false);
    scene.world.toggleRedstonePower(util.select.position(5, 1, 1));
    scene.world.modifyTileNBT(nixie, NixieTubeTileEntity.class, nbt -> nbt.putInt("RedstoneStrength", 0));
    scene.world.setKineticSpeed(outputKinetics, 0);
}
Also used : Selection(com.simibubi.create.foundation.ponder.Selection) Vec3(net.minecraft.world.phys.Vec3) InputWindowElement(com.simibubi.create.foundation.ponder.element.InputWindowElement) BlockPos(net.minecraft.core.BlockPos) WorldSectionElement(com.simibubi.create.foundation.ponder.element.WorldSectionElement)

Aggregations

Selection (com.simibubi.create.foundation.ponder.Selection)94 BlockPos (net.minecraft.core.BlockPos)84 WorldSectionElement (com.simibubi.create.foundation.ponder.element.WorldSectionElement)59 InputWindowElement (com.simibubi.create.foundation.ponder.element.InputWindowElement)57 Vec3 (net.minecraft.world.phys.Vec3)51 ItemStack (net.minecraft.world.item.ItemStack)46 Entity (net.minecraft.world.entity.Entity)15 AABB (net.minecraft.world.phys.AABB)14 EntityElement (com.simibubi.create.foundation.ponder.element.EntityElement)11 ItemEntity (net.minecraft.world.entity.item.ItemEntity)11 FluidStack (net.minecraftforge.fluids.FluidStack)10 SceneBuilder (com.simibubi.create.foundation.ponder.SceneBuilder)8 Direction (net.minecraft.core.Direction)8 ElementLink (com.simibubi.create.foundation.ponder.ElementLink)7 PonderPalette (com.simibubi.create.foundation.ponder.PonderPalette)7 SceneBuildingUtil (com.simibubi.create.foundation.ponder.SceneBuildingUtil)7 BlockState (net.minecraft.world.level.block.state.BlockState)7 CapabilityFluidHandler (net.minecraftforge.fluids.capability.CapabilityFluidHandler)6 FluidAction (net.minecraftforge.fluids.capability.IFluidHandler.FluidAction)6 ParrotElement (com.simibubi.create.foundation.ponder.element.ParrotElement)5