Search in sources :

Example 36 with WorldSectionElement

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

the class HosePulleyScenes method level.

public static void level(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("hose_pulley_level", "Fill and Drain level of Hose Pulleys");
    scene.configureBasePlate(0, 0, 3);
    scene.setSceneOffsetY(-1.5f);
    scene.scaleSceneView(.9f);
    scene.showBasePlate();
    List<BlockPos> blocks = new LinkedList<>();
    for (int y = 1; y < 4; y++) {
        blocks.add(util.grid.at(1, y, 1));
        blocks.add(util.grid.at(0, y, 1));
        blocks.add(util.grid.at(1, y, 0));
        blocks.add(util.grid.at(2, y, 1));
        blocks.add(util.grid.at(1, y, 2));
        blocks.add(util.grid.at(0, y, 0));
        blocks.add(util.grid.at(2, y, 0));
        blocks.add(util.grid.at(2, y, 2));
        blocks.add(util.grid.at(0, y, 2));
    }
    for (BlockPos blockPos : blocks) scene.world.setBlock(blockPos, Blocks.WATER.defaultBlockState(), false);
    scene.idle(5);
    Selection water = util.select.fromTo(2, 1, 0, 0, 4, 2);
    scene.world.showSection(water, Direction.UP);
    scene.idle(10);
    Selection cogs = util.select.fromTo(3, 1, 2, 3, 2, 2);
    Selection pipes = util.select.fromTo(3, 1, 1, 3, 6, 1).add(util.select.position(2, 6, 1));
    BlockPos hosePos = util.grid.at(1, 6, 1);
    Selection hose = util.select.position(1, 6, 1);
    Selection crank = util.select.position(0, 6, 1);
    ElementLink<WorldSectionElement> hoselink = scene.world.showIndependentSection(hose, Direction.DOWN);
    scene.world.moveSection(hoselink, util.vector.of(0, -1, 0), 0);
    scene.idle(10);
    scene.world.showSectionAndMerge(crank, Direction.EAST, hoselink);
    scene.idle(20);
    scene.overlay.showSelectionWithText(util.select.position(hosePos.below()), 50).text("While fully retracted, the Hose Pulley cannot operate").placeNearTarget().colored(PonderPalette.RED).attachKeyFrame().pointAt(util.vector.blockSurface(hosePos.below(), Direction.UP));
    scene.idle(55);
    Selection kinetics = util.select.fromTo(1, 6, 1, 0, 6, 1);
    scene.world.setKineticSpeed(kinetics, 32);
    scene.idle(50);
    scene.world.setKineticSpeed(kinetics, 0);
    scene.overlay.showText(40).text("Draining runs from top to bottom").attachKeyFrame().placeNearTarget().pointAt(util.vector.centerOf(hosePos.below(3)));
    scene.idle(10);
    scene.world.showSectionAndMerge(cogs, Direction.NORTH, hoselink);
    scene.world.showSectionAndMerge(pipes, Direction.WEST, hoselink);
    scene.world.multiplyKineticSpeed(util.select.fromTo(3, 1, 2, 3, 2, 1), -1);
    scene.world.modifyTileEntity(util.grid.at(1, 6, 1), HosePulleyTileEntity.class, te -> te.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY).ifPresent(ifh -> ((HosePulleyFluidHandler) ifh).fill(new FluidStack(Fluids.WATER, 100), FluidAction.EXECUTE)));
    scene.world.propagatePipeChange(util.grid.at(3, 2, 1));
    Vec3 surface = util.vector.topOf(1, 3, 1).subtract(0, 2 / 8f, 0);
    AABB bb = new AABB(surface, surface).inflate(1.5, 0, 1.5);
    scene.overlay.chaseBoundingBoxOutline(PonderPalette.MEDIUM, bb, bb, 3);
    scene.idle(3);
    scene.overlay.chaseBoundingBoxOutline(PonderPalette.MEDIUM, bb, bb.expandTowards(0, -2, 0), 70);
    scene.idle(20);
    Collections.reverse(blocks);
    int i = 0;
    for (BlockPos blockPos : blocks) {
        if (i++ == 18)
            break;
        scene.world.destroyBlock(blockPos);
        scene.idle(3);
    }
    scene.overlay.chaseBoundingBoxOutline(PonderPalette.WHITE, bb, bb.move(0, -2, 0), 60);
    scene.overlay.showText(60).text("The surface level will end up just below where the hose ends").attachKeyFrame().placeNearTarget().pointAt(util.vector.of(0, 2 - 1 / 8f, 1.5f));
    scene.idle(30);
    scene.idle(10);
    scene.world.multiplyKineticSpeed(util.select.fromTo(3, 1, 2, 3, 2, 1), -1);
    scene.world.propagatePipeChange(util.grid.at(3, 2, 1));
    scene.idle(30);
    scene.world.hideSection(water, Direction.SOUTH);
    scene.idle(15);
    for (BlockPos blockPos : blocks) scene.world.destroyBlock(blockPos);
    scene.world.showSection(water, Direction.UP);
    scene.idle(15);
    scene.world.setKineticSpeed(kinetics, -32);
    scene.idle(16);
    scene.world.setKineticSpeed(kinetics, 0);
    scene.overlay.showText(40).text("Filling runs from bottom to top").attachKeyFrame().placeNearTarget().pointAt(util.vector.centerOf(hosePos.below(3)));
    scene.idle(10);
    scene.overlay.chaseBoundingBoxOutline(PonderPalette.MEDIUM, bb, bb.move(0, -3 + 2 / 8f, 0), 3);
    scene.idle(3);
    scene.overlay.chaseBoundingBoxOutline(PonderPalette.MEDIUM, bb, bb.expandTowards(0, -3 + 2 / 8f, 0), 120);
    scene.idle(20);
    scene.world.setBlock(util.grid.at(1, 3, 1), Blocks.WATER.defaultBlockState(), false);
    scene.idle(3);
    scene.world.setBlock(util.grid.at(1, 2, 1), Blocks.WATER.defaultBlockState(), false);
    scene.idle(3);
    Collections.reverse(blocks);
    for (BlockPos blockPos : blocks) {
        scene.world.setBlock(blockPos, Blocks.WATER.defaultBlockState(), false);
        scene.idle(3);
    }
    scene.overlay.chaseBoundingBoxOutline(PonderPalette.WHITE, bb, bb, 100);
    scene.overlay.showText(100).text("The filled pool will not grow beyond the layer above the hose end").attachKeyFrame().placeNearTarget().pointAt(util.vector.of(0, 4 - 1 / 8f, 1.5f));
    scene.idle(80);
}
Also used : HosePulleyFluidHandler(com.simibubi.create.content.contraptions.fluids.actors.HosePulleyFluidHandler) Selection(com.simibubi.create.foundation.ponder.Selection) AABB(net.minecraft.world.phys.AABB) SceneBuilder(com.simibubi.create.foundation.ponder.SceneBuilder) CapabilityFluidHandler(net.minecraftforge.fluids.capability.CapabilityFluidHandler) Direction(net.minecraft.core.Direction) FluidAction(net.minecraftforge.fluids.capability.IFluidHandler.FluidAction) SceneBuildingUtil(com.simibubi.create.foundation.ponder.SceneBuildingUtil) Blocks(net.minecraft.world.level.block.Blocks) List(java.util.List) WorldSectionElement(com.simibubi.create.foundation.ponder.element.WorldSectionElement) ElementLink(com.simibubi.create.foundation.ponder.ElementLink) PonderPalette(com.simibubi.create.foundation.ponder.PonderPalette) BlockPos(net.minecraft.core.BlockPos) Vec3(net.minecraft.world.phys.Vec3) HosePulleyTileEntity(com.simibubi.create.content.contraptions.fluids.actors.HosePulleyTileEntity) FluidStack(net.minecraftforge.fluids.FluidStack) Fluids(net.minecraft.world.level.material.Fluids) LinkedList(java.util.LinkedList) Collections(java.util.Collections) HosePulleyFluidHandler(com.simibubi.create.content.contraptions.fluids.actors.HosePulleyFluidHandler) Selection(com.simibubi.create.foundation.ponder.Selection) FluidStack(net.minecraftforge.fluids.FluidStack) Vec3(net.minecraft.world.phys.Vec3) BlockPos(net.minecraft.core.BlockPos) WorldSectionElement(com.simibubi.create.foundation.ponder.element.WorldSectionElement) LinkedList(java.util.LinkedList) AABB(net.minecraft.world.phys.AABB)

Example 37 with WorldSectionElement

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

the class PipeScenes method interaction.

public static void interaction(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("fluid_pipe_interaction", "Draining and Filling fluid containers");
    scene.configureBasePlate(0, 1, 5);
    scene.showBasePlate();
    scene.idle(5);
    BlockPos pumpPos = util.grid.at(2, 1, 4);
    Selection largeCog = util.select.position(5, 0, 4);
    Selection kinetics = util.select.fromTo(5, 1, 5, 2, 1, 5);
    Selection pipes = util.select.fromTo(1, 1, 4, 3, 1, 3).add(util.select.position(3, 1, 2));
    Selection tank = util.select.fromTo(4, 1, 3, 4, 2, 3);
    Selection drain = util.select.position(1, 1, 2);
    Selection basin = util.select.position(3, 1, 1);
    Selection waterSourceS = util.select.position(1, 1, 1);
    Selection waterTargetS = util.select.position(4, 1, 1);
    Selection waterTarget2S = util.select.fromTo(4, 0, 0, 4, 1, 0);
    scene.world.setKineticSpeed(util.select.position(pumpPos), 0);
    scene.world.showSection(pipes, Direction.DOWN);
    scene.idle(10);
    scene.world.showSection(basin, Direction.SOUTH);
    scene.idle(5);
    scene.world.showSection(drain, Direction.SOUTH);
    scene.idle(5);
    scene.world.showSection(tank, Direction.WEST);
    scene.overlay.showText(60).text("Endpoints of a pipe network can interact with a variety of blocks").attachKeyFrame().placeNearTarget().pointAt(util.vector.blockSurface(util.grid.at(1, 1, 3), Direction.NORTH));
    scene.idle(60);
    scene.world.showSection(largeCog, Direction.UP);
    scene.idle(5);
    scene.world.showSection(kinetics, Direction.NORTH);
    scene.idle(10);
    scene.world.setKineticSpeed(util.select.position(pumpPos), 64);
    BlockPos drainPos = util.grid.at(1, 1, 2);
    scene.world.modifyTileEntity(drainPos, ItemDrainTileEntity.class, te -> te.getBehaviour(SmartFluidTankBehaviour.TYPE).allowInsertion().getPrimaryHandler().fill(new FluidStack(Fluids.WATER, 1500), FluidAction.EXECUTE));
    scene.idle(50);
    scene.overlay.showOutline(PonderPalette.MEDIUM, new Object(), drain, 40);
    scene.idle(5);
    scene.overlay.showOutline(PonderPalette.MEDIUM, new Object(), tank, 40);
    scene.idle(5);
    scene.overlay.showOutline(PonderPalette.MEDIUM, new Object(), basin, 40);
    scene.idle(5);
    scene.overlay.showText(60).text("Any block with fluid storage capabilities can be filled or drained").attachKeyFrame().colored(PonderPalette.MEDIUM).placeNearTarget().pointAt(util.vector.blockSurface(drainPos, Direction.UP));
    scene.idle(100);
    scene.world.hideSection(drain, Direction.NORTH);
    scene.idle(5);
    scene.world.hideSection(tank, Direction.EAST);
    scene.idle(5);
    scene.world.setBlock(drainPos, Blocks.AIR.defaultBlockState(), false);
    scene.world.propagatePipeChange(pumpPos);
    scene.world.hideSection(basin, Direction.NORTH);
    scene.idle(5);
    scene.world.setBlock(util.grid.at(3, 1, 1), Blocks.AIR.defaultBlockState(), false);
    scene.idle(5);
    scene.world.setBlock(util.grid.at(3, 1, 3), AllBlocks.GLASS_FLUID_PIPE.getDefaultState().setValue(AxisPipeBlock.AXIS, Axis.Z), false);
    scene.idle(10);
    scene.world.multiplyKineticSpeed(util.select.everywhere(), 2);
    scene.world.propagatePipeChange(pumpPos);
    ElementLink<WorldSectionElement> water = scene.world.showIndependentSection(waterSourceS, Direction.DOWN);
    scene.world.moveSection(water, util.vector.of(0, 0, 1), 0);
    scene.idle(10);
    scene.world.setBlock(drainPos, Blocks.WATER.defaultBlockState(), false);
    scene.idle(20);
    scene.overlay.showText(60).text("Source blocks right in front of an open end can be picked up...").attachKeyFrame().placeNearTarget().pointAt(util.vector.blockSurface(drainPos, Direction.SOUTH));
    scene.idle(40);
    scene.world.setBlock(drainPos.north(), Blocks.AIR.defaultBlockState(), false);
    scene.idle(40);
    ElementLink<WorldSectionElement> target = scene.world.showIndependentSection(waterTargetS, Direction.UP);
    scene.world.moveSection(target, util.vector.of(-1, 0, 0), 0);
    scene.idle(5);
    scene.world.showSectionAndMerge(waterTarget2S, Direction.UP, target);
    scene.overlay.showText(60).text("...while spilling into empty spaces can create fluid sources").attachKeyFrame().placeNearTarget().pointAt(util.vector.blockSurface(util.grid.at(3, 1, 2), Direction.NORTH));
    scene.idle(80);
    scene.world.hideIndependentSection(target, Direction.DOWN);
    scene.idle(5);
    scene.world.setBlock(drainPos, Blocks.BEE_NEST.defaultBlockState().setValue(BeehiveBlock.HONEY_LEVEL, 5), false);
    scene.world.showSection(drain, Direction.DOWN);
    scene.world.setBlock(util.grid.at(3, 1, 2), AllBlocks.FLUID_TANK.getDefaultState(), false);
    scene.world.propagatePipeChange(pumpPos);
    scene.idle(15);
    scene.overlay.showText(60).text("Pipes can also extract fluids from a handful of other blocks directly").attachKeyFrame().placeNearTarget().pointAt(util.vector.topOf(drainPos));
    scene.idle(60);
    scene.world.setBlock(drainPos, Blocks.BEE_NEST.defaultBlockState().setValue(BeehiveBlock.HONEY_LEVEL, 0), false);
}
Also used : Selection(com.simibubi.create.foundation.ponder.Selection) FluidStack(net.minecraftforge.fluids.FluidStack) BlockPos(net.minecraft.core.BlockPos) WorldSectionElement(com.simibubi.create.foundation.ponder.element.WorldSectionElement)

Example 38 with WorldSectionElement

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

the class ArmScenes method modes.

public static void modes(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("mechanical_arm_modes", "Distribution modes of the Mechanical Arm");
    scene.configureBasePlate(0, 1, 5);
    scene.world.setBlock(util.grid.at(3, 1, 0), Blocks.BARRIER.defaultBlockState(), false);
    scene.world.showSection(util.select.layer(0), Direction.UP);
    scene.idle(5);
    scene.world.showSection(util.select.fromTo(3, 1, 4, 4, 1, 5), Direction.DOWN);
    scene.idle(5);
    scene.world.showSection(util.select.fromTo(1, 1, 4, 1, 2, 5), Direction.NORTH);
    scene.idle(5);
    scene.world.showSection(util.select.fromTo(1, 1, 1, 5, 1, 2), Direction.SOUTH);
    scene.idle(10);
    AABB depotBox = AllShapes.DEPOT.bounds();
    AABB beltBox = depotBox.contract(0, -3 / 16f, 0).inflate(1, 0, 0);
    BlockPos depotPos = util.grid.at(1, 1, 4);
    BlockPos armPos = util.grid.at(3, 1, 4);
    scene.overlay.chaseBoundingBoxOutline(PonderPalette.INPUT, depotBox, depotBox.move(1, 1, 4), 60);
    scene.overlay.showText(30).text("Input").pointAt(util.vector.blockSurface(depotPos, Direction.WEST)).placeNearTarget().colored(PonderPalette.INPUT);
    scene.idle(40);
    scene.overlay.chaseBoundingBoxOutline(PonderPalette.OUTPUT, depotBox, beltBox.move(2, 1, 2), 40);
    scene.overlay.showText(40).text("Outputs").pointAt(util.vector.blockSurface(util.grid.at(1, 1, 2), Direction.WEST)).placeNearTarget().colored(PonderPalette.OUTPUT);
    scene.idle(50);
    ItemStack item = new ItemStack(Items.SNOWBALL);
    scene.world.createItemOnBeltLike(depotPos, Direction.SOUTH, item);
    scene.overlay.showText(60).attachKeyFrame().text("Whenever an Arm has to choose between multiple valid outputs...").pointAt(util.vector.blockSurface(util.grid.at(2, 1, 2), Direction.UP)).placeNearTarget().colored(PonderPalette.OUTPUT);
    scene.idle(70);
    Vec3 scrollSlot = util.vector.of(3.5, 1.25, 4);
    scene.overlay.showFilterSlotInput(scrollSlot, 120);
    scene.overlay.showText(50).text("...it will act according to its setting").pointAt(scrollSlot).placeNearTarget();
    scene.idle(60);
    scene.overlay.showControls(new InputWindowElement(scrollSlot, Pointing.RIGHT).scroll().withWrench(), 40);
    scene.idle(10);
    scene.overlay.showText(50).text("Scrolling with a Wrench will allow you to configure it").pointAt(scrollSlot).placeNearTarget();
    scene.idle(60);
    ElementLink<WorldSectionElement> blockage = scene.world.showIndependentSection(util.select.position(4, 1, 0), Direction.UP);
    scene.world.moveSection(blockage, util.vector.of(-1, 0, 0), 0);
    for (int i = 0; i < 20; i++) {
        if (i == 2) {
            scene.overlay.showText(60).attachKeyFrame().text("Round Robin mode simply cycles through all outputs that are available").pointAt(util.vector.blockSurface(util.grid.at(2, 1, 2), Direction.UP)).placeNearTarget().colored(PonderPalette.OUTPUT);
        }
        if (i == 6)
            continue;
        if (i == 7) {
            scene.overlay.showText(60).attachKeyFrame().text("If an output is unable to take more items, it will be skipped").pointAt(util.vector.blockSurface(util.grid.at(3, 1, 2), Direction.UP)).placeNearTarget().colored(PonderPalette.GREEN);
        }
        if (i == 12) {
            scene.world.moveSection(blockage, util.vector.of(-1, 0, 0), 10);
            scene.world.setBlock(util.grid.at(3, 1, 0), Blocks.BARRIER.defaultBlockState(), false);
        }
        int index = i % 3;
        if (i == 13) {
            scene.world.setBlock(util.grid.at(2, 1, 0), Blocks.BARRIER.defaultBlockState(), false);
            ElementLink<WorldSectionElement> blockage2 = scene.world.showIndependentSection(util.select.position(4, 1, 0), Direction.UP);
            scene.world.moveSection(blockage2, util.vector.of(-2, 0, 0), 0);
            scene.overlay.showText(60).attachKeyFrame().text("Prefer First prioritizes the outputs selected earliest when configuring this Arm").pointAt(util.vector.blockSurface(util.grid.at(3, 1, 2), Direction.UP)).placeNearTarget().colored(PonderPalette.GREEN);
            index = 0;
        }
        if (i == 14)
            index = 1;
        if (i == 15)
            index = 1;
        if (i >= 16)
            index = 2;
        scene.idle(5);
        scene.world.instructArm(armPos, Phase.MOVE_TO_INPUT, ItemStack.EMPTY, 0);
        scene.idle(12);
        scene.world.instructArm(armPos, Phase.SEARCH_OUTPUTS, item, -1);
        scene.world.removeItemsFromBelt(depotPos);
        scene.idle(5);
        if (i == 9) {
            scene.overlay.showText(80).attachKeyFrame().text("Forced Round Robin mode will never skip outputs, and instead wait until they are free").pointAt(util.vector.blockSurface(util.grid.at(3, 1, 2), Direction.UP)).placeNearTarget().colored(PonderPalette.RED);
            scene.idle(40);
            scene.world.moveSection(blockage, util.vector.of(1, 0, 0), 10);
            scene.world.setBlock(util.grid.at(3, 1, 0), Blocks.AIR.defaultBlockState(), false);
            scene.idle(50);
            scene.world.multiplyKineticSpeed(util.select.fromTo(1, 1, 1, 5, 0, 3), 2);
        }
        scene.world.instructArm(armPos, Phase.MOVE_TO_OUTPUT, item, index);
        scene.world.createItemOnBeltLike(depotPos, Direction.SOUTH, item);
        scene.idle(12);
        scene.world.instructArm(armPos, Phase.SEARCH_INPUTS, ItemStack.EMPTY, -1);
        scene.world.createItemOnBelt(util.grid.at(3 - index, 1, 2), Direction.UP, item);
    }
}
Also used : 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) AABB(net.minecraft.world.phys.AABB)

Example 39 with WorldSectionElement

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

the class BearingScenes method windmillsAsSource.

public static void windmillsAsSource(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("windmill_source", "Generating Rotational Force using Windmill Bearings");
    scene.configureBasePlate(1, 1, 5);
    scene.setSceneOffsetY(-1);
    scene.world.showSection(util.select.fromTo(1, 0, 1, 5, 0, 5), Direction.UP);
    scene.world.setBlock(util.grid.at(2, -1, 0), AllBlocks.SAIL.getDefaultState().setValue(SailBlock.FACING, Direction.NORTH), false);
    scene.idle(5);
    Selection kinetics = util.select.fromTo(3, 1, 1, 4, 1, 4);
    Selection largeCog = util.select.position(3, 2, 2);
    BlockPos windmill = util.grid.at(3, 2, 1);
    scene.world.showSection(kinetics.add(largeCog), Direction.DOWN);
    scene.idle(10);
    scene.world.showSection(util.select.position(windmill), Direction.DOWN);
    scene.idle(10);
    BlockPos anchorPos = windmill.north();
    scene.overlay.showSelectionWithText(util.select.position(anchorPos), 60).colored(PonderPalette.GREEN).pointAt(util.vector.blockSurface(windmill, Direction.WEST)).attachKeyFrame().placeNearTarget().text("Windmill Bearings attach to the block in front of them");
    scene.idle(50);
    ElementLink<WorldSectionElement> structure = scene.world.showIndependentSection(util.select.position(anchorPos), Direction.SOUTH);
    scene.idle(10);
    for (Direction d : Iterate.directions) if (d.getAxis() != Axis.Z)
        scene.world.showSectionAndMerge(util.select.fromTo(anchorPos.relative(d, 1), anchorPos.relative(d, 2)), d.getOpposite(), structure);
    scene.idle(10);
    scene.world.showSectionAndMerge(util.select.fromTo(anchorPos.above().east(), anchorPos.above(3).east()), Direction.WEST, structure);
    scene.world.showSectionAndMerge(util.select.fromTo(anchorPos.below().west(), anchorPos.below(3).west()), Direction.EAST, structure);
    scene.world.showSectionAndMerge(util.select.fromTo(anchorPos.east().below(), anchorPos.east(3).below()), Direction.UP, structure);
    scene.world.showSectionAndMerge(util.select.fromTo(anchorPos.west().above(), anchorPos.west(3).above()), Direction.DOWN, structure);
    scene.idle(5);
    for (Direction d : Iterate.directions) if (d.getAxis() != Axis.Z)
        scene.effects.superGlue(anchorPos.relative(d, 1), d.getOpposite(), false);
    scene.idle(10);
    scene.overlay.showText(60).pointAt(util.vector.blockSurface(anchorPos, Direction.NORTH)).attachKeyFrame().placeNearTarget().text("If enough Sail-like blocks are attached to the block, it can act as a Windmill");
    scene.idle(70);
    scene.rotateCameraY(-90);
    scene.idle(20);
    scene.overlay.showControls(new InputWindowElement(util.vector.topOf(windmill), Pointing.DOWN).rightClick(), 60);
    scene.idle(7);
    scene.world.rotateBearing(windmill, 360, 200);
    scene.world.rotateSection(structure, 0, 0, 360, 200);
    scene.world.setKineticSpeed(largeCog, 4);
    scene.world.setKineticSpeed(kinetics, -8);
    scene.effects.rotationDirectionIndicator(windmill.south());
    BlockPos gaugePos = util.grid.at(4, 1, 4);
    scene.effects.indicateSuccess(gaugePos);
    scene.idle(10);
    scene.overlay.showText(60).pointAt(util.vector.topOf(windmill)).placeNearTarget().attachKeyFrame().text("Activated with Right-Click, the Windmill Bearing will start providing Rotational Force");
    scene.idle(70);
    scene.overlay.showText(60).pointAt(util.vector.blockSurface(gaugePos, Direction.WEST)).colored(PonderPalette.SLOW).placeNearTarget().text("The Amount of Sail Blocks determine its Rotation Speed");
    scene.idle(90);
    Vec3 surface = util.vector.blockSurface(windmill, Direction.WEST);
    scene.overlay.showControls(new InputWindowElement(surface, Pointing.DOWN).scroll().withWrench(), 60);
    scene.overlay.showCenteredScrollInput(windmill, Direction.WEST, 50);
    scene.overlay.showText(60).pointAt(surface).attachKeyFrame().placeNearTarget().text("Use a Wrench to configure its rotation direction");
    scene.idle(36);
    scene.world.rotateBearing(windmill, -90 - 45, 75);
    scene.world.rotateSection(structure, 0, 0, -90 - 45, 75);
    scene.world.modifyKineticSpeed(largeCog, f -> -f);
    scene.world.modifyKineticSpeed(kinetics, f -> -f);
    scene.effects.rotationDirectionIndicator(windmill.south());
    scene.idle(69);
    scene.overlay.showControls(new InputWindowElement(util.vector.topOf(windmill), Pointing.DOWN).rightClick(), 60);
    scene.idle(7);
    scene.world.rotateBearing(windmill, -45, 0);
    scene.world.rotateSection(structure, 0, 0, -45, 0);
    scene.world.setKineticSpeed(largeCog, 0);
    scene.world.setKineticSpeed(kinetics, 0);
    scene.idle(10);
    scene.overlay.showText(60).pointAt(util.vector.topOf(windmill)).placeNearTarget().text("Right-click the Bearing anytime to stop and edit the Structure again");
}
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) Direction(net.minecraft.core.Direction)

Example 40 with WorldSectionElement

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

Aggregations

WorldSectionElement (com.simibubi.create.foundation.ponder.element.WorldSectionElement)70 BlockPos (net.minecraft.core.BlockPos)64 Selection (com.simibubi.create.foundation.ponder.Selection)60 InputWindowElement (com.simibubi.create.foundation.ponder.element.InputWindowElement)44 Vec3 (net.minecraft.world.phys.Vec3)39 ItemStack (net.minecraft.world.item.ItemStack)34 Entity (net.minecraft.world.entity.Entity)16 Direction (net.minecraft.core.Direction)11 ItemEntity (net.minecraft.world.entity.item.ItemEntity)11 EntityElement (com.simibubi.create.foundation.ponder.element.EntityElement)10 ElementLink (com.simibubi.create.foundation.ponder.ElementLink)9 SceneBuilder (com.simibubi.create.foundation.ponder.SceneBuilder)9 SceneBuildingUtil (com.simibubi.create.foundation.ponder.SceneBuildingUtil)8 AABB (net.minecraft.world.phys.AABB)8 FluidStack (net.minecraftforge.fluids.FluidStack)8 PonderPalette (com.simibubi.create.foundation.ponder.PonderPalette)7 Pointing (com.simibubi.create.foundation.utility.Pointing)6 HarvesterTileEntity (com.simibubi.create.content.contraptions.components.actors.HarvesterTileEntity)5 BeltItemElement (com.simibubi.create.foundation.ponder.element.BeltItemElement)5 BlockState (net.minecraft.world.level.block.state.BlockState)5