Search in sources :

Example 51 with Selection

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

the class ArmScenes method setup.

public static void setup(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("mechanical_arm", "Setting up Mechanical Arms");
    scene.configureBasePlate(0, 0, 5);
    scene.showBasePlate();
    ItemStack armItem = AllBlocks.MECHANICAL_ARM.asStack();
    BlockPos armPos = util.grid.at(2, 1, 2);
    Selection armSel = util.select.position(armPos);
    BlockPos inputDepot = util.grid.at(4, 2, 1);
    Vec3 depotSurface = util.vector.blockSurface(inputDepot, Direction.NORTH);
    Vec3 armSurface = util.vector.blockSurface(armPos, Direction.WEST);
    scene.idle(20);
    scene.world.setKineticSpeed(armSel, 0);
    scene.world.showSection(armSel, Direction.DOWN);
    scene.idle(10);
    scene.effects.indicateRedstone(armPos);
    scene.overlay.showSelectionWithText(armSel, 70).attachKeyFrame().colored(PonderPalette.RED).text("Mechanical Arms have to be assigned their in- and outputs before they are placed").pointAt(armSurface).placeNearTarget();
    scene.idle(80);
    scene.world.showSection(util.select.fromTo(4, 1, 1, 4, 2, 1), Direction.DOWN);
    scene.world.showSection(util.select.fromTo(0, 1, 1, 0, 2, 1), Direction.DOWN);
    scene.world.hideSection(armSel, Direction.UP);
    scene.idle(20);
    scene.overlay.showControls(new InputWindowElement(depotSurface, Pointing.RIGHT).rightClick().withItem(armItem), 50);
    scene.idle(7);
    AABB depotBounds = AllShapes.DEPOT.bounds();
    scene.overlay.chaseBoundingBoxOutline(PonderPalette.INPUT, new Object(), depotBounds.move(4, 2, 1), 400);
    scene.overlay.showText(70).attachKeyFrame().colored(PonderPalette.INPUT).text("Right-Click inventories while holding the Arm to assign them as Targets").pointAt(util.vector.blockSurface(inputDepot, Direction.WEST)).placeNearTarget();
    scene.idle(80);
    BlockPos outputDepot = util.grid.at(0, 2, 1);
    InputWindowElement input = new InputWindowElement(util.vector.blockSurface(outputDepot, Direction.NORTH), Pointing.RIGHT).rightClick().withItem(armItem);
    scene.overlay.showControls(input, 20);
    scene.idle(7);
    Object second = new Object();
    scene.overlay.chaseBoundingBoxOutline(PonderPalette.INPUT, second, depotBounds.move(0, 2, 1), 100);
    scene.idle(25);
    scene.overlay.showControls(input, 30);
    scene.idle(7);
    scene.overlay.chaseBoundingBoxOutline(PonderPalette.OUTPUT, second, depotBounds.move(0, 2, 1), 280);
    scene.overlay.showText(70).colored(PonderPalette.OUTPUT).text("Right-Click again to toggle between Input (Blue) and Output (Orange)").pointAt(util.vector.blockSurface(outputDepot, Direction.WEST)).placeNearTarget();
    scene.idle(80);
    scene.world.showSection(util.select.position(1, 1, 0), Direction.DOWN);
    scene.idle(15);
    scene.overlay.chaseBoundingBoxOutline(PonderPalette.INPUT, new Object(), depotBounds.move(1, 1, 0), 43);
    scene.overlay.showText(50).colored(PonderPalette.WHITE).text("Left-Click components to remove their Selection").pointAt(util.vector.blockSurface(util.grid.at(1, 1, 0), Direction.WEST)).placeNearTarget();
    scene.idle(35);
    scene.overlay.showControls(new InputWindowElement(util.vector.topOf(util.grid.at(1, 1, 0)), Pointing.DOWN).leftClick().withItem(armItem), 30);
    scene.idle(50);
    scene.world.showSection(armSel, Direction.DOWN);
    scene.idle(10);
    Vec3 armTop = armSurface.add(0.5, 1.5, 0);
    scene.overlay.showText(70).attachKeyFrame().colored(PonderPalette.GREEN).text("Once placed, the Mechanical Arm will target the blocks selected previously").pointAt(armTop).placeNearTarget();
    scene.idle(80);
    scene.effects.indicateSuccess(armPos);
    scene.world.showSection(util.select.fromTo(2, 1, 5, 2, 1, 3).add(util.select.position(2, 0, 5)), Direction.DOWN);
    ItemStack copper = new ItemStack(Items.COPPER_INGOT);
    scene.world.createItemOnBeltLike(inputDepot, Direction.SOUTH, copper);
    scene.idle(10);
    scene.world.setKineticSpeed(armSel, -48);
    scene.idle(20);
    scene.world.instructArm(armPos, Phase.MOVE_TO_INPUT, ItemStack.EMPTY, 0);
    scene.idle(24);
    scene.world.removeItemsFromBelt(inputDepot);
    scene.world.instructArm(armPos, Phase.SEARCH_OUTPUTS, copper, -1);
    scene.idle(20);
    scene.world.instructArm(armPos, Phase.MOVE_TO_OUTPUT, copper, 0);
    scene.idle(24);
    scene.world.createItemOnBeltLike(outputDepot, Direction.UP, copper);
    scene.world.instructArm(armPos, Phase.SEARCH_INPUTS, ItemStack.EMPTY, -1);
    scene.idle(44);
    scene.world.showSection(util.select.fromTo(1, 1, 4, 1, 3, 4), Direction.DOWN);
    scene.idle(5);
    scene.world.showSection(util.select.position(4, 1, 2), Direction.DOWN);
    scene.idle(5);
    scene.overlay.chaseBoundingBoxOutline(PonderPalette.OUTPUT, new Object(), depotBounds.move(0, 2, 1), 60);
    scene.idle(5);
    scene.overlay.chaseBoundingBoxOutline(PonderPalette.INPUT, new Object(), depotBounds.move(4, 2, 1), 60);
    scene.idle(5);
    scene.overlay.chaseBoundingBoxOutline(PonderPalette.OUTPUT, new Object(), depotBounds.move(1, 1, 0), 60);
    scene.idle(5);
    scene.overlay.chaseBoundingBoxOutline(PonderPalette.INPUT, new Object(), depotBounds.move(1, 3, 4), 60);
    scene.idle(5);
    scene.overlay.chaseBoundingBoxOutline(PonderPalette.INPUT, new Object(), depotBounds.move(4, 1, 2), 60);
    scene.idle(5);
    scene.overlay.showText(80).attachKeyFrame().text("They can have any amount of in- and outputs within their range").pointAt(util.vector.blockSurface(util.grid.at(1, 3, 4), Direction.WEST)).placeNearTarget();
    inputDepot = util.grid.at(1, 3, 4);
    outputDepot = util.grid.at(1, 1, 0);
    copper = new ItemStack(Items.COPPER_BLOCK);
    scene.world.createItemOnBeltLike(inputDepot, Direction.SOUTH, copper);
    scene.idle(20);
    scene.world.instructArm(armPos, Phase.MOVE_TO_INPUT, ItemStack.EMPTY, 2);
    scene.idle(24);
    scene.world.removeItemsFromBelt(inputDepot);
    scene.world.instructArm(armPos, Phase.SEARCH_OUTPUTS, copper, -1);
    scene.idle(20);
    scene.world.instructArm(armPos, Phase.MOVE_TO_OUTPUT, copper, 2);
    scene.idle(24);
    scene.world.createItemOnBeltLike(outputDepot, Direction.UP, copper);
    scene.world.instructArm(armPos, Phase.SEARCH_INPUTS, ItemStack.EMPTY, -1);
    scene.world.hideSection(util.select.fromTo(4, 2, 1, 4, 1, 1), Direction.UP);
    scene.idle(2);
    scene.world.hideSection(util.select.fromTo(1, 1, 4, 1, 3, 4), Direction.UP);
    scene.idle(5);
    scene.world.hideSection(util.select.fromTo(0, 1, 1, 0, 2, 1), Direction.UP);
    scene.idle(2);
    scene.world.hideSection(util.select.position(1, 1, 0), Direction.UP);
    scene.idle(5);
    scene.world.hideSection(util.select.position(4, 1, 2), Direction.UP);
    scene.idle(15);
    scene.world.showSection(util.select.fromTo(4, 1, 3, 4, 2, 3), Direction.NORTH);
    scene.idle(5);
    scene.world.showSection(util.select.fromTo(0, 1, 3, 0, 2, 3), Direction.NORTH);
    scene.idle(15);
    Object in = new Object();
    Object out = new Object();
    AABB chestBounds = new AABB(1 / 16f, 0, 1 / 16f, 15 / 16f, 14 / 16f, 15 / 16f);
    AABB funnelBounds = new AABB(0, 0, 8 / 16f, 16 / 16f, 16 / 16f, 16 / 16f);
    scene.overlay.chaseBoundingBoxOutline(PonderPalette.RED, in, chestBounds.move(4, 2, 3), 120);
    scene.overlay.chaseBoundingBoxOutline(PonderPalette.RED, out, chestBounds.move(0, 2, 3), 120);
    scene.overlay.showText(80).attachKeyFrame().text("However, not every type of Inventory can be interacted with directly").colored(PonderPalette.RED).placeNearTarget().pointAt(util.vector.blockSurface(util.grid.at(0, 2, 3), Direction.WEST));
    scene.idle(90);
    scene.world.showSection(util.select.fromTo(4, 1, 2, 4, 2, 2), Direction.SOUTH);
    scene.idle(5);
    scene.world.showSection(util.select.position(0, 2, 2), Direction.SOUTH);
    scene.idle(10);
    scene.overlay.chaseBoundingBoxOutline(PonderPalette.INPUT, in, depotBounds.move(4, 1, 2), 80);
    scene.idle(5);
    scene.overlay.chaseBoundingBoxOutline(PonderPalette.OUTPUT, out, funnelBounds.move(0, 2, 2), 80);
    scene.idle(5);
    scene.overlay.showText(60).text("Funnels and Depots can help to Bridge that gap").colored(PonderPalette.OUTPUT).placeNearTarget().pointAt(util.vector.topOf(util.grid.at(0, 2, 2)).add(0, 0, 0.25));
    scene.idle(70);
    ItemStack sword = new ItemStack(Items.GOLDEN_SWORD);
    inputDepot = util.grid.at(4, 1, 2);
    scene.overlay.showControls(new InputWindowElement(util.vector.topOf(inputDepot), Pointing.RIGHT).withItem(sword), 30);
    scene.world.createItemOnBeltLike(inputDepot, Direction.SOUTH, sword);
    scene.idle(20);
    scene.world.instructArm(armPos, Phase.MOVE_TO_INPUT, ItemStack.EMPTY, 1);
    scene.idle(24);
    scene.world.removeItemsFromBelt(inputDepot);
    scene.world.instructArm(armPos, Phase.SEARCH_OUTPUTS, sword, -1);
    scene.idle(20);
    scene.world.instructArm(armPos, Phase.MOVE_TO_OUTPUT, sword, 1);
    scene.idle(24);
    scene.world.flapFunnel(util.grid.at(0, 2, 2), false);
    scene.world.instructArm(armPos, Phase.SEARCH_INPUTS, ItemStack.EMPTY, -1);
    scene.idle(5);
    scene.overlay.showControls(new InputWindowElement(util.vector.blockSurface(util.grid.at(0, 2, 3), Direction.WEST), Pointing.LEFT).withItem(sword), 30);
}
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) ItemStack(net.minecraft.world.item.ItemStack) AABB(net.minecraft.world.phys.AABB)

Example 52 with Selection

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

the class BearingScenes method windmillsAsSource.

public static void windmillsAsSource(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("windmill_source", "Generating Rotational Force using Windmill Bearings");
    scene.configureBasePlate(1, 1, 5);
    scene.setSceneOffsetY(-1);
    scene.world.showSection(util.select.fromTo(1, 0, 1, 5, 0, 5), Direction.UP);
    scene.world.setBlock(util.grid.at(2, -1, 0), AllBlocks.SAIL.getDefaultState().setValue(SailBlock.FACING, Direction.NORTH), false);
    scene.idle(5);
    Selection kinetics = util.select.fromTo(3, 1, 1, 4, 1, 4);
    Selection largeCog = util.select.position(3, 2, 2);
    BlockPos windmill = util.grid.at(3, 2, 1);
    scene.world.showSection(kinetics.add(largeCog), Direction.DOWN);
    scene.idle(10);
    scene.world.showSection(util.select.position(windmill), Direction.DOWN);
    scene.idle(10);
    BlockPos anchorPos = windmill.north();
    scene.overlay.showSelectionWithText(util.select.position(anchorPos), 60).colored(PonderPalette.GREEN).pointAt(util.vector.blockSurface(windmill, Direction.WEST)).attachKeyFrame().placeNearTarget().text("Windmill Bearings attach to the block in front of them");
    scene.idle(50);
    ElementLink<WorldSectionElement> structure = scene.world.showIndependentSection(util.select.position(anchorPos), Direction.SOUTH);
    scene.idle(10);
    for (Direction d : Iterate.directions) if (d.getAxis() != Axis.Z)
        scene.world.showSectionAndMerge(util.select.fromTo(anchorPos.relative(d, 1), anchorPos.relative(d, 2)), d.getOpposite(), structure);
    scene.idle(10);
    scene.world.showSectionAndMerge(util.select.fromTo(anchorPos.above().east(), anchorPos.above(3).east()), Direction.WEST, structure);
    scene.world.showSectionAndMerge(util.select.fromTo(anchorPos.below().west(), anchorPos.below(3).west()), Direction.EAST, structure);
    scene.world.showSectionAndMerge(util.select.fromTo(anchorPos.east().below(), anchorPos.east(3).below()), Direction.UP, structure);
    scene.world.showSectionAndMerge(util.select.fromTo(anchorPos.west().above(), anchorPos.west(3).above()), Direction.DOWN, structure);
    scene.idle(5);
    for (Direction d : Iterate.directions) if (d.getAxis() != Axis.Z)
        scene.effects.superGlue(anchorPos.relative(d, 1), d.getOpposite(), false);
    scene.idle(10);
    scene.overlay.showText(60).pointAt(util.vector.blockSurface(anchorPos, Direction.NORTH)).attachKeyFrame().placeNearTarget().text("If enough Sail-like blocks are attached to the block, it can act as a Windmill");
    scene.idle(70);
    scene.rotateCameraY(-90);
    scene.idle(20);
    scene.overlay.showControls(new InputWindowElement(util.vector.topOf(windmill), Pointing.DOWN).rightClick(), 60);
    scene.idle(7);
    scene.world.rotateBearing(windmill, 360, 200);
    scene.world.rotateSection(structure, 0, 0, 360, 200);
    scene.world.setKineticSpeed(largeCog, 4);
    scene.world.setKineticSpeed(kinetics, -8);
    scene.effects.rotationDirectionIndicator(windmill.south());
    BlockPos gaugePos = util.grid.at(4, 1, 4);
    scene.effects.indicateSuccess(gaugePos);
    scene.idle(10);
    scene.overlay.showText(60).pointAt(util.vector.topOf(windmill)).placeNearTarget().attachKeyFrame().text("Activated with Right-Click, the Windmill Bearing will start providing Rotational Force");
    scene.idle(70);
    scene.overlay.showText(60).pointAt(util.vector.blockSurface(gaugePos, Direction.WEST)).colored(PonderPalette.SLOW).placeNearTarget().text("The Amount of Sail Blocks determine its Rotation Speed");
    scene.idle(90);
    Vec3 surface = util.vector.blockSurface(windmill, Direction.WEST);
    scene.overlay.showControls(new InputWindowElement(surface, Pointing.DOWN).scroll().withWrench(), 60);
    scene.overlay.showCenteredScrollInput(windmill, Direction.WEST, 50);
    scene.overlay.showText(60).pointAt(surface).attachKeyFrame().placeNearTarget().text("Use a Wrench to configure its rotation direction");
    scene.idle(36);
    scene.world.rotateBearing(windmill, -90 - 45, 75);
    scene.world.rotateSection(structure, 0, 0, -90 - 45, 75);
    scene.world.modifyKineticSpeed(largeCog, f -> -f);
    scene.world.modifyKineticSpeed(kinetics, f -> -f);
    scene.effects.rotationDirectionIndicator(windmill.south());
    scene.idle(69);
    scene.overlay.showControls(new InputWindowElement(util.vector.topOf(windmill), Pointing.DOWN).rightClick(), 60);
    scene.idle(7);
    scene.world.rotateBearing(windmill, -45, 0);
    scene.world.rotateSection(structure, 0, 0, -45, 0);
    scene.world.setKineticSpeed(largeCog, 0);
    scene.world.setKineticSpeed(kinetics, 0);
    scene.idle(10);
    scene.overlay.showText(60).pointAt(util.vector.topOf(windmill)).placeNearTarget().text("Right-click the Bearing anytime to stop and edit the Structure again");
}
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) Direction(net.minecraft.core.Direction)

Example 53 with Selection

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

the class BearingScenes method bearingModes.

public static void bearingModes(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("bearing_modes", "Movement Modes of the Mechanical Bearing");
    scene.configureBasePlate(1, 1, 6);
    scene.setSceneOffsetY(-1);
    Selection sideCog = util.select.position(util.grid.at(7, 0, 3));
    Selection cogColumn = util.select.fromTo(6, 1, 3, 6, 4, 3);
    Selection cogAndClutch = util.select.fromTo(5, 3, 1, 5, 4, 2);
    BlockPos leverPos = util.grid.at(5, 3, 1);
    scene.world.setKineticSpeed(sideCog, 4);
    scene.world.setKineticSpeed(cogColumn, -4);
    scene.world.setKineticSpeed(cogAndClutch, 8);
    scene.world.toggleRedstonePower(cogAndClutch);
    scene.world.showSection(util.select.layer(0), Direction.UP);
    scene.idle(5);
    scene.world.showSection(cogColumn, Direction.DOWN);
    scene.idle(5);
    scene.world.showSection(cogAndClutch, Direction.DOWN);
    scene.idle(10);
    BlockPos bearingPos = util.grid.at(5, 2, 2);
    scene.world.showSection(util.select.position(bearingPos), Direction.UP);
    scene.idle(10);
    ElementLink<WorldSectionElement> contraption = scene.world.showIndependentSection(util.select.fromTo(5, 1, 2, 2, 1, 2), Direction.EAST);
    scene.world.configureCenterOfRotation(contraption, util.vector.centerOf(bearingPos));
    scene.idle(20);
    scene.world.toggleRedstonePower(cogAndClutch);
    scene.effects.indicateRedstone(leverPos);
    scene.world.rotateSection(contraption, 0, 55, 0, 23);
    scene.world.rotateBearing(bearingPos, 55, 23);
    scene.idle(24);
    scene.world.toggleRedstonePower(cogAndClutch);
    scene.effects.indicateRedstone(leverPos);
    scene.world.rotateSection(contraption, 0, 35, 0, 0);
    scene.world.rotateBearing(bearingPos, 35, 0);
    Vec3 target = util.vector.topOf(bearingPos.below());
    scene.overlay.showLine(PonderPalette.RED, target.add(-2.5, 0, 3.5), target, 50);
    scene.overlay.showLine(PonderPalette.GREEN, target.add(0, 0, 4.5), target, 50);
    scene.idle(50);
    scene.overlay.showText(100).pointAt(util.vector.blockSurface(bearingPos, Direction.WEST)).placeNearTarget().colored(PonderPalette.RED).attachKeyFrame().text("When Stopped, the Bearing will place the structure at the nearest grid-aligned Angle");
    scene.idle(110);
    scene.overlay.showCenteredScrollInput(bearingPos, Direction.NORTH, 60);
    scene.overlay.showControls(new InputWindowElement(util.vector.blockSurface(bearingPos, Direction.NORTH), Pointing.DOWN).scroll().withWrench(), 60);
    scene.idle(10);
    scene.overlay.showText(60).pointAt(util.vector.blockSurface(bearingPos, Direction.WEST)).placeNearTarget().attachKeyFrame().sharedText("behaviour_modify_wrench");
    scene.idle(70);
    scene.world.modifyKineticSpeed(util.select.everywhere(), f -> -f);
    scene.world.toggleRedstonePower(cogAndClutch);
    scene.effects.indicateRedstone(leverPos);
    scene.world.rotateSection(contraption, 0, -55, 0, 23);
    scene.world.rotateBearing(bearingPos, -55, 23);
    scene.idle(24);
    scene.world.toggleRedstonePower(cogAndClutch);
    scene.effects.indicateRedstone(leverPos);
    scene.idle(40);
    scene.overlay.showText(120).colored(PonderPalette.GREEN).pointAt(util.vector.blockSurface(util.grid.at(3, 1, 3), Direction.UP)).text("It can be configured never to revert to solid blocks, or only near the angle it started at");
}
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)

Example 54 with Selection

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

the class BearingScenes method mechanicalBearing.

public static void mechanicalBearing(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("mechanical_bearing", "Movings Structures using the Mechanical Bearing");
    scene.configureBasePlate(1, 1, 5);
    scene.setSceneOffsetY(-1);
    scene.world.showSection(util.select.layer(0), Direction.UP);
    scene.idle(5);
    scene.world.showSection(util.select.layer(1), Direction.DOWN);
    scene.idle(10);
    scene.world.showSection(util.select.layer(2), Direction.DOWN);
    scene.idle(10);
    Selection cog1 = util.select.position(6, 0, 4);
    Selection cog2 = util.select.position(5, 1, 4);
    Selection cog3 = util.select.position(4, 1, 3);
    Selection cog4 = util.select.position(3, 1, 3);
    Selection all = cog1.copy().add(cog2).add(cog3).add(cog4);
    BlockPos bearingPos = util.grid.at(3, 2, 3);
    scene.overlay.showSelectionWithText(util.select.position(bearingPos.above()), 60).colored(PonderPalette.GREEN).pointAt(util.vector.blockSurface(bearingPos, Direction.WEST)).placeNearTarget().attachKeyFrame().text("Mechanical Bearings attach to the block in front of them");
    scene.idle(50);
    ElementLink<WorldSectionElement> plank = scene.world.showIndependentSection(util.select.position(bearingPos.above().east().north()), Direction.DOWN);
    scene.world.moveSection(plank, util.vector.of(-1, 0, 1), 0);
    scene.idle(20);
    scene.world.setKineticSpeed(cog1, -8);
    scene.world.setKineticSpeed(cog2, 8);
    scene.world.setKineticSpeed(cog3, -16);
    scene.world.setKineticSpeed(cog4, 16);
    scene.effects.rotationSpeedIndicator(bearingPos.below());
    scene.world.rotateBearing(bearingPos, 360, 37 * 2);
    scene.world.rotateSection(plank, 0, 360, 0, 37 * 2);
    scene.overlay.showText(80).pointAt(util.vector.topOf(bearingPos.above())).placeNearTarget().attachKeyFrame().text("Upon receiving Rotational Force, it will assemble it into a Rotating Contraption");
    scene.idle(37 * 2);
    scene.world.setKineticSpeed(all, 0);
    scene.idle(20);
    scene.world.hideIndependentSection(plank, Direction.UP);
    scene.idle(15);
    Selection plank2 = util.select.position(4, 3, 2);
    ElementLink<WorldSectionElement> contraption = scene.world.showIndependentSection(util.select.layersFrom(3).substract(plank2), Direction.DOWN);
    scene.idle(10);
    scene.world.showSectionAndMerge(plank2, Direction.SOUTH, contraption);
    scene.idle(15);
    scene.effects.superGlue(util.grid.at(4, 3, 2), Direction.SOUTH, true);
    scene.idle(5);
    scene.world.configureCenterOfRotation(contraption, util.vector.topOf(bearingPos));
    scene.world.setKineticSpeed(cog1, -8);
    scene.world.setKineticSpeed(cog2, 8);
    scene.world.setKineticSpeed(cog3, -16);
    scene.world.setKineticSpeed(cog4, 16);
    scene.effects.rotationSpeedIndicator(bearingPos.below());
    scene.world.rotateBearing(bearingPos, 360 * 2, 37 * 4);
    scene.world.rotateSection(contraption, 0, 360 * 2, 0, 37 * 4);
    scene.overlay.showText(120).pointAt(util.vector.topOf(bearingPos.above())).placeNearTarget().attachKeyFrame().sharedText("movement_anchors");
    scene.idle(37 * 4);
    scene.world.setKineticSpeed(all, 0);
}
Also used : Selection(com.simibubi.create.foundation.ponder.Selection) BlockPos(net.minecraft.core.BlockPos) WorldSectionElement(com.simibubi.create.foundation.ponder.element.WorldSectionElement)

Example 55 with Selection

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

the class BearingScenes method stabilizedBearings.

public static void stabilizedBearings(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("stabilized_bearings", "Stabilized Contraptions");
    scene.configureBasePlate(1, 1, 5);
    scene.setSceneOffsetY(-1);
    Selection beltAndBearing = util.select.fromTo(3, 3, 4, 3, 1, 6);
    Selection largeCog = util.select.position(2, 0, 6);
    BlockPos parentBearingPos = util.grid.at(3, 3, 4);
    BlockPos bearingPos = util.grid.at(3, 4, 2);
    scene.world.showSection(util.select.layer(0), Direction.UP);
    scene.idle(5);
    scene.world.showSection(beltAndBearing, Direction.DOWN);
    scene.idle(10);
    ElementLink<WorldSectionElement> contraption = scene.world.showIndependentSection(util.select.fromTo(3, 3, 3, 3, 4, 3), Direction.SOUTH);
    scene.world.configureCenterOfRotation(contraption, util.vector.centerOf(parentBearingPos));
    scene.idle(20);
    scene.world.glueBlockOnto(bearingPos, Direction.SOUTH, contraption);
    scene.idle(15);
    scene.overlay.showSelectionWithText(util.select.position(bearingPos), 60).text("Whenever Mechanical Bearings are themselves part of a moving Structure..").attachKeyFrame().placeNearTarget();
    scene.idle(70);
    scene.world.setKineticSpeed(largeCog, -8);
    scene.world.setKineticSpeed(beltAndBearing, 16);
    scene.world.rotateBearing(parentBearingPos, 360, 74);
    scene.world.rotateSection(contraption, 0, 0, 360, 74);
    scene.world.rotateBearing(bearingPos, -360, 74);
    scene.idle(74);
    scene.world.setKineticSpeed(largeCog, 0);
    scene.world.setKineticSpeed(beltAndBearing, 0);
    scene.overlay.showText(60).text("..they will attempt to keep themselves upright").pointAt(util.vector.blockSurface(bearingPos, Direction.NORTH)).placeNearTarget();
    scene.idle(70);
    scene.overlay.showSelectionWithText(util.select.position(bearingPos.north()), 60).colored(PonderPalette.GREEN).text("Once again, the bearing will attach to the block in front of it").attachKeyFrame().placeNearTarget();
    scene.idle(70);
    ElementLink<WorldSectionElement> subContraption = scene.world.showIndependentSection(util.select.fromTo(4, 4, 1, 2, 4, 1), Direction.SOUTH);
    scene.world.configureCenterOfRotation(subContraption, util.vector.centerOf(parentBearingPos));
    scene.world.configureStabilization(subContraption, util.vector.centerOf(bearingPos));
    scene.idle(20);
    scene.overlay.showText(80).text("As a result, the entire sub-Contraption will stay upright");
    scene.world.setKineticSpeed(largeCog, -8);
    scene.world.setKineticSpeed(beltAndBearing, 16);
    scene.world.rotateBearing(parentBearingPos, 360 * 2, 74 * 2);
    scene.world.rotateSection(contraption, 0, 0, 360 * 2, 74 * 2);
    scene.world.rotateBearing(bearingPos, -360 * 2, 74 * 2);
    scene.world.rotateSection(subContraption, 0, 0, 360 * 2, 74 * 2);
    scene.markAsFinished();
    scene.idle(74 * 2);
    scene.world.setKineticSpeed(largeCog, 0);
    scene.world.setKineticSpeed(beltAndBearing, 0);
}
Also used : Selection(com.simibubi.create.foundation.ponder.Selection) 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