Search in sources :

Example 6 with SceneBuildingUtil

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

the class BearingScenes method sails.

private static void sails(SceneBuilder scene, SceneBuildingUtil util, boolean frame) {
    String plural = frame ? "Sail Frames" : "Sails";
    scene.title(frame ? "sail_frame" : "sail", "Assembling Windmills using " + plural);
    scene.configureBasePlate(0, 0, 5);
    scene.scaleSceneView(0.9f);
    scene.world.showSection(util.select.layer(0), Direction.UP);
    scene.idle(5);
    BlockPos bearingPos = util.grid.at(2, 1, 2);
    scene.world.showSection(util.select.position(bearingPos), Direction.DOWN);
    scene.idle(5);
    ElementLink<WorldSectionElement> plank = scene.world.showIndependentSection(util.select.position(bearingPos.above()), Direction.DOWN);
    scene.idle(10);
    for (int i = 0; i < 3; i++) {
        for (Direction d : Iterate.horizontalDirections) {
            BlockPos location = bearingPos.above(i + 1).relative(d);
            if (frame)
                scene.world.modifyBlock(location, s -> AllBlocks.SAIL_FRAME.getDefaultState().setValue(SailBlock.FACING, s.getValue(SailBlock.FACING)), false);
            scene.world.showSectionAndMerge(util.select.position(location), d.getOpposite(), plank);
            scene.idle(2);
        }
    }
    scene.overlay.showText(70).text(plural + " are handy blocks to create Windmills with").pointAt(util.vector.blockSurface(util.grid.at(1, 3, 2), Direction.WEST)).placeNearTarget().attachKeyFrame();
    scene.idle(80);
    scene.overlay.showSelectionWithText(util.select.position(bearingPos.above()), 80).colored(PonderPalette.GREEN).text("They will attach to blocks and each other without the need of Super Glue or Chassis Blocks").attachKeyFrame().placeNearTarget();
    scene.idle(40);
    scene.world.configureCenterOfRotation(plank, util.vector.centerOf(bearingPos));
    if (!frame) {
        scene.world.rotateBearing(bearingPos, 180, 75);
        scene.world.rotateSection(plank, 0, 180, 0, 75);
        scene.idle(76);
        scene.world.rotateBearing(bearingPos, 180, 0);
        scene.world.rotateSection(plank, 0, 180, 0, 0);
        scene.rotateCameraY(-30);
        scene.idle(10);
        InputWindowElement input = new InputWindowElement(util.vector.blockSurface(util.grid.at(2, 3, 1), Direction.NORTH), Pointing.RIGHT).withItem(new ItemStack(Items.BLUE_DYE));
        scene.overlay.showControls(input, 30);
        scene.idle(7);
        scene.world.setBlock(util.grid.at(2, 3, 1), AllBlocks.DYED_SAILS.get(DyeColor.BLUE).getDefaultState().setValue(SailBlock.FACING, Direction.WEST), false);
        scene.idle(10);
        scene.overlay.showText(40).colored(PonderPalette.BLUE).text("Right-Click with Dye to paint them").attachKeyFrame().pointAt(util.vector.blockSurface(util.grid.at(2, 3, 1), Direction.WEST)).placeNearTarget();
        scene.idle(20);
        scene.overlay.showControls(input, 30);
        scene.idle(7);
        scene.world.replaceBlocks(util.select.fromTo(2, 2, 1, 2, 4, 1), AllBlocks.DYED_SAILS.get(DyeColor.BLUE).getDefaultState().setValue(SailBlock.FACING, Direction.WEST), false);
        scene.idle(20);
        scene.world.rotateBearing(bearingPos, 90, 33);
        scene.world.rotateSection(plank, 0, 90, 0, 33);
        scene.idle(40);
        input = new InputWindowElement(util.vector.blockSurface(util.grid.at(2, 3, 1), Direction.NORTH), Pointing.RIGHT).withItem(new ItemStack(Items.SHEARS));
        scene.overlay.showControls(input, 30);
        scene.idle(7);
        scene.world.setBlock(util.grid.at(3, 3, 2), AllBlocks.SAIL_FRAME.getDefaultState().setValue(SailBlock.FACING, Direction.NORTH), false);
        scene.idle(10);
        scene.overlay.showText(40).text("Right-Click with Shears to turn them back into frames").attachKeyFrame().pointAt(util.vector.blockSurface(util.grid.at(2, 3, 1), Direction.WEST)).placeNearTarget();
        scene.idle(20);
        scene.overlay.showControls(input, 30);
        scene.idle(7);
        scene.world.replaceBlocks(util.select.fromTo(3, 2, 2, 3, 4, 2), AllBlocks.SAIL_FRAME.getDefaultState().setValue(SailBlock.FACING, Direction.NORTH), false);
        scene.idle(20);
    }
    scene.world.rotateBearing(bearingPos, 720, 300);
    scene.world.rotateSection(plank, 0, 720, 0, 300);
}
Also used : SailBlock(com.simibubi.create.content.contraptions.components.structureMovement.bearing.SailBlock) SuperGlueEntity(com.simibubi.create.content.contraptions.components.structureMovement.glue.SuperGlueEntity) DyeColor(net.minecraft.world.item.DyeColor) Selection(com.simibubi.create.foundation.ponder.Selection) Iterate(com.simibubi.create.foundation.utility.Iterate) 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) SceneBuildingUtil(com.simibubi.create.foundation.ponder.SceneBuildingUtil) Pointing(com.simibubi.create.foundation.utility.Pointing) HarvesterTileEntity(com.simibubi.create.content.contraptions.components.actors.HarvesterTileEntity) Axis(net.minecraft.core.Direction.Axis) WorldSectionElement(com.simibubi.create.foundation.ponder.element.WorldSectionElement) ElementLink(com.simibubi.create.foundation.ponder.ElementLink) Entity(net.minecraft.world.entity.Entity) PonderPalette(com.simibubi.create.foundation.ponder.PonderPalette) BlockPos(net.minecraft.core.BlockPos) Vec3(net.minecraft.world.phys.Vec3) ItemStack(net.minecraft.world.item.ItemStack) AllBlocks(com.simibubi.create.AllBlocks) 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) Direction(net.minecraft.core.Direction)

Example 7 with SceneBuildingUtil

use of com.simibubi.create.foundation.ponder.SceneBuildingUtil 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 8 with SceneBuildingUtil

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

the class ProcessingScenes method compacting.

public static void compacting(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("mechanical_press_compacting", "Compacting items with the Mechanical Press");
    scene.configureBasePlate(0, 0, 5);
    scene.world.setBlock(util.grid.at(1, 1, 2), AllBlocks.ANDESITE_CASING.getDefaultState(), false);
    scene.world.showSection(util.select.layer(0), Direction.UP);
    scene.idle(5);
    scene.world.showSection(util.select.fromTo(1, 4, 3, 1, 1, 5), Direction.DOWN);
    scene.idle(5);
    scene.world.showSection(util.select.position(1, 1, 2), Direction.DOWN);
    scene.idle(5);
    scene.world.showSection(util.select.position(1, 2, 2), Direction.DOWN);
    scene.idle(5);
    scene.world.showSection(util.select.position(1, 4, 2), Direction.SOUTH);
    scene.idle(5);
    scene.world.showSection(util.select.fromTo(3, 1, 1, 1, 1, 1), Direction.SOUTH);
    scene.world.showSection(util.select.fromTo(3, 1, 5, 3, 1, 2), Direction.SOUTH);
    scene.idle(20);
    BlockPos basin = util.grid.at(1, 2, 2);
    BlockPos pressPos = util.grid.at(1, 4, 2);
    Vec3 basinSide = util.vector.blockSurface(basin, Direction.WEST);
    ItemStack copper = new ItemStack(Items.COPPER_INGOT);
    ItemStack copperBlock = new ItemStack(Items.COPPER_BLOCK);
    scene.overlay.showText(60).pointAt(basinSide).placeNearTarget().attachKeyFrame().text("Pressing items held in a Basin will cause them to be Compacted");
    scene.idle(40);
    scene.overlay.showControls(new InputWindowElement(util.vector.topOf(basin), Pointing.DOWN).withItem(copper), 30);
    scene.idle(30);
    Class<MechanicalPressTileEntity> type = MechanicalPressTileEntity.class;
    scene.world.modifyTileEntity(pressPos, type, pte -> pte.start(Mode.BASIN));
    scene.idle(30);
    scene.world.modifyTileEntity(pressPos, type, pte -> pte.makeCompactingParticleEffect(util.vector.centerOf(basin), copper));
    scene.world.modifyTileNBT(util.select.position(basin), BasinTileEntity.class, nbt -> {
        nbt.put("VisualizedItems", NBTHelper.writeCompoundList(ImmutableList.of(IntAttached.with(1, copperBlock)), ia -> ia.getValue().serializeNBT()));
    });
    scene.idle(4);
    scene.world.createItemOnBelt(util.grid.at(1, 1, 1), Direction.UP, copperBlock);
    scene.idle(30);
    scene.overlay.showText(80).pointAt(basinSide).placeNearTarget().attachKeyFrame().text("Compacting includes any filled 2x2 or 3x3 Crafting Recipe, plus a couple extra ones");
    scene.idle(30);
    ItemStack log = new ItemStack(Items.OAK_LOG);
    ItemStack bark = new ItemStack(Items.OAK_WOOD);
    scene.overlay.showControls(new InputWindowElement(util.vector.topOf(basin), Pointing.DOWN).withItem(log), 30);
    scene.idle(30);
    scene.world.modifyTileEntity(pressPos, type, pte -> pte.start(Mode.BASIN));
    scene.idle(30);
    scene.world.modifyTileEntity(pressPos, type, pte -> pte.makeCompactingParticleEffect(util.vector.centerOf(basin), log));
    scene.world.modifyTileNBT(util.select.position(basin), BasinTileEntity.class, nbt -> {
        nbt.put("VisualizedItems", NBTHelper.writeCompoundList(ImmutableList.of(IntAttached.with(1, bark)), ia -> ia.getValue().serializeNBT()));
    });
    scene.idle(4);
    scene.world.createItemOnBelt(util.grid.at(1, 1, 1), Direction.UP, bark);
    scene.idle(30);
    scene.rotateCameraY(-30);
    scene.idle(10);
    scene.world.setBlock(util.grid.at(1, 1, 2), AllBlocks.BLAZE_BURNER.getDefaultState().setValue(BlazeBurnerBlock.HEAT_LEVEL, HeatLevel.KINDLED), true);
    scene.idle(10);
    scene.overlay.showText(80).pointAt(basinSide.subtract(0, 1, 0)).placeNearTarget().text("Some of those recipes may require the heat of a Blaze Burner");
    scene.idle(40);
    scene.rotateCameraY(30);
    scene.idle(60);
    Vec3 filterPos = util.vector.of(1, 2.75f, 2.5f);
    scene.overlay.showFilterSlotInput(filterPos, 100);
    scene.overlay.showText(120).pointAt(filterPos).placeNearTarget().attachKeyFrame().text("The filter slot can be used in case two recipes are conflicting.");
    scene.idle(60);
}
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) EntityType(net.minecraft.world.entity.EntityType) BasinTileEntity(com.simibubi.create.content.contraptions.processing.BasinTileEntity) Pointing(com.simibubi.create.foundation.utility.Pointing) MechanicalPressTileEntity(com.simibubi.create.content.contraptions.components.press.MechanicalPressTileEntity) ItemParticleOption(net.minecraft.core.particles.ItemParticleOption) AllItems(com.simibubi.create.AllItems) ElementLink(com.simibubi.create.foundation.ponder.ElementLink) ImmutableList(com.google.common.collect.ImmutableList) BasinBlock(com.simibubi.create.content.contraptions.processing.BasinBlock) PonderPalette(com.simibubi.create.foundation.ponder.PonderPalette) BeltItemElement(com.simibubi.create.foundation.ponder.element.BeltItemElement) DeployerTileEntity(com.simibubi.create.content.contraptions.components.deployer.DeployerTileEntity) AllBlocks(com.simibubi.create.AllBlocks) Selection(com.simibubi.create.foundation.ponder.Selection) Iterate(com.simibubi.create.foundation.utility.Iterate) Mode(com.simibubi.create.content.contraptions.components.press.MechanicalPressTileEntity.Mode) EntityElement(com.simibubi.create.foundation.ponder.element.EntityElement) Emitter(com.simibubi.create.foundation.ponder.instruction.EmitParticlesInstruction.Emitter) Blaze(net.minecraft.world.entity.monster.Blaze) SceneBuildingUtil(com.simibubi.create.foundation.ponder.SceneBuildingUtil) BlazeBurnerBlock(com.simibubi.create.content.contraptions.processing.burner.BlazeBurnerBlock) HeatLevel(com.simibubi.create.content.contraptions.processing.burner.BlazeBurnerBlock.HeatLevel) IntAttached(com.simibubi.create.foundation.utility.IntAttached) 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) LitBlazeBurnerBlock(com.simibubi.create.content.contraptions.processing.burner.LitBlazeBurnerBlock) NBTHelper(com.simibubi.create.foundation.utility.NBTHelper) ItemStack(net.minecraft.world.item.ItemStack) MillstoneTileEntity(com.simibubi.create.content.contraptions.components.millstone.MillstoneTileEntity) MechanicalMixerTileEntity(com.simibubi.create.content.contraptions.components.mixer.MechanicalMixerTileEntity) ParticleTypes(net.minecraft.core.particles.ParticleTypes) 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) MechanicalPressTileEntity(com.simibubi.create.content.contraptions.components.press.MechanicalPressTileEntity)

Example 9 with SceneBuildingUtil

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

the class ProcessingScenes method mixing.

public static void mixing(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("mechanical_mixer", "Processing Items with the Mechanical Mixer");
    scene.configureBasePlate(0, 0, 5);
    scene.world.setBlock(util.grid.at(1, 1, 2), AllBlocks.ANDESITE_CASING.getDefaultState(), false);
    scene.world.showSection(util.select.layer(0), Direction.UP);
    scene.idle(5);
    scene.world.showSection(util.select.fromTo(1, 4, 3, 1, 1, 5), Direction.DOWN);
    scene.idle(5);
    scene.world.showSection(util.select.position(1, 1, 2), Direction.DOWN);
    scene.idle(5);
    scene.world.showSection(util.select.position(1, 2, 2), Direction.DOWN);
    scene.idle(5);
    scene.world.showSection(util.select.position(1, 4, 2), Direction.SOUTH);
    scene.idle(5);
    scene.world.showSection(util.select.fromTo(3, 1, 1, 1, 1, 1), Direction.SOUTH);
    scene.world.showSection(util.select.fromTo(3, 1, 5, 3, 1, 2), Direction.SOUTH);
    scene.idle(20);
    BlockPos basin = util.grid.at(1, 2, 2);
    BlockPos pressPos = util.grid.at(1, 4, 2);
    Vec3 basinSide = util.vector.blockSurface(basin, Direction.WEST);
    ItemStack blue = new ItemStack(Items.BLUE_DYE);
    ItemStack red = new ItemStack(Items.RED_DYE);
    ItemStack purple = new ItemStack(Items.PURPLE_DYE);
    scene.overlay.showText(60).pointAt(basinSide).placeNearTarget().attachKeyFrame().text("With a Mixer and Basin, some Crafting Recipes can be automated");
    scene.idle(40);
    scene.overlay.showControls(new InputWindowElement(util.vector.topOf(basin), Pointing.LEFT).withItem(blue), 30);
    scene.overlay.showControls(new InputWindowElement(util.vector.topOf(basin), Pointing.RIGHT).withItem(red), 30);
    scene.idle(30);
    Class<MechanicalMixerTileEntity> type = MechanicalMixerTileEntity.class;
    scene.world.modifyTileEntity(pressPos, type, pte -> pte.startProcessingBasin());
    scene.world.createItemOnBeltLike(basin, Direction.UP, red);
    scene.world.createItemOnBeltLike(basin, Direction.UP, blue);
    scene.idle(80);
    scene.world.modifyTileNBT(util.select.position(basin), BasinTileEntity.class, nbt -> {
        nbt.put("VisualizedItems", NBTHelper.writeCompoundList(ImmutableList.of(IntAttached.with(1, purple)), ia -> ia.getValue().serializeNBT()));
    });
    scene.idle(4);
    scene.world.createItemOnBelt(util.grid.at(1, 1, 1), Direction.UP, purple);
    scene.idle(30);
    scene.overlay.showText(80).pointAt(basinSide).placeNearTarget().attachKeyFrame().text("Available recipes include any Shapeless Crafting Recipe, plus a couple extra ones");
    scene.idle(80);
    scene.rotateCameraY(-30);
    scene.idle(10);
    scene.world.setBlock(util.grid.at(1, 1, 2), AllBlocks.BLAZE_BURNER.getDefaultState().setValue(BlazeBurnerBlock.HEAT_LEVEL, HeatLevel.KINDLED), true);
    scene.idle(10);
    scene.overlay.showText(80).pointAt(basinSide.subtract(0, 1, 0)).placeNearTarget().text("Some of those recipes may require the heat of a Blaze Burner");
    scene.idle(40);
    scene.rotateCameraY(30);
    scene.idle(60);
    Vec3 filterPos = util.vector.of(1, 2.75f, 2.5f);
    scene.overlay.showFilterSlotInput(filterPos, 100);
    scene.overlay.showText(120).pointAt(filterPos).placeNearTarget().attachKeyFrame().text("The filter slot can be used in case two recipes are conflicting.");
    scene.idle(60);
}
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) EntityType(net.minecraft.world.entity.EntityType) BasinTileEntity(com.simibubi.create.content.contraptions.processing.BasinTileEntity) Pointing(com.simibubi.create.foundation.utility.Pointing) MechanicalPressTileEntity(com.simibubi.create.content.contraptions.components.press.MechanicalPressTileEntity) ItemParticleOption(net.minecraft.core.particles.ItemParticleOption) AllItems(com.simibubi.create.AllItems) ElementLink(com.simibubi.create.foundation.ponder.ElementLink) ImmutableList(com.google.common.collect.ImmutableList) BasinBlock(com.simibubi.create.content.contraptions.processing.BasinBlock) PonderPalette(com.simibubi.create.foundation.ponder.PonderPalette) BeltItemElement(com.simibubi.create.foundation.ponder.element.BeltItemElement) DeployerTileEntity(com.simibubi.create.content.contraptions.components.deployer.DeployerTileEntity) AllBlocks(com.simibubi.create.AllBlocks) Selection(com.simibubi.create.foundation.ponder.Selection) Iterate(com.simibubi.create.foundation.utility.Iterate) Mode(com.simibubi.create.content.contraptions.components.press.MechanicalPressTileEntity.Mode) EntityElement(com.simibubi.create.foundation.ponder.element.EntityElement) Emitter(com.simibubi.create.foundation.ponder.instruction.EmitParticlesInstruction.Emitter) Blaze(net.minecraft.world.entity.monster.Blaze) SceneBuildingUtil(com.simibubi.create.foundation.ponder.SceneBuildingUtil) BlazeBurnerBlock(com.simibubi.create.content.contraptions.processing.burner.BlazeBurnerBlock) HeatLevel(com.simibubi.create.content.contraptions.processing.burner.BlazeBurnerBlock.HeatLevel) IntAttached(com.simibubi.create.foundation.utility.IntAttached) 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) LitBlazeBurnerBlock(com.simibubi.create.content.contraptions.processing.burner.LitBlazeBurnerBlock) NBTHelper(com.simibubi.create.foundation.utility.NBTHelper) ItemStack(net.minecraft.world.item.ItemStack) MillstoneTileEntity(com.simibubi.create.content.contraptions.components.millstone.MillstoneTileEntity) MechanicalMixerTileEntity(com.simibubi.create.content.contraptions.components.mixer.MechanicalMixerTileEntity) ParticleTypes(net.minecraft.core.particles.ParticleTypes) MechanicalMixerTileEntity(com.simibubi.create.content.contraptions.components.mixer.MechanicalMixerTileEntity) Vec3(net.minecraft.world.phys.Vec3) InputWindowElement(com.simibubi.create.foundation.ponder.element.InputWindowElement) BlockPos(net.minecraft.core.BlockPos) ItemStack(net.minecraft.world.item.ItemStack)

Example 10 with SceneBuildingUtil

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

the class DrainScenes method emptying.

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

Aggregations

SceneBuilder (com.simibubi.create.foundation.ponder.SceneBuilder)12 SceneBuildingUtil (com.simibubi.create.foundation.ponder.SceneBuildingUtil)12 ElementLink (com.simibubi.create.foundation.ponder.ElementLink)11 Selection (com.simibubi.create.foundation.ponder.Selection)11 WorldSectionElement (com.simibubi.create.foundation.ponder.element.WorldSectionElement)11 BlockPos (net.minecraft.core.BlockPos)11 Direction (net.minecraft.core.Direction)11 PonderPalette (com.simibubi.create.foundation.ponder.PonderPalette)10 Pointing (com.simibubi.create.foundation.utility.Pointing)10 InputWindowElement (com.simibubi.create.foundation.ponder.element.InputWindowElement)9 ItemStack (net.minecraft.world.item.ItemStack)9 Vec3 (net.minecraft.world.phys.Vec3)9 Items (net.minecraft.world.item.Items)8 AllBlocks (com.simibubi.create.AllBlocks)7 Blocks (net.minecraft.world.level.block.Blocks)7 FluidStack (net.minecraftforge.fluids.FluidStack)6 CapabilityFluidHandler (net.minecraftforge.fluids.capability.CapabilityFluidHandler)6 FluidAction (net.minecraftforge.fluids.capability.IFluidHandler.FluidAction)6 BasinTileEntity (com.simibubi.create.content.contraptions.processing.BasinTileEntity)5 Fluids (net.minecraft.world.level.material.Fluids)5