Search in sources :

Example 76 with Selection

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

the class DeployerScenes method processing.

public static void processing(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("deployer_processing", "Processing Items using Deployers");
    scene.configureBasePlate(0, 0, 5);
    scene.world.showSection(util.select.layer(0), Direction.UP);
    scene.idle(5);
    ElementLink<WorldSectionElement> depot = scene.world.showIndependentSection(util.select.position(2, 1, 1), Direction.DOWN);
    scene.world.moveSection(depot, util.vector.of(0, 0, 1), 0);
    scene.idle(10);
    Selection pressS = util.select.position(2, 3, 2);
    BlockPos pressPos = util.grid.at(2, 3, 2);
    BlockPos depotPos = util.grid.at(2, 1, 1);
    scene.world.setKineticSpeed(pressS, 0);
    scene.world.showSection(pressS, Direction.DOWN);
    scene.idle(10);
    scene.world.showSection(util.select.fromTo(2, 1, 3, 2, 1, 5), Direction.NORTH);
    scene.idle(3);
    scene.world.showSection(util.select.position(2, 2, 3), Direction.SOUTH);
    scene.idle(3);
    scene.world.showSection(util.select.position(2, 3, 3), Direction.NORTH);
    scene.world.setKineticSpeed(pressS, -32);
    scene.effects.indicateSuccess(pressPos);
    scene.idle(10);
    ItemStack tool = AllItems.SAND_PAPER.asStack();
    scene.overlay.showControls(new InputWindowElement(util.vector.blockSurface(pressPos.below(), Direction.EAST).add(0, 0.15, 0), Pointing.RIGHT).withItem(tool), 30);
    scene.idle(7);
    scene.world.modifyTileNBT(pressS, DeployerTileEntity.class, nbt -> nbt.put("HeldItem", tool.serializeNBT()));
    scene.idle(25);
    Vec3 pressSide = util.vector.blockSurface(pressPos, Direction.WEST);
    scene.overlay.showText(60).pointAt(pressSide).placeNearTarget().attachKeyFrame().text("With a fitting held item, Deployers can process items provided beneath them");
    scene.idle(80);
    scene.overlay.showText(60).pointAt(pressSide.subtract(0, 2, 0)).placeNearTarget().text("The Input items can be dropped or placed on a Depot under the Deployer");
    scene.idle(50);
    ItemStack quartz = AllItems.ROSE_QUARTZ.asStack();
    scene.world.createItemOnBeltLike(depotPos, Direction.NORTH, quartz);
    Vec3 depotCenter = util.vector.centerOf(depotPos.south());
    scene.overlay.showControls(new InputWindowElement(depotCenter, Pointing.UP).withItem(quartz), 30);
    scene.idle(10);
    Vec3 targetV = util.vector.centerOf(pressPos).subtract(0, 1.65, 0);
    scene.world.moveDeployer(pressPos, 1, 30);
    scene.idle(30);
    scene.world.moveDeployer(pressPos, -1, 30);
    scene.debug.enqueueCallback(s -> SandPaperItem.spawnParticles(targetV, quartz, s.getWorld()));
    // particle
    scene.world.removeItemsFromBelt(depotPos);
    ItemStack polished = AllItems.POLISHED_ROSE_QUARTZ.asStack();
    scene.world.createItemOnBeltLike(depotPos, Direction.UP, polished);
    scene.idle(10);
    scene.overlay.showControls(new InputWindowElement(depotCenter, Pointing.UP).withItem(polished), 50);
    scene.idle(60);
    scene.world.hideIndependentSection(depot, Direction.NORTH);
    scene.idle(5);
    scene.world.showSection(util.select.fromTo(0, 1, 3, 0, 2, 3), Direction.DOWN);
    scene.idle(10);
    scene.world.showSection(util.select.fromTo(4, 1, 2, 0, 2, 2), Direction.SOUTH);
    scene.idle(20);
    BlockPos beltPos = util.grid.at(0, 1, 2);
    scene.overlay.showText(40).pointAt(util.vector.blockSurface(beltPos, Direction.WEST)).placeNearTarget().attachKeyFrame().text("When items are provided on a belt...");
    scene.idle(30);
    ElementLink<BeltItemElement> ingot = scene.world.createItemOnBelt(beltPos, Direction.SOUTH, quartz);
    scene.idle(15);
    ElementLink<BeltItemElement> ingot2 = scene.world.createItemOnBelt(beltPos, Direction.SOUTH, quartz);
    scene.idle(15);
    scene.world.stallBeltItem(ingot, true);
    scene.world.moveDeployer(pressPos, 1, 30);
    scene.overlay.showText(50).pointAt(pressSide).placeNearTarget().attachKeyFrame().text("The Deployer will hold and process them automatically");
    scene.idle(30);
    scene.world.moveDeployer(pressPos, -1, 30);
    scene.debug.enqueueCallback(s -> SandPaperItem.spawnParticles(targetV, quartz, s.getWorld()));
    scene.world.removeItemsFromBelt(pressPos.below(2));
    ingot = scene.world.createItemOnBelt(pressPos.below(2), Direction.UP, polished);
    scene.world.stallBeltItem(ingot, true);
    scene.idle(15);
    scene.world.stallBeltItem(ingot, false);
    scene.idle(15);
    scene.world.stallBeltItem(ingot2, true);
    scene.world.moveDeployer(pressPos, 1, 30);
    scene.idle(30);
    scene.world.moveDeployer(pressPos, -1, 30);
    scene.debug.enqueueCallback(s -> SandPaperItem.spawnParticles(targetV, quartz, s.getWorld()));
    scene.world.removeItemsFromBelt(pressPos.below(2));
    ingot2 = scene.world.createItemOnBelt(pressPos.below(2), Direction.UP, polished);
    scene.world.stallBeltItem(ingot2, true);
    scene.idle(15);
    scene.world.stallBeltItem(ingot2, false);
}
Also used : Selection(com.simibubi.create.foundation.ponder.Selection) Vec3(net.minecraft.world.phys.Vec3) InputWindowElement(com.simibubi.create.foundation.ponder.element.InputWindowElement) BlockPos(net.minecraft.core.BlockPos) WorldSectionElement(com.simibubi.create.foundation.ponder.element.WorldSectionElement) ItemStack(net.minecraft.world.item.ItemStack) BeltItemElement(com.simibubi.create.foundation.ponder.element.BeltItemElement)

Example 77 with Selection

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

the class DeployerScenes method modes.

public static void modes(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("deployer_modes", "Modes of the Deployer");
    scene.configureBasePlate(0, 0, 5);
    scene.world.showSection(util.select.layer(0), Direction.UP);
    scene.idle(5);
    scene.world.showSection(util.select.fromTo(3, 1, 3, 3, 1, 5), Direction.DOWN);
    scene.idle(10);
    BlockPos deployerPos = util.grid.at(3, 1, 2);
    Vec3 frontVec = util.vector.blockSurface(deployerPos, Direction.WEST).add(-.125, 0, 0);
    Selection grassBlock = util.select.position(1, 1, 2);
    Selection deployerSelection = util.select.position(deployerPos);
    scene.world.showSection(deployerSelection, Direction.DOWN);
    scene.idle(10);
    scene.world.showSection(grassBlock, Direction.DOWN);
    scene.idle(10);
    ItemStack tool = new ItemStack(Items.GOLDEN_HOE);
    scene.overlay.showControls(new InputWindowElement(util.vector.topOf(deployerPos), Pointing.DOWN).withItem(tool), 30);
    scene.idle(7);
    scene.world.modifyTileNBT(deployerSelection, DeployerTileEntity.class, nbt -> nbt.put("HeldItem", tool.serializeNBT()));
    scene.idle(45);
    scene.world.setKineticSpeed(util.select.position(2, 0, 5), 16);
    scene.world.setKineticSpeed(util.select.layer(1), -32);
    scene.world.moveDeployer(deployerPos, 1, 25);
    scene.overlay.showText(60).attachKeyFrame().placeNearTarget().pointAt(util.vector.topOf(1, 1, 2)).text("By default, a Deployer imitates a Right-click interaction");
    scene.idle(26);
    scene.world.replaceBlocks(grassBlock, Blocks.FARMLAND.defaultBlockState(), false);
    scene.world.moveDeployer(deployerPos, -1, 25);
    scene.idle(46);
    scene.overlay.showControls(new InputWindowElement(frontVec, Pointing.LEFT).rightClick().withWrench(), 40);
    scene.idle(7);
    scene.world.modifyTileNBT(deployerSelection, DeployerTileEntity.class, nbt -> nbt.putString("Mode", "PUNCH"));
    scene.idle(45);
    scene.overlay.showText(60).attachKeyFrame().placeNearTarget().pointAt(util.vector.topOf(1, 1, 2)).text("Using a Wrench, it can be set to imitate a Left-click instead");
    BlockPos breakingPos = deployerPos.west(2);
    for (int i = 0; i < 4; i++) {
        scene.idle(26);
        scene.world.moveDeployer(deployerPos, 1, 25);
        scene.idle(26);
        scene.world.incrementBlockBreakingProgress(breakingPos);
        scene.world.incrementBlockBreakingProgress(breakingPos);
        scene.world.incrementBlockBreakingProgress(breakingPos);
        scene.world.moveDeployer(deployerPos, -1, 25);
        if (i == 3)
            scene.world.createItemEntity(util.vector.centerOf(breakingPos), util.vector.of(0, 0, 0), new ItemStack(Blocks.DIRT));
        scene.idle(26);
        if (i == 0)
            scene.markAsFinished();
    }
}
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)

Example 78 with Selection

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

the class EjectorScenes method ejector.

public static void ejector(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("weighted_ejector", "Using Weighted Ejectors");
    scene.configureBasePlate(0, 0, 5);
    scene.showBasePlate();
    BlockPos ejectorPos = util.grid.at(4, 1, 2);
    Selection ejectorS = util.select.position(ejectorPos);
    BlockPos targetPos = util.grid.at(0, 1, 2);
    Selection targetS = util.select.position(targetPos);
    scene.world.setBlock(targetPos, AllBlocks.ANDESITE_CASING.getDefaultState(), false);
    scene.idle(5);
    scene.world.showSection(targetS, Direction.DOWN);
    scene.idle(10);
    ItemStack asStack = AllBlocks.WEIGHTED_EJECTOR.asStack();
    scene.overlay.showControls(new InputWindowElement(util.vector.topOf(targetPos), Pointing.DOWN).rightClick().whileSneaking().withItem(asStack), 50);
    scene.idle(7);
    Object slot = new Object();
    scene.overlay.chaseBoundingBoxOutline(PonderPalette.OUTPUT, slot, new AABB(targetPos), 160);
    scene.overlay.showText(70).attachKeyFrame().colored(PonderPalette.OUTPUT).text("Sneak and Right-Click holding an Ejector to select its target location").pointAt(util.vector.blockSurface(targetPos, Direction.WEST)).placeNearTarget();
    scene.idle(80);
    scene.overlay.showControls(new InputWindowElement(util.vector.topOf(ejectorPos), Pointing.DOWN).rightClick().withItem(asStack), 50);
    scene.idle(7);
    scene.world.setKineticSpeed(ejectorS, 0);
    scene.world.modifyTileNBT(ejectorS, EjectorTileEntity.class, nbt -> {
        NBTHelper.writeEnum(nbt, "State", EjectorTileEntity.State.RETRACTING);
        nbt.putFloat("ForceAngle", 1);
    });
    scene.world.showSection(ejectorS, Direction.DOWN);
    scene.idle(10);
    scene.overlay.showText(60).colored(PonderPalette.OUTPUT).text("The placed ejector will now launch objects to the marked location").pointAt(util.vector.blockSurface(ejectorPos, Direction.WEST)).placeNearTarget();
    scene.idle(70);
    slot = new Object();
    AABB bb = new AABB(ejectorPos.west());
    scene.overlay.chaseBoundingBoxOutline(PonderPalette.OUTPUT, slot, bb, 20);
    scene.idle(10);
    scene.overlay.chaseBoundingBoxOutline(PonderPalette.GREEN, slot, bb.expandTowards(-15, 15, 0), 100);
    scene.idle(10);
    scene.overlay.showText(60).attachKeyFrame().colored(PonderPalette.GREEN).text("A valid target can be at any height or distance within range").pointAt(util.vector.blockSurface(targetPos, Direction.WEST)).placeNearTarget();
    scene.idle(70);
    scene.overlay.chaseBoundingBoxOutline(PonderPalette.RED, new Object(), bb.move(-2, 0, -1), 60);
    scene.idle(10);
    scene.overlay.showText(50).colored(PonderPalette.RED).text("They cannot however be off to a side").pointAt(util.vector.blockSurface(targetPos.north().east(), Direction.WEST)).placeNearTarget();
    scene.idle(70);
    scene.overlay.showSelectionWithText(util.select.position(ejectorPos.west()), 70).colored(PonderPalette.OUTPUT).text("If no valid Target was selected, it will simply target the block directly in front").placeNearTarget();
    scene.idle(80);
    scene.world.showSection(util.select.position(3, 0, 5), Direction.UP);
    scene.world.showSection(util.select.fromTo(4, 1, 5, 4, 1, 3), Direction.DOWN);
    scene.idle(12);
    scene.world.setKineticSpeed(ejectorS, 32);
    scene.idle(10);
    scene.overlay.showText(50).attachKeyFrame().text("Supply Rotational Force in order to charge it up").pointAt(util.vector.topOf(4, 1, 3)).placeNearTarget();
    scene.idle(60);
    ItemStack copperBlock = new ItemStack(Items.COPPER_BLOCK);
    ItemStack copperIngot = new ItemStack(Items.COPPER_INGOT);
    scene.overlay.showControls(new InputWindowElement(util.vector.topOf(ejectorPos).add(0.5, 0, 0), Pointing.RIGHT).withItem(copperBlock), 30);
    scene.idle(7);
    scene.world.createItemOnBeltLike(ejectorPos, Direction.NORTH, copperBlock);
    scene.idle(20);
    scene.overlay.showText(50).text("Items placed on the ejector cause it to trigger").pointAt(util.vector.topOf(ejectorPos)).placeNearTarget();
    scene.idle(60);
    scene.world.modifyEntities(ItemEntity.class, Entity::discard);
    scene.world.hideSection(targetS, Direction.SOUTH);
    scene.idle(15);
    scene.world.restoreBlocks(targetS);
    scene.world.showSection(targetS, Direction.SOUTH);
    scene.idle(10);
    scene.world.createItemOnBeltLike(targetPos, Direction.SOUTH, copperIngot);
    scene.idle(20);
    scene.world.createItemOnBeltLike(ejectorPos, Direction.SOUTH, copperBlock);
    scene.overlay.showText(60).attachKeyFrame().text("If Inventories are targeted, the ejector will wait until there is space").pointAt(util.vector.topOf(targetPos)).placeNearTarget();
    scene.idle(70);
    scene.effects.indicateSuccess(targetPos);
    scene.world.removeItemsFromBelt(targetPos);
    scene.idle(40);
    scene.world.hideSection(targetS, Direction.NORTH);
    scene.idle(15);
    scene.world.setBlock(targetPos, AllBlocks.ANDESITE_CASING.getDefaultState(), false);
    scene.world.showSection(targetS, Direction.NORTH);
    Vec3 input = util.vector.of(4.8, 1 + 12 / 16f, 2.5);
    Vec3 topOfSlot = input.add(0, 2 / 16f, 0);
    scene.overlay.showControls(new InputWindowElement(topOfSlot, Pointing.DOWN).scroll().withWrench(), 60);
    scene.overlay.showFilterSlotInput(input, 80);
    scene.idle(10);
    scene.overlay.showText(80).attachKeyFrame().text("Using the Wrench, a required Stack Size can be configured").pointAt(topOfSlot).placeNearTarget();
    scene.world.modifyTileNBT(ejectorS, EjectorTileEntity.class, nbt -> {
        nbt.putInt("ScrollValue", 10);
    });
    scene.idle(90);
    scene.world.showSection(util.select.fromTo(5, 1, 0, 4, 1, 1), Direction.DOWN);
    scene.world.showSection(util.select.position(5, 0, 1), Direction.UP);
    scene.idle(15);
    BlockPos beltPos = util.grid.at(4, 1, 0);
    scene.world.createItemOnBeltLike(beltPos, Direction.UP, copperBlock);
    scene.overlay.showText(100).text("It is now limited to this stack size, and only activates when its held stack reaches this amount").pointAt(util.vector.topOf(ejectorPos)).placeNearTarget();
    for (int i = 0; i < 4; i++) {
        scene.idle(20);
        scene.world.createItemOnBeltLike(beltPos, Direction.UP, copperBlock);
    }
    scene.idle(20);
    scene.world.createItemOnBeltLike(beltPos, Direction.UP, ItemHandlerHelper.copyStackWithSize(copperBlock, 15));
    scene.idle(80);
    scene.world.hideSection(util.select.fromTo(5, 1, 0, 4, 1, 1), Direction.UP);
    scene.world.hideSection(util.select.position(5, 0, 1), Direction.DOWN);
    scene.idle(30);
    scene.world.modifyEntities(ItemEntity.class, Entity::discard);
    scene.addKeyframe();
    ElementLink<ParrotElement> birb = scene.special.createBirb(util.vector.topOf(ejectorPos).add(0, -3 / 16f, 0), ParrotElement.FlappyPose::new);
    scene.idle(15);
    scene.world.modifyTileEntity(ejectorPos, EjectorTileEntity.class, ejector -> ejector.activateDeferred());
    scene.special.moveParrot(birb, util.vector.of(-2, 3, 0), 5);
    scene.special.rotateParrot(birb, 0, 360 * 2, 0, 21);
    scene.idle(5);
    scene.special.moveParrot(birb, util.vector.of(-1, 0, 0), 3);
    scene.idle(3);
    scene.special.moveParrot(birb, util.vector.of(-0.75, -1, 0), 6);
    scene.idle(6);
    scene.special.moveParrot(birb, util.vector.of(-0.25, -2 + 3 / 16f, 0), 12);
    scene.idle(15);
    scene.special.changeBirbPose(birb, ParrotElement.FaceCursorPose::new);
    scene.overlay.showText(80).text("Other Entities will always trigger an Ejector when stepping on it").pointAt(util.vector.topOf(targetPos)).placeNearTarget();
}
Also used : EjectorTileEntity(com.simibubi.create.content.logistics.block.depot.EjectorTileEntity) 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) ParrotElement(com.simibubi.create.foundation.ponder.element.ParrotElement) ItemStack(net.minecraft.world.item.ItemStack) AABB(net.minecraft.world.phys.AABB)

Example 79 with Selection

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

the class FunnelScenes method directionality.

public static void directionality(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("funnel_direction", "Direction of Transfer");
    scene.configureBasePlate(0, 0, 5);
    scene.world.showSection(util.select.layer(0), Direction.UP);
    scene.world.modifyKineticSpeed(util.select.everywhere(), f -> f / 2f);
    scene.world.setBlocks(util.select.position(3, 1, 1), AllBlocks.ANDESITE_CASING.getDefaultState(), false);
    BlockPos topFunnel = util.grid.at(3, 3, 2);
    Selection topFunnelSelection = util.select.position(topFunnel);
    Selection firstShow = util.select.fromTo(3, 1, 2, 3, 2, 2);
    scene.idle(5);
    scene.world.showSection(firstShow, Direction.DOWN);
    scene.idle(15);
    ItemStack itemStack = AllBlocks.BRASS_BLOCK.asStack();
    Vec3 topCenter = util.vector.centerOf(topFunnel);
    Vec3 topSide = util.vector.blockSurface(topFunnel, Direction.EAST);
    InputWindowElement controlsSneak = new InputWindowElement(topCenter, Pointing.DOWN).rightClick().whileSneaking();
    // Placing funnels without sneak
    scene.world.showSection(topFunnelSelection, Direction.DOWN);
    scene.overlay.showText(80).text("Placed normally, it pulls items from the inventory.").attachKeyFrame().pointAt(topCenter).placeNearTarget();
    scene.idle(45);
    ElementLink<EntityElement> itemLink = scene.world.createItemEntity(topCenter, util.vector.of(0, 4 / 16f, 0), itemStack);
    scene.idle(40);
    scene.world.modifyEntity(itemLink, Entity::discard);
    scene.world.hideSection(topFunnelSelection, Direction.UP);
    scene.idle(20);
    // Placing funnels with sneak
    scene.world.modifyBlock(topFunnel, s -> s.setValue(FunnelBlock.EXTRACTING, false), false);
    scene.idle(5);
    scene.world.showSection(topFunnelSelection, Direction.DOWN);
    scene.overlay.showControls(controlsSneak, 35);
    scene.overlay.showText(80).text("Placed while sneaking, it puts items into the inventory.").attachKeyFrame().pointAt(topCenter).placeNearTarget();
    scene.idle(45);
    itemLink = scene.world.createItemEntity(topCenter.add(0, 3, 0), util.vector.of(0, -0.2, 0), itemStack);
    scene.idle(10);
    scene.world.modifyEntity(itemLink, Entity::discard);
    scene.idle(45);
    // Wrench interaction
    InputWindowElement wrenchControls = new InputWindowElement(topSide, Pointing.RIGHT).rightClick().withWrench();
    scene.overlay.showControls(wrenchControls, 40);
    scene.idle(10);
    scene.world.modifyBlock(topFunnel, s -> s.cycle(FunnelBlock.EXTRACTING), true);
    scene.idle(10);
    scene.overlay.showText(80).text("Using a wrench, the funnel can be flipped after placement.").attachKeyFrame().pointAt(topCenter).placeNearTarget();
    itemLink = scene.world.createItemEntity(topCenter, util.vector.of(0, 4 / 16f, 0), itemStack);
    scene.idle(30);
    scene.overlay.showControls(wrenchControls, 40);
    scene.idle(10);
    scene.world.modifyBlock(topFunnel, s -> s.cycle(FunnelBlock.EXTRACTING), true);
    scene.idle(10);
    scene.world.modifyEntity(itemLink, Entity::discard);
    scene.idle(20);
    // Side funnel
    BlockPos sideFunnel = util.grid.at(3, 2, 1);
    Selection sideFunnelSelection = util.select.fromTo(sideFunnel.below(), sideFunnel);
    Vec3 sideCenter = util.vector.centerOf(sideFunnel);
    scene.world.modifyBlock(sideFunnel, s -> s.cycle(FunnelBlock.EXTRACTING), false);
    scene.world.showSection(sideFunnelSelection, Direction.DOWN);
    scene.overlay.showText(70).text("Same rules will apply for most orientations.").pointAt(sideCenter).placeNearTarget();
    scene.idle(20);
    scene.world.flapFunnel(sideFunnel, true);
    itemLink = scene.world.createItemEntity(sideCenter.subtract(0, .45, 0), util.vector.of(0, 0, -0.1), itemStack);
    scene.idle(60);
    scene.world.hideSection(sideFunnelSelection, Direction.UP);
    scene.world.hideSection(topFunnelSelection, Direction.UP);
    scene.world.modifyEntity(itemLink, Entity::discard);
    scene.idle(20);
    // Belt funnel
    Selection beltFunnelSetup = util.select.fromTo(0, 1, 0, 2, 2, 5);
    Selection gearshiftAndLever = util.select.fromTo(1, 1, 4, 1, 2, 4);
    Selection gearshiftedKinetics = util.select.fromTo(1, 1, 2, 2, 1, 4);
    Vec3 topOfBeltFunnel = util.vector.topOf(2, 2, 2);
    BlockPos beltPos = util.grid.at(2, 1, 2);
    BlockPos cogPos = util.grid.at(1, 1, 3);
    scene.world.showSection(beltFunnelSetup, Direction.DOWN);
    scene.overlay.showText(140).text("Funnels on belts will extract/insert depending on its movement direction.").attachKeyFrame().pointAt(topOfBeltFunnel);
    scene.idle(15);
    for (int i = 0; i < 2; i++) {
        scene.world.createItemOnBelt(beltPos, Direction.EAST, itemStack);
        scene.effects.rotationDirectionIndicator(cogPos);
        scene.idle(50);
        scene.world.modifyBlocks(gearshiftAndLever, s -> s.cycle(BlockStateProperties.POWERED), false);
        scene.world.modifyKineticSpeed(gearshiftedKinetics, f -> -f);
        scene.effects.indicateRedstone(util.grid.at(1, 2, 4));
        scene.effects.rotationDirectionIndicator(cogPos);
        scene.idle(35);
        scene.world.removeItemsFromBelt(beltPos);
        scene.world.flapFunnel(util.grid.at(2, 2, 2), false);
        if (i == 0) {
            scene.idle(50);
            scene.world.modifyBlocks(gearshiftAndLever, s -> s.cycle(BlockStateProperties.POWERED), false);
            scene.world.modifyKineticSpeed(gearshiftedKinetics, f -> -f);
            scene.effects.indicateRedstone(util.grid.at(1, 2, 4));
        }
    }
}
Also used : FunnelTileEntity(com.simibubi.create.content.logistics.block.funnel.FunnelTileEntity) 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) EntityElement(com.simibubi.create.foundation.ponder.element.EntityElement) ItemStack(net.minecraft.world.item.ItemStack)

Example 80 with Selection

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

the class DrainScenes method emptying.

public static void emptying(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("item_drain", "Emptying Fluid Containers using Item Drains");
    scene.configureBasePlate(0, 0, 5);
    scene.showBasePlate();
    scene.idle(5);
    Selection drain = util.select.position(3, 1, 2);
    BlockPos drainPos = util.grid.at(3, 1, 2);
    Selection pipes = util.select.fromTo(3, 1, 3, 3, 1, 4).add(util.select.fromTo(3, 2, 4, 2, 2, 4));
    Selection tank = util.select.fromTo(1, 1, 4, 1, 3, 4);
    Selection largeCog = util.select.position(1, 0, 5);
    Selection kinetics = util.select.fromTo(2, 1, 3, 2, 1, 5);
    Selection belt = util.select.fromTo(2, 1, 2, 1, 1, 2);
    BlockPos beltPos = util.grid.at(1, 1, 2);
    ElementLink<WorldSectionElement> drainLink = scene.world.showIndependentSection(drain, Direction.DOWN);
    scene.world.moveSection(drainLink, util.vector.of(-1, 0, 0), 0);
    scene.idle(10);
    scene.overlay.showText(40).text("Item Drains can extract fluids from items").attachKeyFrame().placeNearTarget().pointAt(util.vector.blockSurface(drainPos.west(), Direction.UP));
    scene.idle(50);
    ItemStack lavaBucket = new ItemStack(Items.LAVA_BUCKET);
    scene.overlay.showControls(new InputWindowElement(util.vector.blockSurface(drainPos.west(), Direction.UP), Pointing.DOWN).rightClick().withItem(lavaBucket), 40);
    scene.idle(7);
    scene.world.modifyTileEntity(drainPos, ItemDrainTileEntity.class, te -> {
        te.getBehaviour(SmartFluidTankBehaviour.TYPE).allowInsertion();
        te.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY).ifPresent(ifh -> ifh.fill(new FluidStack(Fluids.LAVA, 1000), FluidAction.EXECUTE));
    });
    scene.idle(10);
    scene.overlay.showText(50).text("Right-click it to pour fluids from your held item into it").attachKeyFrame().placeNearTarget().pointAt(util.vector.blockSurface(drainPos.west(), Direction.WEST));
    scene.idle(60);
    scene.world.modifyTileEntity(drainPos, ItemDrainTileEntity.class, te -> te.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY).ifPresent(ifh -> ifh.drain(500, FluidAction.EXECUTE)));
    scene.world.moveSection(drainLink, util.vector.of(1, 0, 0), 7);
    scene.world.showSection(largeCog, Direction.UP);
    scene.idle(3);
    scene.world.showSection(kinetics, Direction.NORTH);
    scene.idle(4);
    scene.world.showSection(belt, Direction.SOUTH);
    scene.idle(10);
    scene.overlay.showText(40).text("When items are inserted from the side...").attachKeyFrame().placeNearTarget().pointAt(util.vector.topOf(util.grid.at(2, 1, 2)));
    scene.idle(40);
    scene.overlay.showControls(new InputWindowElement(util.vector.topOf(beltPos), Pointing.DOWN).withItem(lavaBucket), 20);
    scene.idle(7);
    scene.world.createItemOnBelt(beltPos, Direction.NORTH, lavaBucket);
    scene.idle(30);
    scene.overlay.showText(60).text("...they roll across, emptying out their contained fluid").attachKeyFrame().placeNearTarget().pointAt(util.vector.topOf(drainPos));
    scene.idle(40);
    scene.world.showSection(tank, Direction.DOWN);
    scene.idle(5);
    scene.world.showSection(pipes, Direction.NORTH);
    scene.idle(20);
    scene.overlay.showText(90).text("Pipe Networks can now pull the fluid from the drains' internal buffer").attachKeyFrame().placeNearTarget().pointAt(util.vector.topOf(util.grid.at(3, 1, 3)));
    scene.idle(50);
    scene.markAsFinished();
    scene.idle(50);
    for (int i = 0; i < 5; i++) {
        scene.world.createItemOnBelt(beltPos, Direction.NORTH, lavaBucket);
        scene.idle(30);
    }
}
Also used : SmartFluidTankBehaviour(com.simibubi.create.foundation.tileEntity.behaviour.fluid.SmartFluidTankBehaviour) Selection(com.simibubi.create.foundation.ponder.Selection) Items(net.minecraft.world.item.Items) SceneBuilder(com.simibubi.create.foundation.ponder.SceneBuilder) CapabilityFluidHandler(net.minecraftforge.fluids.capability.CapabilityFluidHandler) InputWindowElement(com.simibubi.create.foundation.ponder.element.InputWindowElement) Direction(net.minecraft.core.Direction) FluidAction(net.minecraftforge.fluids.capability.IFluidHandler.FluidAction) SceneBuildingUtil(com.simibubi.create.foundation.ponder.SceneBuildingUtil) Pointing(com.simibubi.create.foundation.utility.Pointing) ItemDrainTileEntity(com.simibubi.create.content.contraptions.fluids.actors.ItemDrainTileEntity) WorldSectionElement(com.simibubi.create.foundation.ponder.element.WorldSectionElement) ElementLink(com.simibubi.create.foundation.ponder.ElementLink) BlockPos(net.minecraft.core.BlockPos) FluidStack(net.minecraftforge.fluids.FluidStack) ItemStack(net.minecraft.world.item.ItemStack) Fluids(net.minecraft.world.level.material.Fluids) Selection(com.simibubi.create.foundation.ponder.Selection) FluidStack(net.minecraftforge.fluids.FluidStack) 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)

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