Search in sources :

Example 66 with InputWindowElement

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

the class RedstoneScenes method nixieTube.

public static void nixieTube(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("nixie_tube", "Using Nixie Tubes");
    scene.configureBasePlate(0, 0, 5);
    scene.world.showSection(util.select.layer(0).add(util.select.fromTo(2, 1, 1, 2, 1, 2)), Direction.UP);
    scene.idle(10);
    scene.world.showSection(util.select.position(2, 1, 3), Direction.DOWN);
    scene.idle(20);
    Selection tubes = util.select.fromTo(3, 1, 3, 1, 1, 3);
    scene.effects.indicateRedstone(util.grid.at(2, 1, 1));
    scene.world.modifyTileNBT(util.select.position(2, 1, 1), AnalogLeverTileEntity.class, nbt -> nbt.putInt("State", 11));
    scene.world.modifyBlock(util.grid.at(2, 1, 2), s -> s.setValue(RedStoneWireBlock.POWER, 11), false);
    scene.world.modifyTileNBT(tubes, NixieTubeTileEntity.class, nbt -> nbt.putInt("RedstoneStrength", 11));
    scene.idle(20);
    Vec3 centerTube = util.vector.centerOf(2, 1, 3);
    scene.overlay.showText(60).attachKeyFrame().text("When powered by Redstone, Nixie Tubes will display the redstone signals' strength").placeNearTarget().pointAt(util.vector.blockSurface(util.grid.at(2, 1, 3), Direction.WEST));
    scene.idle(70);
    scene.world.hideSection(util.select.position(2, 1, 3), Direction.UP);
    scene.idle(5);
    scene.world.hideSection(util.select.fromTo(2, 1, 1, 2, 1, 2), Direction.NORTH);
    scene.idle(10);
    scene.world.modifyTileNBT(tubes, NixieTubeTileEntity.class, nbt -> nbt.putInt("RedstoneStrength", 0));
    scene.world.showSection(tubes, Direction.DOWN);
    scene.idle(20);
    scene.overlay.showControls(new InputWindowElement(centerTube.add(1, .35, 0), Pointing.DOWN).rightClick().withItem(new ItemStack(Items.NAME_TAG)), 40);
    scene.idle(7);
    Component component = new TextComponent("CREATE");
    for (int i = 0; i < 3; i++) {
        final int index = i;
        scene.world.modifyTileNBT(util.select.position(3 - i, 1, 3), NixieTubeTileEntity.class, nbt -> {
            nbt.putString("RawCustomText", component.getString());
            nbt.putString("CustomText", Component.Serializer.toJson(component));
            nbt.putInt("CustomTextIndex", index);
        });
    }
    scene.idle(10);
    scene.world.showSection(util.select.position(4, 1, 3), Direction.DOWN);
    scene.idle(10);
    scene.special.createBirb(util.vector.topOf(util.grid.at(0, 0, 3)), ParrotElement.DancePose::new);
    scene.idle(20);
    scene.overlay.showText(80).attachKeyFrame().placeNearTarget().text("Using name tags edited with an anvil, custom text can be displayed").pointAt(util.vector.topOf(util.grid.at(3, 1, 3)).add(-.75, -.05f, 0));
    scene.idle(90);
    InputWindowElement input = new InputWindowElement(util.vector.blockSurface(util.grid.at(3, 1, 3), Direction.UP), Pointing.DOWN).withItem(new ItemStack(Items.BLUE_DYE));
    scene.overlay.showControls(input, 30);
    scene.idle(7);
    scene.world.setBlocks(util.select.fromTo(1, 1, 3, 3, 1, 3), AllBlocks.NIXIE_TUBES.get(DyeColor.BLUE).getDefaultState().setValue(NixieTubeBlock.FACING, Direction.NORTH), false);
    scene.idle(10);
    scene.overlay.showText(80).colored(PonderPalette.BLUE).text("Right-Click with Dye to change their display colour").attachKeyFrame().pointAt(util.vector.topOf(util.grid.at(3, 1, 3)).add(-.75, -.05f, 0)).placeNearTarget();
    scene.idle(60);
}
Also used : TextComponent(net.minecraft.network.chat.TextComponent) Selection(com.simibubi.create.foundation.ponder.Selection) Vec3(net.minecraft.world.phys.Vec3) InputWindowElement(com.simibubi.create.foundation.ponder.element.InputWindowElement) ItemStack(net.minecraft.world.item.ItemStack) Component(net.minecraft.network.chat.Component) TextComponent(net.minecraft.network.chat.TextComponent)

Example 67 with InputWindowElement

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

the class RedstoneScenes method poweredLatch.

public static void poweredLatch(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("powered_latch", "Controlling signals using the Powered Latch");
    scene.configureBasePlate(0, 0, 5);
    scene.world.showSection(util.select.layer(0), Direction.UP);
    BlockPos circuitPos = util.grid.at(2, 1, 2);
    BlockPos buttonPos = util.grid.at(4, 1, 2);
    Vec3 circuitTop = util.vector.blockSurface(circuitPos, Direction.DOWN).add(0, 3 / 16f, 0);
    scene.world.showSection(util.select.layersFrom(1).substract(util.select.position(circuitPos)), Direction.UP);
    scene.idle(10);
    scene.world.showSection(util.select.position(circuitPos), Direction.DOWN);
    scene.idle(20);
    scene.overlay.showText(40).attachKeyFrame().text("Powered Latches are redstone controllable Levers").placeNearTarget().pointAt(circuitTop);
    scene.idle(50);
    scene.effects.indicateRedstone(buttonPos);
    scene.world.toggleRedstonePower(util.select.fromTo(4, 1, 2, 0, 1, 2));
    scene.world.cycleBlockProperty(circuitPos, PoweredLatchBlock.POWERING);
    scene.idle(30);
    scene.world.toggleRedstonePower(util.select.fromTo(4, 1, 2, 3, 1, 2));
    AABB bb = new AABB(circuitPos).inflate(-.48f, -.45f, -.05f).move(.575, -.45, 0);
    scene.overlay.chaseBoundingBoxOutline(PonderPalette.GREEN, bb, bb, 40);
    scene.overlay.showText(40).colored(PonderPalette.GREEN).text("Signals at the back switch it on").placeNearTarget().pointAt(bb.getCenter());
    scene.idle(60);
    scene.effects.indicateRedstone(util.grid.at(2, 1, 0));
    scene.world.toggleRedstonePower(util.select.fromTo(2, 1, 0, 2, 1, 1));
    scene.world.toggleRedstonePower(util.select.fromTo(2, 1, 2, 0, 1, 2));
    scene.world.cycleBlockProperty(circuitPos, PoweredLatchBlock.POWERING);
    scene.idle(30);
    scene.world.toggleRedstonePower(util.select.fromTo(2, 1, 0, 2, 1, 1));
    bb = new AABB(circuitPos).inflate(-.05f, -.45f, -.48f).move(0, -.45, .575);
    AABB bb2 = new AABB(circuitPos).inflate(-.05f, -.45f, -.48f).move(0, -.45, -.575);
    scene.overlay.chaseBoundingBoxOutline(PonderPalette.RED, bb, bb, 40);
    scene.overlay.chaseBoundingBoxOutline(PonderPalette.RED, bb2, bb2, 40);
    scene.overlay.showText(40).colored(PonderPalette.RED).text("Signals from the side switch it back off").placeNearTarget().pointAt(bb2.getCenter());
    scene.idle(50);
    scene.addKeyframe();
    scene.idle(10);
    scene.overlay.showControls(new InputWindowElement(circuitTop, Pointing.DOWN).rightClick(), 40);
    scene.idle(7);
    scene.world.toggleRedstonePower(util.select.fromTo(2, 1, 2, 0, 1, 2));
    scene.world.cycleBlockProperty(circuitPos, PoweredLatchBlock.POWERING);
    scene.idle(10);
    scene.overlay.showText(50).text("Powered latches can also be toggled manually").placeNearTarget().pointAt(circuitTop);
    scene.idle(60);
    scene.overlay.showControls(new InputWindowElement(circuitTop, Pointing.DOWN).rightClick(), 40);
    scene.idle(7);
    scene.world.toggleRedstonePower(util.select.fromTo(2, 1, 2, 0, 1, 2));
    scene.world.cycleBlockProperty(circuitPos, PoweredLatchBlock.POWERING);
    scene.idle(10);
}
Also used : Vec3(net.minecraft.world.phys.Vec3) InputWindowElement(com.simibubi.create.foundation.ponder.element.InputWindowElement) BlockPos(net.minecraft.core.BlockPos) AABB(net.minecraft.world.phys.AABB)

Example 68 with InputWindowElement

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

the class RedstoneScenes method pulseExtender.

public static void pulseExtender(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("pulse_extender", "Controlling signals using Pulse Extenders");
    scene.configureBasePlate(0, 0, 5);
    scene.world.showSection(util.select.layer(0), Direction.UP);
    BlockPos circuitPos = util.grid.at(2, 1, 2);
    BlockPos leverPos = util.grid.at(4, 1, 2);
    scene.world.modifyTileNBT(util.select.position(circuitPos), PulseExtenderTileEntity.class, nbt -> nbt.putInt("ScrollValue", 30));
    scene.world.showSection(util.select.layersFrom(1).substract(util.select.position(circuitPos)), Direction.UP);
    scene.idle(10);
    scene.world.showSection(util.select.position(circuitPos), Direction.DOWN);
    scene.idle(20);
    Vec3 circuitTop = util.vector.blockSurface(circuitPos, Direction.DOWN).add(0, 3 / 16f, 0);
    scene.overlay.showText(70).text("Pulse Extenders can lengthen a signal passing through").attachKeyFrame().placeNearTarget().pointAt(circuitTop);
    scene.idle(60);
    scene.effects.indicateRedstone(leverPos);
    scene.world.toggleRedstonePower(util.select.fromTo(4, 1, 2, 2, 1, 2));
    scene.idle(2);
    scene.world.toggleRedstonePower(util.select.fromTo(1, 1, 2, 0, 1, 2));
    scene.idle(15);
    scene.overlay.showText(60).text("They activate after a short delay...").placeNearTarget().pointAt(util.vector.topOf(util.grid.at(0, 1, 2)));
    scene.idle(50);
    scene.effects.indicateRedstone(leverPos);
    scene.world.toggleRedstonePower(util.select.fromTo(4, 1, 2, 2, 1, 2));
    scene.idle(30);
    scene.world.cycleBlockProperty(circuitPos, BrassDiodeBlock.POWERING);
    scene.world.toggleRedstonePower(util.select.position(1, 1, 2));
    scene.idle(1);
    scene.world.toggleRedstonePower(util.select.position(0, 1, 2));
    scene.idle(15);
    scene.overlay.showText(40).text("...and cool down for the configured duration").placeNearTarget().pointAt(util.vector.topOf(util.grid.at(0, 1, 2)));
    scene.idle(50);
    scene.overlay.showRepeaterScrollInput(circuitPos, 60);
    scene.overlay.showControls(new InputWindowElement(circuitTop, Pointing.DOWN).scroll(), 60);
    scene.idle(10);
    scene.overlay.showText(60).text("Using the mouse wheel, the discharge time can be configured").attachKeyFrame().placeNearTarget().pointAt(circuitTop);
    scene.world.modifyTileNBT(util.select.position(circuitPos), PulseExtenderTileEntity.class, nbt -> nbt.putInt("ScrollValue", 120));
    scene.idle(70);
    scene.effects.indicateRedstone(leverPos);
    scene.world.toggleRedstonePower(util.select.fromTo(4, 1, 2, 2, 1, 2));
    scene.idle(2);
    scene.world.toggleRedstonePower(util.select.fromTo(1, 1, 2, 0, 1, 2));
    scene.idle(20);
    scene.effects.indicateRedstone(leverPos);
    scene.world.toggleRedstonePower(util.select.fromTo(4, 1, 2, 2, 1, 2));
    scene.idle(15);
    scene.overlay.showText(50).text("The configured duration can range up to 30 minutes").placeNearTarget().pointAt(circuitTop);
    scene.idle(70);
    scene.world.cycleBlockProperty(circuitPos, BrassDiodeBlock.POWERING);
    scene.world.toggleRedstonePower(util.select.position(1, 1, 2));
    scene.idle(1);
    scene.world.toggleRedstonePower(util.select.position(0, 1, 2));
    scene.idle(15);
}
Also used : Vec3(net.minecraft.world.phys.Vec3) InputWindowElement(com.simibubi.create.foundation.ponder.element.InputWindowElement) BlockPos(net.minecraft.core.BlockPos)

Example 69 with InputWindowElement

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

the class DeployerScenes method filter.

public static void filter(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("deployer", "Using the Deployer");
    scene.configureBasePlate(0, 0, 5);
    BlockPos potPosition = util.grid.at(1, 1, 2);
    BlockPos deployerPos = util.grid.at(3, 1, 2);
    Selection deployerSelection = util.select.position(deployerPos);
    scene.world.setBlock(potPosition, Blocks.AIR.defaultBlockState(), false);
    scene.world.showSection(util.select.layer(0).add(util.select.position(1, 1, 2)), Direction.UP);
    scene.idle(5);
    scene.world.showSection(util.select.fromTo(3, 1, 3, 3, 1, 5), Direction.DOWN);
    scene.idle(10);
    scene.world.showSection(deployerSelection, Direction.SOUTH);
    scene.idle(10);
    scene.overlay.showText(60).placeNearTarget().pointAt(util.vector.topOf(deployerPos)).text("Given Rotational Force, a Deployer can imitate player interactions");
    scene.world.moveDeployer(deployerPos, 1, 25);
    scene.idle(26);
    scene.world.moveDeployer(deployerPos, -1, 25);
    scene.idle(44);
    scene.overlay.showSelectionWithText(util.select.position(deployerPos.west(2)), 60).text("It will always interact with the position 2 blocks in front of itself").attachKeyFrame().placeNearTarget().colored(PonderPalette.GREEN).attachKeyFrame();
    scene.world.moveDeployer(deployerPos, 1, 25);
    scene.idle(26);
    scene.world.moveDeployer(deployerPos, -1, 25);
    scene.idle(20);
    scene.world.showSection(util.select.fromTo(2, 1, 3, 2, 1, 1), Direction.DOWN);
    scene.idle(24);
    scene.overlay.showText(50).pointAt(util.vector.topOf(deployerPos.west())).text("Blocks directly in front will not obstruct it").placeNearTarget();
    scene.world.moveDeployer(deployerPos, 1, 25);
    scene.idle(26);
    scene.world.moveDeployer(deployerPos, -1, 25);
    scene.idle(34);
    scene.world.hideSection(util.select.fromTo(2, 1, 3, 2, 1, 1), Direction.UP);
    scene.idle(20);
    String[] actions = new String[] { "Place Blocks,", "Use Items,", "Activate Blocks,", "Harvest blocks", "and Attack Mobs" };
    scene.overlay.showText(80).attachKeyFrame().independent(40).placeNearTarget().text("Deployers can:");
    int y = 60;
    for (String s : actions) {
        scene.idle(15);
        scene.overlay.showText(50).colored(PonderPalette.MEDIUM).placeNearTarget().independent(y).text(s);
        y += 16;
    }
    scene.idle(50);
    ItemStack pot = new ItemStack(Items.FLOWER_POT);
    Vec3 frontVec = util.vector.blockSurface(deployerPos, Direction.WEST).add(-.125, 0, 0);
    scene.overlay.showControls(new InputWindowElement(frontVec, Pointing.DOWN).rightClick().withItem(pot), 40);
    scene.idle(7);
    Class<DeployerTileEntity> teType = DeployerTileEntity.class;
    scene.world.modifyTileNBT(deployerSelection, teType, nbt -> nbt.put("HeldItem", pot.serializeNBT()));
    scene.idle(10);
    scene.overlay.showText(40).attachKeyFrame().placeNearTarget().pointAt(frontVec).text("Right-click the front to give it an Item to use");
    scene.idle(40);
    scene.world.moveDeployer(deployerPos, 1, 25);
    scene.idle(26);
    scene.world.restoreBlocks(util.select.position(potPosition));
    scene.world.modifyTileNBT(deployerSelection, teType, nbt -> nbt.put("HeldItem", ItemStack.EMPTY.serializeNBT()));
    scene.world.moveDeployer(deployerPos, -1, 25);
    scene.idle(20);
    scene.world.showSection(util.select.position(deployerPos.above()), Direction.DOWN);
    ItemStack tulip = new ItemStack(Items.RED_TULIP);
    Vec3 entitySpawn = util.vector.topOf(deployerPos.above(3));
    ElementLink<EntityElement> entity1 = scene.world.createItemEntity(entitySpawn, util.vector.of(0, 0.2, 0), tulip);
    scene.idle(17);
    scene.world.modifyEntity(entity1, Entity::discard);
    scene.world.modifyTileNBT(deployerSelection, teType, nbt -> nbt.put("HeldItem", tulip.serializeNBT()));
    scene.idle(10);
    scene.overlay.showText(40).placeNearTarget().pointAt(util.vector.of(3, 2.5, 3)).text("Items can also be inserted automatically");
    scene.idle(30);
    scene.world.moveDeployer(deployerPos, 1, 25);
    scene.idle(26);
    scene.world.setBlock(potPosition, Blocks.POTTED_RED_TULIP.defaultBlockState(), false);
    scene.world.modifyTileNBT(deployerSelection, teType, nbt -> nbt.put("HeldItem", ItemStack.EMPTY.serializeNBT()));
    scene.world.moveDeployer(deployerPos, -1, 25);
    scene.idle(25);
    scene.world.hideSection(util.select.position(potPosition), Direction.UP);
    scene.world.hideSection(util.select.position(deployerPos.above()), Direction.EAST);
    scene.idle(20);
    Vec3 filterSlot = frontVec.add(0.375, 0.25, 0);
    scene.overlay.showFilterSlotInput(filterSlot, 80);
    scene.overlay.showText(40).attachKeyFrame().placeNearTarget().pointAt(filterSlot).text("Deployers carry a filter slot");
    scene.idle(50);
    ItemStack shears = new ItemStack(Items.SHEARS);
    scene.overlay.showControls(new InputWindowElement(filterSlot, Pointing.DOWN).rightClick().withItem(shears), 40);
    scene.idle(7);
    scene.world.setFilterData(deployerSelection, teType, shears);
    scene.overlay.showText(60).placeNearTarget().pointAt(filterSlot).text("When a filter is set, it activates only while holding a matching item");
    scene.idle(70);
    ElementLink<EntityElement> sheep = scene.world.createEntity(w -> {
        Sheep entity = EntityType.SHEEP.create(w);
        entity.setColor(DyeColor.PINK);
        Vec3 p = util.vector.topOf(util.grid.at(1, 0, 2));
        entity.setPos(p.x, p.y, p.z);
        entity.xo = p.x;
        entity.yo = p.y;
        entity.zo = p.z;
        entity.animationPosition = 0;
        entity.yRotO = 210;
        entity.setYRot(210);
        entity.yHeadRotO = 210;
        entity.yHeadRot = 210;
        return entity;
    });
    scene.idle(20);
    scene.world.showSection(util.select.position(deployerPos.above()), Direction.WEST);
    entity1 = scene.world.createItemEntity(entitySpawn, util.vector.of(0, 0.2, 0), shears);
    scene.idle(17);
    scene.world.modifyEntity(entity1, Entity::discard);
    scene.world.modifyTileNBT(deployerSelection, teType, nbt -> nbt.put("HeldItem", shears.serializeNBT()));
    scene.idle(10);
    scene.overlay.showText(60).placeNearTarget().pointAt(util.vector.of(3, 2.5, 3)).text("Only items matching the filter can now be inserted...");
    scene.idle(70);
    scene.world.moveDeployer(deployerPos, 1, 25);
    scene.idle(26);
    scene.world.modifyEntity(sheep, e -> ((Sheep) e).setSheared(true));
    scene.effects.emitParticles(util.vector.topOf(deployerPos.west(2)).add(0, -.25, 0), Emitter.withinBlockSpace(new BlockParticleOption(ParticleTypes.BLOCK, Blocks.PINK_WOOL.defaultBlockState()), util.vector.of(0, 0, 0)), 25, 1);
    scene.world.moveDeployer(deployerPos, -1, 25);
    scene.world.showSection(util.select.position(deployerPos.north()), Direction.SOUTH);
    scene.idle(25);
    scene.overlay.showText(80).placeNearTarget().pointAt(util.vector.of(3.5, 1.25, 1.25)).text("...and only non-matching items will be extracted");
    scene.world.flapFunnel(deployerPos.north(), true);
    scene.world.createItemEntity(util.vector.centerOf(deployerPos.north()).subtract(0, .45, 0), util.vector.of(0, 0, -0.1), new ItemStack(Items.PINK_WOOL));
    scene.markAsFinished();
    for (int i = 0; i < 10; i++) {
        scene.idle(26);
        scene.world.moveDeployer(deployerPos, 1, 25);
        scene.idle(26);
        scene.world.moveDeployer(deployerPos, -1, 25);
        scene.idle(26);
    }
}
Also used : DeployerTileEntity(com.simibubi.create.content.contraptions.components.deployer.DeployerTileEntity) Entity(net.minecraft.world.entity.Entity) BlockParticleOption(net.minecraft.core.particles.BlockParticleOption) Selection(com.simibubi.create.foundation.ponder.Selection) DeployerTileEntity(com.simibubi.create.content.contraptions.components.deployer.DeployerTileEntity) EntityElement(com.simibubi.create.foundation.ponder.element.EntityElement) Vec3(net.minecraft.world.phys.Vec3) InputWindowElement(com.simibubi.create.foundation.ponder.element.InputWindowElement) Sheep(net.minecraft.world.entity.animal.Sheep) BlockPos(net.minecraft.core.BlockPos) ItemStack(net.minecraft.world.item.ItemStack)

Example 70 with InputWindowElement

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

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