Search in sources :

Example 86 with Selection

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

the class CrafterScenes method setup.

public static void setup(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("mechanical_crafter", "Setting up Mechanical Crafters");
    scene.configureBasePlate(0, 0, 5);
    scene.world.showSection(util.select.layer(0), Direction.UP);
    scene.world.modifyKineticSpeed(util.select.everywhere(), f -> 1.5f * f);
    Selection redstone = util.select.fromTo(3, 1, 0, 3, 1, 1);
    Selection kinetics = util.select.fromTo(4, 1, 2, 4, 1, 5);
    BlockPos depotPos = util.grid.at(0, 1, 2);
    Selection crafters = util.select.fromTo(1, 1, 2, 3, 3, 2);
    scene.world.modifyBlocks(crafters, s -> s.setValue(MechanicalCrafterBlock.POINTING, Pointing.DOWN), false);
    scene.world.setKineticSpeed(crafters, 0);
    for (int y = 0; y < 3; y++) {
        for (int x = 0; x < 3; x++) {
            scene.world.showSection(util.select.position(y == 1 ? x + 1 : 3 - x, y + 1, 2), Direction.DOWN);
            scene.idle(2);
        }
    }
    scene.overlay.showText(70).text("An array of Mechanical Crafters can be used to automate any Crafting Recipe").pointAt(util.vector.blockSurface(util.grid.at(1, 2, 2), Direction.WEST)).attachKeyFrame().placeNearTarget();
    scene.idle(80);
    scene.overlay.showControls(new InputWindowElement(util.vector.blockSurface(util.grid.at(2, 3, 2), Direction.NORTH), Pointing.RIGHT).rightClick().withWrench(), 40);
    scene.idle(7);
    scene.world.cycleBlockProperty(util.grid.at(2, 3, 2), MechanicalCrafterBlock.POINTING);
    scene.idle(10);
    scene.overlay.showText(50).text("Using a Wrench, the Crafters' paths can be arranged").pointAt(util.vector.blockSurface(util.grid.at(2, 3, 2), Direction.NORTH)).attachKeyFrame().placeNearTarget();
    scene.idle(60);
    BlockPos[] positions = new BlockPos[] { util.grid.at(3, 1, 2), util.grid.at(2, 1, 2), util.grid.at(1, 1, 2) };
    for (BlockPos pos : positions) {
        scene.overlay.showControls(new InputWindowElement(util.vector.blockSurface(pos, Direction.NORTH), Pointing.RIGHT).rightClick().withWrench(), 10);
        scene.idle(7);
        scene.world.cycleBlockProperty(pos, MechanicalCrafterBlock.POINTING);
        scene.idle(15);
    }
    scene.overlay.showText(100).text("For a valid setup, all paths have to converge into one exit at any side").pointAt(util.vector.blockSurface(util.grid.at(1, 1, 2), Direction.WEST).add(0, 0, -.5f)).colored(PonderPalette.GREEN).attachKeyFrame().placeNearTarget();
    scene.idle(60);
    Collection<Couple<BlockPos>> couples = ImmutableList.of(Couple.create(util.grid.at(3, 3, 2), util.grid.at(3, 2, 2)), Couple.create(util.grid.at(3, 2, 2), util.grid.at(3, 1, 2)), Couple.create(util.grid.at(2, 3, 2), util.grid.at(1, 3, 2)), Couple.create(util.grid.at(3, 1, 2), util.grid.at(2, 1, 2)), Couple.create(util.grid.at(1, 3, 2), util.grid.at(1, 2, 2)), Couple.create(util.grid.at(2, 2, 2), util.grid.at(2, 1, 2)), Couple.create(util.grid.at(1, 2, 2), util.grid.at(1, 1, 2)), Couple.create(util.grid.at(2, 1, 2), util.grid.at(1, 1, 2)), Couple.create(util.grid.at(1, 1, 2), util.grid.at(0, 1, 2)));
    for (Couple<BlockPos> c : couples) {
        scene.idle(5);
        Vec3 p1 = util.vector.blockSurface(c.getFirst(), Direction.NORTH).add(0, 0, -0.125);
        Vec3 p2 = util.vector.blockSurface(c.getSecond(), Direction.NORTH).add(0, 0, -0.125);
        AABB point = new AABB(p1, p1);
        AABB line = new AABB(p1, p2);
        scene.overlay.chaseBoundingBoxOutline(PonderPalette.GREEN, p1, point, 2);
        scene.idle(1);
        scene.overlay.chaseBoundingBoxOutline(PonderPalette.GREEN, p1, line, 30);
    }
    scene.world.showSection(util.select.position(depotPos), Direction.EAST);
    scene.idle(20);
    scene.overlay.showText(60).text("The outputs will be placed into the inventory at the exit").pointAt(util.vector.blockSurface(util.grid.at(0, 1, 2), Direction.NORTH)).placeNearTarget();
    scene.idle(70);
    scene.rotateCameraY(60);
    scene.idle(20);
    scene.world.showSection(kinetics, Direction.NORTH);
    scene.overlay.showText(60).text("Mechanical Crafters require Rotational Force to operate").pointAt(util.vector.blockSurface(util.grid.at(4, 1, 2), Direction.NORTH)).attachKeyFrame().placeNearTarget();
    scene.idle(8);
    scene.world.setKineticSpeed(crafters, -48);
    scene.world.multiplyKineticSpeed(util.select.position(3, 2, 2).add(util.select.position(2, 3, 2)).add(util.select.position(1, 2, 2)).add(util.select.position(2, 1, 2)), -1);
    scene.idle(55);
    scene.rotateCameraY(-60);
    scene.idle(40);
    ItemStack planks = new ItemStack(Items.OAK_PLANKS);
    scene.overlay.showControls(new InputWindowElement(util.vector.blockSurface(util.grid.at(1, 3, 2), Direction.NORTH), Pointing.RIGHT).rightClick().withItem(planks), 40);
    scene.idle(7);
    Class<MechanicalCrafterTileEntity> type = MechanicalCrafterTileEntity.class;
    scene.world.modifyTileEntity(util.grid.at(1, 3, 2), type, mct -> mct.getInventory().insertItem(0, planks.copy(), false));
    scene.idle(10);
    scene.overlay.showText(50).text("Right-Click the front to insert Items manually").pointAt(util.vector.blockSurface(util.grid.at(1, 3, 2), Direction.NORTH)).attachKeyFrame().placeNearTarget();
    scene.idle(60);
    ItemStack alloy = AllItems.ANDESITE_ALLOY.asStack();
    ItemStack log = new ItemStack(Items.OAK_LOG);
    scene.world.setCraftingResult(util.grid.at(1, 1, 2), AllBlocks.ANDESITE_CASING.asStack(4));
    scene.world.modifyTileEntity(util.grid.at(2, 3, 2), type, mct -> mct.getInventory().insertItem(0, planks.copy(), false));
    scene.idle(5);
    scene.world.modifyTileEntity(util.grid.at(3, 3, 2), type, mct -> mct.getInventory().insertItem(0, planks.copy(), false));
    scene.idle(5);
    scene.world.modifyTileEntity(util.grid.at(3, 2, 2), type, mct -> mct.getInventory().insertItem(0, alloy.copy(), false));
    scene.idle(5);
    scene.world.modifyTileEntity(util.grid.at(2, 2, 2), type, mct -> mct.getInventory().insertItem(0, log.copy(), false));
    scene.idle(5);
    scene.world.modifyTileEntity(util.grid.at(1, 2, 2), type, mct -> mct.getInventory().insertItem(0, alloy.copy(), false));
    scene.idle(5);
    scene.world.modifyTileEntity(util.grid.at(1, 1, 2), type, mct -> mct.getInventory().insertItem(0, planks.copy(), false));
    scene.idle(5);
    scene.world.modifyTileEntity(util.grid.at(2, 1, 2), type, mct -> mct.getInventory().insertItem(0, planks.copy(), false));
    scene.idle(5);
    scene.world.modifyTileEntity(util.grid.at(3, 1, 2), type, mct -> mct.getInventory().insertItem(0, planks.copy(), false));
    scene.overlay.showText(80).attachKeyFrame().text("Once every slot of a path contains an Item, the crafting process will begin").pointAt(util.vector.blockSurface(util.grid.at(1, 3, 2), Direction.WEST)).placeNearTarget();
    scene.idle(180);
    scene.world.removeItemsFromBelt(depotPos);
    ItemStack stick = new ItemStack(Items.STICK);
    ItemStack iron = new ItemStack(Items.IRON_INGOT);
    scene.world.setCraftingResult(util.grid.at(1, 1, 2), new ItemStack(Items.IRON_PICKAXE));
    scene.world.modifyTileEntity(util.grid.at(1, 3, 2), type, mct -> mct.getInventory().insertItem(0, iron.copy(), false));
    scene.idle(2);
    scene.world.modifyTileEntity(util.grid.at(2, 3, 2), type, mct -> mct.getInventory().insertItem(0, iron.copy(), false));
    scene.idle(2);
    scene.world.modifyTileEntity(util.grid.at(3, 3, 2), type, mct -> mct.getInventory().insertItem(0, iron.copy(), false));
    scene.idle(2);
    scene.world.modifyTileEntity(util.grid.at(2, 2, 2), type, mct -> mct.getInventory().insertItem(0, stick.copy(), false));
    scene.idle(2);
    scene.world.modifyTileEntity(util.grid.at(2, 1, 2), type, mct -> mct.getInventory().insertItem(0, stick.copy(), false));
    scene.world.showSection(redstone, Direction.SOUTH);
    scene.idle(10);
    scene.overlay.showText(90).attachKeyFrame().colored(PonderPalette.RED).text("For recipes not fully occupying the crafter setup, the start can be forced using a Redstone Pulse").pointAt(util.vector.blockSurface(util.grid.at(1, 2, 2), Direction.NORTH)).placeNearTarget();
    scene.idle(100);
    scene.effects.indicateRedstone(util.grid.at(3, 1, 0));
    scene.world.toggleRedstonePower(redstone);
    scene.idle(20);
    scene.world.toggleRedstonePower(redstone);
}
Also used : Selection(com.simibubi.create.foundation.ponder.Selection) Couple(com.simibubi.create.foundation.utility.Couple) Vec3(net.minecraft.world.phys.Vec3) MechanicalCrafterTileEntity(com.simibubi.create.content.contraptions.components.crafter.MechanicalCrafterTileEntity) InputWindowElement(com.simibubi.create.foundation.ponder.element.InputWindowElement) BlockPos(net.minecraft.core.BlockPos) ItemStack(net.minecraft.world.item.ItemStack) AABB(net.minecraft.world.phys.AABB)

Example 87 with Selection

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

the class FunnelScenes method brass.

public static void brass(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("brass_funnel", "The Brass Funnel");
    scene.configureBasePlate(0, 0, 5);
    scene.world.showSection(util.select.layer(0), Direction.UP);
    scene.idle(5);
    BlockPos firstDepot = util.grid.at(3, 1, 1);
    BlockPos secondDepot = util.grid.at(1, 1, 1);
    Selection depots = util.select.fromTo(firstDepot, secondDepot);
    Selection beltAndStuff = util.select.fromTo(0, 1, 2, 4, 1, 2).add(util.select.fromTo(0, 1, 3, 0, 2, 5));
    Selection withoutBelt = util.select.layersFrom(1).substract(beltAndStuff).substract(depots);
    scene.world.showSection(withoutBelt, Direction.DOWN);
    ElementLink<WorldSectionElement> independentSection = scene.world.showIndependentSection(depots, Direction.DOWN);
    scene.world.moveSection(independentSection, util.vector.of(0, 0, 1), 0);
    BlockPos andesiteFunnel = util.grid.at(3, 2, 2);
    BlockPos brassFunnel = util.grid.at(1, 2, 2);
    ItemStack itemStack = AllItems.BRASS_INGOT.asStack();
    scene.idle(10);
    scene.overlay.showText(60).text("Andesite Funnels can only ever extract single items.").attachKeyFrame().pointAt(util.vector.topOf(andesiteFunnel)).placeNearTarget();
    scene.idle(10);
    scene.world.createItemOnBeltLike(andesiteFunnel.below().north(), Direction.SOUTH, itemStack);
    scene.world.flapFunnel(andesiteFunnel, true);
    scene.idle(60);
    scene.overlay.showText(60).text("Brass Funnels can extract up to a full stack.").attachKeyFrame().pointAt(util.vector.topOf(brassFunnel)).placeNearTarget();
    scene.idle(10);
    scene.world.createItemOnBeltLike(brassFunnel.below().north(), Direction.SOUTH, ItemHandlerHelper.copyStackWithSize(itemStack, 64));
    scene.world.flapFunnel(brassFunnel, true);
    scene.idle(60);
    AABB filterSlot = new AABB(brassFunnel).inflate(-.35, -.35, -.35).move(0, 0.2, 0);
    scene.overlay.chaseBoundingBoxOutline(PonderPalette.WHITE, filterSlot, filterSlot, 80);
    scene.overlay.showControls(new InputWindowElement(util.vector.topOf(brassFunnel), Pointing.DOWN).scroll(), 60);
    scene.idle(10);
    scene.overlay.showText(80).text("Scrolling on the filter slot allows for precise control over the extracted stack size.").attachKeyFrame().pointAt(filterSlot.getCenter()).placeNearTarget();
    scene.idle(90);
    // belt
    scene.world.hideIndependentSection(independentSection, Direction.NORTH);
    scene.world.hideSection(util.select.position(brassFunnel), Direction.UP);
    scene.idle(20);
    scene.world.modifyBlock(brassFunnel, s -> s.cycle(BeltFunnelBlock.SHAPE), false);
    scene.world.showSection(util.select.position(brassFunnel), Direction.DOWN);
    scene.world.showSection(beltAndStuff, Direction.SOUTH);
    scene.idle(10);
    ItemStack dirt = new ItemStack(Items.DIRT);
    ItemStack gravel = new ItemStack(Items.GRAVEL);
    ItemStack emerald = new ItemStack(Items.EMERALD);
    for (int i = 0; i < 14; i++) {
        if (i < 12)
            scene.world.createItemOnBelt(andesiteFunnel.below(), Direction.SOUTH, i % 3 == 0 ? dirt : i % 3 == 1 ? gravel : emerald);
        scene.idle(10);
        if (i > 0 && (i < 3 || i % 3 == 0)) {
            scene.world.removeItemsFromBelt(brassFunnel.below());
            scene.world.flapFunnel(brassFunnel, false);
        }
        scene.world.modifyEntities(ItemEntity.class, e -> {
            if (e.getY() < 1)
                e.discard();
        });
        if (i == 2) {
            scene.overlay.chaseBoundingBoxOutline(PonderPalette.WHITE, filterSlot, filterSlot, 80);
            scene.overlay.showControls(new InputWindowElement(util.vector.topOf(brassFunnel), Pointing.DOWN).rightClick().withItem(emerald), 60);
            scene.idle(10);
            scene.overlay.showText(80).text("Using items on the filter slot will restrict the funnel to only transfer matching stacks.").attachKeyFrame().pointAt(filterSlot.getCenter()).placeNearTarget();
            scene.world.setFilterData(util.select.position(brassFunnel), FunnelTileEntity.class, emerald);
        } else
            scene.idle(10);
        if (i == 8)
            scene.markAsFinished();
    }
}
Also used : Selection(com.simibubi.create.foundation.ponder.Selection) InputWindowElement(com.simibubi.create.foundation.ponder.element.InputWindowElement) BlockPos(net.minecraft.core.BlockPos) WorldSectionElement(com.simibubi.create.foundation.ponder.element.WorldSectionElement) ItemStack(net.minecraft.world.item.ItemStack) AABB(net.minecraft.world.phys.AABB)

Example 88 with Selection

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

the class ItemVaultScenes method storage.

public static void storage(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("item_vault_storage", "Storing Items in Vaults");
    scene.configureBasePlate(0, 0, 5);
    scene.showBasePlate();
    scene.idle(5);
    Selection chests = util.select.fromTo(4, 3, 2, 3, 4, 3);
    Selection largeCog = util.select.position(3, 0, 5);
    Selection belt1 = util.select.fromTo(0, 2, 3, 2, 1, 5);
    Selection gearbox = util.select.position(2, 1, 2);
    Selection belt2 = util.select.fromTo(0, 1, 1, 2, 2, 1);
    Selection vault = util.select.fromTo(3, 2, 3, 4, 1, 1);
    scene.world.showSection(vault, Direction.NORTH);
    scene.idle(5);
    ElementLink<WorldSectionElement> chestLink = scene.world.showIndependentSection(chests, Direction.NORTH);
    scene.world.moveSection(chestLink, util.vector.of(-3, -2, 0), 0);
    scene.idle(10);
    scene.overlay.showOutline(PonderPalette.GREEN, "chestOutline", util.select.fromTo(1, 1, 2, 0, 2, 3), 40);
    scene.idle(10);
    scene.overlay.showLine(PonderPalette.GREEN, util.vector.of(2, 1, 2), util.vector.of(3, 1, 1), 30);
    scene.overlay.showLine(PonderPalette.GREEN, util.vector.of(2, 3, 2), util.vector.of(3, 3, 1), 30);
    scene.overlay.showLine(PonderPalette.GREEN, util.vector.of(2, 3, 4), util.vector.of(3, 3, 4), 30);
    scene.overlay.showOutline(PonderPalette.GREEN, "vaultOutline", vault, 40);
    scene.idle(10);
    BlockPos frontVault = util.grid.at(3, 2, 1);
    scene.overlay.showText(60).text("Item Vaults can be used to store large amounts of items").attachKeyFrame().placeNearTarget().pointAt(util.vector.blockSurface(frontVault, Direction.NORTH));
    scene.idle(70);
    scene.world.hideIndependentSection(chestLink, Direction.DOWN);
    scene.idle(15);
    ItemStack hand = AllItems.BRASS_HAND.asStack();
    scene.overlay.showControls(new InputWindowElement(util.vector.blockSurface(frontVault, Direction.NORTH), Pointing.RIGHT).showing(AllIcons.I_MTD_CLOSE).withItem(hand), 40);
    scene.idle(7);
    scene.overlay.showText(60).text("However, contents cannot be added or taken manually").attachKeyFrame().colored(PonderPalette.RED).placeNearTarget().pointAt(util.vector.blockSurface(frontVault, Direction.WEST));
    scene.idle(70);
    scene.world.showSection(largeCog, Direction.UP);
    scene.idle(5);
    scene.world.showSection(belt1, Direction.EAST);
    scene.idle(20);
    scene.overlay.showText(80).text("Any components for item transfer can both insert...").attachKeyFrame().colored(PonderPalette.GREEN).placeNearTarget().pointAt(util.vector.topOf(2, 2, 3));
    ItemStack[] junk = { new ItemStack(Items.APPLE), new ItemStack(Items.GOLD_INGOT, 8), new ItemStack(Items.TUFF, 32) };
    for (int i = 0; i < junk.length + 2; i++) {
        scene.idle(4);
        if (i > 1) {
            scene.world.removeItemsFromBelt(util.grid.at(2, 1, 3));
            scene.world.flapFunnel(util.grid.at(2, 2, 3), false);
        }
        scene.idle(5);
        if (i < junk.length)
            scene.world.createItemOnBeltLike(util.grid.at(0, 1, 3), Direction.SOUTH, junk[i]);
        scene.idle(9);
    }
    scene.world.showSection(gearbox, Direction.SOUTH);
    scene.idle(5);
    scene.world.showSection(belt2, Direction.EAST);
    scene.idle(15);
    scene.overlay.showText(80).text("...and take contents from this container").colored(PonderPalette.GREEN).placeNearTarget().pointAt(util.vector.topOf(2, 1, 1));
    for (int i = 0; i < junk.length; i++) {
        scene.world.createItemOnBeltLike(util.grid.at(2, 1, 1), Direction.EAST, junk[i]);
        scene.idle(18);
    }
}
Also used : Selection(com.simibubi.create.foundation.ponder.Selection) 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 89 with Selection

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

the class KineticsScenes method cogsSpeedUp.

public static void cogsSpeedUp(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("cog_speedup", "Gearshifting with Cogs");
    scene.configureBasePlate(0, 0, 5);
    scene.world.showSection(util.select.layer(0), Direction.UP);
    scene.idle(5);
    scene.world.showSection(util.select.fromTo(5, 1, 2, 4, 1, 2), Direction.DOWN);
    scene.idle(10);
    BlockPos lowerCog = util.grid.at(3, 1, 2);
    BlockPos upperCog = util.grid.at(3, 2, 3);
    BlockState largeCogState = AllBlocks.LARGE_COGWHEEL.getDefaultState().setValue(CogWheelBlock.AXIS, Axis.X);
    BlockState smallCogState = AllBlocks.COGWHEEL.getDefaultState().setValue(CogWheelBlock.AXIS, Axis.X);
    scene.world.setBlock(lowerCog, largeCogState, false);
    scene.world.setBlock(upperCog, smallCogState, false);
    BlockPos upperShaftEnd = upperCog.west(3);
    BlockPos lowerShaftEnd = lowerCog.west(3);
    scene.world.setKineticSpeed(util.select.fromTo(upperCog, upperShaftEnd), -64);
    scene.world.showSection(util.select.fromTo(lowerCog, upperCog), Direction.EAST);
    scene.overlay.showText(60).text("Large and Small cogs can be connected diagonally").placeNearTarget().pointAt(util.vector.blockSurface(upperCog, Direction.WEST));
    scene.idle(80);
    Selection gaugesSelect = util.select.fromTo(0, 1, 2, 2, 2, 3);
    scene.world.showSection(gaugesSelect, Direction.DOWN);
    scene.overlay.showText(60).text("Shifting from large to small cogs, the conveyed speed will be doubled").colored(PonderPalette.GREEN).attachKeyFrame().placeNearTarget().pointAt(util.vector.blockSurface(util.grid.at(1, 2, 3), Direction.NORTH));
    scene.idle(10);
    scene.effects.rotationSpeedIndicator(upperCog);
    scene.idle(60);
    scene.overlay.showText(30).sharedText("rpm32").colored(PonderPalette.FAST).placeNearTarget().pointAt(util.vector.blockSurface(upperShaftEnd, Direction.WEST));
    scene.idle(5);
    scene.overlay.showText(30).sharedText("rpm16").colored(PonderPalette.MEDIUM).placeNearTarget().pointAt(util.vector.blockSurface(lowerShaftEnd, Direction.WEST));
    scene.idle(45);
    scene.world.setKineticSpeed(util.select.fromTo(lowerCog, upperShaftEnd), 0);
    ElementLink<WorldSectionElement> cogs = scene.world.makeSectionIndependent(util.select.fromTo(lowerCog, upperCog));
    scene.world.moveSection(cogs, util.vector.of(0, 1, 0), 5);
    scene.idle(5);
    scene.world.rotateSection(cogs, 180, 0, 0, 10);
    scene.idle(10);
    scene.world.setBlock(lowerCog, smallCogState, false);
    scene.world.setBlock(upperCog, largeCogState, false);
    scene.world.rotateSection(cogs, 180, 0, 0, 0);
    scene.world.moveSection(cogs, util.vector.of(0, -1, 0), 5);
    scene.idle(5);
    scene.world.setKineticSpeed(util.select.fromTo(lowerCog, lowerShaftEnd), 32);
    scene.world.setKineticSpeed(util.select.fromTo(upperCog, upperShaftEnd), -16);
    scene.overlay.showText(80).text("Shifting the opposite way, the conveyed speed will be halved").colored(PonderPalette.RED).attachKeyFrame().placeNearTarget().pointAt(util.vector.blockSurface(util.grid.at(1, 2, 3), Direction.NORTH));
    scene.idle(10);
    scene.effects.rotationSpeedIndicator(upperCog);
    scene.idle(80);
    scene.overlay.showText(60).sharedText("rpm8").colored(PonderPalette.SLOW).placeNearTarget().pointAt(util.vector.blockSurface(upperShaftEnd, Direction.WEST));
    scene.idle(5);
    scene.overlay.showText(60).sharedText("rpm16").colored(PonderPalette.MEDIUM).placeNearTarget().pointAt(util.vector.blockSurface(lowerShaftEnd, Direction.WEST));
    scene.idle(40);
}
Also used : BlockState(net.minecraft.world.level.block.state.BlockState) Selection(com.simibubi.create.foundation.ponder.Selection) BlockPos(net.minecraft.core.BlockPos) WorldSectionElement(com.simibubi.create.foundation.ponder.element.WorldSectionElement)

Example 90 with Selection

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

the class KineticsScenes method gauge.

private static void gauge(SceneBuilder scene, SceneBuildingUtil util, boolean speed) {
    String component = speed ? "Speedometer" : "Stressometer";
    String title = "Monitoring Kinetic information using the " + component;
    scene.title(speed ? "speedometer" : "stressometer", title);
    scene.configureBasePlate(1, 0, 5);
    BlockPos gaugePos = util.grid.at(2, 1, 3);
    scene.world.showSection(util.select.layer(0), Direction.UP);
    scene.idle(5);
    for (int x = 6; x >= 0; x--) {
        scene.idle(2);
        scene.world.showSection(util.select.position(x, 1, 3), Direction.DOWN);
    }
    scene.idle(10);
    scene.world.setBlock(gaugePos, (speed ? AllBlocks.SPEEDOMETER : AllBlocks.STRESSOMETER).getDefaultState().setValue(GaugeBlock.FACING, Direction.UP), true);
    scene.world.setKineticSpeed(util.select.position(gaugePos), 32);
    scene.idle(10);
    scene.overlay.showText(80).text("The " + component + " displays the current " + (speed ? "Speed" : "Stress Capacity") + " of the attached " + (speed ? "components" : "kinetic network")).attachKeyFrame().pointAt(util.vector.topOf(gaugePos)).placeNearTarget();
    scene.idle(90);
    if (speed) {
        scene.world.multiplyKineticSpeed(util.select.everywhere(), 4);
        scene.effects.rotationSpeedIndicator(util.grid.at(6, 1, 3));
        scene.idle(5);
        scene.effects.indicateSuccess(gaugePos);
    } else {
        BlockState state = AllBlocks.CRUSHING_WHEEL.getDefaultState().setValue(CrushingWheelBlock.AXIS, Axis.X);
        scene.world.setBlock(util.grid.at(5, 1, 3), state, true);
        scene.world.setKineticSpeed(util.select.position(5, 1, 3), 32);
        scene.world.modifyTileNBT(util.select.position(gaugePos), StressGaugeTileEntity.class, nbt -> nbt.putFloat("Value", .5f));
        scene.effects.indicateRedstone(gaugePos);
        scene.idle(20);
        scene.world.setBlock(util.grid.at(4, 1, 3), state, true);
        scene.world.setKineticSpeed(util.select.position(4, 1, 3), 32);
        scene.world.modifyTileNBT(util.select.position(gaugePos), StressGaugeTileEntity.class, nbt -> nbt.putFloat("Value", .9f));
        scene.effects.indicateRedstone(gaugePos);
        scene.idle(10);
    }
    scene.idle(30);
    Vec3 blockSurface = util.vector.blockSurface(gaugePos, Direction.NORTH);
    scene.overlay.showControls(new InputWindowElement(blockSurface, Pointing.RIGHT).withItem(AllItems.GOGGLES.asStack()), 40);
    scene.idle(7);
    scene.overlay.showText(80).text("When wearing Engineers' Goggles, the player can get more detailed information from the Gauge").attachKeyFrame().colored(PonderPalette.MEDIUM).pointAt(blockSurface).placeNearTarget();
    scene.idle(100);
    Selection comparator = util.select.fromTo(2, 1, 1, 2, 1, 2);
    scene.world.showSection(comparator, Direction.SOUTH);
    scene.idle(10);
    scene.world.toggleRedstonePower(comparator);
    scene.effects.indicateRedstone(util.grid.at(2, 1, 2));
    scene.idle(20);
    scene.overlay.showText(120).text("Comparators can emit analog Restone Signals relative to the " + component + "'s measurements").attachKeyFrame().colored(PonderPalette.RED).pointAt(util.vector.centerOf(2, 1, 2).add(0, -0.35, 0)).placeNearTarget();
    scene.idle(130);
    scene.markAsFinished();
}
Also used : BlockState(net.minecraft.world.level.block.state.BlockState) 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)

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