Search in sources :

Example 1 with SceneBuilder

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

the class ProcessingScenes method basin.

public static void basin(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("basin", "Processing Items in the Basin");
    scene.configureBasePlate(0, 0, 5);
    scene.world.showSection(util.select.layer(0), Direction.UP);
    scene.idle(5);
    scene.world.showSection(util.select.position(1, 1, 2), Direction.DOWN);
    scene.idle(10);
    BlockPos basinPos = util.grid.at(1, 2, 2);
    scene.world.modifyBlock(basinPos, s -> s.setValue(BasinBlock.FACING, Direction.DOWN), false);
    scene.world.showSection(util.select.position(basinPos), Direction.DOWN);
    scene.idle(10);
    Vec3 basinSide = util.vector.blockSurface(basinPos, Direction.WEST);
    scene.overlay.showText(80).attachKeyFrame().text("A Basin can hold Items and Fluids for Processing").pointAt(basinSide).placeNearTarget();
    scene.idle(10);
    ItemStack stack = new ItemStack(Items.BRICK);
    for (int i = 0; i < 4; i++) {
        scene.world.createItemEntity(util.vector.centerOf(basinPos.above(3)), util.vector.of(0, 0, 0), stack);
        scene.idle(10);
    }
    scene.idle(10);
    scene.overlay.showControls(new InputWindowElement(util.vector.topOf(basinPos), Pointing.DOWN).withItem(stack), 30);
    scene.idle(30);
    for (Direction d : Iterate.horizontalDirections) {
        scene.overlay.showOutline(PonderPalette.GREEN, new Object(), util.select.position(basinPos.below().relative(d)), 60);
        scene.idle(4);
    }
    scene.overlay.showText(80).attachKeyFrame().colored(PonderPalette.GREEN).text("After a processing step, basins try to output below to the side of them").pointAt(basinSide).placeNearTarget();
    scene.idle(90);
    ElementLink<WorldSectionElement> depot = scene.world.showIndependentSection(util.select.position(3, 1, 1), Direction.EAST);
    scene.world.moveSection(depot, util.vector.of(-2, 0, 0), 0);
    scene.idle(10);
    scene.world.modifyBlock(basinPos, s -> s.setValue(BasinBlock.FACING, Direction.NORTH), false);
    scene.idle(10);
    scene.overlay.showText(80).attachKeyFrame().colored(PonderPalette.GREEN).text("When a valid component is present, the Basin will show an output faucet").pointAt(basinSide.add(0.15, 0, -0.5)).placeNearTarget();
    scene.idle(90);
    scene.world.hideIndependentSection(depot, Direction.EAST);
    scene.idle(15);
    depot = scene.world.showIndependentSection(util.select.position(0, 1, 1), Direction.EAST);
    scene.world.moveSection(depot, util.vector.of(1, 0, 0), 0);
    scene.idle(20);
    scene.world.hideIndependentSection(depot, Direction.EAST);
    scene.overlay.showText(80).text("A number of options are applicable here").pointAt(util.vector.centerOf(util.grid.at(1, 1, 1))).placeNearTarget();
    scene.idle(15);
    depot = scene.world.showIndependentSection(util.select.position(1, 1, 0), Direction.EAST);
    scene.world.moveSection(depot, util.vector.of(0, 0, 1), 0);
    scene.idle(20);
    scene.world.hideIndependentSection(depot, Direction.EAST);
    scene.idle(15);
    depot = scene.world.showIndependentSection(util.select.position(1, 1, 1), Direction.EAST);
    scene.idle(20);
    scene.world.hideIndependentSection(depot, Direction.EAST);
    scene.idle(15);
    depot = scene.world.showIndependentSection(util.select.fromTo(3, 1, 0, 2, 1, 0), Direction.EAST);
    scene.world.moveSection(depot, util.vector.of(-2, 0, 1), 0);
    scene.idle(20);
    scene.world.hideIndependentSection(depot, Direction.EAST);
    scene.idle(15);
    depot = scene.world.showIndependentSection(util.select.position(2, 1, 1), Direction.EAST);
    scene.world.moveSection(depot, util.vector.of(-1, 0, 0), 0);
    scene.idle(25);
    BlockPos pressPos = util.grid.at(1, 4, 2);
    scene.world.showSection(util.select.position(pressPos), Direction.DOWN);
    scene.idle(5);
    scene.world.showSection(util.select.fromTo(1, 4, 3, 1, 1, 5), Direction.NORTH);
    scene.idle(10);
    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(basinPos), stack));
    scene.world.modifyTileNBT(util.select.position(basinPos), BasinTileEntity.class, nbt -> {
        nbt.put("VisualizedItems", NBTHelper.writeCompoundList(ImmutableList.of(IntAttached.with(1, new ItemStack(Blocks.BRICKS))), ia -> ia.getValue().serializeNBT()));
    });
    scene.idle(4);
    scene.overlay.showControls(new InputWindowElement(util.vector.topOf(basinPos.below().north()), Pointing.RIGHT).withItem(new ItemStack(Items.BRICKS)), 30);
    scene.overlay.showText(60).attachKeyFrame().colored(PonderPalette.GREEN).text("Outputs will be caught by the inventory below").pointAt(basinSide.add(0, -1, -1)).placeNearTarget();
    scene.idle(70);
    scene.world.hideIndependentSection(depot, Direction.NORTH);
    scene.idle(10);
    scene.world.modifyBlock(basinPos, s -> s.setValue(BasinBlock.FACING, Direction.DOWN), false);
    scene.idle(20);
    scene.overlay.showText(80).attachKeyFrame().text("Without output faucet, the Basin will retain items created in its processing").pointAt(basinSide).placeNearTarget();
    scene.idle(50);
    ItemStack nugget = AllItems.COPPER_NUGGET.asStack();
    scene.overlay.showControls(new InputWindowElement(util.vector.topOf(basinPos), Pointing.RIGHT).withItem(nugget), 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(basinPos), nugget));
    ItemStack ingot = new ItemStack(Items.COPPER_INGOT);
    scene.idle(30);
    scene.overlay.showControls(new InputWindowElement(util.vector.topOf(basinPos), Pointing.RIGHT).withItem(ingot), 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(basinPos), ingot));
    ItemStack block = new ItemStack(Items.COPPER_BLOCK);
    scene.idle(30);
    scene.overlay.showControls(new InputWindowElement(util.vector.topOf(basinPos), Pointing.RIGHT).withItem(block), 30);
    scene.overlay.showText(70).attachKeyFrame().colored(PonderPalette.GREEN).text("This can be useful if outputs should be re-used as ingredients").pointAt(basinSide).placeNearTarget();
    scene.idle(80);
    scene.world.showSection(util.select.fromTo(2, 2, 5, 4, 1, 2), Direction.DOWN);
    scene.rotateCameraY(70);
    scene.world.createItemOnBelt(util.grid.at(2, 1, 2), Direction.WEST, block);
    scene.idle(40);
    scene.overlay.showText(70).text("Desired outputs will then have to be extracted from the basin").pointAt(util.vector.topOf(util.grid.at(3, 1, 2)).subtract(0, 3 / 16f, 0)).placeNearTarget();
    scene.idle(80);
    Vec3 filter = util.vector.of(2.5, 2.85, 2.5);
    scene.overlay.showFilterSlotInput(filter, 80);
    scene.overlay.showText(70).text("A Filter might be necessary to avoid pulling out un-processed items").pointAt(filter).placeNearTarget();
    scene.idle(40);
    scene.markAsFinished();
}
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) WorldSectionElement(com.simibubi.create.foundation.ponder.element.WorldSectionElement) ItemStack(net.minecraft.world.item.ItemStack) Direction(net.minecraft.core.Direction) MechanicalPressTileEntity(com.simibubi.create.content.contraptions.components.press.MechanicalPressTileEntity)

Example 2 with SceneBuilder

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

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

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

the class PipeScenes method smart.

public static void smart(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("smart_pipe", "Controlling Fluid flow using Smart Pipes");
    scene.configureBasePlate(1, 0, 5);
    scene.showBasePlate();
    scene.idle(5);
    Selection tank1 = util.select.fromTo(4, 1, 3, 4, 2, 3);
    Selection tank2 = util.select.fromTo(4, 1, 4, 4, 2, 4);
    Selection additionalPipes = util.select.fromTo(3, 1, 4, 1, 1, 4);
    Selection mainPipes = util.select.fromTo(3, 1, 3, 1, 1, 1);
    Selection kinetics1 = util.select.fromTo(0, 0, 2, 0, 0, 5);
    Selection kinetics2 = util.select.position(1, 0, 5);
    BlockPos basinPos = util.grid.at(4, 1, 1);
    BlockPos pumpPos = util.grid.at(1, 1, 2);
    Selection pump = util.select.position(1, 1, 2);
    Selection basin = util.select.position(basinPos);
    BlockPos smartPos = util.grid.at(3, 1, 1);
    scene.world.modifyTileEntity(basinPos, BasinTileEntity.class, te -> te.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY).ifPresent(ifh -> ifh.fill(new FluidStack(ForgeMod.MILK.get(), 1000), FluidAction.EXECUTE)));
    scene.world.setBlock(util.grid.at(3, 1, 3), AllBlocks.FLUID_PIPE.get().getAxisState(Axis.X), false);
    scene.world.setBlock(smartPos, AllBlocks.FLUID_PIPE.get().getAxisState(Axis.X), false);
    scene.world.setBlock(util.grid.at(2, 1, 3), AllBlocks.GLASS_FLUID_PIPE.getDefaultState().setValue(GlassFluidPipeBlock.AXIS, Axis.X), false);
    scene.world.setBlock(util.grid.at(1, 1, 3), AllBlocks.FLUID_PIPE.get().getAxisState(Axis.X).setValue(FluidPipeBlock.NORTH, true).setValue(FluidPipeBlock.WEST, false), false);
    scene.world.showSection(basin, Direction.DOWN);
    scene.idle(5);
    scene.world.showSection(tank1, Direction.DOWN);
    scene.idle(5);
    scene.world.showSection(mainPipes, Direction.EAST);
    scene.idle(15);
    scene.world.destroyBlock(smartPos);
    scene.world.restoreBlocks(util.select.position(smartPos));
    Vec3 filterVec = util.vector.topOf(smartPos).subtract(0.25, 0, 0);
    scene.overlay.showText(50).placeNearTarget().text("Smart pipes can help control flows by fluid type").attachKeyFrame().pointAt(filterVec);
    scene.idle(60);
    scene.overlay.showSelectionWithText(util.select.position(basinPos), 80).placeNearTarget().colored(PonderPalette.GREEN).text("When placed directly at the source, they can specify the type of fluid to extract").attachKeyFrame().pointAt(filterVec);
    scene.idle(90);
    FluidStack chocolate = new FluidStack(FluidHelper.convertToStill(AllFluids.CHOCOLATE.get()), 1000);
    ItemStack bucket = AllFluids.CHOCOLATE.get().getAttributes().getBucket(chocolate);
    ItemStack milkBucket = new ItemStack(Items.MILK_BUCKET);
    scene.overlay.showControls(new InputWindowElement(filterVec, Pointing.DOWN).rightClick().withItem(bucket), 80);
    scene.idle(7);
    scene.world.setFilterData(util.select.position(3, 1, 1), SmartFluidPipeTileEntity.class, bucket);
    scene.idle(10);
    scene.overlay.showText(60).placeNearTarget().attachKeyFrame().text("Simply Right-Click their filter slot with any item containing the desired fluid").pointAt(filterVec);
    scene.idle(50);
    scene.world.showSection(kinetics2, Direction.WEST);
    scene.world.setKineticSpeed(kinetics2, 64);
    scene.idle(5);
    scene.world.showSection(kinetics1, Direction.EAST);
    scene.world.setKineticSpeed(kinetics1, -64);
    scene.idle(10);
    scene.world.setKineticSpeed(pump, 128);
    scene.world.propagatePipeChange(pumpPos);
    scene.idle(120);
    scene.world.setKineticSpeed(util.select.everywhere(), 0);
    scene.world.propagatePipeChange(pumpPos);
    scene.effects.rotationSpeedIndicator(pumpPos);
    scene.idle(15);
    scene.world.showSection(tank2, Direction.DOWN);
    scene.world.showSection(additionalPipes, Direction.NORTH);
    scene.world.setBlock(util.grid.at(3, 1, 1), AllBlocks.FLUID_PIPE.get().getAxisState(Axis.X), true);
    scene.idle(10);
    for (int i = 0; i < 3; i++) {
        BlockPos pos = util.grid.at(1 + i, 1, 3);
        scene.world.destroyBlock(pos);
        scene.world.restoreBlocks(util.select.position(pos));
        scene.idle(2);
    }
    scene.idle(15);
    scene.world.modifyTileEntity(basinPos, BasinTileEntity.class, te -> te.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY).ifPresent(ifh -> ifh.fill(chocolate, FluidAction.EXECUTE)));
    scene.idle(10);
    scene.overlay.showText(80).placeNearTarget().colored(PonderPalette.GREEN).text("When placed further down a pipe network, smart pipes will only let matching fluids continue").attachKeyFrame().pointAt(filterVec.add(-1, 0, 2));
    scene.idle(90);
    scene.overlay.showControls(new InputWindowElement(filterVec.add(-1, 0, 3), Pointing.DOWN).rightClick().withItem(milkBucket), 30);
    scene.idle(7);
    scene.world.setFilterData(util.select.position(2, 1, 4), SmartFluidPipeTileEntity.class, milkBucket);
    scene.idle(30);
    scene.overlay.showControls(new InputWindowElement(filterVec.add(-1, 0, 2), Pointing.DOWN).rightClick().withItem(bucket), 30);
    scene.idle(7);
    scene.world.setFilterData(util.select.position(2, 1, 3), SmartFluidPipeTileEntity.class, bucket);
    scene.idle(30);
    scene.world.setKineticSpeed(kinetics2, 64);
    scene.world.setKineticSpeed(kinetics1, -64);
    scene.world.setKineticSpeed(pump, 128);
    scene.world.propagatePipeChange(pumpPos);
    scene.effects.rotationSpeedIndicator(pumpPos);
    scene.idle(40);
}
Also used : SmartFluidTankBehaviour(com.simibubi.create.foundation.tileEntity.behaviour.fluid.SmartFluidTankBehaviour) AllFluids(com.simibubi.create.AllFluids) FluidValveBlock(com.simibubi.create.content.contraptions.fluids.pipes.FluidValveBlock) GlassFluidPipeBlock(com.simibubi.create.content.contraptions.fluids.pipes.GlassFluidPipeBlock) Items(net.minecraft.world.item.Items) AABB(net.minecraft.world.phys.AABB) SceneBuilder(com.simibubi.create.foundation.ponder.SceneBuilder) InputWindowElement(com.simibubi.create.foundation.ponder.element.InputWindowElement) Direction(net.minecraft.core.Direction) FluidAction(net.minecraftforge.fluids.capability.IFluidHandler.FluidAction) ForgeMod(net.minecraftforge.common.ForgeMod) BasinTileEntity(com.simibubi.create.content.contraptions.processing.BasinTileEntity) Pointing(com.simibubi.create.foundation.utility.Pointing) BlockState(net.minecraft.world.level.block.state.BlockState) BeehiveBlock(net.minecraft.world.level.block.BeehiveBlock) Axis(net.minecraft.core.Direction.Axis) BooleanProperty(net.minecraft.world.level.block.state.properties.BooleanProperty) ElementLink(com.simibubi.create.foundation.ponder.ElementLink) PonderPalette(com.simibubi.create.foundation.ponder.PonderPalette) PumpBlock(com.simibubi.create.content.contraptions.fluids.PumpBlock) FluidPipeBlock(com.simibubi.create.content.contraptions.fluids.pipes.FluidPipeBlock) Fluids(net.minecraft.world.level.material.Fluids) AllBlocks(com.simibubi.create.AllBlocks) Selection(com.simibubi.create.foundation.ponder.Selection) CapabilityFluidHandler(net.minecraftforge.fluids.capability.CapabilityFluidHandler) SmartFluidPipeTileEntity(com.simibubi.create.content.contraptions.fluids.pipes.SmartFluidPipeTileEntity) SceneBuildingUtil(com.simibubi.create.foundation.ponder.SceneBuildingUtil) FluidHelper(com.simibubi.create.foundation.fluid.FluidHelper) ItemDrainTileEntity(com.simibubi.create.content.contraptions.fluids.actors.ItemDrainTileEntity) Blocks(net.minecraft.world.level.block.Blocks) AxisPipeBlock(com.simibubi.create.content.contraptions.fluids.pipes.AxisPipeBlock) WorldSectionElement(com.simibubi.create.foundation.ponder.element.WorldSectionElement) BlockPos(net.minecraft.core.BlockPos) Vec3(net.minecraft.world.phys.Vec3) FluidValveTileEntity(com.simibubi.create.content.contraptions.fluids.pipes.FluidValveTileEntity) FluidStack(net.minecraftforge.fluids.FluidStack) FluidTankTileEntity(com.simibubi.create.content.contraptions.fluids.tank.FluidTankTileEntity) ItemStack(net.minecraft.world.item.ItemStack) 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) ItemStack(net.minecraft.world.item.ItemStack)

Example 5 with SceneBuilder

use of com.simibubi.create.foundation.ponder.SceneBuilder in project FrostedHeart by TeamMoegMC.

the class MixinProcessingScenes method pressing.

/**
 * @author khjxiaogu
 * @reason change mechanical press scene to fit TWR
 */
@Overwrite(remap = false)
public static void pressing(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("mechanical_press", "Processing Items with the Mechanical Press");
    scene.configureBasePlate(0, 0, 5);
    scene.world.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);
    Vector3d basinSide = util.vector.blockSurface(basin, Direction.WEST);
    ItemStack copper = AllItems.COPPER_INGOT.asStack();
    ItemStack copperBlock = AllItems.COPPER_SHEET.asStack();
    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().with(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);
    Vector3d 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 : Mode(com.simibubi.create.content.contraptions.components.press.MechanicalPressTileEntity.Mode) SceneBuilder(com.simibubi.create.foundation.ponder.SceneBuilder) BasinTileEntity(com.simibubi.create.content.contraptions.processing.BasinTileEntity) SceneBuildingUtil(com.simibubi.create.foundation.ponder.SceneBuildingUtil) Pointing(com.simibubi.create.foundation.utility.Pointing) BlockPos(net.minecraft.util.math.BlockPos) Overwrite(org.spongepowered.asm.mixin.Overwrite) MechanicalPressTileEntity(com.simibubi.create.content.contraptions.components.press.MechanicalPressTileEntity) BlazeBurnerBlock(com.simibubi.create.content.contraptions.processing.burner.BlazeBurnerBlock) Items(net.minecraft.item.Items) Direction(net.minecraft.util.Direction) AllItems(com.simibubi.create.AllItems) HeatLevel(com.simibubi.create.content.contraptions.processing.burner.BlazeBurnerBlock.HeatLevel) IntAttached(com.simibubi.create.foundation.utility.IntAttached) ItemStack(net.minecraft.item.ItemStack) Vector3d(net.minecraft.util.math.vector.Vector3d) ImmutableList(com.google.common.collect.ImmutableList) Mixin(org.spongepowered.asm.mixin.Mixin) ProcessingScenes(com.simibubi.create.foundation.ponder.content.ProcessingScenes) NBTHelper(com.simibubi.create.foundation.utility.NBTHelper) InputWindowElement(com.simibubi.create.foundation.ponder.elements.InputWindowElement) AllBlocks(com.simibubi.create.AllBlocks) Vector3d(net.minecraft.util.math.vector.Vector3d) InputWindowElement(com.simibubi.create.foundation.ponder.elements.InputWindowElement) BlockPos(net.minecraft.util.math.BlockPos) ItemStack(net.minecraft.item.ItemStack) MechanicalPressTileEntity(com.simibubi.create.content.contraptions.components.press.MechanicalPressTileEntity) Overwrite(org.spongepowered.asm.mixin.Overwrite)

Aggregations

SceneBuilder (com.simibubi.create.foundation.ponder.SceneBuilder)13 SceneBuildingUtil (com.simibubi.create.foundation.ponder.SceneBuildingUtil)12 Selection (com.simibubi.create.foundation.ponder.Selection)12 WorldSectionElement (com.simibubi.create.foundation.ponder.element.WorldSectionElement)12 BlockPos (net.minecraft.core.BlockPos)12 ElementLink (com.simibubi.create.foundation.ponder.ElementLink)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