Search in sources :

Example 11 with InputWindowElement

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

the class KineticsScenes method creativeMotor.

public static void creativeMotor(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("creative_motor", "Generating Rotational Force using Creative Motors");
    scene.configureBasePlate(0, 0, 5);
    scene.world.showSection(util.select.layer(0), Direction.UP);
    BlockPos motor = util.grid.at(3, 1, 2);
    for (int i = 0; i < 3; i++) {
        scene.idle(5);
        scene.world.showSection(util.select.position(1 + i, 1, 2), Direction.DOWN);
    }
    scene.idle(10);
    scene.effects.rotationSpeedIndicator(motor);
    scene.overlay.showText(50).text("Creative motors are a compact and configurable source of Rotational Force").placeNearTarget().pointAt(util.vector.topOf(motor));
    scene.idle(50);
    scene.rotateCameraY(90);
    scene.idle(20);
    Vec3 blockSurface = util.vector.blockSurface(motor, Direction.EAST);
    AABB point = new AABB(blockSurface, blockSurface);
    AABB expanded = point.inflate(1 / 16f, 1 / 5f, 1 / 5f);
    scene.overlay.chaseBoundingBoxOutline(PonderPalette.WHITE, blockSurface, point, 1);
    scene.idle(1);
    scene.overlay.chaseBoundingBoxOutline(PonderPalette.WHITE, blockSurface, expanded, 60);
    scene.overlay.showControls(new InputWindowElement(blockSurface, Pointing.DOWN).scroll(), 60);
    scene.idle(20);
    scene.overlay.showText(50).text("Scrolling on the back panel changes the RPM of the motors' rotational output").attachKeyFrame().placeNearTarget().pointAt(blockSurface);
    scene.idle(10);
    scene.world.modifyKineticSpeed(util.select.fromTo(1, 1, 2, 3, 1, 2), f -> 4 * f);
    scene.idle(50);
    scene.effects.rotationSpeedIndicator(motor);
    scene.rotateCameraY(-90);
}
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 12 with InputWindowElement

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

the class KineticsScenes method shaftsCanBeEncased.

public static void shaftsCanBeEncased(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("shaft_casing", "Encasing Shafts");
    scene.configureBasePlate(0, 0, 5);
    scene.showBasePlate();
    Selection shaft = util.select.cuboid(new BlockPos(0, 1, 2), new Vec3i(5, 0, 2));
    Selection andesite = util.select.position(3, 1, 2);
    Selection brass = util.select.position(1, 1, 2);
    scene.world.showSection(shaft, Direction.DOWN);
    scene.idle(20);
    BlockEntry<EncasedShaftBlock> andesiteEncased = AllBlocks.ANDESITE_ENCASED_SHAFT;
    ItemStack andesiteCasingItem = AllBlocks.ANDESITE_CASING.asStack();
    scene.overlay.showControls(new InputWindowElement(util.vector.topOf(3, 1, 2), Pointing.DOWN).rightClick().withItem(andesiteCasingItem), 60);
    scene.idle(7);
    scene.world.setBlocks(andesite, andesiteEncased.getDefaultState().setValue(EncasedShaftBlock.AXIS, Axis.X), true);
    scene.world.setKineticSpeed(shaft, 32);
    scene.idle(10);
    BlockEntry<EncasedShaftBlock> brassEncased = AllBlocks.BRASS_ENCASED_SHAFT;
    ItemStack brassCasingItem = AllBlocks.BRASS_CASING.asStack();
    scene.overlay.showControls(new InputWindowElement(util.vector.topOf(1, 0, 2), Pointing.UP).rightClick().withItem(brassCasingItem), 60);
    scene.idle(7);
    scene.world.setBlocks(brass, brassEncased.getDefaultState().setValue(EncasedShaftBlock.AXIS, Axis.X), true);
    scene.world.setKineticSpeed(shaft, 32);
    scene.idle(10);
    scene.overlay.showText(1000).placeNearTarget().text("Brass or Andesite Casing can be used to decorate Shafts").pointAt(util.vector.topOf(1, 1, 2));
}
Also used : Vec3i(net.minecraft.core.Vec3i) Selection(com.simibubi.create.foundation.ponder.Selection) InputWindowElement(com.simibubi.create.foundation.ponder.element.InputWindowElement) BlockPos(net.minecraft.core.BlockPos) ItemStack(net.minecraft.world.item.ItemStack) EncasedShaftBlock(com.simibubi.create.content.contraptions.relays.encased.EncasedShaftBlock)

Example 13 with InputWindowElement

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

the class DebugScenes method controlsScene.

public static void controlsScene(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("debug_controls", "Basic player interaction");
    scene.showBasePlate();
    scene.idle(10);
    scene.world.showSection(util.select.layer(1), Direction.DOWN);
    scene.idle(4);
    scene.world.showSection(util.select.layer(2), Direction.DOWN);
    scene.idle(4);
    scene.world.showSection(util.select.layer(3), Direction.DOWN);
    scene.idle(10);
    BlockPos shaftPos = util.grid.at(3, 1, 1);
    Selection shaftSelection = util.select.position(shaftPos);
    scene.overlay.showControls(new InputWindowElement(util.vector.topOf(shaftPos), Pointing.DOWN).rightClick().whileSneaking().withWrench(), 40);
    scene.idle(20);
    scene.world.replaceBlocks(shaftSelection, AllBlocks.SHAFT.getDefaultState(), true);
    scene.idle(20);
    scene.world.hideSection(shaftSelection, Direction.UP);
    scene.idle(20);
    scene.overlay.showControls(new InputWindowElement(util.vector.of(1, 4.5, 3.5), Pointing.LEFT).rightClick().withItem(new ItemStack(Blocks.POLISHED_ANDESITE)), 20);
    scene.world.showSection(util.select.layer(4), Direction.DOWN);
    scene.idle(40);
    BlockPos chassis = util.grid.at(1, 1, 3);
    Vec3 chassisSurface = util.vector.blockSurface(chassis, Direction.NORTH);
    Object chassisValueBoxHighlight = new Object();
    Object chassisEffectHighlight = new Object();
    AABB point = new AABB(chassisSurface, chassisSurface);
    AABB expanded = point.inflate(1 / 4f, 1 / 4f, 1 / 16f);
    Selection singleBlock = util.select.position(1, 2, 3);
    Selection twoBlocks = util.select.fromTo(1, 2, 3, 1, 3, 3);
    Selection threeBlocks = util.select.fromTo(1, 2, 3, 1, 4, 3);
    Selection singleRow = util.select.fromTo(1, 2, 3, 3, 2, 3);
    Selection twoRows = util.select.fromTo(1, 2, 3, 3, 3, 3);
    Selection threeRows = twoRows.copy().add(threeBlocks);
    scene.overlay.chaseBoundingBoxOutline(PonderPalette.GREEN, chassisValueBoxHighlight, point, 1);
    scene.idle(1);
    scene.overlay.chaseBoundingBoxOutline(PonderPalette.GREEN, chassisValueBoxHighlight, expanded, 120);
    scene.overlay.showControls(new InputWindowElement(chassisSurface, Pointing.UP).scroll().withWrench(), 40);
    PonderPalette white = PonderPalette.WHITE;
    scene.overlay.showOutline(white, chassisEffectHighlight, singleBlock, 10);
    scene.idle(10);
    scene.overlay.showOutline(white, chassisEffectHighlight, twoBlocks, 10);
    scene.idle(10);
    scene.overlay.showOutline(white, chassisEffectHighlight, threeBlocks, 10);
    scene.idle(10);
    scene.overlay.showOutline(white, chassisEffectHighlight, twoBlocks, 10);
    scene.idle(10);
    scene.overlay.showOutline(white, chassisEffectHighlight, singleBlock, 10);
    scene.idle(10);
    scene.idle(30);
    scene.overlay.showControls(new InputWindowElement(chassisSurface, Pointing.UP).whileCTRL().scroll().withWrench(), 40);
    scene.overlay.showOutline(white, chassisEffectHighlight, singleRow, 10);
    scene.idle(10);
    scene.overlay.showOutline(white, chassisEffectHighlight, twoRows, 10);
    scene.idle(10);
    scene.overlay.showOutline(white, chassisEffectHighlight, threeRows, 10);
    scene.idle(10);
    scene.overlay.showOutline(white, chassisEffectHighlight, twoRows, 10);
    scene.idle(10);
    scene.overlay.showOutline(white, chassisEffectHighlight, singleRow, 10);
    scene.idle(10);
    scene.markAsFinished();
}
Also used : PonderPalette(com.simibubi.create.foundation.ponder.PonderPalette) 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) AABB(net.minecraft.world.phys.AABB)

Example 14 with InputWindowElement

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

the class DeployerScenes method contraption.

public static void contraption(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("deployer_contraption", "Using Deployers on Contraptions");
    scene.configureBasePlate(0, 0, 6);
    scene.scaleSceneView(.9f);
    Selection flowers = util.select.fromTo(4, 1, 1, 1, 1, 1);
    scene.world.replaceBlocks(flowers, Blocks.AIR.defaultBlockState(), false);
    Selection kinetics = util.select.fromTo(5, 1, 6, 5, 1, 3);
    BlockPos deployerPos = util.grid.at(4, 1, 3);
    Selection deployerSelection = util.select.position(deployerPos);
    scene.world.showSection(util.select.layer(0).add(flowers), Direction.UP);
    scene.idle(5);
    ElementLink<WorldSectionElement> pistonHead = scene.world.showIndependentSection(util.select.fromTo(5, 1, 2, 8, 1, 2), 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(deployerSelection, Direction.DOWN);
    scene.idle(5);
    scene.world.glueBlockOnto(util.grid.at(4, 2, 3), Direction.DOWN, contraption);
    scene.overlay.showText(60).attachKeyFrame().placeNearTarget().pointAt(util.vector.blockSurface(deployerPos, Direction.WEST)).text("Whenever Deployers are moved as part of an animated Contraption...");
    scene.idle(70);
    scene.world.setKineticSpeed(util.select.position(4, 0, 6), -8);
    scene.world.setKineticSpeed(kinetics, 16);
    scene.world.moveSection(pistonHead, util.vector.of(-3, 0, 0), 100);
    scene.world.moveSection(contraption, util.vector.of(-3, 0, 0), 100);
    for (int x = 0; x < 4; x++) {
        scene.world.moveDeployer(deployerPos, 1, 9);
        scene.idle(10);
        scene.world.moveDeployer(deployerPos, -1, 9);
        scene.world.restoreBlocks(util.select.position(4 - x, 1, 1));
        scene.idle(18);
    }
    scene.overlay.showSelectionWithText(flowers, 90).attachKeyFrame().colored(PonderPalette.GREEN).text("They activate at each visited location, using items from inventories anywhere on the contraption");
    scene.idle(100);
    scene.world.hideSection(flowers, Direction.UP);
    scene.idle(15);
    scene.world.replaceBlocks(flowers, Blocks.AIR.defaultBlockState(), false);
    scene.world.showSection(flowers, Direction.UP);
    Vec3 frontVec = util.vector.blockSurface(deployerPos.west(3), Direction.NORTH).add(0, 0, -.125);
    Vec3 filterSlot = frontVec.add(0, 0.25, 0.375);
    scene.overlay.showFilterSlotInput(filterSlot, 80);
    scene.overlay.showText(60).attachKeyFrame().placeNearTarget().pointAt(filterSlot).text("The Filter slot can be used to specify which items to pull");
    scene.idle(70);
    ItemStack poppy = new ItemStack(Items.POPPY);
    scene.overlay.showControls(new InputWindowElement(filterSlot, Pointing.DOWN).withItem(poppy), 30);
    scene.idle(7);
    scene.world.setFilterData(deployerSelection, DeployerTileEntity.class, poppy);
    scene.idle(25);
    scene.world.setKineticSpeed(util.select.position(4, 0, 6), 8);
    scene.world.setKineticSpeed(kinetics, -16);
    scene.world.moveSection(pistonHead, util.vector.of(3, 0, 0), 100);
    scene.world.moveSection(contraption, util.vector.of(3, 0, 0), 100);
    for (int x = 0; x < 4; x++) {
        scene.world.moveDeployer(deployerPos, 1, 9);
        scene.idle(10);
        scene.world.moveDeployer(deployerPos, -1, 9);
        scene.world.setBlock(util.grid.at(1 + x, 1, 1), Blocks.POPPY.defaultBlockState(), false);
        scene.idle(18);
    }
}
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)

Example 15 with InputWindowElement

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

the class EjectorScenes method splitY.

public static void splitY(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("weighted_ejector_tunnel", "Splitting item stacks using Weighted Ejectors");
    scene.configureBasePlate(0, 0, 5);
    scene.world.showSection(util.select.layer(0), Direction.UP);
    scene.idle(5);
    scene.world.showSection(util.select.fromTo(4, 1, 5, 0, 1, 3), Direction.DOWN);
    scene.idle(5);
    scene.world.showSection(util.select.position(2, 2, 3), Direction.DOWN);
    scene.idle(10);
    scene.world.showSection(util.select.position(2, 1, 2), Direction.SOUTH);
    scene.idle(5);
    scene.world.showSection(util.select.fromTo(4, 1, 2, 3, 1, 1), Direction.SOUTH);
    scene.world.showSection(util.select.fromTo(2, 1, 1, 2, 1, 0), Direction.SOUTH);
    scene.idle(10);
    BlockPos ejectorPos = util.grid.at(2, 1, 2);
    scene.overlay.showText(80).attachKeyFrame().text("Combined with Brass Tunnels, Ejectors can split item stacks by specific amounts").pointAt(util.vector.topOf(ejectorPos)).placeNearTarget();
    scene.idle(90);
    BlockPos tunnel = util.grid.at(2, 2, 3);
    scene.overlay.showControls(new InputWindowElement(util.vector.topOf(tunnel), Pointing.DOWN).scroll().withWrench(), 70);
    scene.idle(10);
    scene.overlay.showControls(new InputWindowElement(util.vector.topOf(tunnel), Pointing.UP).showing(AllIcons.I_TUNNEL_PREFER_NEAREST), 60);
    scene.overlay.showCenteredScrollInput(tunnel, Direction.UP, 100);
    scene.idle(10);
    scene.overlay.showText(100).attachKeyFrame().colored(PonderPalette.BLUE).text("First, configure the Brass Tunnel to 'Prefer Nearest', in order to prioritize its side output").pointAt(util.vector.topOf(tunnel)).placeNearTarget();
    scene.idle(110);
    Vec3 input = util.vector.of(2.5, 1 + 12 / 16f, 2.8);
    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("The Stack Size set on the Ejector now determines the amount to be split off").pointAt(topOfSlot).placeNearTarget();
    scene.world.modifyTileNBT(util.select.position(2, 1, 2), EjectorTileEntity.class, nbt -> {
        nbt.putInt("ScrollValue", 10);
    });
    scene.idle(90);
    scene.overlay.showControls(new InputWindowElement(util.vector.topOf(util.grid.at(4, 1, 3)), Pointing.DOWN).withItem(new ItemStack(Items.COPPER_INGOT)), 20);
    scene.idle(7);
    scene.world.createItemOnBelt(util.grid.at(4, 1, 3), Direction.UP, new ItemStack(Items.COPPER_INGOT, 64));
    scene.idle(40);
    scene.world.multiplyKineticSpeed(util.select.everywhere(), 1 / 16f);
    scene.overlay.showText(80).attachKeyFrame().text("While a new stack of the configured size exits the side output...").pointAt(util.vector.blockSurface(util.grid.at(2, 1, 1), Direction.WEST)).placeNearTarget();
    scene.idle(90);
    scene.overlay.showText(80).text("...the remainder will continue on its path").pointAt(util.vector.blockSurface(util.grid.at(0, 1, 3), Direction.UP)).placeNearTarget();
    scene.idle(90);
    scene.world.multiplyKineticSpeed(util.select.everywhere(), 16f);
}
Also used : 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)

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