Search in sources :

Example 41 with Selection

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

the class RedstoneScenes method analogLever.

public static void analogLever(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("analog_lever", "Controlling signals using the Analog Lever");
    scene.configureBasePlate(0, 0, 5);
    BlockPos[] wireLocations = new BlockPos[] { util.grid.at(2, 1, 1), util.grid.at(2, 1, 0), util.grid.at(1, 1, 0), util.grid.at(0, 1, 0), util.grid.at(0, 1, 1), util.grid.at(0, 1, 2), util.grid.at(0, 1, 3), util.grid.at(0, 1, 4), util.grid.at(1, 1, 4), util.grid.at(2, 1, 4), util.grid.at(3, 1, 4), util.grid.at(4, 1, 4), util.grid.at(4, 1, 3), util.grid.at(4, 1, 2), util.grid.at(4, 1, 1) };
    Selection leverSelection = util.select.fromTo(2, 1, 2, 2, 2, 2);
    Selection lamp = util.select.position(4, 1, 0);
    BlockPos leverPos = util.grid.at(2, 2, 2);
    Vec3 leverVec = util.vector.centerOf(leverPos).add(0, -.25, 0);
    scene.world.showSection(util.select.layersFrom(0).substract(lamp).substract(leverSelection), Direction.UP);
    scene.idle(5);
    scene.world.showSection(lamp, Direction.DOWN);
    scene.idle(10);
    scene.world.showSection(leverSelection, Direction.DOWN);
    scene.idle(20);
    scene.overlay.showText(60).text("Analog Levers make for a compact and precise source of redstone power").placeNearTarget().attachKeyFrame().pointAt(leverVec);
    scene.idle(70);
    IntegerProperty power = RedStoneWireBlock.POWER;
    scene.overlay.showControls(new InputWindowElement(leverVec, Pointing.DOWN).rightClick(), 40);
    scene.idle(7);
    for (int i = 0; i < 7; i++) {
        scene.idle(2);
        final int state = i + 1;
        scene.world.modifyTileNBT(leverSelection, AnalogLeverTileEntity.class, nbt -> nbt.putInt("State", state));
        scene.world.modifyBlock(wireLocations[i], s -> s.setValue(power, 7 - state), false);
        scene.effects.indicateRedstone(wireLocations[i]);
    }
    scene.idle(20);
    scene.overlay.showText(60).attachKeyFrame().text("Right-click to increase its analog power output").placeNearTarget().pointAt(leverVec);
    scene.idle(70);
    scene.overlay.showControls(new InputWindowElement(leverVec, Pointing.DOWN).rightClick().whileSneaking(), 40);
    scene.idle(7);
    for (int i = 7; i > 0; i--) {
        scene.idle(2);
        final int state = i - 1;
        if (i > 3) {
            scene.world.modifyTileNBT(leverSelection, AnalogLeverTileEntity.class, nbt -> nbt.putInt("State", state));
            scene.effects.indicateRedstone(wireLocations[i]);
        }
        scene.world.modifyBlock(wireLocations[i], s -> s.setValue(power, state > 2 ? 0 : 3 - state), false);
    }
    scene.world.modifyBlock(wireLocations[0], s -> s.setValue(power, 3), false);
    scene.idle(20);
    scene.overlay.showText(60).attachKeyFrame().text("Right-click while Sneaking to decrease the power output again").placeNearTarget().pointAt(leverVec);
    scene.idle(70);
    scene.overlay.showControls(new InputWindowElement(leverVec, Pointing.DOWN).rightClick(), 40);
    scene.idle(7);
    for (int i = 0; i < 15; i++) {
        scene.idle(2);
        final int state = i + 1;
        if (i >= 4) {
            scene.world.modifyTileNBT(leverSelection, AnalogLeverTileEntity.class, nbt -> nbt.putInt("State", state));
            scene.effects.indicateRedstone(wireLocations[i]);
        }
        scene.world.modifyBlock(wireLocations[i], s -> s.setValue(power, 15 - state), false);
    }
    scene.world.toggleRedstonePower(lamp);
    scene.effects.indicateRedstone(leverPos);
    scene.effects.indicateRedstone(util.grid.at(4, 1, 1));
    scene.idle(20);
}
Also used : IntegerProperty(net.minecraft.world.level.block.state.properties.IntegerProperty) 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)

Example 42 with Selection

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

the class FluidMovementActorScenes method transfer.

public static void transfer(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("portable_fluid_interface", "Contraption Fluid Exchange");
    scene.configureBasePlate(0, 0, 6);
    scene.scaleSceneView(0.95f);
    scene.setSceneOffsetY(-1);
    scene.showBasePlate();
    scene.idle(5);
    Selection pipes = util.select.fromTo(2, 1, 3, 0, 1, 3).add(util.select.position(0, 1, 4));
    BlockPos pumpPos = util.grid.at(0, 1, 4);
    Selection kinetics = util.select.fromTo(1, 1, 7, 1, 1, 4);
    Selection tank = util.select.fromTo(0, 1, 5, 0, 3, 5);
    Selection largeCog = util.select.position(2, 0, 7);
    FluidStack chocolate = new FluidStack(FluidHelper.convertToStill(AllFluids.CHOCOLATE.get()), 1000);
    BlockPos ct1 = util.grid.at(5, 3, 2);
    BlockPos ct2 = util.grid.at(6, 3, 2);
    BlockPos st = util.grid.at(0, 1, 5);
    Capability<IFluidHandler> fhc = CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY;
    Class<FluidTankTileEntity> type = FluidTankTileEntity.class;
    ItemStack bucket = AllFluids.CHOCOLATE.get().getAttributes().getBucket(chocolate);
    scene.world.modifyTileEntity(st, type, te -> te.getCapability(fhc).ifPresent(ifh -> ifh.fill(FluidHelper.copyStackWithAmount(chocolate, 10000), FluidAction.EXECUTE)));
    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, 4, 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("Fluid Tanks on moving contraptions cannot be accessed by any pipes");
    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 fluid tanks 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<PortableFluidInterfaceTileEntity> psiClass = PortableFluidInterfaceTileEntity.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, 4, 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 Tanks on the contraption");
    scene.idle(80);
    ElementLink<WorldSectionElement> p = scene.world.showIndependentSection(tank, Direction.DOWN);
    scene.world.moveSection(p, util.vector.of(0, 0, -1), 0);
    scene.idle(5);
    scene.world.showSectionAndMerge(pipes, Direction.EAST, p);
    scene.idle(5);
    scene.world.showSectionAndMerge(largeCog, Direction.UP, p);
    scene.world.showSectionAndMerge(kinetics, Direction.NORTH, p);
    scene.idle(10);
    scene.overlay.showText(70).placeNearTarget().pointAt(util.vector.topOf(pumpPos)).attachKeyFrame().text("Fluid can now be inserted...");
    scene.idle(30);
    for (int i = 0; i < 16; i++) {
        if (i == 8)
            scene.overlay.showControls(new InputWindowElement(util.vector.blockSurface(util.grid.at(5, 3, 2), Direction.WEST).add(0, 0.5, 0), Pointing.LEFT).withItem(bucket), 30);
        scene.world.modifyTileEntity(st, type, te -> te.getCapability(fhc).ifPresent(ifh -> ifh.drain(1000, FluidAction.EXECUTE)));
        scene.world.modifyTileEntity(ct1, type, te -> te.getCapability(fhc).ifPresent(ifh -> ifh.fill(chocolate, FluidAction.EXECUTE)));
        scene.idle(2);
    }
    for (int i = 0; i < 8; i++) {
        scene.world.modifyTileEntity(st, type, te -> te.getCapability(fhc).ifPresent(ifh -> ifh.drain(1000, FluidAction.EXECUTE)));
        scene.world.modifyTileEntity(ct2, type, te -> te.getCapability(fhc).ifPresent(ifh -> ifh.fill(chocolate, FluidAction.EXECUTE)));
        scene.idle(2);
    }
    scene.idle(50);
    scene.overlay.showText(40).placeNearTarget().pointAt(util.vector.topOf(pumpPos)).text("...or extracted from the contraption");
    scene.world.multiplyKineticSpeed(util.select.everywhere(), -1);
    scene.world.propagatePipeChange(pumpPos);
    scene.idle(30);
    for (int i = 0; i < 8; i++) {
        scene.world.modifyTileEntity(ct2, type, te -> te.getCapability(fhc).ifPresent(ifh -> ifh.drain(1000, FluidAction.EXECUTE)));
        scene.world.modifyTileEntity(st, type, te -> te.getCapability(fhc).ifPresent(ifh -> ifh.fill(chocolate, FluidAction.EXECUTE)));
        scene.idle(2);
    }
    for (int i = 0; i < 16; i++) {
        scene.world.modifyTileEntity(ct1, type, te -> te.getCapability(fhc).ifPresent(ifh -> ifh.drain(1000, FluidAction.EXECUTE)));
        scene.world.modifyTileEntity(st, type, te -> te.getCapability(fhc).ifPresent(ifh -> ifh.fill(chocolate, FluidAction.EXECUTE)));
        scene.idle(2);
    }
    scene.world.modifyTileEntity(util.grid.at(2, 2, 3), type, te -> te.getCapability(fhc).ifPresent(ifh -> ifh.drain(8000, FluidAction.EXECUTE)));
    scene.idle(50);
    scene.overlay.showText(120).placeNearTarget().attachKeyFrame().pointAt(util.vector.topOf(psi2)).text("After no contents 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 : AllFluids(com.simibubi.create.AllFluids) IFluidHandler(net.minecraftforge.fluids.capability.IFluidHandler) Selection(com.simibubi.create.foundation.ponder.Selection) 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) FluidHelper(com.simibubi.create.foundation.fluid.FluidHelper) Capability(net.minecraftforge.common.capabilities.Capability) 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) FluidStack(net.minecraftforge.fluids.FluidStack) FluidTankTileEntity(com.simibubi.create.content.contraptions.fluids.tank.FluidTankTileEntity) ItemStack(net.minecraft.world.item.ItemStack) PortableFluidInterfaceTileEntity(com.simibubi.create.content.contraptions.components.actors.PortableFluidInterfaceTileEntity) FluidTankTileEntity(com.simibubi.create.content.contraptions.fluids.tank.FluidTankTileEntity) Selection(com.simibubi.create.foundation.ponder.Selection) FluidStack(net.minecraftforge.fluids.FluidStack) PortableFluidInterfaceTileEntity(com.simibubi.create.content.contraptions.components.actors.PortableFluidInterfaceTileEntity) WorldSectionElement(com.simibubi.create.foundation.ponder.element.WorldSectionElement) IFluidHandler(net.minecraftforge.fluids.capability.IFluidHandler) InputWindowElement(com.simibubi.create.foundation.ponder.element.InputWindowElement) BlockPos(net.minecraft.core.BlockPos) ItemStack(net.minecraft.world.item.ItemStack)

Example 43 with Selection

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

the class FluidTankScenes method creative.

public static void creative(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("creative_fluid_tank", "Creative Fluid Tanks");
    scene.configureBasePlate(0, 0, 5);
    scene.showBasePlate();
    scene.idle(5);
    Selection largeCog = util.select.position(5, 0, 2);
    Selection cTank = util.select.fromTo(3, 1, 1, 3, 2, 1);
    Selection tank = util.select.fromTo(1, 1, 3, 1, 3, 3);
    Selection pipes = util.select.fromTo(3, 1, 2, 2, 1, 3);
    Selection cog = util.select.position(4, 1, 2);
    BlockPos cTankPos = util.grid.at(3, 1, 1);
    BlockPos pumpPos = util.grid.at(3, 1, 2);
    ElementLink<WorldSectionElement> cTankLink = scene.world.showIndependentSection(cTank, Direction.DOWN);
    scene.world.moveSection(cTankLink, util.vector.of(-1, 0, 1), 0);
    scene.overlay.showText(70).text("Creative Fluid Tanks can be used to provide a bottomless supply of fluid").attachKeyFrame().placeNearTarget().pointAt(util.vector.blockSurface(util.grid.at(2, 2, 2), Direction.WEST));
    scene.idle(80);
    ItemStack bucket = new ItemStack(Items.LAVA_BUCKET);
    scene.overlay.showControls(new InputWindowElement(util.vector.blockSurface(util.grid.at(2, 2, 2), Direction.NORTH), Pointing.RIGHT).rightClick().withItem(bucket), 40);
    scene.idle(7);
    scene.world.modifyTileEntity(cTankPos, CreativeFluidTankTileEntity.class, te -> ((CreativeSmartFluidTank) te.getTankInventory()).setContainedFluid(new FluidStack(Fluids.FLOWING_LAVA, 1000)));
    scene.idle(5);
    scene.overlay.showText(50).text("Right-Click with a fluid containing item to configure it").attachKeyFrame().placeNearTarget().pointAt(util.vector.blockSurface(util.grid.at(2, 2, 2), Direction.WEST));
    scene.idle(60);
    scene.world.moveSection(cTankLink, util.vector.of(1, 0, -1), 6);
    scene.idle(7);
    scene.world.showSection(tank, Direction.DOWN);
    scene.idle(5);
    scene.world.showSection(largeCog, Direction.UP);
    scene.world.showSection(cog, Direction.NORTH);
    scene.world.showSection(pipes, Direction.NORTH);
    scene.world.multiplyKineticSpeed(util.select.everywhere(), -1);
    scene.world.propagatePipeChange(pumpPos);
    scene.effects.rotationDirectionIndicator(pumpPos);
    scene.idle(40);
    scene.overlay.showText(70).text("Pipe Networks can now endlessly draw the assigned fluid from the tank").attachKeyFrame().placeNearTarget().pointAt(util.vector.blockSurface(util.grid.at(3, 1, 2), Direction.WEST));
    scene.idle(120);
    scene.world.multiplyKineticSpeed(util.select.everywhere(), -1);
    scene.world.propagatePipeChange(pumpPos);
    scene.effects.rotationDirectionIndicator(pumpPos);
    scene.idle(40);
    scene.overlay.showText(70).text("Any Fluids pushed back into a Creative Fluid Tank will be voided").attachKeyFrame().placeNearTarget().pointAt(util.vector.blockSurface(util.grid.at(3, 1, 2), Direction.WEST));
    scene.idle(40);
}
Also used : 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)

Example 44 with Selection

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

the class FluidTankScenes method sizes.

public static void sizes(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("fluid_tank_sizes", "Dimensions of a Fluid tank");
    scene.configureBasePlate(0, 0, 6);
    scene.scaleSceneView(0.9f);
    scene.showBasePlate();
    scene.idle(5);
    Selection single = util.select.position(0, 3, 0);
    Selection single2 = util.select.fromTo(1, 2, 1, 0, 2, 0);
    Selection single3 = util.select.fromTo(2, 1, 0, 0, 1, 2);
    ElementLink<WorldSectionElement> s1 = scene.world.showIndependentSection(single, Direction.DOWN);
    scene.world.moveSection(s1, util.vector.of(2, -2, 2), 0);
    scene.idle(10);
    scene.overlay.showText(60).text("Fluid Tanks can be combined to increase the total capacity").attachKeyFrame().placeNearTarget().pointAt(util.vector.topOf(2, 1, 2));
    scene.idle(40);
    ElementLink<WorldSectionElement> s2 = scene.world.showIndependentSection(single, Direction.DOWN);
    scene.world.moveSection(s2, util.vector.of(2, -2, 3), 0);
    scene.idle(5);
    ElementLink<WorldSectionElement> s3 = scene.world.showIndependentSection(single, Direction.DOWN);
    scene.world.moveSection(s3, util.vector.of(3, -2, 3), 0);
    scene.idle(5);
    ElementLink<WorldSectionElement> s4 = scene.world.showIndependentSection(single, Direction.DOWN);
    scene.world.moveSection(s4, util.vector.of(3, -2, 2), 0);
    scene.idle(10);
    scene.world.moveSection(s1, util.vector.of(0, -100, 0), 0);
    scene.world.moveSection(s2, util.vector.of(0, -100, 0), 0);
    scene.world.moveSection(s3, util.vector.of(0, -100, 0), 0);
    scene.world.moveSection(s4, util.vector.of(0, -100, 0), 0);
    ElementLink<WorldSectionElement> d = scene.world.showIndependentSectionImmediately(single2);
    scene.world.moveSection(d, util.vector.of(2, -1, 2), 0);
    scene.effects.indicateSuccess(util.grid.at(2, 1, 2));
    scene.effects.indicateSuccess(util.grid.at(3, 1, 2));
    scene.effects.indicateSuccess(util.grid.at(2, 1, 3));
    scene.effects.indicateSuccess(util.grid.at(3, 1, 3));
    scene.world.hideIndependentSection(s1, Direction.DOWN);
    scene.world.hideIndependentSection(s2, Direction.DOWN);
    scene.world.hideIndependentSection(s3, Direction.DOWN);
    scene.world.hideIndependentSection(s4, Direction.DOWN);
    scene.idle(25);
    scene.overlay.showText(60).text("Their base square can be up to 3 blocks wide...").attachKeyFrame().placeNearTarget().pointAt(util.vector.topOf(2, 1, 2));
    scene.idle(40);
    s1 = scene.world.showIndependentSection(single, Direction.DOWN);
    scene.world.moveSection(s1, util.vector.of(2, -2, 4), 0);
    scene.idle(3);
    s2 = scene.world.showIndependentSection(single, Direction.DOWN);
    scene.world.moveSection(s2, util.vector.of(3, -2, 4), 0);
    scene.idle(3);
    s3 = scene.world.showIndependentSection(single, Direction.DOWN);
    scene.world.moveSection(s3, util.vector.of(4, -2, 4), 0);
    scene.idle(3);
    s4 = scene.world.showIndependentSection(single, Direction.DOWN);
    scene.world.moveSection(s4, util.vector.of(4, -2, 3), 0);
    scene.idle(3);
    ElementLink<WorldSectionElement> s5 = scene.world.showIndependentSection(single, Direction.DOWN);
    scene.world.moveSection(s5, util.vector.of(4, -2, 2), 0);
    scene.idle(10);
    scene.world.moveSection(d, util.vector.of(0, -100, 0), 0);
    scene.world.moveSection(s1, util.vector.of(0, -100, 0), 0);
    scene.world.moveSection(s2, util.vector.of(0, -100, 0), 0);
    scene.world.moveSection(s3, util.vector.of(0, -100, 0), 0);
    scene.world.moveSection(s4, util.vector.of(0, -100, 0), 0);
    scene.world.moveSection(s5, util.vector.of(0, -100, 0), 0);
    ElementLink<WorldSectionElement> t = scene.world.showIndependentSectionImmediately(single3);
    scene.world.moveSection(t, util.vector.of(2, 0, 2), 0);
    for (int i = 2; i < 5; i++) for (int j = 2; j < 5; j++) scene.effects.indicateSuccess(util.grid.at(i, 1, j));
    scene.world.hideIndependentSection(d, Direction.DOWN);
    scene.world.hideIndependentSection(s1, Direction.DOWN);
    scene.world.hideIndependentSection(s2, Direction.DOWN);
    scene.world.hideIndependentSection(s3, Direction.DOWN);
    scene.world.hideIndependentSection(s4, Direction.DOWN);
    scene.world.hideIndependentSection(s5, Direction.DOWN);
    scene.idle(25);
    scene.world.hideIndependentSection(t, Direction.DOWN);
    scene.idle(10);
    Selection full1 = util.select.fromTo(5, 1, 0, 5, 6, 0);
    Selection full2 = util.select.fromTo(4, 1, 1, 3, 6, 2);
    Selection full3 = util.select.fromTo(0, 6, 5, 2, 1, 3);
    scene.world.showSection(full1, Direction.DOWN);
    scene.idle(5);
    scene.world.showSection(full2, Direction.DOWN);
    scene.idle(5);
    scene.world.showSection(full3, Direction.DOWN);
    scene.idle(10);
    Vec3 blockSurface = util.vector.blockSurface(util.grid.at(3, 3, 1), Direction.WEST);
    scene.overlay.showText(60).text("...and grow in height by more than 30 additional layers").attachKeyFrame().placeNearTarget().pointAt(blockSurface);
    scene.idle(70);
    scene.overlay.showControls(new InputWindowElement(util.vector.blockSurface(util.grid.at(3, 3, 1), Direction.NORTH), Pointing.RIGHT).rightClick().withWrench(), 60);
    scene.idle(7);
    scene.world.modifyBlocks(full2, s -> s.setValue(FluidTankBlock.SHAPE, FluidTankBlock.Shape.PLAIN), false);
    scene.idle(30);
    scene.overlay.showText(60).text("Using a Wrench, a tanks' window can be toggled").attachKeyFrame().placeNearTarget().pointAt(blockSurface);
    scene.idle(50);
}
Also used : Selection(com.simibubi.create.foundation.ponder.Selection) Vec3(net.minecraft.world.phys.Vec3) InputWindowElement(com.simibubi.create.foundation.ponder.element.InputWindowElement) WorldSectionElement(com.simibubi.create.foundation.ponder.element.WorldSectionElement)

Example 45 with Selection

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

the class HosePulleyScenes method infinite.

public static void infinite(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("hose_pulley_infinite", "Passively Filling and Draining large bodies of Fluid");
    scene.configureBasePlate(0, 0, 5);
    scene.setSceneOffsetY(-.5f);
    scene.scaleSceneView(.9f);
    scene.showBasePlate();
    scene.idle(5);
    Selection tank = util.select.fromTo(4, 1, 1, 4, 3, 1);
    Selection pipes = util.select.fromTo(3, 1, 1, 2, 3, 2);
    Selection kinetics = util.select.fromTo(5, 1, 2, 4, 2, 2).add(util.select.position(5, 0, 2));
    Selection hose = util.select.fromTo(1, 3, 2, 0, 3, 2);
    BlockPos pumpPos = util.grid.at(3, 2, 2);
    scene.world.showSection(hose, Direction.UP);
    scene.idle(5);
    scene.world.showSection(tank, Direction.DOWN);
    scene.idle(10);
    scene.world.showSection(pipes, Direction.NORTH);
    scene.idle(5);
    scene.world.showSection(kinetics, Direction.DOWN);
    scene.idle(10);
    scene.world.setKineticSpeed(hose, 32);
    scene.idle(10);
    Vec3 entryPoint = util.vector.topOf(1, 0, 2);
    scene.overlay.showText(60).text("When deploying the Hose Pulley into a large enough ocean...").attachKeyFrame().placeNearTarget().pointAt(entryPoint);
    scene.idle(40);
    scene.world.setKineticSpeed(hose, 0);
    scene.world.multiplyKineticSpeed(util.select.everywhere(), -1);
    scene.world.propagatePipeChange(pumpPos);
    scene.effects.rotationDirectionIndicator(pumpPos);
    scene.idle(30);
    Selection pulleyPos = util.select.position(1, 3, 2);
    scene.overlay.showSelectionWithText(pulleyPos, 60).text("It will provide/dispose fluids without affecting the source").attachKeyFrame().colored(PonderPalette.BLUE).placeNearTarget().pointAt(util.vector.topOf(util.grid.at(1, 3, 2)));
    scene.idle(80);
    scene.overlay.showText(60).text("Pipe networks can limitlessly take fluids from/to such pulleys").attachKeyFrame().placeNearTarget().pointAt(util.vector.blockSurface(util.grid.at(3, 2, 2), Direction.WEST));
    scene.idle(40);
}
Also used : Selection(com.simibubi.create.foundation.ponder.Selection) Vec3(net.minecraft.world.phys.Vec3) BlockPos(net.minecraft.core.BlockPos)

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