Search in sources :

Example 66 with WorldSectionElement

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

the class GantryScenes method subgantry.

public static void subgantry(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("gantry_cascaded", "Cascaded Gantries");
    scene.configureBasePlate(0, 0, 5);
    scene.setSceneOffsetY(-1);
    scene.world.modifyKineticSpeed(util.select.everywhere(), f -> -2 * f);
    scene.world.showSection(util.select.layer(0).add(util.select.column(5, 3)).add(util.select.fromTo(2, 1, 3, 4, 1, 3)), Direction.UP);
    scene.idle(10);
    BlockPos gantryPos = util.grid.at(5, 1, 2);
    BlockPos gantryPos2 = util.grid.at(3, 2, 2);
    ElementLink<WorldSectionElement> gantry = scene.world.showIndependentSection(util.select.position(gantryPos), Direction.SOUTH);
    scene.idle(5);
    scene.world.showSectionAndMerge(util.select.fromTo(0, 1, 2, 4, 1, 2), Direction.EAST, gantry);
    scene.idle(15);
    scene.world.moveSection(gantry, util.vector.of(0, 2, 0), 40);
    scene.overlay.showText(60).attachKeyFrame().text("Gantry shafts attach to a carriage without the need of super glue").independent(20);
    scene.idle(40);
    scene.world.modifyKineticSpeed(util.select.everywhere(), f -> -f);
    scene.world.moveSection(gantry, util.vector.of(0, -2, 0), 40);
    scene.idle(40);
    ElementLink<WorldSectionElement> secondGantry = scene.world.showIndependentSection(util.select.position(gantryPos2), Direction.DOWN);
    scene.idle(15);
    scene.overlay.showText(60).attachKeyFrame().text("Same applies for carriages on moved Gantry Shafts").independent(20);
    scene.idle(15);
    scene.world.moveSection(gantry, util.vector.of(0, 2, 0), 40);
    scene.world.moveSection(secondGantry, util.vector.of(0, 2, 0), 40);
    scene.idle(40);
    BlockPos leverPos = util.grid.at(2, 1, 3);
    scene.world.toggleRedstonePower(util.select.position(leverPos));
    scene.world.toggleRedstonePower(util.select.fromTo(3, 1, 3, 4, 1, 3));
    scene.world.toggleRedstonePower(util.select.fromTo(5, 1, 3, 5, 4, 3));
    scene.world.modifyKineticSpeed(util.select.fromTo(0, 1, 2, 5, 1, 2), f -> -32f);
    scene.effects.indicateRedstone(leverPos);
    scene.world.moveSection(secondGantry, util.vector.of(-3, 0, 0), 60);
    scene.idle(20);
    scene.overlay.showText(120).text("Thus, a gantry system can be cascaded to cover multiple axes of movement").independent(20);
}
Also used : BlockPos(net.minecraft.core.BlockPos) WorldSectionElement(com.simibubi.create.foundation.ponder.element.WorldSectionElement)

Example 67 with WorldSectionElement

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

the class ItemVaultScenes method storage.

public static void storage(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("item_vault_storage", "Storing Items in Vaults");
    scene.configureBasePlate(0, 0, 5);
    scene.showBasePlate();
    scene.idle(5);
    Selection chests = util.select.fromTo(4, 3, 2, 3, 4, 3);
    Selection largeCog = util.select.position(3, 0, 5);
    Selection belt1 = util.select.fromTo(0, 2, 3, 2, 1, 5);
    Selection gearbox = util.select.position(2, 1, 2);
    Selection belt2 = util.select.fromTo(0, 1, 1, 2, 2, 1);
    Selection vault = util.select.fromTo(3, 2, 3, 4, 1, 1);
    scene.world.showSection(vault, Direction.NORTH);
    scene.idle(5);
    ElementLink<WorldSectionElement> chestLink = scene.world.showIndependentSection(chests, Direction.NORTH);
    scene.world.moveSection(chestLink, util.vector.of(-3, -2, 0), 0);
    scene.idle(10);
    scene.overlay.showOutline(PonderPalette.GREEN, "chestOutline", util.select.fromTo(1, 1, 2, 0, 2, 3), 40);
    scene.idle(10);
    scene.overlay.showLine(PonderPalette.GREEN, util.vector.of(2, 1, 2), util.vector.of(3, 1, 1), 30);
    scene.overlay.showLine(PonderPalette.GREEN, util.vector.of(2, 3, 2), util.vector.of(3, 3, 1), 30);
    scene.overlay.showLine(PonderPalette.GREEN, util.vector.of(2, 3, 4), util.vector.of(3, 3, 4), 30);
    scene.overlay.showOutline(PonderPalette.GREEN, "vaultOutline", vault, 40);
    scene.idle(10);
    BlockPos frontVault = util.grid.at(3, 2, 1);
    scene.overlay.showText(60).text("Item Vaults can be used to store large amounts of items").attachKeyFrame().placeNearTarget().pointAt(util.vector.blockSurface(frontVault, Direction.NORTH));
    scene.idle(70);
    scene.world.hideIndependentSection(chestLink, Direction.DOWN);
    scene.idle(15);
    ItemStack hand = AllItems.BRASS_HAND.asStack();
    scene.overlay.showControls(new InputWindowElement(util.vector.blockSurface(frontVault, Direction.NORTH), Pointing.RIGHT).showing(AllIcons.I_MTD_CLOSE).withItem(hand), 40);
    scene.idle(7);
    scene.overlay.showText(60).text("However, contents cannot be added or taken manually").attachKeyFrame().colored(PonderPalette.RED).placeNearTarget().pointAt(util.vector.blockSurface(frontVault, Direction.WEST));
    scene.idle(70);
    scene.world.showSection(largeCog, Direction.UP);
    scene.idle(5);
    scene.world.showSection(belt1, Direction.EAST);
    scene.idle(20);
    scene.overlay.showText(80).text("Any components for item transfer can both insert...").attachKeyFrame().colored(PonderPalette.GREEN).placeNearTarget().pointAt(util.vector.topOf(2, 2, 3));
    ItemStack[] junk = { new ItemStack(Items.APPLE), new ItemStack(Items.GOLD_INGOT, 8), new ItemStack(Items.TUFF, 32) };
    for (int i = 0; i < junk.length + 2; i++) {
        scene.idle(4);
        if (i > 1) {
            scene.world.removeItemsFromBelt(util.grid.at(2, 1, 3));
            scene.world.flapFunnel(util.grid.at(2, 2, 3), false);
        }
        scene.idle(5);
        if (i < junk.length)
            scene.world.createItemOnBeltLike(util.grid.at(0, 1, 3), Direction.SOUTH, junk[i]);
        scene.idle(9);
    }
    scene.world.showSection(gearbox, Direction.SOUTH);
    scene.idle(5);
    scene.world.showSection(belt2, Direction.EAST);
    scene.idle(15);
    scene.overlay.showText(80).text("...and take contents from this container").colored(PonderPalette.GREEN).placeNearTarget().pointAt(util.vector.topOf(2, 1, 1));
    for (int i = 0; i < junk.length; i++) {
        scene.world.createItemOnBeltLike(util.grid.at(2, 1, 1), Direction.EAST, junk[i]);
        scene.idle(18);
    }
}
Also used : Selection(com.simibubi.create.foundation.ponder.Selection) InputWindowElement(com.simibubi.create.foundation.ponder.element.InputWindowElement) BlockPos(net.minecraft.core.BlockPos) WorldSectionElement(com.simibubi.create.foundation.ponder.element.WorldSectionElement) ItemStack(net.minecraft.world.item.ItemStack)

Example 68 with WorldSectionElement

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

the class KineticsScenes method cogsSpeedUp.

public static void cogsSpeedUp(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("cog_speedup", "Gearshifting with Cogs");
    scene.configureBasePlate(0, 0, 5);
    scene.world.showSection(util.select.layer(0), Direction.UP);
    scene.idle(5);
    scene.world.showSection(util.select.fromTo(5, 1, 2, 4, 1, 2), Direction.DOWN);
    scene.idle(10);
    BlockPos lowerCog = util.grid.at(3, 1, 2);
    BlockPos upperCog = util.grid.at(3, 2, 3);
    BlockState largeCogState = AllBlocks.LARGE_COGWHEEL.getDefaultState().setValue(CogWheelBlock.AXIS, Axis.X);
    BlockState smallCogState = AllBlocks.COGWHEEL.getDefaultState().setValue(CogWheelBlock.AXIS, Axis.X);
    scene.world.setBlock(lowerCog, largeCogState, false);
    scene.world.setBlock(upperCog, smallCogState, false);
    BlockPos upperShaftEnd = upperCog.west(3);
    BlockPos lowerShaftEnd = lowerCog.west(3);
    scene.world.setKineticSpeed(util.select.fromTo(upperCog, upperShaftEnd), -64);
    scene.world.showSection(util.select.fromTo(lowerCog, upperCog), Direction.EAST);
    scene.overlay.showText(60).text("Large and Small cogs can be connected diagonally").placeNearTarget().pointAt(util.vector.blockSurface(upperCog, Direction.WEST));
    scene.idle(80);
    Selection gaugesSelect = util.select.fromTo(0, 1, 2, 2, 2, 3);
    scene.world.showSection(gaugesSelect, Direction.DOWN);
    scene.overlay.showText(60).text("Shifting from large to small cogs, the conveyed speed will be doubled").colored(PonderPalette.GREEN).attachKeyFrame().placeNearTarget().pointAt(util.vector.blockSurface(util.grid.at(1, 2, 3), Direction.NORTH));
    scene.idle(10);
    scene.effects.rotationSpeedIndicator(upperCog);
    scene.idle(60);
    scene.overlay.showText(30).sharedText("rpm32").colored(PonderPalette.FAST).placeNearTarget().pointAt(util.vector.blockSurface(upperShaftEnd, Direction.WEST));
    scene.idle(5);
    scene.overlay.showText(30).sharedText("rpm16").colored(PonderPalette.MEDIUM).placeNearTarget().pointAt(util.vector.blockSurface(lowerShaftEnd, Direction.WEST));
    scene.idle(45);
    scene.world.setKineticSpeed(util.select.fromTo(lowerCog, upperShaftEnd), 0);
    ElementLink<WorldSectionElement> cogs = scene.world.makeSectionIndependent(util.select.fromTo(lowerCog, upperCog));
    scene.world.moveSection(cogs, util.vector.of(0, 1, 0), 5);
    scene.idle(5);
    scene.world.rotateSection(cogs, 180, 0, 0, 10);
    scene.idle(10);
    scene.world.setBlock(lowerCog, smallCogState, false);
    scene.world.setBlock(upperCog, largeCogState, false);
    scene.world.rotateSection(cogs, 180, 0, 0, 0);
    scene.world.moveSection(cogs, util.vector.of(0, -1, 0), 5);
    scene.idle(5);
    scene.world.setKineticSpeed(util.select.fromTo(lowerCog, lowerShaftEnd), 32);
    scene.world.setKineticSpeed(util.select.fromTo(upperCog, upperShaftEnd), -16);
    scene.overlay.showText(80).text("Shifting the opposite way, the conveyed speed will be halved").colored(PonderPalette.RED).attachKeyFrame().placeNearTarget().pointAt(util.vector.blockSurface(util.grid.at(1, 2, 3), Direction.NORTH));
    scene.idle(10);
    scene.effects.rotationSpeedIndicator(upperCog);
    scene.idle(80);
    scene.overlay.showText(60).sharedText("rpm8").colored(PonderPalette.SLOW).placeNearTarget().pointAt(util.vector.blockSurface(upperShaftEnd, Direction.WEST));
    scene.idle(5);
    scene.overlay.showText(60).sharedText("rpm16").colored(PonderPalette.MEDIUM).placeNearTarget().pointAt(util.vector.blockSurface(lowerShaftEnd, Direction.WEST));
    scene.idle(40);
}
Also used : BlockState(net.minecraft.world.level.block.state.BlockState) Selection(com.simibubi.create.foundation.ponder.Selection) BlockPos(net.minecraft.core.BlockPos) WorldSectionElement(com.simibubi.create.foundation.ponder.element.WorldSectionElement)

Example 69 with WorldSectionElement

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

the class PumpScenes method speed.

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

Example 70 with WorldSectionElement

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

the class SpoutScenes method filling.

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

Aggregations

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