Search in sources :

Example 31 with Selection

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

the class KineticsScenes method speedController.

public static void speedController(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("rotation_speed_controller", "Using the Rotational Speed Controller");
    scene.configureBasePlate(0, 0, 5);
    scene.world.showSection(util.select.layer(0), Direction.UP);
    scene.idle(5);
    BlockPos cogPos = util.grid.at(1, 2, 1);
    Selection gaugeSelect = util.select.position(1, 2, 3);
    scene.world.multiplyKineticSpeed(util.select.everywhere(), 0.5f);
    scene.world.setKineticSpeed(gaugeSelect, 0);
    scene.world.showSection(util.select.fromTo(5, 1, 1, 2, 1, 1), Direction.DOWN);
    scene.world.showSection(util.select.fromTo(1, 1, 3, 1, 2, 3), Direction.DOWN);
    scene.idle(10);
    ElementLink<WorldSectionElement> rsc = scene.world.showIndependentSection(util.select.position(0, 1, 1), Direction.DOWN);
    scene.world.moveSection(rsc, util.vector.of(1, 0, 0), 0);
    ElementLink<WorldSectionElement> rsc2 = scene.world.showIndependentSection(util.select.position(1, 1, 1), Direction.DOWN);
    scene.world.moveSection(rsc2, util.vector.of(0, -100, 0), 0);
    scene.idle(10);
    scene.world.showSection(util.select.position(1, 2, 1), Direction.DOWN);
    scene.idle(15);
    scene.effects.indicateSuccess(cogPos);
    scene.world.moveSection(rsc2, util.vector.of(0, 100, 0), 0);
    scene.world.moveSection(rsc, util.vector.of(0, -100, 0), 0);
    scene.idle(5);
    scene.world.showSection(util.select.position(1, 2, 2), Direction.DOWN);
    scene.idle(10);
    scene.world.setKineticSpeed(gaugeSelect, 8);
    scene.effects.indicateSuccess(util.grid.at(1, 2, 3));
    scene.overlay.showText(90).placeNearTarget().attachKeyFrame().pointAt(util.vector.blockSurface(cogPos, Direction.NORTH)).text("Rot. Speed Controllers relay rotation from their axis to a Large Cogwheel above them");
    scene.idle(100);
    Vec3 inputVec = util.vector.of(1.5, 1.75, 1);
    scene.overlay.showFilterSlotInput(inputVec, 60);
    scene.overlay.showText(70).placeNearTarget().attachKeyFrame().pointAt(inputVec).text("Using the scroll input on its side, the conveyed speed can be configured");
    scene.idle(80);
    InputWindowElement input = new InputWindowElement(inputVec, Pointing.UP).scroll();
    scene.overlay.showControls(input, 40);
    scene.idle(15);
    scene.world.multiplyKineticSpeed(util.select.fromTo(1, 2, 1, 1, 2, 3), 4);
    scene.effects.rotationSpeedIndicator(cogPos);
    scene.idle(55);
    scene.markAsFinished();
    scene.overlay.showControls(input, 30);
    scene.idle(15);
    scene.world.multiplyKineticSpeed(util.select.fromTo(1, 2, 1, 1, 2, 3), 4);
    scene.effects.rotationSpeedIndicator(cogPos);
    scene.idle(55);
    scene.overlay.showControls(input, 30);
    scene.idle(15);
    scene.world.multiplyKineticSpeed(util.select.fromTo(1, 2, 1, 1, 2, 3), -.05f);
    scene.effects.rotationSpeedIndicator(cogPos);
    scene.idle(35);
}
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 32 with Selection

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

the class MechanicalDrillScenes method contraption.

public static void contraption(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("mechanical_drill_contraption", "Using Mechanical Drills on Contraptions");
    scene.configureBasePlate(0, 0, 6);
    scene.world.showSection(util.select.layer(0), Direction.UP);
    Selection kinetics = util.select.fromTo(5, 1, 2, 5, 1, 6);
    scene.idle(5);
    ElementLink<WorldSectionElement> pistonHead = scene.world.showIndependentSection(util.select.fromTo(5, 1, 1, 7, 1, 1), Direction.DOWN);
    scene.world.moveSection(pistonHead, util.vector.of(0, 0, 1), 0);
    scene.world.showSection(kinetics, Direction.DOWN);
    scene.idle(5);
    ElementLink<WorldSectionElement> contraption = scene.world.showIndependentSection(util.select.fromTo(4, 2, 3, 4, 1, 2), Direction.DOWN);
    scene.idle(5);
    scene.world.showSectionAndMerge(util.select.position(3, 1, 3), Direction.EAST, contraption);
    scene.idle(5);
    scene.world.showSectionAndMerge(util.select.position(3, 1, 2), Direction.EAST, contraption);
    scene.world.showSectionAndMerge(util.select.position(3, 2, 3), Direction.EAST, contraption);
    scene.idle(5);
    scene.world.showSectionAndMerge(util.select.position(3, 2, 2), Direction.EAST, contraption);
    scene.overlay.showText(60).attachKeyFrame().placeNearTarget().pointAt(util.vector.topOf(util.grid.at(3, 2, 3))).text("Whenever Drills are moved as part of an animated Contraption...");
    scene.idle(70);
    Selection drills = util.select.fromTo(3, 1, 2, 3, 2, 3);
    Selection planks = util.select.fromTo(1, 1, 2, 1, 2, 3);
    scene.world.showSection(planks, Direction.DOWN);
    scene.world.setKineticSpeed(util.select.position(4, 0, 6), -8);
    scene.world.setKineticSpeed(kinetics, 16);
    scene.world.setKineticSpeed(drills, 16);
    scene.world.moveSection(pistonHead, util.vector.of(-1, 0, 0), 20);
    scene.world.moveSection(contraption, util.vector.of(-1, 0, 0), 20);
    scene.idle(20);
    scene.world.setKineticSpeed(drills, 64);
    BlockPos p1 = util.grid.at(1, 1, 2);
    BlockPos p2 = util.grid.at(1, 1, 3);
    BlockPos p3 = util.grid.at(1, 2, 2);
    BlockPos p4 = util.grid.at(1, 2, 3);
    for (int i = 0; i < 10; i++) {
        scene.idle(3);
        scene.world.incrementBlockBreakingProgress(p1);
        scene.world.incrementBlockBreakingProgress(p2);
        scene.world.incrementBlockBreakingProgress(p3);
        scene.world.incrementBlockBreakingProgress(p4);
        if (i == 2) {
            scene.overlay.showText(80).placeNearTarget().pointAt(util.vector.topOf(p3)).text("...they will break blocks the contraption runs them into");
        }
    }
    Vec3 m = util.vector.of(-.1, 0, 0);
    ItemStack item = new ItemStack(Items.OAK_PLANKS);
    scene.world.createItemEntity(util.vector.centerOf(p1), m, item);
    scene.world.createItemEntity(util.vector.centerOf(p2), m, item);
    scene.world.createItemEntity(util.vector.centerOf(p3), m, item);
    scene.world.createItemEntity(util.vector.centerOf(p4), m, item);
    scene.world.setKineticSpeed(drills, 16);
    scene.world.moveSection(pistonHead, util.vector.of(-1, 0, 0), 20);
    scene.world.moveSection(contraption, util.vector.of(-1, 0, 0), 20);
    scene.idle(20);
    scene.world.setKineticSpeed(drills, 0);
    scene.idle(20);
    scene.world.modifyKineticSpeed(util.select.everywhere(), f -> -f);
    scene.world.moveSection(pistonHead, util.vector.of(2, 0, 0), 40);
    scene.world.moveSection(contraption, util.vector.of(2, 0, 0), 40);
    scene.world.hideSection(planks, Direction.UP);
    scene.idle(40);
    scene.world.setBlocks(planks, Blocks.OAK_PLANKS.defaultBlockState(), false);
    scene.world.modifyEntities(ItemEntity.class, Entity::discard);
    scene.world.glueBlockOnto(util.grid.at(4, 3, 2), Direction.DOWN, contraption);
    scene.overlay.showText(60).attachKeyFrame().placeNearTarget().pointAt(util.vector.blockSurface(util.grid.at(4, 3, 2), Direction.WEST)).sharedText("storage_on_contraption");
    scene.idle(70);
    scene.world.showSection(planks, Direction.DOWN);
    scene.world.modifyKineticSpeed(util.select.everywhere(), f -> -f);
    scene.world.setKineticSpeed(drills, 16);
    scene.world.moveSection(pistonHead, util.vector.of(-1, 0, 0), 20);
    scene.world.moveSection(contraption, util.vector.of(-1, 0, 0), 20);
    scene.idle(20);
    scene.world.setKineticSpeed(drills, 64);
    for (int i = 0; i < 10; i++) {
        scene.idle(3);
        scene.world.incrementBlockBreakingProgress(p1);
        scene.world.incrementBlockBreakingProgress(p2);
        scene.world.incrementBlockBreakingProgress(p3);
        scene.world.incrementBlockBreakingProgress(p4);
    }
    scene.world.setKineticSpeed(drills, 16);
    scene.world.moveSection(pistonHead, util.vector.of(-1, 0, 0), 20);
    scene.world.moveSection(contraption, util.vector.of(-1, 0, 0), 20);
    scene.idle(20);
    scene.world.setKineticSpeed(drills, 0);
    scene.idle(10);
    scene.overlay.showControls(new InputWindowElement(util.vector.topOf(2, 3, 2), Pointing.DOWN).withItem(new ItemStack(Blocks.OAK_PLANKS)), 60);
    scene.idle(20);
}
Also used : Entity(net.minecraft.world.entity.Entity) ItemEntity(net.minecraft.world.entity.item.ItemEntity) 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)

Example 33 with Selection

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

the class MovementActorScenes method plough.

public static void plough(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("mechanical_plough", "Using Mechanical Ploughs on Contraptions");
    scene.configureBasePlate(0, 0, 6);
    scene.scaleSceneView(0.9f);
    Selection garbage = util.select.fromTo(2, 1, 3, 1, 1, 2);
    Selection kinetics = util.select.fromTo(5, 1, 6, 5, 1, 2);
    Selection dynamic = util.select.fromTo(4, 0, 6, 5, 1, 6);
    scene.showBasePlate();
    ElementLink<WorldSectionElement> cogs = scene.world.showIndependentSection(util.select.fromTo(4, 0, 6, 5, 1, 6), Direction.UP);
    scene.idle(5);
    scene.world.showSection(kinetics.substract(dynamic), Direction.DOWN);
    ElementLink<WorldSectionElement> pistonHead = scene.world.showIndependentSection(util.select.fromTo(5, 1, 1, 7, 1, 1), Direction.DOWN);
    scene.world.moveSection(pistonHead, util.vector.of(0, 0, 1), 0);
    scene.idle(5);
    ElementLink<WorldSectionElement> contraption = scene.world.showIndependentSection(util.select.fromTo(4, 1, 3, 4, 1, 2), Direction.DOWN);
    scene.idle(10);
    scene.world.showSectionAndMerge(util.select.position(3, 1, 3), Direction.EAST, contraption);
    scene.idle(5);
    scene.world.showSectionAndMerge(util.select.position(3, 1, 2), Direction.EAST, contraption);
    scene.idle(20);
    scene.overlay.showText(60).attachKeyFrame().placeNearTarget().pointAt(util.vector.blockSurface(util.grid.at(3, 1, 3), Direction.EAST)).text("Whenever Ploughs are moved as part of an animated Contraption...");
    scene.idle(50);
    scene.world.showSection(garbage, Direction.EAST);
    scene.idle(20);
    scene.world.setKineticSpeed(util.select.position(4, 0, 6), -8);
    scene.world.setKineticSpeed(kinetics, 16);
    scene.world.moveSection(pistonHead, util.vector.of(-2, 0, 0), 60);
    scene.world.moveSection(contraption, util.vector.of(-2, 0, 0), 60);
    scene.idle(15);
    Vec3 m = util.vector.of(-0.1, .2, 0);
    scene.world.destroyBlock(util.grid.at(2, 1, 3));
    scene.world.createItemEntity(util.vector.centerOf(2, 1, 3), m, new ItemStack(Items.LEVER));
    scene.world.destroyBlock(util.grid.at(2, 1, 2));
    scene.world.createItemEntity(util.vector.centerOf(2, 1, 2), m, new ItemStack(Items.TORCH));
    scene.idle(30);
    scene.world.destroyBlock(util.grid.at(1, 1, 3));
    scene.world.createItemEntity(util.vector.centerOf(1, 1, 3), m, new ItemStack(Items.RAIL));
    scene.world.destroyBlock(util.grid.at(1, 1, 2));
    scene.world.createItemEntity(util.vector.centerOf(1, 1, 2), m, new ItemStack(Items.REDSTONE));
    scene.overlay.showText(60).placeNearTarget().pointAt(util.vector.blockSurface(util.grid.at(1, 1, 3), Direction.EAST)).text("...they will break blocks without a solid collision hitbox");
    scene.idle(50);
    scene.world.modifyKineticSpeed(util.select.everywhere(), f -> -f);
    scene.world.moveSection(pistonHead, util.vector.of(2, 0, 0), 40);
    scene.world.moveSection(contraption, util.vector.of(2, 0, 0), 40);
    scene.world.hideSection(garbage, Direction.UP);
    scene.idle(40);
    scene.world.setBlocks(garbage, Blocks.SNOW.defaultBlockState(), false);
    scene.world.modifyEntities(ItemEntity.class, Entity::discard);
    ElementLink<WorldSectionElement> chest = scene.world.showIndependentSection(util.select.position(4, 2, 2), Direction.DOWN);
    scene.overlay.showText(60).attachKeyFrame().placeNearTarget().pointAt(util.vector.blockSurface(util.grid.at(4, 2, 2), Direction.WEST)).sharedText("storage_on_contraption");
    scene.idle(15);
    scene.effects.superGlue(util.grid.at(4, 2, 2), Direction.DOWN, true);
    scene.idle(45);
    scene.world.showSection(garbage, Direction.EAST);
    scene.idle(20);
    scene.world.modifyKineticSpeed(util.select.everywhere(), f -> -f);
    scene.world.moveSection(pistonHead, util.vector.of(-2, 0, 0), 60);
    scene.world.moveSection(contraption, util.vector.of(-2, 0, 0), 60);
    scene.world.moveSection(chest, util.vector.of(-2, 0, 0), 60);
    scene.idle(15);
    scene.world.destroyBlock(util.grid.at(2, 1, 3));
    scene.world.destroyBlock(util.grid.at(2, 1, 2));
    scene.idle(30);
    scene.world.destroyBlock(util.grid.at(1, 1, 3));
    scene.world.destroyBlock(util.grid.at(1, 1, 2));
    scene.idle(15);
    scene.overlay.showControls(new InputWindowElement(util.vector.topOf(2, 2, 2), Pointing.DOWN).withItem(new ItemStack(Items.SNOWBALL)), 40);
    scene.idle(40);
    scene.world.hideIndependentSection(chest, Direction.UP);
    scene.world.modifyKineticSpeed(util.select.everywhere(), f -> -f);
    scene.world.moveSection(pistonHead, util.vector.of(2, 0, 0), 40);
    scene.world.moveSection(contraption, util.vector.of(2, 0, 0), 40);
    scene.idle(40);
    Selection dirt = util.select.fromTo(2, 0, 3, 1, 0, 2);
    scene.world.hideSection(dirt, Direction.DOWN);
    scene.idle(15);
    scene.world.setBlocks(dirt, Blocks.GRASS_BLOCK.defaultBlockState(), false);
    scene.world.showSection(dirt, Direction.UP);
    scene.overlay.showText(60).placeNearTarget().attachKeyFrame().pointAt(util.vector.blockSurface(util.grid.at(3, 1, 3), Direction.EAST)).text("Additionally, ploughs can create farmland");
    scene.idle(30);
    scene.world.modifyKineticSpeed(util.select.everywhere(), f -> -f);
    scene.world.moveSection(pistonHead, util.vector.of(-2, 0, 0), 60);
    scene.world.moveSection(contraption, util.vector.of(-2, 0, 0), 60);
    scene.world.moveSection(chest, util.vector.of(-2, 0, 0), 60);
    scene.idle(15);
    scene.world.setBlocks(util.select.fromTo(2, 0, 2, 2, 0, 3), Blocks.FARMLAND.defaultBlockState(), true);
    scene.idle(30);
    scene.world.setBlocks(util.select.fromTo(1, 0, 2, 1, 0, 3), Blocks.FARMLAND.defaultBlockState(), true);
    scene.idle(20);
    scene.world.modifyKineticSpeed(util.select.everywhere(), f -> -f);
    scene.world.moveSection(pistonHead, util.vector.of(2, 0, 0), 40);
    scene.world.moveSection(contraption, util.vector.of(2, 0, 0), 40);
    scene.idle(50);
    scene.world.setKineticSpeed(util.select.everywhere(), 0);
    scene.world.hideSection(kinetics.substract(dynamic), Direction.EAST);
    scene.world.hideSection(dirt, Direction.DOWN);
    scene.world.hideIndependentSection(pistonHead, Direction.EAST);
    scene.world.moveSection(cogs, util.vector.of(-1, 0, 0), 15);
    scene.idle(15);
    scene.world.restoreBlocks(dirt);
    scene.world.showSection(dirt, Direction.UP);
    scene.world.showSection(util.select.fromTo(4, 1, 6, 4, 3, 4), Direction.NORTH);
    scene.idle(15);
    scene.world.showSectionAndMerge(util.select.fromTo(4, 3, 3, 4, 2, 3), Direction.DOWN, contraption);
    scene.idle(15);
    BlockPos bearingPos = util.grid.at(4, 3, 4);
    scene.addKeyframe();
    scene.world.setKineticSpeed(util.select.position(4, 0, 6), 8);
    scene.world.setKineticSpeed(util.select.position(5, 1, 6), -16);
    scene.world.setKineticSpeed(util.select.position(4, 3, 5), -16);
    scene.world.setKineticSpeed(util.select.position(4, 1, 5), -16);
    scene.world.setKineticSpeed(util.select.position(4, 2, 5), 16);
    scene.world.modifyKineticSpeed(util.select.everywhere(), f -> -2 * f);
    scene.world.configureCenterOfRotation(contraption, util.vector.centerOf(bearingPos));
    scene.world.rotateSection(contraption, 0, 0, 90, 20);
    scene.world.rotateBearing(bearingPos, 90, 20);
    scene.idle(10);
    ElementLink<ParrotElement> birb = scene.special.createBirb(util.vector.topOf(3, 0, 2).add(0, 0, 0.5), FlappyPose::new);
    scene.idle(11);
    scene.world.modifyKineticSpeed(util.select.everywhere(), f -> -2 * f);
    scene.world.rotateSection(contraption, 0, 0, -135, 10);
    scene.world.rotateBearing(bearingPos, -135, 10);
    scene.idle(7);
    scene.special.moveParrot(birb, util.vector.of(-20, 15, 0), 20);
    scene.special.rotateParrot(birb, 0, 360, 0, 20);
    scene.idle(3);
    scene.world.setKineticSpeed(util.select.everywhere(), 0);
    scene.idle(20);
    scene.overlay.showText(60).placeNearTarget().pointAt(util.vector.centerOf(util.grid.at(1, 3, 2))).text("...they can also launch entities without hurting them");
    scene.idle(30);
}
Also used : HarvesterTileEntity(com.simibubi.create.content.contraptions.components.actors.HarvesterTileEntity) Entity(net.minecraft.world.entity.Entity) ItemEntity(net.minecraft.world.entity.item.ItemEntity) PortableItemInterfaceTileEntity(com.simibubi.create.content.contraptions.components.actors.PortableItemInterfaceTileEntity) PortableStorageInterfaceTileEntity(com.simibubi.create.content.contraptions.components.actors.PortableStorageInterfaceTileEntity) FlappyPose(com.simibubi.create.foundation.ponder.element.ParrotElement.FlappyPose) 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) ParrotElement(com.simibubi.create.foundation.ponder.element.ParrotElement) ItemStack(net.minecraft.world.item.ItemStack)

Example 34 with Selection

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

the class MovementActorScenes method psiRedstone.

public static void psiRedstone(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("portable_storage_interface_redstone", "Redstone Control");
    scene.configureBasePlate(0, 0, 5);
    scene.setSceneOffsetY(-1);
    Class<PortableStorageInterfaceTileEntity> psiClass = PortableStorageInterfaceTileEntity.class;
    Selection psis = util.select.fromTo(1, 1, 3, 1, 3, 3);
    scene.world.modifyTileNBT(psis, psiClass, nbt -> {
        nbt.putFloat("Distance", 1);
        nbt.putFloat("Timer", 40);
    });
    scene.world.showSection(util.select.layer(0), Direction.UP);
    scene.idle(5);
    scene.world.showSection(util.select.layer(1), Direction.DOWN);
    scene.idle(5);
    ElementLink<WorldSectionElement> contraption = scene.world.showIndependentSection(util.select.layersFrom(2), Direction.DOWN);
    BlockPos bearing = util.grid.at(3, 1, 3);
    scene.world.configureCenterOfRotation(contraption, util.vector.topOf(bearing));
    scene.idle(20);
    scene.world.modifyTileNBT(psis, psiClass, nbt -> nbt.putFloat("Timer", 9));
    scene.idle(20);
    scene.world.rotateBearing(bearing, 360 * 3 + 270, 240 + 60);
    scene.world.rotateSection(contraption, 0, 360 * 3 + 270, 0, 240 + 60);
    scene.idle(20);
    scene.world.toggleRedstonePower(util.select.fromTo(1, 1, 1, 1, 1, 2));
    scene.effects.indicateRedstone(util.grid.at(1, 1, 1));
    scene.idle(10);
    scene.overlay.showSelectionWithText(util.select.position(1, 1, 3), 120).colored(PonderPalette.RED).text("Redstone power will prevent the stationary interface from engaging");
    scene.idle(20);
    scene.markAsFinished();
}
Also used : PortableStorageInterfaceTileEntity(com.simibubi.create.content.contraptions.components.actors.PortableStorageInterfaceTileEntity) Selection(com.simibubi.create.foundation.ponder.Selection) BlockPos(net.minecraft.core.BlockPos) WorldSectionElement(com.simibubi.create.foundation.ponder.element.WorldSectionElement)

Example 35 with Selection

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

the class ProcessingScenes method millstone.

public static void millstone(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("millstone", "Processing Items in the Millstone");
    scene.configureBasePlate(0, 0, 5);
    Selection belt = util.select.fromTo(1, 1, 5, 0, 1, 2).add(util.select.position(1, 2, 2));
    Selection beltCog = util.select.position(2, 0, 5);
    scene.world.showSection(util.select.layer(0).substract(beltCog), Direction.UP);
    BlockPos millstone = util.grid.at(2, 2, 2);
    Selection millstoneSelect = util.select.position(2, 2, 2);
    Selection cogs = util.select.fromTo(3, 1, 2, 3, 2, 2);
    scene.world.setKineticSpeed(millstoneSelect, 0);
    scene.idle(5);
    scene.world.showSection(util.select.position(4, 1, 3), Direction.DOWN);
    scene.world.showSection(util.select.position(2, 1, 2), Direction.DOWN);
    scene.idle(10);
    scene.world.showSection(util.select.position(millstone), Direction.DOWN);
    scene.idle(10);
    Vec3 millstoneTop = util.vector.topOf(millstone);
    scene.overlay.showText(60).attachKeyFrame().text("Millstones process items by grinding them").pointAt(millstoneTop).placeNearTarget();
    scene.idle(70);
    scene.world.showSection(cogs, Direction.DOWN);
    scene.idle(10);
    scene.world.setKineticSpeed(millstoneSelect, 32);
    scene.effects.indicateSuccess(millstone);
    scene.idle(10);
    scene.overlay.showText(60).attachKeyFrame().colored(PonderPalette.GREEN).text("They can be powered from the side using cogwheels").pointAt(util.vector.topOf(millstone.east())).placeNearTarget();
    scene.idle(70);
    ItemStack itemStack = new ItemStack(Items.WHEAT);
    Vec3 entitySpawn = util.vector.topOf(millstone.above(3));
    ElementLink<EntityElement> entity1 = scene.world.createItemEntity(entitySpawn, util.vector.of(0, 0.2, 0), itemStack);
    scene.idle(18);
    scene.world.modifyEntity(entity1, Entity::discard);
    scene.world.modifyTileEntity(millstone, MillstoneTileEntity.class, ms -> ms.inputInv.setStackInSlot(0, itemStack));
    scene.idle(10);
    scene.overlay.showControls(new InputWindowElement(millstoneTop, Pointing.DOWN).withItem(itemStack), 30);
    scene.idle(7);
    scene.overlay.showText(40).attachKeyFrame().text("Throw or Insert items at the top").pointAt(millstoneTop).placeNearTarget();
    scene.idle(60);
    scene.world.modifyTileEntity(millstone, MillstoneTileEntity.class, ms -> ms.inputInv.setStackInSlot(0, ItemStack.EMPTY));
    scene.overlay.showText(50).text("After some time, the result can be obtained via Right-click").pointAt(util.vector.blockSurface(millstone, Direction.WEST)).placeNearTarget();
    scene.idle(60);
    ItemStack flour = AllItems.WHEAT_FLOUR.asStack();
    scene.overlay.showControls(new InputWindowElement(util.vector.blockSurface(millstone, Direction.NORTH), Pointing.RIGHT).rightClick().withItem(flour), 40);
    scene.idle(50);
    scene.addKeyframe();
    scene.world.showSection(beltCog, Direction.UP);
    scene.world.showSection(belt, Direction.EAST);
    scene.idle(15);
    BlockPos beltPos = util.grid.at(1, 1, 2);
    scene.world.createItemOnBelt(beltPos, Direction.EAST, flour);
    scene.idle(15);
    scene.world.createItemOnBelt(beltPos, Direction.EAST, new ItemStack(Items.WHEAT_SEEDS));
    scene.idle(20);
    scene.overlay.showText(50).text("The outputs can also be extracted by automation").pointAt(util.vector.blockSurface(millstone, Direction.WEST).add(-.5, .4, 0)).placeNearTarget();
    scene.idle(60);
}
Also used : BasinTileEntity(com.simibubi.create.content.contraptions.processing.BasinTileEntity) MechanicalPressTileEntity(com.simibubi.create.content.contraptions.components.press.MechanicalPressTileEntity) DeployerTileEntity(com.simibubi.create.content.contraptions.components.deployer.DeployerTileEntity) Entity(net.minecraft.world.entity.Entity) ItemEntity(net.minecraft.world.entity.item.ItemEntity) MillstoneTileEntity(com.simibubi.create.content.contraptions.components.millstone.MillstoneTileEntity) MechanicalMixerTileEntity(com.simibubi.create.content.contraptions.components.mixer.MechanicalMixerTileEntity) 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) EntityElement(com.simibubi.create.foundation.ponder.element.EntityElement) ItemStack(net.minecraft.world.item.ItemStack)

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