use of com.simibubi.create.foundation.ponder.ElementLink 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();
}
use of com.simibubi.create.foundation.ponder.ElementLink in project Create by Creators-of-Create.
the class TunnelScenes method brass.
public static void brass(SceneBuilder scene, SceneBuildingUtil util) {
scene.title("brass_tunnel", "Using Brass Tunnels");
scene.configureBasePlate(1, 0, 5);
scene.world.cycleBlockProperty(util.grid.at(3, 1, 2), BeltBlock.CASING);
scene.world.showSection(util.select.layer(0), Direction.UP);
scene.idle(5);
scene.world.showSection(util.select.fromTo(5, 1, 5, 5, 1, 3), Direction.DOWN);
scene.idle(5);
scene.world.showSection(util.select.fromTo(5, 1, 2, 1, 1, 2), Direction.SOUTH);
scene.idle(10);
Vector<ElementLink<WorldSectionElement>> tunnels = new Vector<>(3);
for (int i = 0; i < 3; i++) {
tunnels.add(scene.world.showIndependentSection(util.select.position(2 + i, 2, 4), Direction.DOWN));
scene.world.moveSection(tunnels.get(i), util.vector.of(0, 0, -2), 0);
scene.idle(4);
}
for (int i = 0; i < 3; i++) {
scene.world.cycleBlockProperty(util.grid.at(2 + i, 1, 2), BeltBlock.CASING);
scene.world.modifyTileNBT(util.select.position(2 + i, 1, 2), BeltTileEntity.class, nbt -> NBTHelper.writeEnum(nbt, "Casing", BeltTileEntity.CasingType.BRASS), true);
scene.idle(4);
}
scene.overlay.showText(60).attachKeyFrame().pointAt(util.vector.topOf(util.grid.at(2, 2, 2))).placeNearTarget().text("Brass Tunnels can be used to cover up your belts");
scene.idle(70);
for (int i = 0; i < 3; i++) {
scene.world.cycleBlockProperty(util.grid.at(2 + i, 1, 2), BeltBlock.CASING);
scene.world.hideIndependentSection(tunnels.get(i), Direction.UP);
scene.idle(4);
}
scene.idle(10);
scene.world.showSection(util.select.fromTo(3, 1, 0, 1, 1, 1), Direction.SOUTH);
scene.idle(10);
scene.world.showSection(util.select.position(3, 2, 2), Direction.DOWN);
scene.idle(10);
scene.world.cycleBlockProperty(util.grid.at(3, 1, 2), BeltBlock.CASING);
scene.idle(10);
BlockPos tunnelPos = util.grid.at(3, 2, 2);
for (Direction d : Iterate.horizontalDirections) {
if (d == Direction.SOUTH)
continue;
Vec3 filter = getTunnelFilterVec(tunnelPos, d);
scene.overlay.showFilterSlotInput(filter, 40);
scene.idle(3);
}
scene.overlay.showText(60).attachKeyFrame().pointAt(getTunnelFilterVec(tunnelPos, Direction.WEST)).placeNearTarget().text("Brass Tunnels have filter slots on each open side");
scene.idle(70);
scene.rotateCameraY(70);
scene.idle(20);
Vec3 tunnelFilterVec = getTunnelFilterVec(tunnelPos, Direction.EAST);
scene.overlay.showFilterSlotInput(tunnelFilterVec, 40);
scene.overlay.showText(60).attachKeyFrame().pointAt(tunnelFilterVec).placeNearTarget().text("Filters on inbound connections simply block non-matching items");
ItemStack copper = new ItemStack(Items.COPPER_INGOT);
Class<BrassTunnelTileEntity> tunnelClass = BrassTunnelTileEntity.class;
scene.world.modifyTileEntity(tunnelPos, tunnelClass, te -> te.getBehaviour(SidedFilteringBehaviour.TYPE).setFilter(Direction.EAST, copper));
scene.overlay.showControls(new InputWindowElement(tunnelFilterVec, Pointing.DOWN).withItem(copper), 30);
ItemStack zinc = AllItems.ZINC_INGOT.asStack();
scene.world.createItemOnBelt(util.grid.at(5, 1, 2), Direction.EAST, zinc);
scene.idle(70);
scene.world.multiplyKineticSpeed(util.select.everywhere(), -2);
scene.idle(20);
scene.rotateCameraY(-70);
scene.world.multiplyKineticSpeed(util.select.everywhere(), -.5f);
scene.idle(20);
scene.world.modifyTileEntity(tunnelPos, tunnelClass, te -> te.getBehaviour(SidedFilteringBehaviour.TYPE).setFilter(Direction.EAST, ItemStack.EMPTY));
tunnelFilterVec = getTunnelFilterVec(tunnelPos, Direction.NORTH);
scene.overlay.showFilterSlotInput(tunnelFilterVec, 40);
tunnelFilterVec = getTunnelFilterVec(tunnelPos, Direction.WEST);
scene.overlay.showFilterSlotInput(tunnelFilterVec, 40);
scene.overlay.showText(60).attachKeyFrame().pointAt(tunnelFilterVec).placeNearTarget().text("Filters on outbound connections can be used to sort items by type");
scene.idle(70);
scene.overlay.showControls(new InputWindowElement(tunnelFilterVec, Pointing.LEFT).withItem(copper), 30);
scene.world.modifyTileEntity(tunnelPos, tunnelClass, te -> te.getBehaviour(SidedFilteringBehaviour.TYPE).setFilter(Direction.WEST, copper));
scene.idle(4);
tunnelFilterVec = getTunnelFilterVec(tunnelPos, Direction.NORTH);
scene.overlay.showControls(new InputWindowElement(tunnelFilterVec, Pointing.RIGHT).withItem(zinc), 30);
scene.world.modifyTileEntity(tunnelPos, tunnelClass, te -> te.getBehaviour(SidedFilteringBehaviour.TYPE).setFilter(Direction.NORTH, zinc));
scene.world.multiplyKineticSpeed(util.select.everywhere(), 1.5f);
for (int i = 0; i < 6; i++) {
scene.world.createItemOnBelt(util.grid.at(5, 1, 2), Direction.EAST, i % 2 == 0 ? zinc : copper);
scene.idle(12);
}
scene.idle(30);
scene.world.modifyTileEntity(tunnelPos, tunnelClass, te -> te.getBehaviour(SidedFilteringBehaviour.TYPE).setFilter(Direction.NORTH, ItemStack.EMPTY));
scene.world.modifyTileEntity(tunnelPos, tunnelClass, te -> te.getBehaviour(SidedFilteringBehaviour.TYPE).setFilter(Direction.WEST, ItemStack.EMPTY));
scene.idle(10);
Vec3 tunnelTop = util.vector.topOf(tunnelPos);
scene.overlay.showControls(new InputWindowElement(tunnelTop, Pointing.DOWN).scroll().withWrench(), 80);
scene.idle(7);
scene.overlay.showCenteredScrollInput(tunnelPos, Direction.UP, 120);
scene.overlay.showText(120).attachKeyFrame().pointAt(tunnelTop).placeNearTarget().text("Whenever a passing item has multiple valid exits, the distribution mode will decide how to handle it");
for (int i = 0; i < 3; i++) {
scene.idle(40);
scene.world.createItemOnBelt(util.grid.at(5, 1, 2), Direction.EAST, AllItems.BRASS_INGOT.asStack(63));
}
scene.idle(30);
scene.world.hideSection(util.select.position(3, 2, 2), Direction.UP);
scene.idle(5);
scene.world.hideSection(util.select.fromTo(5, 1, 2, 1, 1, 0), Direction.UP);
scene.idle(15);
ElementLink<WorldSectionElement> newBelt = scene.world.showIndependentSection(util.select.fromTo(3, 3, 2, 0, 3, 4).add(util.select.fromTo(5, 3, 3, 4, 3, 3)), Direction.DOWN);
scene.world.moveSection(newBelt, util.vector.of(0, -2, -1), 0);
scene.idle(15);
for (int i = 0; i < 3; i++) {
scene.idle(4);
scene.world.showSectionAndMerge(util.select.position(3, 4, 2 + i), Direction.DOWN, newBelt);
}
scene.overlay.showSelectionWithText(util.select.fromTo(3, 1, 1, 3, 2, 3), 80).attachKeyFrame().placeNearTarget().text("Brass Tunnels on parallel belts will form a group");
scene.idle(90);
ItemStack item1 = new ItemStack(Items.CARROT);
ItemStack item2 = new ItemStack(Items.HONEY_BOTTLE);
ItemStack item3 = new ItemStack(Items.SWEET_BERRIES);
tunnelFilterVec = getTunnelFilterVec(tunnelPos, Direction.WEST);
BlockPos newTunnelPos = tunnelPos.above(2).south();
scene.overlay.showControls(new InputWindowElement(tunnelFilterVec.add(0, 0, -1), Pointing.RIGHT).withItem(item1), 20);
scene.world.modifyTileEntity(newTunnelPos.north(), tunnelClass, te -> te.getBehaviour(SidedFilteringBehaviour.TYPE).setFilter(Direction.WEST, item1));
scene.idle(4);
scene.overlay.showControls(new InputWindowElement(tunnelFilterVec, Pointing.DOWN).withItem(item2), 20);
scene.world.modifyTileEntity(newTunnelPos, tunnelClass, te -> te.getBehaviour(SidedFilteringBehaviour.TYPE).setFilter(Direction.WEST, item2));
scene.idle(4);
scene.overlay.showControls(new InputWindowElement(tunnelFilterVec.add(0, 0, 1), Pointing.LEFT).withItem(item3), 20);
scene.world.modifyTileEntity(newTunnelPos.south(), tunnelClass, te -> te.getBehaviour(SidedFilteringBehaviour.TYPE).setFilter(Direction.WEST, item3));
scene.idle(30);
scene.overlay.showText(80).pointAt(tunnelTop).placeNearTarget().text("Incoming Items will now be distributed across all connected exits");
scene.idle(90);
BlockPos beltPos = util.grid.at(5, 3, 3);
Vec3 m = util.vector.of(0, 0.1, 0);
Vec3 spawn = util.vector.centerOf(util.grid.at(5, 3, 2));
scene.world.createItemEntity(spawn, m, item1);
scene.idle(12);
scene.world.createItemOnBelt(beltPos, Direction.UP, item1);
scene.world.modifyEntities(ItemEntity.class, Entity::discard);
scene.world.createItemEntity(spawn, m, item2);
scene.idle(12);
scene.world.createItemOnBelt(beltPos, Direction.UP, item2);
scene.world.modifyEntities(ItemEntity.class, Entity::discard);
scene.world.createItemEntity(spawn, m, item3);
scene.idle(12);
scene.world.createItemOnBelt(beltPos, Direction.UP, item3);
scene.world.modifyEntities(ItemEntity.class, Entity::discard);
scene.idle(50);
scene.world.showSectionAndMerge(util.select.position(3, 5, 2), Direction.DOWN, newBelt);
scene.overlay.showText(80).pointAt(util.vector.blockSurface(tunnelPos.above().north(), Direction.WEST)).placeNearTarget().text("For this, items can also be inserted into the Tunnel block directly");
scene.idle(20);
beltPos = util.grid.at(3, 3, 3);
spawn = util.vector.centerOf(util.grid.at(3, 5, 1));
scene.world.createItemEntity(spawn, m, item1);
scene.idle(12);
scene.world.createItemOnBelt(beltPos, Direction.EAST, item1);
scene.world.modifyEntities(ItemEntity.class, Entity::discard);
scene.world.createItemEntity(spawn, m, item2);
scene.idle(12);
scene.world.createItemOnBelt(beltPos, Direction.EAST, item2);
scene.world.modifyEntities(ItemEntity.class, Entity::discard);
scene.world.createItemEntity(spawn, m, item3);
scene.idle(12);
scene.world.createItemOnBelt(beltPos, Direction.EAST, item3);
scene.world.modifyEntities(ItemEntity.class, Entity::discard);
scene.idle(30);
}
use of com.simibubi.create.foundation.ponder.ElementLink 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);
}
use of com.simibubi.create.foundation.ponder.ElementLink 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);
}
use of com.simibubi.create.foundation.ponder.ElementLink in project Create by Creators-of-Create.
the class BearingScenes method sails.
private static void sails(SceneBuilder scene, SceneBuildingUtil util, boolean frame) {
String plural = frame ? "Sail Frames" : "Sails";
scene.title(frame ? "sail_frame" : "sail", "Assembling Windmills using " + plural);
scene.configureBasePlate(0, 0, 5);
scene.scaleSceneView(0.9f);
scene.world.showSection(util.select.layer(0), Direction.UP);
scene.idle(5);
BlockPos bearingPos = util.grid.at(2, 1, 2);
scene.world.showSection(util.select.position(bearingPos), Direction.DOWN);
scene.idle(5);
ElementLink<WorldSectionElement> plank = scene.world.showIndependentSection(util.select.position(bearingPos.above()), Direction.DOWN);
scene.idle(10);
for (int i = 0; i < 3; i++) {
for (Direction d : Iterate.horizontalDirections) {
BlockPos location = bearingPos.above(i + 1).relative(d);
if (frame)
scene.world.modifyBlock(location, s -> AllBlocks.SAIL_FRAME.getDefaultState().setValue(SailBlock.FACING, s.getValue(SailBlock.FACING)), false);
scene.world.showSectionAndMerge(util.select.position(location), d.getOpposite(), plank);
scene.idle(2);
}
}
scene.overlay.showText(70).text(plural + " are handy blocks to create Windmills with").pointAt(util.vector.blockSurface(util.grid.at(1, 3, 2), Direction.WEST)).placeNearTarget().attachKeyFrame();
scene.idle(80);
scene.overlay.showSelectionWithText(util.select.position(bearingPos.above()), 80).colored(PonderPalette.GREEN).text("They will attach to blocks and each other without the need of Super Glue or Chassis Blocks").attachKeyFrame().placeNearTarget();
scene.idle(40);
scene.world.configureCenterOfRotation(plank, util.vector.centerOf(bearingPos));
if (!frame) {
scene.world.rotateBearing(bearingPos, 180, 75);
scene.world.rotateSection(plank, 0, 180, 0, 75);
scene.idle(76);
scene.world.rotateBearing(bearingPos, 180, 0);
scene.world.rotateSection(plank, 0, 180, 0, 0);
scene.rotateCameraY(-30);
scene.idle(10);
InputWindowElement input = new InputWindowElement(util.vector.blockSurface(util.grid.at(2, 3, 1), Direction.NORTH), Pointing.RIGHT).withItem(new ItemStack(Items.BLUE_DYE));
scene.overlay.showControls(input, 30);
scene.idle(7);
scene.world.setBlock(util.grid.at(2, 3, 1), AllBlocks.DYED_SAILS.get(DyeColor.BLUE).getDefaultState().setValue(SailBlock.FACING, Direction.WEST), false);
scene.idle(10);
scene.overlay.showText(40).colored(PonderPalette.BLUE).text("Right-Click with Dye to paint them").attachKeyFrame().pointAt(util.vector.blockSurface(util.grid.at(2, 3, 1), Direction.WEST)).placeNearTarget();
scene.idle(20);
scene.overlay.showControls(input, 30);
scene.idle(7);
scene.world.replaceBlocks(util.select.fromTo(2, 2, 1, 2, 4, 1), AllBlocks.DYED_SAILS.get(DyeColor.BLUE).getDefaultState().setValue(SailBlock.FACING, Direction.WEST), false);
scene.idle(20);
scene.world.rotateBearing(bearingPos, 90, 33);
scene.world.rotateSection(plank, 0, 90, 0, 33);
scene.idle(40);
input = new InputWindowElement(util.vector.blockSurface(util.grid.at(2, 3, 1), Direction.NORTH), Pointing.RIGHT).withItem(new ItemStack(Items.SHEARS));
scene.overlay.showControls(input, 30);
scene.idle(7);
scene.world.setBlock(util.grid.at(3, 3, 2), AllBlocks.SAIL_FRAME.getDefaultState().setValue(SailBlock.FACING, Direction.NORTH), false);
scene.idle(10);
scene.overlay.showText(40).text("Right-Click with Shears to turn them back into frames").attachKeyFrame().pointAt(util.vector.blockSurface(util.grid.at(2, 3, 1), Direction.WEST)).placeNearTarget();
scene.idle(20);
scene.overlay.showControls(input, 30);
scene.idle(7);
scene.world.replaceBlocks(util.select.fromTo(3, 2, 2, 3, 4, 2), AllBlocks.SAIL_FRAME.getDefaultState().setValue(SailBlock.FACING, Direction.NORTH), false);
scene.idle(20);
}
scene.world.rotateBearing(bearingPos, 720, 300);
scene.world.rotateSection(plank, 0, 720, 0, 300);
}
Aggregations