Search in sources :

Example 6 with EntityElement

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

the class FunnelScenes method intro.

public static void intro(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("funnel_intro", "Using funnels");
    scene.configureBasePlate(0, 1, 5);
    scene.world.showSection(util.select.layer(0), Direction.UP);
    scene.world.modifyKineticSpeed(util.select.everywhere(), f -> f / 2f);
    scene.idle(10);
    Selection verticalFunnel = util.select.fromTo(2, -1, 4, 2, 4, 4).add(util.select.fromTo(1, 1, 4, 1, 4, 4));
    Selection beltFunnels = util.select.fromTo(1, 2, 2, 3, 2, 2);
    Selection beltFunnelEnv = util.select.fromTo(0, 1, 0, 5, 2, 2).substract(beltFunnels);
    scene.world.showSection(beltFunnelEnv, Direction.DOWN);
    scene.idle(20);
    scene.world.showSection(beltFunnels, Direction.DOWN);
    BlockPos entryBeltPos = util.grid.at(3, 1, 2);
    BlockPos exitBeltPos = util.grid.at(1, 1, 2);
    ItemStack itemStack = AllBlocks.BRASS_BLOCK.asStack();
    for (int i = 0; i < 8; i++) {
        scene.idle(8);
        scene.world.removeItemsFromBelt(exitBeltPos);
        scene.world.flapFunnel(exitBeltPos.above(), false);
        if (i == 2)
            scene.rotateCameraY(70);
        if (i < 6)
            scene.world.createItemOnBelt(entryBeltPos, Direction.EAST, itemStack);
    }
    scene.rotateCameraY(-70);
    scene.idle(10);
    Selection outputFunnel = util.select.position(1, 2, 4);
    scene.world.setBlocks(outputFunnel, Blocks.AIR.defaultBlockState(), false);
    scene.world.setBlocks(util.select.fromTo(2, -1, 4, 2, 0, 4), AllBlocks.ANDESITE_CASING.getDefaultState(), true);
    ElementLink<WorldSectionElement> independentSection = scene.world.showIndependentSection(verticalFunnel, Direction.UP);
    Vec3 topItemSpawn = util.vector.centerOf(2, 6, 4);
    Vec3 sideItemSpawn = util.vector.centerOf(1, 3, 4).add(0.15f, -0.45f, 0);
    ElementLink<EntityElement> lastItemEntity = null;
    for (int i = 0; i < 4; i++) {
        if (lastItemEntity != null)
            scene.world.modifyEntity(lastItemEntity, Entity::discard);
        if (i < 3)
            lastItemEntity = scene.world.createItemEntity(topItemSpawn, util.vector.of(0, -0.4, 0), itemStack);
        scene.idle(8);
    }
    scene.world.moveSection(independentSection, util.vector.of(0, 1, 0), 15);
    scene.idle(10);
    scene.world.setBlocks(outputFunnel, AllBlocks.ANDESITE_FUNNEL.getDefaultState().setValue(FunnelBlock.FACING, Direction.WEST).setValue(FunnelBlock.EXTRACTING, true), false);
    for (int i = 0; i < 3; i++) {
        scene.idle(8);
        scene.world.flapFunnel(util.grid.at(1, 2, 4), false);
        scene.world.createItemEntity(sideItemSpawn, util.vector.of(-.05, 0, 0), itemStack);
    }
    scene.idle(8);
    scene.overlay.showText(360).text("Funnels are ideal for transferring items from and to inventories.").independent();
    scene.markAsFinished();
}
Also used : Selection(com.simibubi.create.foundation.ponder.Selection) Vec3(net.minecraft.world.phys.Vec3) BlockPos(net.minecraft.core.BlockPos) WorldSectionElement(com.simibubi.create.foundation.ponder.element.WorldSectionElement) EntityElement(com.simibubi.create.foundation.ponder.element.EntityElement) ItemStack(net.minecraft.world.item.ItemStack)

Example 7 with EntityElement

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

the class FanScenes method processing.

public static void processing(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("fan_processing", "Processing Items using Encased Fans");
    scene.configureBasePlate(1, 0, 5);
    scene.world.showSection(util.select.layer(0).substract(util.select.position(0, 0, 4)), Direction.UP);
    scene.idle(5);
    scene.world.showSection(util.select.fromTo(6, 1, 2, 5, 1, 2).add(util.select.position(1, 1, 2)), Direction.DOWN);
    scene.idle(25);
    BlockPos blockPos = util.grid.at(4, 1, 2);
    // blasting start
    ElementLink<WorldSectionElement> blockInFront = scene.world.showIndependentSection(util.select.position(3, 1, 0), Direction.SOUTH);
    scene.world.moveSection(blockInFront, util.vector.of(1, 0, 2), 0);
    scene.world.setBlock(blockPos, Blocks.LAVA.defaultBlockState(), false);
    scene.idle(10);
    scene.overlay.showSelectionWithText(util.select.fromTo(blockPos, blockPos.west(2)), 80).colored(PonderPalette.RED).text("When passing through lava, the Air Flow becomes Heated");
    scene.idle(80);
    ItemStack stack = new ItemStack(Items.GOLD_ORE);
    ItemStack smelted = new ItemStack(Items.GOLD_INGOT);
    ElementLink<EntityElement> entityLink = scene.world.createItemEntity(util.vector.centerOf(blockPos.west(2).above(2)), util.vector.of(0, 0.1, 0), stack);
    scene.idle(15);
    scene.world.modifyEntity(entityLink, e -> e.setDeltaMovement(-0.2f, 0, 0));
    Vec3 itemVec = util.vector.blockSurface(util.grid.at(1, 1, 2), Direction.EAST).add(0.1, 0, 0);
    scene.overlay.showControls(new InputWindowElement(itemVec, Pointing.DOWN).withItem(stack), 20);
    scene.idle(20);
    scene.effects.emitParticles(itemVec.add(0, 0.2f, 0), Emitter.simple(ParticleTypes.LARGE_SMOKE, Vec3.ZERO), 1, 60);
    scene.overlay.showText(80).colored(PonderPalette.WHITE).pointAt(itemVec).placeNearTarget().attachKeyFrame().text("Items caught in the area will be smelted");
    scene.idle(60);
    scene.world.modifyEntities(ItemEntity.class, ie -> ie.setItem(smelted));
    scene.idle(40);
    scene.overlay.showControls(new InputWindowElement(itemVec, Pointing.DOWN).withItem(smelted), 20);
    scene.idle(20);
    scene.world.modifyEntities(ItemEntity.class, Entity::discard);
    scene.idle(20);
    scene.overlay.showText(80).colored(PonderPalette.RED).pointAt(itemVec).placeNearTarget().text("Food items thrown here would be incinerated");
    scene.idle(40);
    // smoking start
    BlockState campfire = Blocks.FIRE.defaultBlockState();
    scene.world.hideIndependentSection(blockInFront, Direction.NORTH);
    scene.idle(15);
    scene.world.setBlock(util.grid.at(3, 1, 0), campfire, false);
    scene.world.setBlock(blockPos, campfire, true);
    blockInFront = scene.world.showIndependentSection(util.select.position(3, 1, 0), Direction.NORTH);
    scene.world.moveSection(blockInFront, util.vector.of(1, 0, 2), 0);
    scene.idle(50);
    scene.overlay.showSelectionWithText(util.select.fromTo(blockPos, blockPos.west(2)), 60).colored(PonderPalette.BLACK).attachKeyFrame().text("Instead, a setup for Smoking using Fire should be used for them");
    scene.idle(80);
    // washing start
    BlockState water = Blocks.WATER.defaultBlockState();
    scene.world.hideIndependentSection(blockInFront, Direction.NORTH);
    scene.idle(15);
    scene.world.setBlock(util.grid.at(3, 1, 0), water, false);
    scene.world.setBlock(blockPos, water, true);
    blockInFront = scene.world.showIndependentSection(util.select.position(3, 1, 0), Direction.NORTH);
    scene.world.moveSection(blockInFront, util.vector.of(1, 0, 2), 0);
    scene.idle(20);
    scene.overlay.showSelectionWithText(util.select.fromTo(blockPos, blockPos.west(2)), 60).colored(PonderPalette.MEDIUM).attachKeyFrame().text("Air Flows passing through water create a Washing Setup");
    scene.idle(70);
    stack = new ItemStack(Items.RED_SAND, 16);
    ItemStack washed = new ItemStack(Items.GOLD_NUGGET, 16);
    entityLink = scene.world.createItemEntity(util.vector.centerOf(blockPos.west(2).above(2)), util.vector.of(0, 0.1, 0), stack);
    scene.idle(15);
    scene.world.modifyEntity(entityLink, e -> e.setDeltaMovement(-0.2f, 0, 0));
    scene.overlay.showControls(new InputWindowElement(itemVec, Pointing.DOWN).withItem(stack), 20);
    scene.idle(20);
    scene.effects.emitParticles(itemVec.add(0, 0.2f, 0), Emitter.simple(ParticleTypes.SPIT, Vec3.ZERO), 1, 60);
    scene.overlay.showText(50).colored(PonderPalette.WHITE).pointAt(itemVec).placeNearTarget().text("Some interesting new processing can be done with it");
    scene.idle(60);
    scene.world.modifyEntities(ItemEntity.class, ie -> ie.setItem(washed));
    scene.overlay.showControls(new InputWindowElement(itemVec, Pointing.DOWN).withItem(washed), 20);
    scene.idle(20);
    scene.world.modifyEntities(ItemEntity.class, Entity::discard);
    scene.idle(20);
    scene.overlay.showText(100).colored(PonderPalette.RED).pointAt(util.vector.topOf(blockPos.east())).placeNearTarget().attachKeyFrame().text("The Speed of the Fan does NOT affect the processing speed, only its range");
    scene.world.destroyBlock(util.grid.at(1, 1, 2));
    scene.idle(110);
    ElementLink<WorldSectionElement> cogs = scene.world.makeSectionIndependent(util.select.fromTo(6, 1, 2, 6, 0, 3).add(util.select.fromTo(4, 0, 2, 5, 0, 2)));
    scene.world.modifyKineticSpeed(util.select.position(5, 2, 2), f -> f / 3f);
    scene.world.moveSection(cogs, util.vector.of(0, 1, 0), 15);
    scene.world.moveSection(blockInFront, util.vector.of(0, 1, 0), 15);
    scene.world.destroyBlock(blockPos.east());
    scene.world.showSection(util.select.position(blockPos.east().above()), Direction.DOWN);
    scene.world.setBlock(blockPos.above(), Blocks.WATER.defaultBlockState(), false);
    ItemStack sand = new ItemStack(Items.SAND);
    ItemStack clay = new ItemStack(Items.CLAY_BALL);
    scene.idle(20);
    BlockPos depos = util.grid.at(3, 4, 2);
    ElementLink<WorldSectionElement> depot = scene.world.showIndependentSection(util.select.position(depos), Direction.DOWN);
    scene.world.moveSection(depot, util.vector.of(-1, -3, 0), 0);
    scene.world.createItemOnBeltLike(depos, Direction.NORTH, sand);
    scene.idle(10);
    Vec3 depotTop = util.vector.topOf(2, 1, 2).add(0, 0.25, 0);
    scene.effects.emitParticles(depotTop, Emitter.simple(ParticleTypes.SPIT, Vec3.ZERO), .5f, 30);
    scene.idle(30);
    scene.world.modifyTileNBT(util.select.position(depos), DepotTileEntity.class, nbt -> nbt.put("HeldItem", new TransportedItemStack(clay).serializeNBT()));
    scene.effects.emitParticles(depotTop, Emitter.simple(ParticleTypes.SPIT, Vec3.ZERO), .5f, 30);
    scene.overlay.showText(90).pointAt(depotTop).attachKeyFrame().text("Fan Processing can also be applied to Items on Depots and Belts");
    scene.idle(100);
    scene.world.moveSection(depot, util.vector.of(-1, 0, 0), 15);
    scene.idle(15);
    ElementLink<WorldSectionElement> largeCog = scene.world.showIndependentSection(util.select.position(1, 2, 4), Direction.UP);
    ElementLink<WorldSectionElement> belt = scene.world.showIndependentSection(util.select.fromTo(3, 3, 1, 1, 3, 3), Direction.DOWN);
    scene.world.moveSection(largeCog, util.vector.of(-1, -2, 0), 0);
    scene.world.moveSection(belt, util.vector.of(-1, -2, 0), 0);
    ElementLink<BeltItemElement> transported = scene.world.createItemOnBelt(util.grid.at(3, 3, 3), Direction.SOUTH, sand);
    scene.idle(60);
    scene.effects.emitParticles(depotTop, Emitter.simple(ParticleTypes.SPIT, Vec3.ZERO), .5f, 25);
    scene.idle(25);
    scene.world.changeBeltItemTo(transported, new ItemStack(Items.CLAY_BALL));
    scene.effects.emitParticles(depotTop, Emitter.simple(ParticleTypes.SPIT, Vec3.ZERO), .5f, 25);
    scene.idle(60);
    scene.world.setKineticSpeed(util.select.position(1, 2, 4).add(util.select.fromTo(3, 3, 1, 1, 3, 3)), 0);
}
Also used : DepotTileEntity(com.simibubi.create.content.logistics.block.depot.DepotTileEntity) Entity(net.minecraft.world.entity.Entity) ItemEntity(net.minecraft.world.entity.item.ItemEntity) WorldSectionElement(com.simibubi.create.foundation.ponder.element.WorldSectionElement) EntityElement(com.simibubi.create.foundation.ponder.element.EntityElement) BeltItemElement(com.simibubi.create.foundation.ponder.element.BeltItemElement) BlockState(net.minecraft.world.level.block.state.BlockState) TransportedItemStack(com.simibubi.create.content.contraptions.relays.belt.transport.TransportedItemStack) Vec3(net.minecraft.world.phys.Vec3) InputWindowElement(com.simibubi.create.foundation.ponder.element.InputWindowElement) BlockPos(net.minecraft.core.BlockPos) TransportedItemStack(com.simibubi.create.content.contraptions.relays.belt.transport.TransportedItemStack) ItemStack(net.minecraft.world.item.ItemStack)

Example 8 with EntityElement

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

the class ProcessingScenes method millstone.

public static void millstone(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("millstone", "Processing Items in the Millstone");
    scene.configureBasePlate(0, 0, 5);
    Selection belt = util.select.fromTo(1, 1, 5, 0, 1, 2).add(util.select.position(1, 2, 2));
    Selection beltCog = util.select.position(2, 0, 5);
    scene.world.showSection(util.select.layer(0).substract(beltCog), Direction.UP);
    BlockPos millstone = util.grid.at(2, 2, 2);
    Selection millstoneSelect = util.select.position(2, 2, 2);
    Selection cogs = util.select.fromTo(3, 1, 2, 3, 2, 2);
    scene.world.setKineticSpeed(millstoneSelect, 0);
    scene.idle(5);
    scene.world.showSection(util.select.position(4, 1, 3), Direction.DOWN);
    scene.world.showSection(util.select.position(2, 1, 2), Direction.DOWN);
    scene.idle(10);
    scene.world.showSection(util.select.position(millstone), Direction.DOWN);
    scene.idle(10);
    Vec3 millstoneTop = util.vector.topOf(millstone);
    scene.overlay.showText(60).attachKeyFrame().text("Millstones process items by grinding them").pointAt(millstoneTop).placeNearTarget();
    scene.idle(70);
    scene.world.showSection(cogs, Direction.DOWN);
    scene.idle(10);
    scene.world.setKineticSpeed(millstoneSelect, 32);
    scene.effects.indicateSuccess(millstone);
    scene.idle(10);
    scene.overlay.showText(60).attachKeyFrame().colored(PonderPalette.GREEN).text("They can be powered from the side using cogwheels").pointAt(util.vector.topOf(millstone.east())).placeNearTarget();
    scene.idle(70);
    ItemStack itemStack = new ItemStack(Items.WHEAT);
    Vec3 entitySpawn = util.vector.topOf(millstone.above(3));
    ElementLink<EntityElement> entity1 = scene.world.createItemEntity(entitySpawn, util.vector.of(0, 0.2, 0), itemStack);
    scene.idle(18);
    scene.world.modifyEntity(entity1, Entity::discard);
    scene.world.modifyTileEntity(millstone, MillstoneTileEntity.class, ms -> ms.inputInv.setStackInSlot(0, itemStack));
    scene.idle(10);
    scene.overlay.showControls(new InputWindowElement(millstoneTop, Pointing.DOWN).withItem(itemStack), 30);
    scene.idle(7);
    scene.overlay.showText(40).attachKeyFrame().text("Throw or Insert items at the top").pointAt(millstoneTop).placeNearTarget();
    scene.idle(60);
    scene.world.modifyTileEntity(millstone, MillstoneTileEntity.class, ms -> ms.inputInv.setStackInSlot(0, ItemStack.EMPTY));
    scene.overlay.showText(50).text("After some time, the result can be obtained via Right-click").pointAt(util.vector.blockSurface(millstone, Direction.WEST)).placeNearTarget();
    scene.idle(60);
    ItemStack flour = AllItems.WHEAT_FLOUR.asStack();
    scene.overlay.showControls(new InputWindowElement(util.vector.blockSurface(millstone, Direction.NORTH), Pointing.RIGHT).rightClick().withItem(flour), 40);
    scene.idle(50);
    scene.addKeyframe();
    scene.world.showSection(beltCog, Direction.UP);
    scene.world.showSection(belt, Direction.EAST);
    scene.idle(15);
    BlockPos beltPos = util.grid.at(1, 1, 2);
    scene.world.createItemOnBelt(beltPos, Direction.EAST, flour);
    scene.idle(15);
    scene.world.createItemOnBelt(beltPos, Direction.EAST, new ItemStack(Items.WHEAT_SEEDS));
    scene.idle(20);
    scene.overlay.showText(50).text("The outputs can also be extracted by automation").pointAt(util.vector.blockSurface(millstone, Direction.WEST).add(-.5, .4, 0)).placeNearTarget();
    scene.idle(60);
}
Also used : BasinTileEntity(com.simibubi.create.content.contraptions.processing.BasinTileEntity) MechanicalPressTileEntity(com.simibubi.create.content.contraptions.components.press.MechanicalPressTileEntity) DeployerTileEntity(com.simibubi.create.content.contraptions.components.deployer.DeployerTileEntity) Entity(net.minecraft.world.entity.Entity) ItemEntity(net.minecraft.world.entity.item.ItemEntity) MillstoneTileEntity(com.simibubi.create.content.contraptions.components.millstone.MillstoneTileEntity) MechanicalMixerTileEntity(com.simibubi.create.content.contraptions.components.mixer.MechanicalMixerTileEntity) Selection(com.simibubi.create.foundation.ponder.Selection) Vec3(net.minecraft.world.phys.Vec3) InputWindowElement(com.simibubi.create.foundation.ponder.element.InputWindowElement) BlockPos(net.minecraft.core.BlockPos) EntityElement(com.simibubi.create.foundation.ponder.element.EntityElement) ItemStack(net.minecraft.world.item.ItemStack)

Example 9 with EntityElement

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

the class BeltScenes method transport.

public static void transport(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("belt_transport", "Using Mechanical Belts for Logistics");
    scene.configureBasePlate(0, 0, 5);
    scene.setSceneOffsetY(-1);
    scene.world.modifyKineticSpeed(util.select.everywhere(), f -> -.6f * f);
    scene.showBasePlate();
    scene.idle(5);
    scene.world.showSection(util.select.fromTo(1, 1, 3, 2, 1, 5), Direction.DOWN);
    scene.idle(20);
    scene.world.showSection(util.select.fromTo(2, 1, 2, 4, 3, 2), Direction.SOUTH);
    scene.idle(5);
    scene.world.showSection(util.select.fromTo(1, 1, 2, 0, 1, 2), Direction.SOUTH);
    scene.idle(10);
    scene.special.movePointOfInterest(util.grid.at(2, 2, 0));
    ItemStack stack = new ItemStack(Items.COPPER_BLOCK);
    ElementLink<EntityElement> item = scene.world.createItemEntity(util.vector.centerOf(0, 4, 2), util.vector.of(0, 0, 0), stack);
    scene.idle(13);
    scene.world.modifyEntity(item, Entity::discard);
    BlockPos beltEnd = util.grid.at(0, 1, 2);
    scene.world.createItemOnBelt(beltEnd, Direction.DOWN, stack);
    scene.idle(20);
    ElementLink<ParrotElement> parrot = scene.special.createBirb(util.vector.topOf(0, 1, 2).add(0, -3 / 16f, 0), FacePointOfInterestPose::new);
    scene.special.moveParrot(parrot, util.vector.of(1.78, 0, 0), 40);
    scene.special.movePointOfInterest(util.grid.at(1, 1, 3));
    scene.overlay.showText(60).placeNearTarget().pointAt(util.vector.topOf(beltEnd)).text("Moving belts will transport Items and other Entities");
    scene.idle(20);
    item = scene.world.createItemEntity(util.vector.centerOf(0, 4, 2), util.vector.of(0, 0, 0), stack);
    scene.special.movePointOfInterest(util.grid.at(0, 3, 2));
    scene.idle(10);
    scene.special.movePointOfInterest(beltEnd);
    scene.idle(3);
    scene.world.modifyEntity(item, Entity::discard);
    scene.world.createItemOnBelt(beltEnd, Direction.DOWN, stack);
    scene.idle(8);
    scene.special.movePointOfInterest(util.grid.at(3, 2, 1));
    scene.special.moveParrot(parrot, util.vector.of(2.1, 2.1, 0), 60);
    scene.idle(20);
    scene.special.movePointOfInterest(util.grid.at(5, 5, 2));
    scene.idle(30);
    scene.special.movePointOfInterest(util.grid.at(2, 1, 5));
    scene.idle(10);
    scene.special.moveParrot(parrot, util.vector.of(.23, 0, 0), 5);
    scene.idle(5);
    scene.world.setKineticSpeed(util.select.everywhere(), 0f);
    scene.idle(10);
    scene.world.modifyEntities(ItemEntity.class, Entity::discard);
    scene.special.movePointOfInterest(util.grid.at(2, 5, 4));
    Vec3 topOf = util.vector.topOf(util.grid.at(3, 2, 2)).add(-0.1, 0.3, 0);
    scene.overlay.showControls(new InputWindowElement(topOf, Pointing.DOWN).rightClick(), 60);
    scene.idle(10);
    scene.overlay.showText(60).placeNearTarget().pointAt(topOf.subtract(0, 0.1, 0)).attachKeyFrame().text("Right-Click with an empty hand to take items off a belt");
    scene.idle(20);
    scene.world.removeItemsFromBelt(util.grid.at(3, 2, 2));
    scene.effects.indicateSuccess(util.grid.at(3, 2, 2));
    scene.idle(20);
    scene.special.changeBirbPose(parrot, FaceCursorPose::new);
}
Also used : MechanicalPressTileEntity(com.simibubi.create.content.contraptions.components.press.MechanicalPressTileEntity) BeltTileEntity(com.simibubi.create.content.contraptions.relays.belt.BeltTileEntity) SpoutTileEntity(com.simibubi.create.content.contraptions.fluids.actors.SpoutTileEntity) Entity(net.minecraft.world.entity.Entity) ItemEntity(net.minecraft.world.entity.item.ItemEntity) FaceCursorPose(com.simibubi.create.foundation.ponder.element.ParrotElement.FaceCursorPose) Vec3(net.minecraft.world.phys.Vec3) FacePointOfInterestPose(com.simibubi.create.foundation.ponder.element.ParrotElement.FacePointOfInterestPose) InputWindowElement(com.simibubi.create.foundation.ponder.element.InputWindowElement) BlockPos(net.minecraft.core.BlockPos) EntityElement(com.simibubi.create.foundation.ponder.element.EntityElement) ParrotElement(com.simibubi.create.foundation.ponder.element.ParrotElement) ItemStack(net.minecraft.world.item.ItemStack)

Example 10 with EntityElement

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

the class CartAssemblerScenes method anchor.

public static void anchor(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("cart_assembler", "Moving Structures using Cart Assemblers");
    scene.configureBasePlate(0, 0, 5);
    scene.scaleSceneView(.9f);
    scene.world.showSection(util.select.layer(0), Direction.UP);
    scene.idle(5);
    BlockPos assemblerPos = util.grid.at(2, 1, 2);
    scene.world.setBlock(assemblerPos, Blocks.RAIL.defaultBlockState(), false);
    for (int z = 0; z < 5; z++) {
        scene.world.showSection(util.select.position(2, 1, z), Direction.DOWN);
        scene.idle(2);
    }
    BlockPos leverPos = util.grid.at(0, 1, 2);
    Selection toggle = util.select.fromTo(assemblerPos, leverPos);
    scene.idle(10);
    scene.overlay.showControls(new InputWindowElement(util.vector.centerOf(assemblerPos), Pointing.DOWN).rightClick().withItem(AllBlocks.CART_ASSEMBLER.asStack()), 30);
    scene.idle(7);
    scene.world.setBlock(assemblerPos, AllBlocks.CART_ASSEMBLER.getDefaultState().setValue(CartAssemblerBlock.RAIL_SHAPE, RailShape.NORTH_SOUTH).setValue(CartAssemblerBlock.RAIL_TYPE, CartAssembleRailType.REGULAR), true);
    scene.idle(20);
    scene.world.showSection(util.select.fromTo(0, 1, 2, 1, 1, 2), Direction.EAST);
    scene.idle(20);
    scene.world.toggleRedstonePower(toggle);
    scene.effects.indicateRedstone(leverPos);
    scene.idle(10);
    scene.overlay.showText(70).text("Powered Cart Assemblers mount attached structures to passing Minecarts").attachKeyFrame().pointAt(util.vector.topOf(assemblerPos)).placeNearTarget();
    scene.idle(80);
    ElementLink<MinecartElement> cart = scene.special.createCart(util.vector.topOf(2, 0, 4), 90, Minecart::new);
    scene.world.showSection(util.select.position(assemblerPos.above()), Direction.DOWN);
    scene.idle(10);
    scene.special.moveCart(cart, util.vector.of(0, 0, -2), 20);
    scene.idle(20);
    ElementLink<WorldSectionElement> plank = scene.world.makeSectionIndependent(util.select.position(assemblerPos.above()));
    ElementLink<WorldSectionElement> anchor = scene.world.showIndependentSectionImmediately(util.select.position(assemblerPos.east()));
    scene.world.moveSection(anchor, util.vector.of(-1, 0, 0), 0);
    scene.effects.indicateSuccess(assemblerPos);
    scene.idle(1);
    scene.world.moveSection(anchor, util.vector.of(0, 0, -2), 20);
    scene.world.moveSection(plank, util.vector.of(0, 0, -2), 20);
    scene.special.moveCart(cart, util.vector.of(0, 0, -2), 20);
    scene.idle(20);
    scene.world.toggleRedstonePower(toggle);
    scene.idle(10);
    scene.overlay.showText(70).text("Without a redstone signal, it disassembles passing cart contraptions back into blocks").colored(PonderPalette.RED).attachKeyFrame().pointAt(util.vector.topOf(assemblerPos)).placeNearTarget();
    scene.idle(80);
    scene.world.rotateSection(anchor, 0, 180, 0, 6);
    scene.world.rotateSection(plank, 0, 180, 0, 6);
    scene.idle(3);
    scene.world.moveSection(anchor, util.vector.of(0, 0, 2), 20);
    scene.world.moveSection(plank, util.vector.of(0, 0, 2), 20);
    scene.special.moveCart(cart, util.vector.of(0, 0, 2), 20);
    scene.idle(21);
    scene.world.moveSection(anchor, util.vector.of(0, -2, 0), 0);
    scene.special.moveCart(cart, util.vector.of(0, 0, 2), 20);
    scene.idle(30);
    scene.world.destroyBlock(assemblerPos.above());
    scene.idle(5);
    ElementLink<WorldSectionElement> contraption = scene.world.showIndependentSection(util.select.fromTo(1, 4, 2, 3, 3, 2), Direction.DOWN);
    scene.world.moveSection(contraption, util.vector.of(0, -1, 0), 0);
    scene.idle(10);
    scene.world.showSectionAndMerge(util.select.position(3, 3, 1), Direction.SOUTH, contraption);
    scene.idle(15);
    scene.effects.superGlue(util.grid.at(3, 2, 1), Direction.SOUTH, true);
    scene.overlay.showText(80).attachKeyFrame().sharedText("movement_anchors").pointAt(util.vector.blockSurface(util.grid.at(1, 3, 2), Direction.NORTH)).placeNearTarget();
    scene.idle(80);
    scene.world.toggleRedstonePower(toggle);
    scene.effects.indicateRedstone(leverPos);
    scene.special.moveCart(cart, util.vector.of(0, 0, -2), 20);
    scene.idle(20);
    scene.world.moveSection(anchor, util.vector.of(0, 2, 0), 0);
    scene.idle(1);
    scene.world.moveSection(anchor, util.vector.of(0, 0, -2), 20);
    scene.world.moveSection(contraption, util.vector.of(0, 0, -2), 20);
    scene.special.moveCart(cart, util.vector.of(0, 0, -2), 20);
    scene.idle(25);
    Vec3 cartCenter = util.vector.centerOf(assemblerPos.north(2));
    scene.overlay.showControls(new InputWindowElement(cartCenter, Pointing.LEFT).rightClick().withWrench(), 40);
    scene.idle(7);
    scene.special.moveCart(cart, util.vector.of(0, -100, 4), 0);
    scene.world.moveSection(anchor, util.vector.of(0, -100, 4), 0);
    scene.world.moveSection(contraption, util.vector.of(0, -100, 4), 0);
    ItemStack asStack = AllItems.MINECART_CONTRAPTION.asStack();
    ElementLink<EntityElement> itemEntity = scene.world.createItemEntity(cartCenter, util.vector.of(0, .1, 0), asStack);
    scene.idle(40);
    scene.overlay.showText(80).attachKeyFrame().text("Using a Wrench on the Minecart will let you carry the Contraption elsewhere").pointAt(cartCenter).placeNearTarget();
    scene.idle(80);
    scene.world.modifyEntity(itemEntity, Entity::discard);
    scene.overlay.showControls(new InputWindowElement(cartCenter.add(0, 0, 4), Pointing.DOWN).rightClick().withItem(asStack), 20);
    scene.idle(20);
    scene.special.moveCart(cart, util.vector.of(0, 100.5, 0), 0);
    scene.world.moveSection(anchor, util.vector.of(0, 100.5, 0), 0);
    scene.world.moveSection(contraption, util.vector.of(0, 100.5, 0), 0);
    scene.idle(1);
    scene.special.moveCart(cart, util.vector.of(0, -.5, 0), 5);
    scene.world.moveSection(anchor, util.vector.of(0, -.5, 0), 5);
    scene.world.moveSection(contraption, util.vector.of(0, -.5, 0), 5);
}
Also used : Entity(net.minecraft.world.entity.Entity) Selection(com.simibubi.create.foundation.ponder.Selection) Minecart(net.minecraft.world.entity.vehicle.Minecart) WorldSectionElement(com.simibubi.create.foundation.ponder.element.WorldSectionElement) EntityElement(com.simibubi.create.foundation.ponder.element.EntityElement) MinecartElement(com.simibubi.create.foundation.ponder.element.MinecartElement) 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)

Aggregations

EntityElement (com.simibubi.create.foundation.ponder.element.EntityElement)16 ItemStack (net.minecraft.world.item.ItemStack)15 BlockPos (net.minecraft.core.BlockPos)14 Entity (net.minecraft.world.entity.Entity)14 InputWindowElement (com.simibubi.create.foundation.ponder.element.InputWindowElement)13 Vec3 (net.minecraft.world.phys.Vec3)13 Selection (com.simibubi.create.foundation.ponder.Selection)10 ItemEntity (net.minecraft.world.entity.item.ItemEntity)9 WorldSectionElement (com.simibubi.create.foundation.ponder.element.WorldSectionElement)8 DeployerTileEntity (com.simibubi.create.content.contraptions.components.deployer.DeployerTileEntity)3 MechanicalPressTileEntity (com.simibubi.create.content.contraptions.components.press.MechanicalPressTileEntity)3 MillstoneTileEntity (com.simibubi.create.content.contraptions.components.millstone.MillstoneTileEntity)2 MechanicalMixerTileEntity (com.simibubi.create.content.contraptions.components.mixer.MechanicalMixerTileEntity)2 BasinTileEntity (com.simibubi.create.content.contraptions.processing.BasinTileEntity)2 HarvesterTileEntity (com.simibubi.create.content.contraptions.components.actors.HarvesterTileEntity)1 PortableItemInterfaceTileEntity (com.simibubi.create.content.contraptions.components.actors.PortableItemInterfaceTileEntity)1 PortableStorageInterfaceTileEntity (com.simibubi.create.content.contraptions.components.actors.PortableStorageInterfaceTileEntity)1 MechanicalCrafterTileEntity (com.simibubi.create.content.contraptions.components.crafter.MechanicalCrafterTileEntity)1 SawTileEntity (com.simibubi.create.content.contraptions.components.saw.SawTileEntity)1 SpoutTileEntity (com.simibubi.create.content.contraptions.fluids.actors.SpoutTileEntity)1