Search in sources :

Example 41 with InputWindowElement

use of com.simibubi.create.foundation.ponder.element.InputWindowElement 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 42 with InputWindowElement

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

the class ArmScenes method modes.

public static void modes(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("mechanical_arm_modes", "Distribution modes of the Mechanical Arm");
    scene.configureBasePlate(0, 1, 5);
    scene.world.setBlock(util.grid.at(3, 1, 0), Blocks.BARRIER.defaultBlockState(), false);
    scene.world.showSection(util.select.layer(0), Direction.UP);
    scene.idle(5);
    scene.world.showSection(util.select.fromTo(3, 1, 4, 4, 1, 5), Direction.DOWN);
    scene.idle(5);
    scene.world.showSection(util.select.fromTo(1, 1, 4, 1, 2, 5), Direction.NORTH);
    scene.idle(5);
    scene.world.showSection(util.select.fromTo(1, 1, 1, 5, 1, 2), Direction.SOUTH);
    scene.idle(10);
    AABB depotBox = AllShapes.DEPOT.bounds();
    AABB beltBox = depotBox.contract(0, -3 / 16f, 0).inflate(1, 0, 0);
    BlockPos depotPos = util.grid.at(1, 1, 4);
    BlockPos armPos = util.grid.at(3, 1, 4);
    scene.overlay.chaseBoundingBoxOutline(PonderPalette.INPUT, depotBox, depotBox.move(1, 1, 4), 60);
    scene.overlay.showText(30).text("Input").pointAt(util.vector.blockSurface(depotPos, Direction.WEST)).placeNearTarget().colored(PonderPalette.INPUT);
    scene.idle(40);
    scene.overlay.chaseBoundingBoxOutline(PonderPalette.OUTPUT, depotBox, beltBox.move(2, 1, 2), 40);
    scene.overlay.showText(40).text("Outputs").pointAt(util.vector.blockSurface(util.grid.at(1, 1, 2), Direction.WEST)).placeNearTarget().colored(PonderPalette.OUTPUT);
    scene.idle(50);
    ItemStack item = new ItemStack(Items.SNOWBALL);
    scene.world.createItemOnBeltLike(depotPos, Direction.SOUTH, item);
    scene.overlay.showText(60).attachKeyFrame().text("Whenever an Arm has to choose between multiple valid outputs...").pointAt(util.vector.blockSurface(util.grid.at(2, 1, 2), Direction.UP)).placeNearTarget().colored(PonderPalette.OUTPUT);
    scene.idle(70);
    Vec3 scrollSlot = util.vector.of(3.5, 1.25, 4);
    scene.overlay.showFilterSlotInput(scrollSlot, 120);
    scene.overlay.showText(50).text("...it will act according to its setting").pointAt(scrollSlot).placeNearTarget();
    scene.idle(60);
    scene.overlay.showControls(new InputWindowElement(scrollSlot, Pointing.RIGHT).scroll().withWrench(), 40);
    scene.idle(10);
    scene.overlay.showText(50).text("Scrolling with a Wrench will allow you to configure it").pointAt(scrollSlot).placeNearTarget();
    scene.idle(60);
    ElementLink<WorldSectionElement> blockage = scene.world.showIndependentSection(util.select.position(4, 1, 0), Direction.UP);
    scene.world.moveSection(blockage, util.vector.of(-1, 0, 0), 0);
    for (int i = 0; i < 20; i++) {
        if (i == 2) {
            scene.overlay.showText(60).attachKeyFrame().text("Round Robin mode simply cycles through all outputs that are available").pointAt(util.vector.blockSurface(util.grid.at(2, 1, 2), Direction.UP)).placeNearTarget().colored(PonderPalette.OUTPUT);
        }
        if (i == 6)
            continue;
        if (i == 7) {
            scene.overlay.showText(60).attachKeyFrame().text("If an output is unable to take more items, it will be skipped").pointAt(util.vector.blockSurface(util.grid.at(3, 1, 2), Direction.UP)).placeNearTarget().colored(PonderPalette.GREEN);
        }
        if (i == 12) {
            scene.world.moveSection(blockage, util.vector.of(-1, 0, 0), 10);
            scene.world.setBlock(util.grid.at(3, 1, 0), Blocks.BARRIER.defaultBlockState(), false);
        }
        int index = i % 3;
        if (i == 13) {
            scene.world.setBlock(util.grid.at(2, 1, 0), Blocks.BARRIER.defaultBlockState(), false);
            ElementLink<WorldSectionElement> blockage2 = scene.world.showIndependentSection(util.select.position(4, 1, 0), Direction.UP);
            scene.world.moveSection(blockage2, util.vector.of(-2, 0, 0), 0);
            scene.overlay.showText(60).attachKeyFrame().text("Prefer First prioritizes the outputs selected earliest when configuring this Arm").pointAt(util.vector.blockSurface(util.grid.at(3, 1, 2), Direction.UP)).placeNearTarget().colored(PonderPalette.GREEN);
            index = 0;
        }
        if (i == 14)
            index = 1;
        if (i == 15)
            index = 1;
        if (i >= 16)
            index = 2;
        scene.idle(5);
        scene.world.instructArm(armPos, Phase.MOVE_TO_INPUT, ItemStack.EMPTY, 0);
        scene.idle(12);
        scene.world.instructArm(armPos, Phase.SEARCH_OUTPUTS, item, -1);
        scene.world.removeItemsFromBelt(depotPos);
        scene.idle(5);
        if (i == 9) {
            scene.overlay.showText(80).attachKeyFrame().text("Forced Round Robin mode will never skip outputs, and instead wait until they are free").pointAt(util.vector.blockSurface(util.grid.at(3, 1, 2), Direction.UP)).placeNearTarget().colored(PonderPalette.RED);
            scene.idle(40);
            scene.world.moveSection(blockage, util.vector.of(1, 0, 0), 10);
            scene.world.setBlock(util.grid.at(3, 1, 0), Blocks.AIR.defaultBlockState(), false);
            scene.idle(50);
            scene.world.multiplyKineticSpeed(util.select.fromTo(1, 1, 1, 5, 0, 3), 2);
        }
        scene.world.instructArm(armPos, Phase.MOVE_TO_OUTPUT, item, index);
        scene.world.createItemOnBeltLike(depotPos, Direction.SOUTH, item);
        scene.idle(12);
        scene.world.instructArm(armPos, Phase.SEARCH_INPUTS, ItemStack.EMPTY, -1);
        scene.world.createItemOnBelt(util.grid.at(3 - index, 1, 2), Direction.UP, item);
    }
}
Also used : 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) AABB(net.minecraft.world.phys.AABB)

Example 43 with InputWindowElement

use of com.simibubi.create.foundation.ponder.element.InputWindowElement 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 44 with InputWindowElement

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

the class BearingScenes method sails.

private static void sails(SceneBuilder scene, SceneBuildingUtil util, boolean frame) {
    String plural = frame ? "Sail Frames" : "Sails";
    scene.title(frame ? "sail_frame" : "sail", "Assembling Windmills using " + plural);
    scene.configureBasePlate(0, 0, 5);
    scene.scaleSceneView(0.9f);
    scene.world.showSection(util.select.layer(0), Direction.UP);
    scene.idle(5);
    BlockPos bearingPos = util.grid.at(2, 1, 2);
    scene.world.showSection(util.select.position(bearingPos), Direction.DOWN);
    scene.idle(5);
    ElementLink<WorldSectionElement> plank = scene.world.showIndependentSection(util.select.position(bearingPos.above()), Direction.DOWN);
    scene.idle(10);
    for (int i = 0; i < 3; i++) {
        for (Direction d : Iterate.horizontalDirections) {
            BlockPos location = bearingPos.above(i + 1).relative(d);
            if (frame)
                scene.world.modifyBlock(location, s -> AllBlocks.SAIL_FRAME.getDefaultState().setValue(SailBlock.FACING, s.getValue(SailBlock.FACING)), false);
            scene.world.showSectionAndMerge(util.select.position(location), d.getOpposite(), plank);
            scene.idle(2);
        }
    }
    scene.overlay.showText(70).text(plural + " are handy blocks to create Windmills with").pointAt(util.vector.blockSurface(util.grid.at(1, 3, 2), Direction.WEST)).placeNearTarget().attachKeyFrame();
    scene.idle(80);
    scene.overlay.showSelectionWithText(util.select.position(bearingPos.above()), 80).colored(PonderPalette.GREEN).text("They will attach to blocks and each other without the need of Super Glue or Chassis Blocks").attachKeyFrame().placeNearTarget();
    scene.idle(40);
    scene.world.configureCenterOfRotation(plank, util.vector.centerOf(bearingPos));
    if (!frame) {
        scene.world.rotateBearing(bearingPos, 180, 75);
        scene.world.rotateSection(plank, 0, 180, 0, 75);
        scene.idle(76);
        scene.world.rotateBearing(bearingPos, 180, 0);
        scene.world.rotateSection(plank, 0, 180, 0, 0);
        scene.rotateCameraY(-30);
        scene.idle(10);
        InputWindowElement input = new InputWindowElement(util.vector.blockSurface(util.grid.at(2, 3, 1), Direction.NORTH), Pointing.RIGHT).withItem(new ItemStack(Items.BLUE_DYE));
        scene.overlay.showControls(input, 30);
        scene.idle(7);
        scene.world.setBlock(util.grid.at(2, 3, 1), AllBlocks.DYED_SAILS.get(DyeColor.BLUE).getDefaultState().setValue(SailBlock.FACING, Direction.WEST), false);
        scene.idle(10);
        scene.overlay.showText(40).colored(PonderPalette.BLUE).text("Right-Click with Dye to paint them").attachKeyFrame().pointAt(util.vector.blockSurface(util.grid.at(2, 3, 1), Direction.WEST)).placeNearTarget();
        scene.idle(20);
        scene.overlay.showControls(input, 30);
        scene.idle(7);
        scene.world.replaceBlocks(util.select.fromTo(2, 2, 1, 2, 4, 1), AllBlocks.DYED_SAILS.get(DyeColor.BLUE).getDefaultState().setValue(SailBlock.FACING, Direction.WEST), false);
        scene.idle(20);
        scene.world.rotateBearing(bearingPos, 90, 33);
        scene.world.rotateSection(plank, 0, 90, 0, 33);
        scene.idle(40);
        input = new InputWindowElement(util.vector.blockSurface(util.grid.at(2, 3, 1), Direction.NORTH), Pointing.RIGHT).withItem(new ItemStack(Items.SHEARS));
        scene.overlay.showControls(input, 30);
        scene.idle(7);
        scene.world.setBlock(util.grid.at(3, 3, 2), AllBlocks.SAIL_FRAME.getDefaultState().setValue(SailBlock.FACING, Direction.NORTH), false);
        scene.idle(10);
        scene.overlay.showText(40).text("Right-Click with Shears to turn them back into frames").attachKeyFrame().pointAt(util.vector.blockSurface(util.grid.at(2, 3, 1), Direction.WEST)).placeNearTarget();
        scene.idle(20);
        scene.overlay.showControls(input, 30);
        scene.idle(7);
        scene.world.replaceBlocks(util.select.fromTo(3, 2, 2, 3, 4, 2), AllBlocks.SAIL_FRAME.getDefaultState().setValue(SailBlock.FACING, Direction.NORTH), false);
        scene.idle(20);
    }
    scene.world.rotateBearing(bearingPos, 720, 300);
    scene.world.rotateSection(plank, 0, 720, 0, 300);
}
Also used : SailBlock(com.simibubi.create.content.contraptions.components.structureMovement.bearing.SailBlock) SuperGlueEntity(com.simibubi.create.content.contraptions.components.structureMovement.glue.SuperGlueEntity) DyeColor(net.minecraft.world.item.DyeColor) Selection(com.simibubi.create.foundation.ponder.Selection) Iterate(com.simibubi.create.foundation.utility.Iterate) Items(net.minecraft.world.item.Items) SceneBuilder(com.simibubi.create.foundation.ponder.SceneBuilder) InputWindowElement(com.simibubi.create.foundation.ponder.element.InputWindowElement) Direction(net.minecraft.core.Direction) SceneBuildingUtil(com.simibubi.create.foundation.ponder.SceneBuildingUtil) Pointing(com.simibubi.create.foundation.utility.Pointing) HarvesterTileEntity(com.simibubi.create.content.contraptions.components.actors.HarvesterTileEntity) Axis(net.minecraft.core.Direction.Axis) WorldSectionElement(com.simibubi.create.foundation.ponder.element.WorldSectionElement) ElementLink(com.simibubi.create.foundation.ponder.ElementLink) Entity(net.minecraft.world.entity.Entity) PonderPalette(com.simibubi.create.foundation.ponder.PonderPalette) BlockPos(net.minecraft.core.BlockPos) Vec3(net.minecraft.world.phys.Vec3) ItemStack(net.minecraft.world.item.ItemStack) AllBlocks(com.simibubi.create.AllBlocks) 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) Direction(net.minecraft.core.Direction)

Example 45 with InputWindowElement

use of com.simibubi.create.foundation.ponder.element.InputWindowElement 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)

Aggregations

InputWindowElement (com.simibubi.create.foundation.ponder.element.InputWindowElement)85 BlockPos (net.minecraft.core.BlockPos)75 Vec3 (net.minecraft.world.phys.Vec3)63 Selection (com.simibubi.create.foundation.ponder.Selection)61 ItemStack (net.minecraft.world.item.ItemStack)60 WorldSectionElement (com.simibubi.create.foundation.ponder.element.WorldSectionElement)47 Entity (net.minecraft.world.entity.Entity)25 ItemEntity (net.minecraft.world.entity.item.ItemEntity)18 EntityElement (com.simibubi.create.foundation.ponder.element.EntityElement)17 AABB (net.minecraft.world.phys.AABB)16 Direction (net.minecraft.core.Direction)12 ElementLink (com.simibubi.create.foundation.ponder.ElementLink)11 MechanicalPressTileEntity (com.simibubi.create.content.contraptions.components.press.MechanicalPressTileEntity)9 PonderPalette (com.simibubi.create.foundation.ponder.PonderPalette)9 SceneBuilder (com.simibubi.create.foundation.ponder.SceneBuilder)9 SceneBuildingUtil (com.simibubi.create.foundation.ponder.SceneBuildingUtil)9 Pointing (com.simibubi.create.foundation.utility.Pointing)9 DeployerTileEntity (com.simibubi.create.content.contraptions.components.deployer.DeployerTileEntity)8 Items (net.minecraft.world.item.Items)8 BlockState (net.minecraft.world.level.block.state.BlockState)8