Search in sources :

Example 11 with Selection

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

the class GantryScenes method intro.

private static void intro(SceneBuilder scene, SceneBuildingUtil util, boolean pinion) {
    String id = "gantry_" + (pinion ? "carriage" : "shaft");
    String title = "Using Gantry " + (pinion ? "Carriages" : "Shafts");
    scene.title(id, title);
    scene.world.modifyKineticSpeed(util.select.everywhere(), f -> -2 * f);
    scene.configureBasePlate(0, 0, 5);
    scene.world.showSection(util.select.layer(0), Direction.UP);
    scene.idle(10);
    scene.world.showSection(util.select.layer(1), Direction.DOWN);
    scene.idle(10);
    ElementLink<WorldSectionElement> gantry = scene.world.showIndependentSection(util.select.layer(2), Direction.DOWN);
    scene.idle(10);
    BlockPos centralShaft = util.grid.at(2, 1, 2);
    scene.world.moveSection(gantry, util.vector.of(-4, 0, 0), 60);
    String text = pinion ? "Gantry Carriages can mount to and slide along a Gantry Shaft." : "Gantry Shafts form the basis of a gantry setup. Attached Carriages will move along them.";
    scene.overlay.showText(80).attachKeyFrame().text(text).pointAt(util.vector.centerOf(centralShaft));
    scene.idle(80);
    scene.world.hideIndependentSection(gantry, Direction.UP);
    scene.idle(10);
    gantry = scene.world.showIndependentSection(util.select.layer(2), Direction.DOWN);
    Vec3 gantryTop = util.vector.topOf(4, 2, 2);
    scene.world.modifyKineticSpeed(util.select.everywhere(), f -> 0f);
    scene.overlay.showText(40).attachKeyFrame().text("Gantry setups can move attached Blocks.").pointAt(gantryTop).placeNearTarget();
    scene.idle(30);
    Selection planks = util.select.position(5, 3, 1);
    scene.world.showSectionAndMerge(util.select.layersFrom(3).substract(planks), Direction.DOWN, gantry);
    scene.idle(10);
    scene.world.showSectionAndMerge(planks, Direction.SOUTH, gantry);
    scene.idle(10);
    scene.effects.superGlue(util.grid.at(5, 3, 1), Direction.SOUTH, true);
    scene.idle(20);
    scene.overlay.showText(80).attachKeyFrame().sharedText("movement_anchors").pointAt(gantryTop).placeNearTarget();
    scene.idle(80);
    scene.world.modifyKineticSpeed(util.select.layer(0), f -> 32f);
    scene.world.modifyKineticSpeed(util.select.layer(1), f -> -64f);
    scene.world.moveSection(gantry, util.vector.of(-4, 0, 0), 60);
    scene.idle(20);
    scene.markAsFinished();
}
Also used : Selection(com.simibubi.create.foundation.ponder.Selection) Vec3(net.minecraft.world.phys.Vec3) BlockPos(net.minecraft.core.BlockPos) WorldSectionElement(com.simibubi.create.foundation.ponder.element.WorldSectionElement)

Example 12 with Selection

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

the class GantryScenes method direction.

public static void direction(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("gantry_direction", "Gantry Movement Direction");
    scene.configureBasePlate(0, 0, 5);
    scene.world.modifyKineticSpeed(util.select.everywhere(), f -> -f);
    scene.world.showSection(util.select.layer(0), Direction.UP);
    scene.idle(10);
    Selection shaftAndGearshiftAndLever = util.select.fromTo(0, 1, 2, 5, 2, 2);
    Selection shafts = util.select.fromTo(0, 1, 2, 3, 1, 2);
    scene.world.showSection(shaftAndGearshiftAndLever, Direction.DOWN);
    scene.overlay.showText(60).text("Gantry Shafts can have opposite orientations").pointAt(util.vector.of(2, 1.5, 2.5)).placeNearTarget();
    scene.idle(60);
    ElementLink<WorldSectionElement> gantry1 = scene.world.showIndependentSection(util.select.position(0, 1, 3), Direction.NORTH);
    ElementLink<WorldSectionElement> gantry2 = scene.world.showIndependentSection(util.select.position(3, 1, 3), Direction.NORTH);
    scene.idle(10);
    scene.world.moveSection(gantry1, util.vector.of(1, 0, 0), 20);
    scene.world.moveSection(gantry2, util.vector.of(-1, 0, 0), 20);
    scene.overlay.showText(80).attachKeyFrame().text("The movement direction of carriages depend on their shafts' orientation").pointAt(util.vector.topOf(1, 1, 3)).placeNearTarget();
    scene.idle(80);
    BlockPos lastShaft = util.grid.at(0, 1, 2);
    boolean flip = true;
    for (int i = 0; i < 3; i++) {
        scene.world.modifyBlocks(util.select.fromTo(4, 1, 2, 4, 2, 2), s -> s.cycle(BlockStateProperties.POWERED), false);
        scene.effects.indicateRedstone(util.grid.at(4, 2, 2));
        scene.world.moveSection(gantry1, util.vector.of(flip ? -1 : 1, 0, 0), 20);
        scene.world.moveSection(gantry2, util.vector.of(flip ? 1 : -1, 0, 0), 20);
        scene.world.modifyKineticSpeed(shafts, f -> -f);
        scene.effects.rotationDirectionIndicator(lastShaft.east(flip ? 1 : 0));
        scene.idle(20);
        if (i == 0) {
            scene.overlay.showText(80).attachKeyFrame().text("...as well as the rotation direction of the shaft").pointAt(util.vector.blockSurface(lastShaft, Direction.WEST)).placeNearTarget();
        }
        scene.idle(30);
        flip = !flip;
    }
    Selection kinetics = util.select.fromTo(0, 2, 3, 3, 3, 3);
    Selection gears1 = util.select.fromTo(0, 1, 3, 0, 3, 3);
    Selection gears2 = util.select.fromTo(3, 1, 3, 3, 3, 3);
    scene.world.showSection(kinetics, Direction.DOWN);
    scene.world.showSection(util.select.fromTo(0, 1, 0, 4, 1, 1), Direction.SOUTH);
    scene.idle(20);
    BlockPos leverPos = util.grid.at(4, 1, 0);
    scene.world.modifyBlocks(util.select.fromTo(1, 1, 0, 3, 1, 1), s -> s.hasProperty(RedStoneWireBlock.POWER) ? s.setValue(RedStoneWireBlock.POWER, 15) : s, false);
    scene.world.toggleRedstonePower(util.select.position(leverPos));
    scene.world.toggleRedstonePower(shafts);
    scene.effects.indicateRedstone(leverPos);
    scene.world.modifyKineticSpeed(gears1, f -> -32f);
    scene.world.modifyKineticSpeed(gears2, f -> 32f);
    scene.idle(20);
    scene.overlay.showText(120).attachKeyFrame().text("Same rules apply for the propagated rotation").pointAt(util.vector.topOf(0, 3, 3)).placeNearTarget();
    scene.idle(20);
    for (boolean flip2 : Iterate.trueAndFalse) {
        scene.effects.rotationDirectionIndicator(util.grid.at(0, 3, 3));
        scene.effects.rotationDirectionIndicator(util.grid.at(3, 3, 3));
        scene.idle(60);
        scene.world.modifyBlocks(util.select.fromTo(4, 1, 2, 4, 2, 2), s -> s.cycle(BlockStateProperties.POWERED), false);
        scene.effects.indicateRedstone(util.grid.at(4, 2, 2));
        scene.world.modifyKineticSpeed(gears1, f -> -f);
        scene.world.modifyKineticSpeed(gears2, f -> -f);
        if (!flip2) {
            scene.effects.rotationDirectionIndicator(util.grid.at(0, 3, 3));
            scene.effects.rotationDirectionIndicator(util.grid.at(3, 3, 3));
            scene.markAsFinished();
        }
    }
}
Also used : Selection(com.simibubi.create.foundation.ponder.Selection) BlockPos(net.minecraft.core.BlockPos) WorldSectionElement(com.simibubi.create.foundation.ponder.element.WorldSectionElement)

Example 13 with Selection

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

the class GantryScenes method redstone.

public static void redstone(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("gantry_redstone", "Gantry Power Propagation");
    scene.world.modifyKineticSpeed(util.select.everywhere(), f -> -f);
    Selection leverRedstone = util.select.fromTo(3, 1, 0, 3, 1, 1);
    Selection shaft = util.select.fromTo(0, 1, 2, 4, 1, 2);
    Selection shaftAndCog = util.select.fromTo(0, 1, 2, 5, 1, 2);
    scene.configureBasePlate(0, 0, 5);
    scene.world.showSection(util.select.layer(0).add(leverRedstone), Direction.UP);
    scene.idle(10);
    scene.world.showSection(shaftAndCog, Direction.DOWN);
    scene.idle(10);
    BlockPos gantryPos = util.grid.at(4, 2, 2);
    ElementLink<WorldSectionElement> gantry = scene.world.showIndependentSection(util.select.position(gantryPos), Direction.DOWN);
    scene.idle(15);
    scene.world.moveSection(gantry, util.vector.of(-3, 0, 0), 40);
    scene.idle(40);
    scene.world.toggleRedstonePower(shaft);
    scene.world.toggleRedstonePower(util.select.position(3, 1, 0));
    scene.world.toggleRedstonePower(util.select.position(3, 1, 1));
    scene.effects.indicateRedstone(util.grid.at(3, 1, 0));
    scene.world.modifyKineticSpeed(util.select.position(gantryPos), f -> 32f);
    scene.idle(40);
    BlockPos cogPos = util.grid.at(1, 2, 1);
    scene.overlay.showText(60).attachKeyFrame().colored(PonderPalette.RED).pointAt(util.vector.centerOf(cogPos.below().south())).text("Redstone-powered gantry shafts stop moving their carriages").placeNearTarget();
    scene.idle(70);
    Selection cogSelection = util.select.position(cogPos);
    scene.world.showSection(cogSelection, Direction.SOUTH);
    scene.world.modifyKineticSpeed(cogSelection, f -> 32f);
    scene.overlay.showText(180).colored(PonderPalette.GREEN).pointAt(util.vector.blockSurface(cogPos, Direction.NORTH)).text("Instead, its rotational force is relayed to the carriages' output shaft").placeNearTarget();
    scene.idle(10);
    scene.effects.rotationSpeedIndicator(cogPos);
    scene.markAsFinished();
}
Also used : Selection(com.simibubi.create.foundation.ponder.Selection) BlockPos(net.minecraft.core.BlockPos) WorldSectionElement(com.simibubi.create.foundation.ponder.element.WorldSectionElement)

Example 14 with Selection

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

the class ItemVaultScenes method sizes.

public static void sizes(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("item_vault_sizes", "Dimensions of an Item Vault");
    scene.configureBasePlate(0, 0, 6);
    scene.scaleSceneView(0.9f);
    scene.showBasePlate();
    scene.idle(5);
    Selection single = util.select.position(2, 4, 2);
    Selection single2 = util.select.fromTo(2, 4, 3, 3, 5, 3);
    Selection single3 = util.select.fromTo(2, 4, 4, 4, 6, 4);
    ElementLink<WorldSectionElement> s1 = scene.world.showIndependentSection(single, Direction.DOWN);
    scene.world.moveSection(s1, util.vector.of(0, -3, 0), 0);
    scene.idle(10);
    scene.overlay.showText(60).text("Item Vaults can be combined to increase the total capacity").attachKeyFrame().placeNearTarget().pointAt(util.vector.topOf(2, 1, 2));
    scene.idle(40);
    ElementLink<WorldSectionElement> s2 = scene.world.showIndependentSection(single, Direction.DOWN);
    scene.world.moveSection(s2, util.vector.of(1, -3, 0), 0);
    scene.idle(5);
    ElementLink<WorldSectionElement> s3 = scene.world.showIndependentSection(single, Direction.DOWN);
    scene.world.moveSection(s3, util.vector.of(1, -2, 0), 0);
    scene.idle(5);
    ElementLink<WorldSectionElement> s4 = scene.world.showIndependentSection(single, Direction.DOWN);
    scene.world.moveSection(s4, util.vector.of(0, -2, 0), 0);
    scene.idle(10);
    scene.world.moveSection(s1, util.vector.of(0, -100, 0), 0);
    scene.world.moveSection(s2, util.vector.of(0, -100, 0), 0);
    scene.world.moveSection(s3, util.vector.of(0, -100, 0), 0);
    scene.world.moveSection(s4, util.vector.of(0, -100, 0), 0);
    ElementLink<WorldSectionElement> d = scene.world.showIndependentSectionImmediately(single2);
    scene.world.moveSection(d, util.vector.of(0, -3, -1), 0);
    scene.effects.indicateSuccess(util.grid.at(2, 1, 2));
    scene.effects.indicateSuccess(util.grid.at(2, 2, 2));
    scene.effects.indicateSuccess(util.grid.at(3, 2, 2));
    scene.effects.indicateSuccess(util.grid.at(3, 1, 2));
    scene.world.hideIndependentSection(s1, Direction.DOWN);
    scene.world.hideIndependentSection(s2, Direction.DOWN);
    scene.world.hideIndependentSection(s3, Direction.DOWN);
    scene.world.hideIndependentSection(s4, Direction.DOWN);
    scene.idle(25);
    scene.overlay.showText(60).text("Their base square can be up to 3 blocks wide...").attachKeyFrame().placeNearTarget().pointAt(util.vector.blockSurface(util.grid.at(2, 2, 2), Direction.NORTH));
    scene.idle(40);
    s1 = scene.world.showIndependentSection(single, Direction.DOWN);
    scene.world.moveSection(s1, util.vector.of(2, -3, 0), 0);
    scene.idle(3);
    s2 = scene.world.showIndependentSection(single, Direction.DOWN);
    scene.world.moveSection(s2, util.vector.of(2, -2, 0), 0);
    scene.idle(3);
    s3 = scene.world.showIndependentSection(single, Direction.DOWN);
    scene.world.moveSection(s3, util.vector.of(2, -1, 0), 0);
    scene.idle(3);
    s4 = scene.world.showIndependentSection(single, Direction.DOWN);
    scene.world.moveSection(s4, util.vector.of(1, -1, 0), 0);
    scene.idle(3);
    ElementLink<WorldSectionElement> s5 = scene.world.showIndependentSection(single, Direction.DOWN);
    scene.world.moveSection(s5, util.vector.of(0, -1, 0), 0);
    scene.idle(10);
    scene.world.moveSection(d, util.vector.of(0, -100, 0), 0);
    scene.world.moveSection(s1, util.vector.of(0, -100, 0), 0);
    scene.world.moveSection(s2, util.vector.of(0, -100, 0), 0);
    scene.world.moveSection(s3, util.vector.of(0, -100, 0), 0);
    scene.world.moveSection(s4, util.vector.of(0, -100, 0), 0);
    scene.world.moveSection(s5, util.vector.of(0, -100, 0), 0);
    ElementLink<WorldSectionElement> t = scene.world.showIndependentSectionImmediately(single3);
    scene.world.moveSection(t, util.vector.of(0, -3, -2), 0);
    for (int i = 1; i < 4; i++) for (int j = 2; j < 5; j++) scene.effects.indicateSuccess(util.grid.at(j, i, 2));
    scene.world.hideIndependentSection(d, Direction.DOWN);
    scene.world.hideIndependentSection(s1, Direction.DOWN);
    scene.world.hideIndependentSection(s2, Direction.DOWN);
    scene.world.hideIndependentSection(s3, Direction.DOWN);
    scene.world.hideIndependentSection(s4, Direction.DOWN);
    scene.world.hideIndependentSection(s5, Direction.DOWN);
    scene.idle(25);
    scene.world.hideIndependentSection(t, Direction.DOWN);
    scene.idle(15);
    Selection full1 = util.select.fromTo(2, 1, 0, 4, 1, 0);
    Selection full2 = util.select.fromTo(0, 1, 1, 3, 2, 2);
    Selection full3 = util.select.fromTo(1, 1, 5, 5, 3, 3);
    scene.world.showSection(full3, Direction.WEST);
    scene.idle(5);
    scene.world.showSection(full2, Direction.EAST);
    scene.idle(5);
    scene.world.showSection(full1, Direction.WEST);
    scene.idle(10);
    Vec3 blockSurface = util.vector.blockSurface(util.grid.at(1, 3, 3), Direction.NORTH);
    scene.overlay.showText(60).text("...and grow in length up to 3x their diameter").attachKeyFrame().placeNearTarget().pointAt(blockSurface);
    scene.idle(40);
}
Also used : Selection(com.simibubi.create.foundation.ponder.Selection) Vec3(net.minecraft.world.phys.Vec3) WorldSectionElement(com.simibubi.create.foundation.ponder.element.WorldSectionElement)

Example 15 with Selection

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

the class KineticsScenes method shaftAsRelay.

public static void shaftAsRelay(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("shaft", "Relaying rotational force using Shafts");
    scene.configureBasePlate(0, 0, 5);
    scene.world.showSection(util.select.layer(0), Direction.UP);
    BlockPos gaugePos = util.grid.at(0, 1, 2);
    Selection gauge = util.select.position(gaugePos);
    scene.world.showSection(gauge, Direction.UP);
    scene.world.setKineticSpeed(gauge, 0);
    scene.idle(5);
    scene.world.showSection(util.select.position(5, 1, 2), Direction.DOWN);
    scene.idle(10);
    for (int i = 4; i >= 1; i--) {
        if (i == 2)
            scene.rotateCameraY(70);
        scene.idle(5);
        scene.world.showSection(util.select.position(i, 1, 2), Direction.DOWN);
    }
    scene.world.setKineticSpeed(gauge, 64);
    scene.effects.indicateSuccess(gaugePos);
    scene.idle(10);
    scene.overlay.showText(1000).text("Shafts will relay rotation in a straight line.").pointAt(util.vector.of(3, 1.5, 2.5));
    scene.idle(20);
    scene.markAsFinished();
}
Also used : Selection(com.simibubi.create.foundation.ponder.Selection) BlockPos(net.minecraft.core.BlockPos)

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