Search in sources :

Example 91 with Selection

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

the class PipeScenes method flow.

public static void flow(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("fluid_pipe_flow", "Moving Fluids using Copper Pipes");
    scene.configureBasePlate(0, 0, 5);
    scene.showBasePlate();
    scene.idle(5);
    BlockState pipeState = AllBlocks.FLUID_PIPE.getDefaultState().setValue(FluidPipeBlock.UP, false).setValue(FluidPipeBlock.DOWN, false);
    scene.world.setBlock(util.grid.at(2, 1, 1), pipeState.setValue(FluidPipeBlock.NORTH, false).setValue(FluidPipeBlock.SOUTH, false), false);
    scene.world.setBlock(util.grid.at(1, 1, 2), pipeState.setValue(FluidPipeBlock.WEST, false).setValue(FluidPipeBlock.EAST, false), false);
    Selection largeCog = util.select.position(5, 0, 1);
    Selection kinetics = util.select.fromTo(5, 1, 0, 3, 1, 0);
    Selection tank = util.select.fromTo(4, 1, 2, 4, 2, 2);
    Selection tank2 = util.select.fromTo(0, 1, 3, 0, 2, 3);
    Selection strayPipes = util.select.fromTo(2, 1, 2, 2, 2, 2).add(util.select.fromTo(1, 2, 2, 1, 3, 2));
    scene.world.showSection(tank, Direction.DOWN);
    scene.idle(5);
    scene.world.showSection(tank2, Direction.DOWN);
    FluidStack content = new FluidStack(Fluids.LAVA, 10000);
    scene.world.modifyTileEntity(util.grid.at(4, 1, 2), FluidTankTileEntity.class, te -> te.getTankInventory().fill(content, FluidAction.EXECUTE));
    scene.idle(10);
    for (int i = 4; i >= 1; i--) {
        scene.world.showSection(util.select.position(i, 1, 1), i == 4 ? Direction.SOUTH : Direction.EAST);
        scene.idle(3);
    }
    scene.overlay.showText(60).text("Fluid Pipes can connect two or more fluid sources and targets").attachKeyFrame().placeNearTarget().pointAt(util.vector.topOf(1, 1, 1));
    for (int i = 2; i <= 3; i++) {
        scene.world.showSection(util.select.position(1, 1, i), Direction.NORTH);
        scene.idle(3);
    }
    scene.idle(60);
    scene.overlay.showControls(new InputWindowElement(util.vector.centerOf(2, 1, 1), Pointing.DOWN).rightClick().withWrench(), 40);
    scene.idle(7);
    scene.world.restoreBlocks(util.select.position(2, 1, 1));
    scene.overlay.showText(70).attachKeyFrame().pointAt(util.vector.centerOf(2, 1, 1)).placeNearTarget().text("Using a wrench, a straight pipe segment can be given a window");
    scene.idle(40);
    scene.overlay.showControls(new InputWindowElement(util.vector.centerOf(1, 1, 2), Pointing.DOWN).rightClick().withWrench(), 10);
    scene.idle(7);
    scene.world.restoreBlocks(util.select.position(1, 1, 2));
    scene.idle(40);
    Vec3 center = util.vector.centerOf(2, 1, 2);
    AABB bb = new AABB(center, center).inflate(1 / 6f);
    AABB bb1 = bb.move(-0.5, 0, 0);
    AABB bb2 = bb.move(0, 0, -0.5);
    scene.world.showSection(strayPipes, Direction.DOWN);
    scene.idle(10);
    scene.overlay.chaseBoundingBoxOutline(PonderPalette.RED, bb1, bb, 1);
    scene.overlay.chaseBoundingBoxOutline(PonderPalette.RED, bb2, bb, 1);
    scene.idle(1);
    scene.overlay.chaseBoundingBoxOutline(PonderPalette.RED, bb1, bb1, 50);
    scene.overlay.chaseBoundingBoxOutline(PonderPalette.RED, bb2, bb2, 50);
    scene.idle(10);
    scene.overlay.showText(55).attachKeyFrame().pointAt(util.vector.centerOf(2, 1, 2)).placeNearTarget().colored(PonderPalette.RED).text("Windowed pipes will not connect to any other adjacent pipe segments");
    scene.idle(60);
    scene.world.hideSection(strayPipes, Direction.UP);
    scene.idle(10);
    BlockPos pumpPos = util.grid.at(3, 1, 1);
    scene.world.setBlock(pumpPos, AllBlocks.MECHANICAL_PUMP.getDefaultState().setValue(PumpBlock.FACING, Direction.WEST), true);
    scene.idle(10);
    scene.world.showSection(largeCog, Direction.UP);
    scene.world.showSection(kinetics, Direction.SOUTH);
    scene.idle(10);
    scene.world.setKineticSpeed(util.select.position(pumpPos), 32);
    scene.world.propagatePipeChange(pumpPos);
    scene.overlay.showText(70).attachKeyFrame().pointAt(util.vector.topOf(pumpPos)).placeNearTarget().text("Powered by Mechanical Pumps, the Pipes can transport Fluids");
    scene.idle(85);
    scene.overlay.showSelectionWithText(tank, 40).colored(PonderPalette.RED).placeNearTarget().text("No fluid is being extracted at first");
    scene.idle(90);
    scene.overlay.showOutline(PonderPalette.GREEN, new Object(), tank, 100);
    scene.idle(5);
    scene.overlay.showOutline(PonderPalette.GREEN, new Object(), tank2, 100);
    scene.idle(5);
    scene.overlay.showText(100).attachKeyFrame().independent().text("Once the flow connects them, the endpoints gradually transfer their contents");
    scene.overlay.showLine(PonderPalette.GREEN, util.vector.blockSurface(util.grid.at(4, 2, 2), Direction.WEST), util.vector.blockSurface(util.grid.at(0, 2, 3), Direction.EAST), 80);
    scene.world.multiplyKineticSpeed(util.select.everywhere(), 2);
    scene.world.propagatePipeChange(pumpPos);
    scene.effects.rotationSpeedIndicator(pumpPos);
    scene.idle(120);
    scene.overlay.showText(60).text("Thus, the Pipe blocks themselves never 'physically' contain any fluid").placeNearTarget().pointAt(util.vector.topOf(1, 1, 1));
    scene.idle(50);
}
Also used : BlockState(net.minecraft.world.level.block.state.BlockState) Selection(com.simibubi.create.foundation.ponder.Selection) FluidStack(net.minecraftforge.fluids.FluidStack) Vec3(net.minecraft.world.phys.Vec3) InputWindowElement(com.simibubi.create.foundation.ponder.element.InputWindowElement) BlockPos(net.minecraft.core.BlockPos) AABB(net.minecraft.world.phys.AABB)

Example 92 with Selection

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

the class PipeScenes method valve.

public static void valve(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("valve_pipe", "Controlling Fluid flow using Valves");
    scene.configureBasePlate(0, 0, 5);
    scene.showBasePlate();
    Selection cogs = util.select.fromTo(5, 0, 2, 5, 1, 2);
    Selection tank1 = util.select.fromTo(3, 1, 3, 3, 2, 3);
    Selection tank2 = util.select.fromTo(1, 1, 3, 1, 2, 3);
    BlockPos valvePos = util.grid.at(2, 1, 1);
    BlockPos handlePos = util.grid.at(2, 2, 1);
    BlockPos pumpPos = util.grid.at(4, 1, 2);
    Selection pipes1 = util.select.fromTo(4, 1, 3, 4, 1, 1);
    Selection pipes2 = util.select.fromTo(3, 1, 1, 1, 1, 1);
    Selection pipes3 = util.select.fromTo(0, 1, 1, 0, 1, 3);
    scene.world.setKineticSpeed(pipes1, 0);
    scene.world.propagatePipeChange(pumpPos);
    scene.world.setBlock(valvePos, AllBlocks.FLUID_PIPE.get().getAxisState(Axis.X), false);
    scene.world.setBlock(util.grid.at(3, 1, 1), Blocks.AIR.defaultBlockState(), false);
    scene.world.setBlock(util.grid.at(3, 1, 1), AllBlocks.GLASS_FLUID_PIPE.getDefaultState().setValue(GlassFluidPipeBlock.AXIS, Axis.X), false);
    scene.idle(5);
    scene.world.showSection(tank1, Direction.NORTH);
    scene.idle(5);
    scene.world.showSection(tank2, Direction.NORTH);
    scene.idle(10);
    scene.world.showSection(pipes1, Direction.WEST);
    scene.idle(5);
    scene.world.showSection(pipes2, Direction.SOUTH);
    scene.idle(5);
    scene.world.showSection(pipes3, Direction.EAST);
    scene.idle(15);
    scene.world.destroyBlock(valvePos);
    scene.world.restoreBlocks(util.select.position(valvePos));
    scene.overlay.showText(60).placeNearTarget().text("Valve pipes help control fluids propagating through pipe networks").attachKeyFrame().pointAt(util.vector.blockSurface(valvePos, Direction.WEST));
    scene.idle(75);
    scene.world.showSection(cogs, Direction.WEST);
    scene.idle(10);
    scene.world.setKineticSpeed(util.select.position(pumpPos), 64);
    scene.world.propagatePipeChange(pumpPos);
    scene.overlay.showText(60).placeNearTarget().text("Their shaft input controls whether fluid is currently allowed through").attachKeyFrame().pointAt(util.vector.topOf(valvePos));
    scene.idle(60);
    scene.world.showSection(util.select.position(handlePos), Direction.DOWN);
    scene.idle(15);
    Selection valveKinetics = util.select.fromTo(2, 1, 1, 2, 2, 1);
    scene.world.setKineticSpeed(valveKinetics, 16);
    scene.effects.rotationSpeedIndicator(handlePos);
    scene.world.modifyTileEntity(valvePos, FluidValveTileEntity.class, te -> te.onSpeedChanged(0));
    scene.idle(22);
    scene.world.modifyBlock(valvePos, s -> s.setValue(FluidValveBlock.ENABLED, true), false);
    scene.effects.indicateSuccess(valvePos);
    scene.idle(5);
    scene.world.setKineticSpeed(valveKinetics, 0);
    scene.overlay.showText(60).placeNearTarget().text("Given Rotational Force in the opening direction, the valve will open up").attachKeyFrame().pointAt(util.vector.blockSurface(valvePos, Direction.NORTH));
    scene.idle(90);
    scene.overlay.showText(50).placeNearTarget().text("It can be closed again by reversing the input rotation").attachKeyFrame().pointAt(util.vector.blockSurface(valvePos, Direction.NORTH));
    scene.idle(40);
    scene.world.setKineticSpeed(valveKinetics, -16);
    scene.effects.rotationSpeedIndicator(handlePos);
    scene.world.modifyTileEntity(valvePos, FluidValveTileEntity.class, te -> te.onSpeedChanged(0));
    scene.idle(22);
    scene.world.modifyBlock(valvePos, s -> s.setValue(FluidValveBlock.ENABLED, false), false);
    scene.effects.indicateRedstone(valvePos);
    scene.world.propagatePipeChange(pumpPos);
    scene.idle(5);
    scene.world.setKineticSpeed(valveKinetics, 0);
}
Also used : Selection(com.simibubi.create.foundation.ponder.Selection) BlockPos(net.minecraft.core.BlockPos)

Example 93 with Selection

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

the class PumpScenes method speed.

public static void speed(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("mechanical_pump_speed", "Throughput of Mechanical Pumps");
    scene.configureBasePlate(0, 0, 5);
    scene.showBasePlate();
    scene.idle(5);
    // scene.world.showSection(util.select.layersFrom(1), Direction.DOWN);
    Selection largeCog = util.select.position(5, 0, 3);
    Selection cogs = util.select.fromTo(5, 1, 4, 2, 1, 4).add(util.select.position(2, 1, 3));
    BlockPos pumpPos = util.grid.at(2, 1, 2);
    Selection pump = util.select.position(pumpPos);
    Selection tank1 = util.select.fromTo(4, 1, 2, 4, 2, 2);
    Selection tank2 = util.select.fromTo(0, 1, 2, 0, 2, 2);
    Selection megapipe1 = util.select.fromTo(0, 3, 5, 1, 4, 2);
    Selection megapipe2 = util.select.fromTo(3, 3, 1, 5, 6, 2);
    scene.world.modifyTileEntity(util.grid.at(0, 1, 2), FluidTankTileEntity.class, te -> te.getTankInventory().drain(3000, FluidAction.EXECUTE));
    BlockPos east = pumpPos.east();
    scene.world.setBlock(east, Blocks.AIR.defaultBlockState(), false);
    scene.world.setBlock(east, AllBlocks.GLASS_FLUID_PIPE.getDefaultState().setValue(GlassFluidPipeBlock.AXIS, Axis.X), false);
    scene.world.setBlock(pumpPos.south(), AllBlocks.COGWHEEL.getDefaultState().setValue(CogWheelBlock.AXIS, Axis.X), false);
    Selection southPump = util.select.position(pumpPos.south());
    scene.world.setKineticSpeed(southPump, 32);
    scene.world.setKineticSpeed(pump, 0);
    scene.world.showSection(pump, Direction.DOWN);
    scene.idle(10);
    ElementLink<WorldSectionElement> mp1 = scene.world.showIndependentSection(megapipe1, Direction.EAST);
    scene.world.moveSection(mp1, util.vector.of(0, -3, 0), 0);
    scene.idle(5);
    ElementLink<WorldSectionElement> mp2 = scene.world.showIndependentSection(megapipe2, Direction.WEST);
    scene.world.moveSection(mp2, util.vector.of(0, -3, 0), 0);
    scene.idle(15);
    scene.overlay.showText(70).attachKeyFrame().pointAt(util.vector.topOf(pumpPos)).placeNearTarget().text("Regardless of speed, Mechanical Pumps affect pipes connected up to 16 blocks away");
    scene.idle(75);
    scene.world.hideIndependentSection(mp1, Direction.WEST);
    scene.idle(5);
    scene.world.hideIndependentSection(mp2, Direction.EAST);
    scene.idle(15);
    scene.world.showSection(tank1, Direction.DOWN);
    scene.idle(2);
    scene.world.showSection(util.select.position(east), Direction.DOWN);
    scene.idle(5);
    BlockPos west = pumpPos.west();
    scene.world.showSection(util.select.position(west), Direction.DOWN);
    scene.idle(2);
    scene.world.showSection(tank2, Direction.DOWN);
    scene.idle(5);
    scene.world.showSection(largeCog, Direction.UP);
    scene.world.showSection(cogs, Direction.SOUTH);
    scene.idle(10);
    scene.world.setKineticSpeed(util.select.position(pumpPos), -32);
    scene.effects.rotationSpeedIndicator(pumpPos);
    scene.world.propagatePipeChange(pumpPos);
    scene.idle(40);
    scene.world.multiplyKineticSpeed(util.select.everywhere(), 4);
    scene.effects.rotationSpeedIndicator(pumpPos);
    scene.world.propagatePipeChange(pumpPos);
    scene.idle(20);
    scene.overlay.showText(60).attachKeyFrame().pointAt(util.vector.topOf(pumpPos)).placeNearTarget().text("Speeding up the input rotation changes the speed of flow propagation...");
    scene.idle(70);
    scene.overlay.showText(50).pointAt(util.vector.blockSurface(util.grid.at(0, 1, 2), Direction.WEST)).placeNearTarget().text("...aswell as how quickly fluids are transferred");
    scene.idle(60);
    BlockState pipeState = AllBlocks.FLUID_PIPE.getDefaultState().setValue(FluidPipeBlock.DOWN, false).setValue(FluidPipeBlock.UP, false);
    scene.world.setKineticSpeed(util.select.everywhere(), 0);
    scene.idle(10);
    scene.world.setBlock(east, pipeState, true);
    scene.world.setBlock(west, pipeState, true);
    scene.world.setBlock(east.north(), pipeState.setValue(FluidPipeBlock.NORTH, false).setValue(FluidPipeBlock.EAST, false), false);
    scene.world.setBlock(east.south(), pipeState.setValue(FluidPipeBlock.SOUTH, false).setValue(FluidPipeBlock.EAST, false), false);
    scene.world.showSection(util.select.position(east.north()), Direction.DOWN);
    scene.world.showSection(util.select.position(east.south()), Direction.DOWN);
    Selection northPump = util.select.position(pumpPos.north());
    scene.world.setBlock(west.north(), pipeState.setValue(FluidPipeBlock.NORTH, false).setValue(FluidPipeBlock.WEST, false), false);
    scene.world.setBlock(west.south(), pipeState.setValue(FluidPipeBlock.SOUTH, false).setValue(FluidPipeBlock.WEST, false), false);
    scene.world.showSection(util.select.position(west.north()), Direction.DOWN);
    scene.world.showSection(util.select.position(west.south()), Direction.DOWN);
    scene.world.restoreBlocks(southPump);
    scene.world.modifyBlock(pumpPos.south(), s -> s.setValue(PumpBlock.FACING, Direction.EAST), false);
    scene.world.setKineticSpeed(util.select.everywhere(), 0);
    scene.world.showSection(northPump, Direction.DOWN);
    scene.world.modifyBlock(pumpPos.north(), s -> s.setValue(PumpBlock.FACING, Direction.EAST), false);
    scene.idle(4);
    scene.world.setKineticSpeed(util.select.everywhere(), -16);
    scene.world.setKineticSpeed(northPump, 16);
    scene.world.setKineticSpeed(southPump, 16);
    scene.world.setKineticSpeed(largeCog, 8);
    scene.idle(20);
    scene.overlay.showSelectionWithText(util.select.fromTo(2, 1, 1, 2, 1, 3), 60).attachKeyFrame().colored(PonderPalette.GREEN).pointAt(util.vector.topOf(pumpPos)).placeNearTarget().text("Pumps can combine their throughputs within shared pipe networks");
    scene.idle(70);
    scene.overlay.showControls(new InputWindowElement(util.vector.topOf(pumpPos.south()), Pointing.DOWN).rightClick().withWrench(), 30);
    scene.idle(7);
    scene.world.modifyBlock(pumpPos.south(), s -> s.setValue(PumpBlock.FACING, Direction.WEST), true);
    scene.idle(30);
    scene.overlay.showControls(new InputWindowElement(util.vector.topOf(pumpPos.north()), Pointing.DOWN).rightClick().withWrench(), 30);
    scene.idle(7);
    scene.world.modifyBlock(pumpPos.north(), s -> s.setValue(PumpBlock.FACING, Direction.WEST), true);
    scene.idle(30);
    scene.overlay.showText(70).attachKeyFrame().pointAt(util.vector.topOf(pumpPos.north()).subtract(0.5f, 0.125f, 0)).placeNearTarget().text("Alternating their orientation can help align their flow directions");
    scene.idle(40);
    scene.world.multiplyKineticSpeed(util.select.everywhere(), 8);
    scene.effects.rotationSpeedIndicator(pumpPos);
    scene.effects.rotationSpeedIndicator(pumpPos.north());
    scene.effects.rotationSpeedIndicator(pumpPos.south());
    scene.world.propagatePipeChange(pumpPos);
    scene.world.propagatePipeChange(pumpPos.north());
    scene.world.propagatePipeChange(pumpPos.south());
    scene.idle(100);
    scene.world.multiplyKineticSpeed(util.select.everywhere(), -1);
    scene.effects.rotationSpeedIndicator(pumpPos);
    scene.effects.rotationSpeedIndicator(pumpPos.north());
    scene.effects.rotationSpeedIndicator(pumpPos.south());
    scene.world.propagatePipeChange(pumpPos);
    scene.world.propagatePipeChange(pumpPos.north());
    scene.world.propagatePipeChange(pumpPos.south());
}
Also used : 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)

Example 94 with Selection

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

the class SpoutScenes method filling.

public static void filling(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("spout_filling", "Filling Items using a Spout");
    scene.configureBasePlate(0, 0, 5);
    scene.showBasePlate();
    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 largeCog = util.select.position(3, 0, 5);
    Selection kinetics = util.select.fromTo(2, 1, 5, 2, 2, 3);
    Selection tank = util.select.fromTo(1, 1, 4, 1, 2, 4);
    Selection pipes = util.select.fromTo(1, 3, 4, 2, 3, 3);
    Selection spoutS = util.select.position(2, 3, 2);
    BlockPos spoutPos = util.grid.at(2, 3, 2);
    BlockPos depotPos = util.grid.at(2, 1, 1);
    scene.world.showSection(spoutS, Direction.DOWN);
    scene.idle(10);
    Vec3 spoutSide = util.vector.blockSurface(spoutPos, Direction.WEST);
    scene.overlay.showText(60).pointAt(spoutSide).placeNearTarget().attachKeyFrame().text("The Spout can fill fluid holding items provided beneath it");
    scene.idle(50);
    scene.world.showSection(tank, Direction.DOWN);
    scene.idle(5);
    scene.world.showSection(largeCog, Direction.UP);
    scene.world.showSection(kinetics, Direction.NORTH);
    scene.world.showSection(pipes, Direction.NORTH);
    scene.idle(20);
    FluidStack honey = new FluidStack(FluidHelper.convertToStill(AllFluids.HONEY.get()), 1000);
    ItemStack bucket = AllFluids.HONEY.get().getAttributes().getBucket(honey);
    scene.overlay.showControls(new InputWindowElement(util.vector.blockSurface(util.grid.at(2, 3, 2), Direction.NORTH), Pointing.RIGHT).showing(AllIcons.I_MTD_CLOSE).withItem(bucket), 40);
    scene.idle(7);
    scene.overlay.showSelectionWithText(util.select.position(2, 3, 2), 50).pointAt(util.vector.blockSurface(util.grid.at(2, 3, 2), Direction.WEST)).attachKeyFrame().colored(PonderPalette.RED).placeNearTarget().text("The content of a Spout cannot be accessed manually");
    scene.idle(60);
    scene.overlay.showText(70).pointAt(util.vector.blockSurface(util.grid.at(2, 3, 3), Direction.WEST)).colored(PonderPalette.GREEN).placeNearTarget().text("Instead, Pipes can be used to supply it with fluids");
    scene.idle(90);
    scene.overlay.showText(60).pointAt(spoutSide.subtract(0, 2, 0)).attachKeyFrame().placeNearTarget().text("The Input items can be placed on a Depot under the Spout");
    scene.idle(50);
    ItemStack bottle = new ItemStack(Items.GLASS_BOTTLE);
    scene.world.createItemOnBeltLike(depotPos, Direction.NORTH, bottle);
    Vec3 depotCenter = util.vector.centerOf(depotPos.south());
    scene.overlay.showControls(new InputWindowElement(depotCenter, Pointing.UP).withItem(bottle), 30);
    scene.idle(10);
    scene.idle(20);
    scene.world.modifyTileNBT(spoutS, SpoutTileEntity.class, nbt -> nbt.putInt("ProcessingTicks", 20));
    scene.idle(20);
    scene.world.removeItemsFromBelt(depotPos);
    ItemStack potion = new ItemStack(Items.HONEY_BOTTLE);
    scene.world.createItemOnBeltLike(depotPos, Direction.UP, potion);
    ParticleOptions fluidParticle = FluidFX.getFluidParticle(new FluidStack(AllFluids.HONEY.get(), 1000));
    for (int i = 0; i < 10; i++) {
        scene.effects.emitParticles(util.vector.topOf(depotPos.south()).add(0, 1 / 16f, 0), Emitter.simple(fluidParticle, VecHelper.offsetRandomly(Vec3.ZERO, Create.RANDOM, .1f)), 1, 1);
    }
    scene.idle(10);
    scene.overlay.showControls(new InputWindowElement(depotCenter, Pointing.UP).withItem(potion), 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, bottle);
    scene.idle(15);
    ElementLink<BeltItemElement> ingot2 = scene.world.createItemOnBelt(beltPos, Direction.SOUTH, bottle);
    scene.idle(15);
    scene.world.stallBeltItem(ingot, true);
    scene.world.modifyTileNBT(spoutS, SpoutTileEntity.class, nbt -> nbt.putInt("ProcessingTicks", 20));
    scene.overlay.showText(50).pointAt(spoutSide).placeNearTarget().attachKeyFrame().text("The Spout will hold and process them automatically");
    scene.idle(20);
    for (int i = 0; i < 10; i++) {
        scene.effects.emitParticles(util.vector.topOf(depotPos.south()).add(0, 1 / 16f, 0), Emitter.simple(fluidParticle, VecHelper.offsetRandomly(Vec3.ZERO, Create.RANDOM, .1f)), 1, 1);
    }
    scene.world.removeItemsFromBelt(spoutPos.below(2));
    ingot = scene.world.createItemOnBelt(spoutPos.below(2), Direction.UP, potion);
    scene.world.stallBeltItem(ingot, true);
    scene.idle(5);
    scene.world.stallBeltItem(ingot, false);
    scene.idle(15);
    scene.world.stallBeltItem(ingot2, true);
    scene.world.modifyTileNBT(spoutS, SpoutTileEntity.class, nbt -> nbt.putInt("ProcessingTicks", 20));
    scene.idle(20);
    for (int i = 0; i < 10; i++) {
        scene.effects.emitParticles(util.vector.topOf(depotPos.south()).add(0, 1 / 16f, 0), Emitter.simple(fluidParticle, VecHelper.offsetRandomly(Vec3.ZERO, Create.RANDOM, .1f)), 1, 1);
    }
    scene.world.removeItemsFromBelt(spoutPos.below(2));
    ingot2 = scene.world.createItemOnBelt(spoutPos.below(2), Direction.UP, potion);
    scene.world.stallBeltItem(ingot2, true);
    scene.idle(5);
    scene.world.stallBeltItem(ingot2, false);
}
Also used : ParticleOptions(net.minecraft.core.particles.ParticleOptions) Selection(com.simibubi.create.foundation.ponder.Selection) FluidStack(net.minecraftforge.fluids.FluidStack) 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) BeltItemElement(com.simibubi.create.foundation.ponder.element.BeltItemElement)

Aggregations

Selection (com.simibubi.create.foundation.ponder.Selection)94 BlockPos (net.minecraft.core.BlockPos)84 WorldSectionElement (com.simibubi.create.foundation.ponder.element.WorldSectionElement)59 InputWindowElement (com.simibubi.create.foundation.ponder.element.InputWindowElement)57 Vec3 (net.minecraft.world.phys.Vec3)51 ItemStack (net.minecraft.world.item.ItemStack)46 Entity (net.minecraft.world.entity.Entity)15 AABB (net.minecraft.world.phys.AABB)14 EntityElement (com.simibubi.create.foundation.ponder.element.EntityElement)11 ItemEntity (net.minecraft.world.entity.item.ItemEntity)11 FluidStack (net.minecraftforge.fluids.FluidStack)10 SceneBuilder (com.simibubi.create.foundation.ponder.SceneBuilder)8 Direction (net.minecraft.core.Direction)8 ElementLink (com.simibubi.create.foundation.ponder.ElementLink)7 PonderPalette (com.simibubi.create.foundation.ponder.PonderPalette)7 SceneBuildingUtil (com.simibubi.create.foundation.ponder.SceneBuildingUtil)7 BlockState (net.minecraft.world.level.block.state.BlockState)7 CapabilityFluidHandler (net.minecraftforge.fluids.capability.CapabilityFluidHandler)6 FluidAction (net.minecraftforge.fluids.capability.IFluidHandler.FluidAction)6 ParrotElement (com.simibubi.create.foundation.ponder.element.ParrotElement)5