Search in sources :

Example 56 with InputWindowElement

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

the class MovementActorScenes method psiTransfer.

public static void psiTransfer(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("portable_storage_interface", "Contraption Storage Exchange");
    scene.configureBasePlate(0, 0, 6);
    scene.scaleSceneView(0.95f);
    scene.setSceneOffsetY(-1);
    scene.world.showSection(util.select.layer(0), Direction.UP);
    scene.idle(5);
    BlockPos bearing = util.grid.at(5, 1, 2);
    scene.world.showSection(util.select.position(bearing), Direction.DOWN);
    scene.idle(5);
    ElementLink<WorldSectionElement> contraption = scene.world.showIndependentSection(util.select.fromTo(5, 2, 2, 6, 3, 2), Direction.DOWN);
    scene.world.configureCenterOfRotation(contraption, util.vector.centerOf(bearing));
    scene.idle(10);
    scene.world.rotateBearing(bearing, 360, 70);
    scene.world.rotateSection(contraption, 0, 360, 0, 70);
    scene.overlay.showText(60).pointAt(util.vector.topOf(bearing.above(2))).colored(PonderPalette.RED).placeNearTarget().attachKeyFrame().text("Inventories on moving contraptions cannot be accessed by players.");
    scene.idle(70);
    BlockPos psi = util.grid.at(4, 2, 2);
    scene.world.showSectionAndMerge(util.select.position(psi), Direction.EAST, contraption);
    scene.idle(13);
    scene.effects.superGlue(psi, Direction.EAST, true);
    scene.overlay.showText(80).pointAt(util.vector.topOf(psi)).colored(PonderPalette.GREEN).placeNearTarget().attachKeyFrame().text("This component can interact with storage without the need to stop the contraption.");
    scene.idle(90);
    BlockPos psi2 = psi.west(2);
    scene.world.showSection(util.select.position(psi2), Direction.DOWN);
    scene.overlay.showSelectionWithText(util.select.position(psi.west()), 50).colored(PonderPalette.RED).placeNearTarget().attachKeyFrame().text("Place a second one with a gap of 1 or 2 blocks inbetween");
    scene.idle(55);
    scene.world.rotateBearing(bearing, 360, 60);
    scene.world.rotateSection(contraption, 0, 360, 0, 60);
    scene.idle(20);
    scene.overlay.showText(40).placeNearTarget().pointAt(util.vector.of(3, 3, 2.5)).text("Whenever they pass by each other, they will engage in a connection");
    scene.idle(35);
    Selection both = util.select.fromTo(2, 2, 2, 4, 2, 2);
    Class<PortableItemInterfaceTileEntity> psiClass = PortableItemInterfaceTileEntity.class;
    scene.world.modifyTileNBT(both, psiClass, nbt -> {
        nbt.putFloat("Distance", 1);
        nbt.putFloat("Timer", 40);
    });
    scene.idle(20);
    scene.overlay.showOutline(PonderPalette.GREEN, psi, util.select.fromTo(5, 3, 2, 6, 3, 2), 80);
    scene.idle(10);
    scene.overlay.showSelectionWithText(util.select.position(psi2), 70).placeNearTarget().colored(PonderPalette.GREEN).attachKeyFrame().text("While engaged, the stationary interface will represent ALL inventories on the contraption");
    scene.idle(80);
    BlockPos hopper = util.grid.at(2, 3, 2);
    scene.world.showSection(util.select.position(hopper), Direction.DOWN);
    scene.overlay.showText(70).placeNearTarget().pointAt(util.vector.topOf(hopper)).attachKeyFrame().text("Items can now be inserted...");
    ItemStack itemStack = new ItemStack(Items.COPPER_INGOT);
    Vec3 entitySpawn = util.vector.topOf(hopper.above(3));
    ElementLink<EntityElement> entity1 = scene.world.createItemEntity(entitySpawn, util.vector.of(0, 0.2, 0), itemStack);
    scene.idle(10);
    ElementLink<EntityElement> entity2 = scene.world.createItemEntity(entitySpawn, util.vector.of(0, 0.2, 0), itemStack);
    scene.idle(10);
    scene.world.modifyEntity(entity1, Entity::discard);
    scene.idle(10);
    scene.world.modifyEntity(entity2, Entity::discard);
    scene.overlay.showControls(new InputWindowElement(util.vector.topOf(5, 3, 2), Pointing.DOWN).withItem(itemStack), 40);
    scene.idle(30);
    scene.world.hideSection(util.select.position(hopper), Direction.UP);
    scene.idle(15);
    BlockPos beltPos = util.grid.at(1, 1, 2);
    scene.world.showSection(util.select.fromTo(0, 1, 0, 1, 2, 6), Direction.DOWN);
    scene.idle(10);
    scene.world.createItemOnBelt(beltPos, Direction.EAST, itemStack.copy());
    scene.overlay.showText(40).placeNearTarget().pointAt(util.vector.topOf(beltPos.above())).text("...or extracted from the contraption");
    scene.idle(15);
    scene.world.createItemOnBelt(beltPos, Direction.EAST, itemStack);
    scene.idle(20);
    scene.world.modifyEntities(ItemEntity.class, Entity::discard);
    scene.idle(15);
    scene.world.modifyEntities(ItemEntity.class, Entity::discard);
    scene.overlay.showText(120).placeNearTarget().pointAt(util.vector.topOf(psi2)).text("After no items have been exchanged for a while, the contraption will continue on its way");
    scene.world.modifyTileNBT(both, psiClass, nbt -> nbt.putFloat("Timer", 9));
    scene.idle(15);
    scene.markAsFinished();
    scene.world.rotateBearing(bearing, 270, 120);
    scene.world.rotateSection(contraption, 0, 270, 0, 120);
}
Also used : HarvesterTileEntity(com.simibubi.create.content.contraptions.components.actors.HarvesterTileEntity) Entity(net.minecraft.world.entity.Entity) ItemEntity(net.minecraft.world.entity.item.ItemEntity) PortableItemInterfaceTileEntity(com.simibubi.create.content.contraptions.components.actors.PortableItemInterfaceTileEntity) PortableStorageInterfaceTileEntity(com.simibubi.create.content.contraptions.components.actors.PortableStorageInterfaceTileEntity) 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) EntityElement(com.simibubi.create.foundation.ponder.element.EntityElement) PortableItemInterfaceTileEntity(com.simibubi.create.content.contraptions.components.actors.PortableItemInterfaceTileEntity) ItemStack(net.minecraft.world.item.ItemStack)

Example 57 with InputWindowElement

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

the class MovementActorScenes method harvester.

public static void harvester(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("mechanical_harvester", "Using Mechanical Harvesters on Contraptions");
    scene.configureBasePlate(0, 0, 6);
    scene.scaleSceneView(0.9f);
    Selection crops = util.select.fromTo(4, 1, 2, 3, 1, 2).add(util.select.fromTo(3, 1, 1, 2, 1, 1).add(util.select.position(2, 1, 3)).add(util.select.position(1, 1, 2)));
    scene.world.setBlocks(crops, Blocks.WHEAT.defaultBlockState().setValue(CropBlock.AGE, 7), false);
    scene.world.showSection(util.select.layer(0), Direction.UP);
    BlockPos bearingPos = util.grid.at(4, 1, 4);
    scene.idle(5);
    scene.world.showSection(crops, Direction.UP);
    scene.world.showSection(util.select.position(bearingPos), Direction.DOWN);
    scene.idle(5);
    ElementLink<WorldSectionElement> contraption = scene.world.showIndependentSection(util.select.fromTo(4, 2, 4, 2, 2, 5).add(util.select.fromTo(2, 1, 5, 0, 1, 5)), Direction.DOWN);
    scene.world.configureCenterOfRotation(contraption, util.vector.centerOf(bearingPos));
    scene.idle(10);
    for (int i = 0; i < 3; i++) {
        scene.world.showSectionAndMerge(util.select.position(i, 1, 4), Direction.SOUTH, contraption);
        scene.idle(5);
    }
    scene.overlay.showText(60).attachKeyFrame().placeNearTarget().pointAt(util.vector.blockSurface(util.grid.at(1, 1, 4), Direction.SOUTH)).text("Whenever Harvesters are moved as part of an animated Contraption...");
    scene.idle(70);
    for (int i = 0; i < 3; i++) scene.world.modifyTileEntity(util.grid.at(i, 1, 4), HarvesterTileEntity.class, hte -> hte.setAnimatedSpeed(-150));
    scene.world.rotateBearing(bearingPos, -360, 140);
    scene.world.rotateSection(contraption, 0, -360, 0, 140);
    BlockState harvested = Blocks.WHEAT.defaultBlockState();
    ItemStack wheatItem = new ItemStack(Items.WHEAT);
    scene.idle(5);
    BlockPos current = util.grid.at(2, 1, 3);
    scene.world.setBlock(current, harvested, true);
    scene.world.createItemEntity(util.vector.centerOf(current), util.vector.of(0, 0.3, -.2), wheatItem);
    scene.idle(5);
    current = util.grid.at(1, 1, 2);
    scene.world.setBlock(current, harvested, true);
    scene.world.createItemEntity(util.vector.centerOf(current), util.vector.of(0, 0.3, -.2), wheatItem);
    scene.idle(5);
    current = util.grid.at(3, 1, 2);
    scene.world.setBlock(current, harvested, true);
    scene.world.createItemEntity(util.vector.centerOf(current), util.vector.of(.1, 0.3, -.1), wheatItem);
    current = util.grid.at(2, 1, 1);
    scene.world.setBlock(current, harvested, true);
    scene.world.createItemEntity(util.vector.centerOf(current), util.vector.of(.1, 0.3, -.1), wheatItem);
    scene.idle(5);
    current = util.grid.at(3, 1, 1);
    scene.world.setBlock(current, harvested, true);
    scene.world.createItemEntity(util.vector.centerOf(current), util.vector.of(.1, 0.3, -.1), wheatItem);
    scene.idle(5);
    current = util.grid.at(4, 1, 2);
    scene.world.setBlock(current, harvested, true);
    scene.world.createItemEntity(util.vector.centerOf(current), util.vector.of(.2, 0.3, 0), wheatItem);
    scene.overlay.showText(80).pointAt(util.vector.topOf(1, 0, 2)).text("They will harvest and reset any mature crops on their way").placeNearTarget();
    scene.idle(101);
    scene.world.hideSection(crops, Direction.DOWN);
    scene.idle(15);
    scene.world.modifyEntities(ItemEntity.class, Entity::discard);
    scene.world.setBlocks(crops, Blocks.WHEAT.defaultBlockState().setValue(CropBlock.AGE, 7), false);
    scene.world.showSection(crops, Direction.UP);
    for (int i = 0; i < 3; i++) scene.world.modifyTileEntity(util.grid.at(i, 1, 4), HarvesterTileEntity.class, hte -> hte.setAnimatedSpeed(0));
    scene.idle(10);
    scene.world.cycleBlockProperty(util.grid.at(1, 1, 5), LinearChassisBlock.STICKY_TOP);
    scene.world.glueBlockOnto(util.grid.at(1, 2, 5), Direction.DOWN, contraption);
    scene.overlay.showText(60).attachKeyFrame().placeNearTarget().pointAt(util.vector.blockSurface(util.grid.at(1, 2, 5), Direction.WEST)).sharedText("storage_on_contraption");
    scene.idle(70);
    for (int i = 0; i < 3; i++) scene.world.modifyTileEntity(util.grid.at(i, 1, 4), HarvesterTileEntity.class, hte -> hte.setAnimatedSpeed(-150));
    scene.world.rotateBearing(bearingPos, -360, 140);
    scene.world.rotateSection(contraption, 0, -360, 0, 140);
    scene.idle(5);
    current = util.grid.at(2, 1, 3);
    scene.world.setBlock(current, harvested, true);
    scene.idle(5);
    current = util.grid.at(1, 1, 2);
    scene.world.setBlock(current, harvested, true);
    scene.idle(5);
    current = util.grid.at(3, 1, 2);
    scene.world.setBlock(current, harvested, true);
    current = util.grid.at(2, 1, 1);
    scene.world.setBlock(current, harvested, true);
    scene.idle(5);
    current = util.grid.at(3, 1, 1);
    scene.world.setBlock(current, harvested, true);
    scene.idle(5);
    current = util.grid.at(4, 1, 2);
    scene.world.setBlock(current, harvested, true);
    scene.idle(116);
    scene.overlay.showControls(new InputWindowElement(util.vector.topOf(1, 2, 5), Pointing.DOWN).withItem(wheatItem), 50);
    for (int i = 0; i < 3; i++) scene.world.modifyTileEntity(util.grid.at(i, 1, 4), HarvesterTileEntity.class, hte -> hte.setAnimatedSpeed(0));
}
Also used : Items(net.minecraft.world.item.Items) SceneBuilder(com.simibubi.create.foundation.ponder.SceneBuilder) InputWindowElement(com.simibubi.create.foundation.ponder.element.InputWindowElement) Direction(net.minecraft.core.Direction) Pointing(com.simibubi.create.foundation.utility.Pointing) BlockState(net.minecraft.world.level.block.state.BlockState) LinearChassisBlock(com.simibubi.create.content.contraptions.components.structureMovement.chassis.LinearChassisBlock) CropBlock(net.minecraft.world.level.block.CropBlock) ElementLink(com.simibubi.create.foundation.ponder.ElementLink) PonderPalette(com.simibubi.create.foundation.ponder.PonderPalette) FlappyPose(com.simibubi.create.foundation.ponder.element.ParrotElement.FlappyPose) Selection(com.simibubi.create.foundation.ponder.Selection) EntityElement(com.simibubi.create.foundation.ponder.element.EntityElement) SceneBuildingUtil(com.simibubi.create.foundation.ponder.SceneBuildingUtil) HarvesterTileEntity(com.simibubi.create.content.contraptions.components.actors.HarvesterTileEntity) ParrotElement(com.simibubi.create.foundation.ponder.element.ParrotElement) Blocks(net.minecraft.world.level.block.Blocks) WorldSectionElement(com.simibubi.create.foundation.ponder.element.WorldSectionElement) Entity(net.minecraft.world.entity.Entity) BlockPos(net.minecraft.core.BlockPos) ItemEntity(net.minecraft.world.entity.item.ItemEntity) Vec3(net.minecraft.world.phys.Vec3) PortableItemInterfaceTileEntity(com.simibubi.create.content.contraptions.components.actors.PortableItemInterfaceTileEntity) ItemStack(net.minecraft.world.item.ItemStack) PortableStorageInterfaceTileEntity(com.simibubi.create.content.contraptions.components.actors.PortableStorageInterfaceTileEntity) HarvesterTileEntity(com.simibubi.create.content.contraptions.components.actors.HarvesterTileEntity) Entity(net.minecraft.world.entity.Entity) ItemEntity(net.minecraft.world.entity.item.ItemEntity) PortableItemInterfaceTileEntity(com.simibubi.create.content.contraptions.components.actors.PortableItemInterfaceTileEntity) PortableStorageInterfaceTileEntity(com.simibubi.create.content.contraptions.components.actors.PortableStorageInterfaceTileEntity) HarvesterTileEntity(com.simibubi.create.content.contraptions.components.actors.HarvesterTileEntity) BlockState(net.minecraft.world.level.block.state.BlockState) 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 58 with InputWindowElement

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

the class PistonScenes method movement.

public static void movement(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("mechanical_piston", "Moving Structures using Mechanical Pistons");
    scene.configureBasePlate(0, 0, 5);
    scene.world.showSection(util.select.layer(0).add(util.select.position(0, 1, 2)), Direction.UP);
    Selection kinetics = util.select.fromTo(3, 1, 3, 3, 1, 2);
    BlockPos piston = util.grid.at(3, 1, 2);
    BlockPos leverPos = util.grid.at(3, 2, 4);
    BlockPos shaft = util.grid.at(3, 1, 3);
    scene.idle(5);
    scene.world.showSection(util.select.fromTo(3, 1, 3, 3, 2, 5), Direction.DOWN);
    scene.idle(10);
    scene.world.showSection(util.select.position(piston), Direction.DOWN);
    ElementLink<WorldSectionElement> contraption = scene.world.showIndependentSection(util.select.position(3, 1, 1), Direction.DOWN);
    scene.world.moveSection(contraption, util.vector.of(0, 0, 1), 0);
    scene.idle(20);
    scene.world.showSectionAndMerge(util.select.position(piston.north().east()), Direction.DOWN, contraption);
    scene.idle(5);
    scene.world.showSectionAndMerge(util.select.position(piston.north().east(2)), Direction.DOWN, contraption);
    scene.world.showSectionAndMerge(util.select.position(piston.north().west()), Direction.DOWN, contraption);
    scene.idle(15);
    scene.effects.indicateRedstone(leverPos);
    scene.world.toggleRedstonePower(util.select.fromTo(leverPos, leverPos.below()));
    scene.world.modifyKineticSpeed(kinetics, f -> -f);
    scene.effects.rotationDirectionIndicator(shaft);
    scene.world.moveSection(contraption, util.vector.of(-2, 0, 0), 40);
    scene.overlay.showText(55).pointAt(util.vector.topOf(piston)).placeNearTarget().attachKeyFrame().text("Mechanical Pistons can move blocks in front of them");
    scene.idle(65);
    scene.overlay.showText(45).pointAt(util.vector.blockSurface(shaft, Direction.SOUTH)).placeNearTarget().text("Speed and direction of movement depend on the Rotational Input");
    scene.world.setBlock(util.grid.at(2, 1, 1), Blocks.AIR.defaultBlockState(), false);
    scene.world.setBlock(util.grid.at(0, 1, 2), Blocks.OAK_PLANKS.defaultBlockState(), false);
    scene.effects.indicateRedstone(leverPos);
    scene.world.toggleRedstonePower(util.select.fromTo(leverPos, leverPos.below()));
    scene.world.modifyKineticSpeed(kinetics, f -> -f);
    scene.effects.rotationDirectionIndicator(shaft);
    scene.world.moveSection(contraption, util.vector.of(2, 0, 0), 40);
    scene.idle(60);
    scene.overlay.showControls(new InputWindowElement(util.vector.blockSurface(piston, Direction.WEST), Pointing.DOWN).rightClick().withItem(new ItemStack(Items.SLIME_BALL)), 30);
    scene.idle(7);
    scene.world.modifyBlock(piston.north(), s -> s.setValue(MechanicalPistonHeadBlock.TYPE, PistonType.STICKY), false);
    scene.effects.superGlue(piston, Direction.WEST, true);
    scene.idle(33);
    scene.effects.indicateRedstone(leverPos);
    scene.world.toggleRedstonePower(util.select.fromTo(leverPos, leverPos.below()));
    scene.world.modifyKineticSpeed(kinetics, f -> -f);
    scene.effects.rotationDirectionIndicator(shaft);
    scene.world.moveSection(contraption, util.vector.of(-2, 0, 0), 40);
    scene.idle(25);
    scene.overlay.showText(60).pointAt(util.vector.topOf(piston)).placeNearTarget().attachKeyFrame().text("Sticky Mechanical Pistons can pull the attached blocks back");
    scene.idle(20);
    scene.world.setBlock(util.grid.at(2, 1, 1), Blocks.OAK_PLANKS.defaultBlockState(), false);
    scene.world.setBlock(util.grid.at(0, 1, 2), Blocks.AIR.defaultBlockState(), false);
    scene.effects.indicateRedstone(leverPos);
    scene.world.toggleRedstonePower(util.select.fromTo(leverPos, leverPos.below()));
    scene.world.modifyKineticSpeed(kinetics, f -> -f);
    scene.effects.rotationDirectionIndicator(shaft);
    scene.world.moveSection(contraption, util.vector.of(2, 0, 0), 40);
    scene.idle(50);
    scene.world.setBlock(util.grid.at(2, 1, 1), Blocks.AIR.defaultBlockState(), false);
    ElementLink<WorldSectionElement> chassis = scene.world.showIndependentSection(util.select.fromTo(2, 2, 0, 2, 3, 2), Direction.DOWN);
    scene.world.moveSection(chassis, util.vector.of(0, -1, 1), 0);
    scene.addKeyframe();
    scene.idle(5);
    scene.world.showSectionAndMerge(util.select.position(1, 2, 0), Direction.EAST, chassis);
    scene.idle(15);
    scene.effects.superGlue(piston.west().north(), Direction.WEST, true);
    scene.overlay.showText(80).pointAt(util.vector.topOf(piston.west())).placeNearTarget().sharedText("movement_anchors");
    scene.idle(90);
    scene.effects.indicateRedstone(leverPos);
    scene.world.toggleRedstonePower(util.select.fromTo(leverPos, leverPos.below()));
    scene.world.modifyKineticSpeed(kinetics, f -> -f);
    scene.effects.rotationDirectionIndicator(shaft);
    scene.world.moveSection(contraption, util.vector.of(-2, 0, 0), 40);
    scene.world.moveSection(chassis, util.vector.of(-2, 0, 0), 40);
}
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 59 with InputWindowElement

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

the class PistonScenes method movementModes.

public static void movementModes(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("mechanical_piston_modes", "Movement Modes of the Mechanical Piston");
    scene.configureBasePlate(0, 0, 5);
    Selection rose = util.select.fromTo(0, 2, 2, 0, 1, 2);
    scene.world.showSection(util.select.layer(0).add(rose), Direction.UP);
    Selection kinetics = util.select.fromTo(3, 1, 3, 3, 1, 2);
    BlockPos piston = util.grid.at(3, 1, 2);
    BlockPos leverPos = util.grid.at(3, 2, 4);
    BlockPos shaft = util.grid.at(3, 1, 3);
    scene.idle(5);
    scene.world.showSection(util.select.fromTo(3, 1, 3, 3, 2, 5), Direction.DOWN);
    scene.idle(10);
    scene.world.showSection(util.select.position(piston), Direction.DOWN);
    ElementLink<WorldSectionElement> contraption = scene.world.showIndependentSection(util.select.position(3, 1, 1), Direction.DOWN);
    scene.world.moveSection(contraption, util.vector.of(0, 0, 1), 0);
    scene.idle(20);
    scene.world.showSectionAndMerge(util.select.position(piston.north().east()), Direction.DOWN, contraption);
    scene.idle(5);
    scene.world.showSectionAndMerge(util.select.position(piston.north().east(2)), Direction.DOWN, contraption);
    scene.world.showSectionAndMerge(util.select.position(piston.north().west()), Direction.DOWN, contraption);
    scene.idle(5);
    scene.world.showSectionAndMerge(util.select.position(piston.north().west().above()), Direction.DOWN, contraption);
    scene.idle(15);
    scene.effects.superGlue(piston.west(), Direction.UP, true);
    scene.idle(10);
    scene.effects.indicateRedstone(leverPos);
    scene.world.toggleRedstonePower(util.select.fromTo(leverPos, leverPos.below()));
    scene.world.modifyKineticSpeed(kinetics, f -> -f);
    scene.effects.rotationDirectionIndicator(shaft);
    scene.world.moveSection(contraption, util.vector.of(-2, 0, 0), 40);
    scene.idle(40);
    scene.world.destroyBlock(util.grid.at(0, 1, 2));
    scene.world.destroyBlock(util.grid.at(0, 2, 2));
    scene.idle(10);
    scene.overlay.showSelectionWithText(rose, 70).text("Whenever Pistons stop moving, the moved structure reverts to blocks").attachKeyFrame().colored(PonderPalette.RED);
    scene.idle(80);
    scene.effects.indicateRedstone(leverPos);
    scene.world.toggleRedstonePower(util.select.fromTo(leverPos, leverPos.below()));
    scene.world.modifyKineticSpeed(kinetics, f -> -f);
    scene.effects.rotationDirectionIndicator(shaft);
    scene.world.moveSection(contraption, util.vector.of(2, 0, 0), 40);
    scene.world.hideSection(rose, Direction.UP);
    scene.idle(50);
    scene.world.setBlock(util.grid.at(0, 1, 2), Blocks.ROSE_BUSH.defaultBlockState(), false);
    scene.world.setBlock(util.grid.at(0, 2, 2), Blocks.ROSE_BUSH.defaultBlockState().setValue(DoublePlantBlock.HALF, DoubleBlockHalf.UPPER), false);
    scene.world.showIndependentSection(rose, Direction.DOWN);
    scene.overlay.showCenteredScrollInput(piston, Direction.UP, 60);
    scene.overlay.showControls(new InputWindowElement(util.vector.topOf(piston), Pointing.DOWN).scroll().withWrench(), 60);
    scene.overlay.showText(70).pointAt(util.vector.topOf(piston)).placeNearTarget().attachKeyFrame().sharedText("behaviour_modify_wrench");
    scene.idle(80);
    scene.effects.indicateRedstone(leverPos);
    scene.world.toggleRedstonePower(util.select.fromTo(leverPos, leverPos.below()));
    scene.world.modifyKineticSpeed(kinetics, f -> -f);
    scene.effects.rotationDirectionIndicator(shaft);
    scene.world.moveSection(contraption, util.vector.of(-2, 0, 0), 40);
    scene.idle(50);
    scene.overlay.showText(120).colored(PonderPalette.GREEN).pointAt(util.vector.blockSurface(util.grid.at(0, 1, 2), Direction.WEST)).placeNearTarget().text("It can be configured never to revert to solid blocks, or only at the location it started at");
}
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)

Example 60 with InputWindowElement

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

the class ProcessingScenes method pressing.

public static void pressing(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("mechanical_press", "Processing Items with the Mechanical Press");
    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);
    Vec3 pressSide = util.vector.blockSurface(pressPos, Direction.WEST);
    scene.overlay.showText(60).pointAt(pressSide).placeNearTarget().attachKeyFrame().text("The Mechanical Press can process items provided beneath it");
    scene.idle(70);
    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 Press");
    scene.idle(50);
    ItemStack copper = new ItemStack(Items.COPPER_INGOT);
    scene.world.createItemOnBeltLike(depotPos, Direction.NORTH, copper);
    Vec3 depotCenter = util.vector.centerOf(depotPos.south());
    scene.overlay.showControls(new InputWindowElement(depotCenter, Pointing.UP).withItem(copper), 30);
    scene.idle(10);
    Class<MechanicalPressTileEntity> type = MechanicalPressTileEntity.class;
    scene.world.modifyTileEntity(pressPos, type, pte -> pte.start(Mode.BELT));
    scene.idle(30);
    scene.world.modifyTileEntity(pressPos, type, pte -> pte.makePressingParticleEffect(depotCenter.add(0, 8 / 16f, 0), copper));
    scene.world.removeItemsFromBelt(depotPos);
    ItemStack sheet = AllItems.COPPER_SHEET.asStack();
    scene.world.createItemOnBeltLike(depotPos, Direction.UP, sheet);
    scene.idle(10);
    scene.overlay.showControls(new InputWindowElement(depotCenter, Pointing.UP).withItem(sheet), 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, copper);
    scene.idle(15);
    ElementLink<BeltItemElement> ingot2 = scene.world.createItemOnBelt(beltPos, Direction.SOUTH, copper);
    scene.idle(15);
    scene.world.stallBeltItem(ingot, true);
    scene.world.modifyTileEntity(pressPos, type, pte -> pte.start(Mode.BELT));
    scene.overlay.showText(50).pointAt(pressSide).placeNearTarget().attachKeyFrame().text("The Press will hold and process them automatically");
    scene.idle(30);
    scene.world.modifyTileEntity(pressPos, type, pte -> pte.makePressingParticleEffect(depotCenter.add(0, 8 / 16f, 0), copper));
    scene.world.removeItemsFromBelt(pressPos.below(2));
    ingot = scene.world.createItemOnBelt(pressPos.below(2), Direction.UP, sheet);
    scene.world.stallBeltItem(ingot, true);
    scene.idle(15);
    scene.world.stallBeltItem(ingot, false);
    scene.idle(15);
    scene.world.stallBeltItem(ingot2, true);
    scene.world.modifyTileEntity(pressPos, type, pte -> pte.start(Mode.BELT));
    scene.idle(30);
    scene.world.modifyTileEntity(pressPos, type, pte -> pte.makePressingParticleEffect(depotCenter.add(0, 8 / 16f, 0), copper));
    scene.world.removeItemsFromBelt(pressPos.below(2));
    ingot2 = scene.world.createItemOnBelt(pressPos.below(2), Direction.UP, sheet);
    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) MechanicalPressTileEntity(com.simibubi.create.content.contraptions.components.press.MechanicalPressTileEntity) 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