Search in sources :

Example 16 with WorldSectionElement

use of com.simibubi.create.foundation.ponder.element.WorldSectionElement 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 17 with WorldSectionElement

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

the class BearingScenes method windmillsAnyStructure.

public static void windmillsAnyStructure(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("windmill_structure", "Windmill Contraptions");
    scene.configureBasePlate(1, 1, 5);
    scene.setSceneOffsetY(-1);
    scene.world.modifyEntities(SuperGlueEntity.class, Entity::discard);
    scene.world.showSection(util.select.layer(0), Direction.UP);
    scene.idle(5);
    BlockPos bearingPos = util.grid.at(3, 1, 3);
    scene.world.showSection(util.select.position(bearingPos), Direction.DOWN);
    scene.idle(10);
    ElementLink<WorldSectionElement> contraption = scene.world.showIndependentSection(util.select.position(bearingPos.above()), Direction.DOWN);
    scene.idle(10);
    scene.world.showSectionAndMerge(util.select.fromTo(3, 2, 2, 3, 3, 1), Direction.SOUTH, contraption);
    scene.world.showSectionAndMerge(util.select.fromTo(3, 2, 4, 3, 3, 5), Direction.NORTH, contraption);
    scene.idle(5);
    scene.world.showSectionAndMerge(util.select.position(3, 1, 5), Direction.NORTH, contraption);
    scene.world.showSectionAndMerge(util.select.position(3, 4, 2), Direction.DOWN, contraption);
    scene.idle(5);
    scene.world.showSectionAndMerge(util.select.position(2, 1, 5), Direction.EAST, contraption);
    scene.world.showSectionAndMerge(util.select.position(3, 3, 3), Direction.DOWN, contraption);
    scene.idle(5);
    scene.effects.superGlue(bearingPos.above(), Direction.SOUTH, true);
    scene.effects.superGlue(bearingPos.above(), Direction.NORTH, true);
    scene.idle(5);
    scene.effects.superGlue(util.grid.at(3, 1, 5), Direction.UP, true);
    scene.idle(5);
    scene.effects.superGlue(util.grid.at(3, 3, 3), Direction.DOWN, true);
    scene.idle(10);
    scene.overlay.showOutline(PonderPalette.BLUE, bearingPos, util.select.fromTo(3, 2, 1, 3, 3, 2), 80);
    scene.overlay.showSelectionWithText(util.select.fromTo(3, 2, 4, 3, 3, 5), 80).colored(PonderPalette.BLUE).attachKeyFrame().text("Any Structure can count as a valid Windmill, as long as it contains at least 8 sail-like Blocks.");
    scene.idle(90);
    scene.overlay.showControls(new InputWindowElement(util.vector.blockSurface(bearingPos, Direction.WEST), Pointing.LEFT).rightClick(), 40);
    scene.idle(7);
    scene.markAsFinished();
    scene.world.rotateBearing(bearingPos, -720, 400);
    scene.world.rotateSection(contraption, 0, -720, 0, 400);
    scene.world.modifyTileEntity(util.grid.at(2, 1, 5), HarvesterTileEntity.class, hte -> hte.setAnimatedSpeed(-150));
    scene.idle(400);
    scene.world.modifyTileEntity(util.grid.at(2, 1, 5), HarvesterTileEntity.class, hte -> hte.setAnimatedSpeed(0));
}
Also used : SuperGlueEntity(com.simibubi.create.content.contraptions.components.structureMovement.glue.SuperGlueEntity) HarvesterTileEntity(com.simibubi.create.content.contraptions.components.actors.HarvesterTileEntity) Entity(net.minecraft.world.entity.Entity) InputWindowElement(com.simibubi.create.foundation.ponder.element.InputWindowElement) BlockPos(net.minecraft.core.BlockPos) WorldSectionElement(com.simibubi.create.foundation.ponder.element.WorldSectionElement)

Example 18 with WorldSectionElement

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

the class BearingScenes method clockwork.

public static void clockwork(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("clockwork_bearing", "Animating Structures using Clockwork Bearings");
    scene.configureBasePlate(1, 1, 5);
    scene.setSceneOffsetY(-1);
    Selection kinetics = util.select.fromTo(3, 3, 4, 3, 1, 6);
    Selection largeCog = util.select.position(2, 0, 6);
    BlockPos bearingPos = util.grid.at(3, 3, 3);
    scene.world.showSection(util.select.layer(0), Direction.UP);
    scene.idle(5);
    scene.world.showSection(kinetics, Direction.DOWN);
    scene.idle(10);
    scene.world.showSection(util.select.position(bearingPos), Direction.DOWN);
    scene.idle(10);
    scene.overlay.showSelectionWithText(util.select.position(bearingPos.north()), 60).colored(PonderPalette.GREEN).pointAt(util.vector.blockSurface(bearingPos, Direction.WEST)).placeNearTarget().attachKeyFrame().text("Clockwork Bearings attach to blocks in front of them");
    scene.idle(50);
    ElementLink<WorldSectionElement> plank = scene.world.showIndependentSection(util.select.position(2, 3, 2), Direction.SOUTH);
    scene.world.moveSection(plank, util.vector.of(1, 0, 0), 0);
    scene.idle(20);
    scene.world.rotateSection(plank, 0, 0, 60, 25);
    scene.world.rotateBearing(bearingPos, 60, 25);
    scene.world.setKineticSpeed(kinetics, 8);
    scene.world.setKineticSpeed(largeCog, -4);
    scene.idle(25);
    scene.overlay.showText(80).pointAt(util.vector.blockSurface(bearingPos.north(), Direction.NORTH)).placeNearTarget().attachKeyFrame().text("Upon receiving Rotational Force, the structure will be rotated according to the hour of the day");
    scene.idle(90);
    scene.overlay.showText(30).pointAt(util.vector.blockSurface(bearingPos.north(), Direction.NORTH)).placeNearTarget().text("3:00");
    scene.world.rotateSection(plank, 0, 0, 30, 12);
    scene.world.rotateBearing(bearingPos, 30, 12);
    scene.idle(42);
    scene.overlay.showText(30).pointAt(util.vector.blockSurface(bearingPos.north(), Direction.NORTH)).placeNearTarget().text("4:00");
    scene.world.rotateSection(plank, 0, 0, 30, 12);
    scene.world.rotateBearing(bearingPos, 30, 12);
    scene.idle(42);
    InputWindowElement clickTheBearing = new InputWindowElement(util.vector.topOf(bearingPos), Pointing.DOWN);
    InputWindowElement clickTheBearingSide = new InputWindowElement(util.vector.blockSurface(bearingPos, Direction.WEST), Pointing.LEFT);
    scene.overlay.showControls(clickTheBearing.rightClick(), 60);
    scene.idle(7);
    scene.world.rotateSection(plank, 0, 0, -120, 0);
    scene.world.rotateBearing(bearingPos, -120, 0);
    scene.overlay.showText(60).pointAt(util.vector.blockSurface(bearingPos, Direction.WEST)).placeNearTarget().attachKeyFrame().text("Right-Click the bearing to start or stop animating the structure");
    scene.idle(70);
    scene.world.hideIndependentSection(plank, Direction.NORTH);
    scene.idle(15);
    ElementLink<WorldSectionElement> hourHand = scene.world.showIndependentSection(util.select.fromTo(3, 3, 1, 3, 5, 2), Direction.SOUTH);
    scene.world.configureCenterOfRotation(hourHand, util.vector.centerOf(bearingPos));
    scene.idle(15);
    scene.overlay.showSelectionWithText(util.select.fromTo(3, 3, 1, 3, 4, 2), 80).placeNearTarget().attachKeyFrame().sharedText("movement_anchors");
    scene.idle(90);
    scene.overlay.showControls(clickTheBearingSide.rightClick(), 20);
    scene.idle(7);
    scene.world.rotateSection(hourHand, 0, 0, 120, 50);
    scene.world.rotateBearing(bearingPos, 120, 50);
    scene.idle(60);
    scene.overlay.showSelectionWithText(util.select.position(bearingPos.north(3)), 80).placeNearTarget().colored(PonderPalette.BLUE).attachKeyFrame().text("In front of the Hour Hand, a second structure can be added");
    scene.idle(90);
    scene.overlay.showControls(clickTheBearingSide.rightClick(), 20);
    scene.idle(7);
    scene.world.rotateSection(hourHand, 0, 0, -120, 0);
    scene.world.rotateBearing(bearingPos, -120, 0);
    scene.idle(10);
    ElementLink<WorldSectionElement> minuteHand = scene.world.showIndependentSection(util.select.fromTo(3, 3, 0, 3, 6, 0), Direction.SOUTH);
    scene.world.configureCenterOfRotation(minuteHand, util.vector.centerOf(bearingPos));
    scene.idle(30);
    scene.overlay.showOutline(PonderPalette.BLUE, minuteHand, util.select.fromTo(3, 3, 0, 3, 6, 0), 85);
    scene.overlay.showSelectionWithText(util.select.fromTo(3, 3, 1, 3, 4, 2), 80).placeNearTarget().colored(PonderPalette.GREEN).text("Ensure the two Structures are not attached to each other through super glue or similar");
    scene.idle(90);
    scene.overlay.showControls(clickTheBearingSide.rightClick(), 20);
    scene.idle(7);
    scene.world.rotateSection(hourHand, 0, 0, 120, 50);
    scene.world.rotateSection(minuteHand, 0, 0, 180, 75);
    scene.world.rotateBearing(bearingPos, 120, 50);
    scene.idle(90);
    scene.world.rotateSection(minuteHand, 0, 0, 6, 3);
    scene.overlay.showText(80).placeNearTarget().pointAt(util.vector.blockSurface(bearingPos.north(3), Direction.NORTH)).colored(PonderPalette.GREEN).text("The Second Structure will now rotate as the Minute Hand");
    scene.markAsFinished();
    for (int i = 0; i < 40; i++) {
        scene.idle(23);
        scene.world.rotateSection(minuteHand, 0, 0, 6, 3);
        if (i == 29)
            scene.world.rotateSection(hourHand, 0, 0, 30, 20);
    }
}
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)

Example 19 with WorldSectionElement

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

the class BeltScenes method depot.

public static void depot(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("depot", "Using Depots");
    scene.configureBasePlate(0, 0, 5);
    scene.showBasePlate();
    scene.idle(5);
    scene.world.setBlock(util.grid.at(3, 2, 2), Blocks.WATER.defaultBlockState(), false);
    BlockPos depotPos = util.grid.at(2, 1, 2);
    scene.world.showSection(util.select.position(2, 1, 2), Direction.DOWN);
    Vec3 topOf = util.vector.topOf(depotPos);
    scene.overlay.showText(60).attachKeyFrame().text("Depots can serve as 'stationary' belt elements").placeNearTarget().pointAt(topOf);
    scene.idle(70);
    scene.overlay.showControls(new InputWindowElement(topOf, Pointing.DOWN).rightClick().withItem(new ItemStack(Items.COPPER_BLOCK)), 20);
    scene.idle(7);
    scene.world.createItemOnBeltLike(depotPos, Direction.NORTH, new ItemStack(Items.COPPER_BLOCK));
    scene.idle(10);
    scene.overlay.showText(70).attachKeyFrame().text("Right-Click to manually place or remove Items from it").placeNearTarget().pointAt(topOf);
    scene.idle(80);
    scene.overlay.showControls(new InputWindowElement(topOf, Pointing.DOWN).rightClick(), 20);
    scene.idle(7);
    scene.world.removeItemsFromBelt(depotPos);
    scene.effects.indicateSuccess(depotPos);
    scene.idle(20);
    scene.world.showSection(util.select.position(depotPos.above(2)), Direction.SOUTH);
    scene.overlay.showText(70).attachKeyFrame().text("Just like Mechanical Belts, it can provide items to processing").placeNearTarget().pointAt(util.vector.blockSurface(depotPos.above(2), Direction.WEST));
    ItemStack bottle = new ItemStack(Items.BUCKET);
    scene.world.createItemOnBeltLike(depotPos, Direction.NORTH, bottle);
    scene.idle(20);
    scene.world.modifyTileNBT(util.select.position(depotPos.above(2)), SpoutTileEntity.class, nbt -> nbt.putInt("ProcessingTicks", 20));
    scene.idle(20);
    scene.world.removeItemsFromBelt(depotPos);
    scene.world.createItemOnBeltLike(depotPos, Direction.UP, new ItemStack(Items.WATER_BUCKET));
    scene.world.modifyTileNBT(util.select.position(depotPos.above(2)), SpoutTileEntity.class, nbt -> nbt.putBoolean("Splash", true));
    scene.idle(30);
    scene.world.removeItemsFromBelt(depotPos);
    scene.world.hideSection(util.select.position(depotPos.above(2)), Direction.SOUTH);
    scene.idle(20);
    ElementLink<WorldSectionElement> spout = scene.world.showIndependentSection(util.select.position(depotPos.above(2).west()), Direction.SOUTH);
    scene.world.moveSection(spout, util.vector.of(1, 0, 0), 0);
    BlockPos pressPos = depotPos.above(2).west();
    ItemStack copper = new ItemStack(Items.COPPER_INGOT);
    scene.world.createItemOnBeltLike(depotPos, Direction.NORTH, copper);
    Vec3 depotCenter = util.vector.centerOf(depotPos);
    scene.idle(10);
    Class<MechanicalPressTileEntity> type = MechanicalPressTileEntity.class;
    scene.world.modifyTileEntity(pressPos, type, pte -> pte.start(Mode.BELT));
    scene.idle(15);
    scene.world.modifyTileEntity(pressPos, type, pte -> pte.makePressingParticleEffect(depotCenter.add(0, 8 / 16f, 0), copper));
    scene.world.removeItemsFromBelt(depotPos);
    ItemStack sheet = AllItems.COPPER_SHEET.asStack();
    scene.world.createItemOnBeltLike(depotPos, Direction.UP, sheet);
    scene.idle(20);
    scene.world.hideIndependentSection(spout, Direction.SOUTH);
    scene.idle(10);
    Selection fanSelect = util.select.fromTo(4, 1, 3, 5, 2, 2).add(util.select.position(3, 1, 2)).add(util.select.position(5, 0, 2));
    scene.world.showSection(fanSelect, Direction.SOUTH);
    ElementLink<WorldSectionElement> water = scene.world.showIndependentSection(util.select.position(3, 1, 0), Direction.SOUTH);
    scene.world.moveSection(water, util.vector.of(0, 1, 2), 0);
    scene.idle(30);
    scene.world.hideSection(fanSelect, Direction.SOUTH);
    scene.world.hideIndependentSection(water, Direction.SOUTH);
    scene.idle(30);
    scene.world.showSection(util.select.fromTo(2, 1, 4, 2, 1, 5).add(util.select.position(2, 0, 5)), Direction.DOWN);
    BlockPos armPos = util.grid.at(2, 1, 4);
    scene.overlay.showText(70).attachKeyFrame().text("...as well as provide Items to Mechanical Arms").placeNearTarget().pointAt(util.vector.blockSurface(armPos, Direction.WEST));
    scene.idle(20);
    scene.world.instructArm(armPos, Phase.MOVE_TO_INPUT, ItemStack.EMPTY, 0);
    scene.idle(37);
    scene.world.removeItemsFromBelt(depotPos);
    scene.world.instructArm(armPos, Phase.SEARCH_OUTPUTS, sheet, -1);
}
Also used : 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) WorldSectionElement(com.simibubi.create.foundation.ponder.element.WorldSectionElement) ItemStack(net.minecraft.world.item.ItemStack) MechanicalPressTileEntity(com.simibubi.create.content.contraptions.components.press.MechanicalPressTileEntity)

Example 20 with WorldSectionElement

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

the class CartAssemblerScenes method dual.

public static void dual(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("cart_assembler_dual", "Assembling Carriage Contraptions");
    scene.configureBasePlate(0, 0, 6);
    scene.scaleSceneView(.9f);
    scene.world.showSection(util.select.layer(0), Direction.UP);
    scene.idle(5);
    for (int z = 0; z < 5; z++) {
        scene.world.showSection(util.select.position(1, 1, z), Direction.DOWN);
        scene.idle(2);
    }
    for (int x = 2; x < 6; x++) {
        scene.world.showSection(util.select.position(x, 1, 4), Direction.DOWN);
        scene.idle(2);
    }
    BlockPos assembler1 = util.grid.at(2, 1, 4);
    BlockPos assembler2 = util.grid.at(5, 1, 4);
    Selection chassis = util.select.fromTo(5, 2, 4, 2, 2, 4);
    scene.idle(5);
    scene.world.showSection(util.select.fromTo(2, 1, 3, 2, 1, 2), Direction.SOUTH);
    scene.idle(5);
    ElementLink<MinecartElement> cart = scene.special.createCart(util.vector.topOf(assembler1.below()), 0, Minecart::new);
    ElementLink<MinecartElement> cart2 = scene.special.createCart(util.vector.topOf(assembler2.below()), 0, MinecartChest::new);
    scene.idle(15);
    scene.world.setBlock(assembler1, AllBlocks.CART_ASSEMBLER.getDefaultState().setValue(CartAssemblerBlock.RAIL_SHAPE, RailShape.EAST_WEST).setValue(CartAssemblerBlock.RAIL_TYPE, CartAssembleRailType.CONTROLLER_RAIL), true);
    scene.idle(5);
    scene.world.setBlock(assembler2, AllBlocks.CART_ASSEMBLER.getDefaultState().setValue(CartAssemblerBlock.RAIL_SHAPE, RailShape.EAST_WEST).setValue(CartAssemblerBlock.RAIL_TYPE, CartAssembleRailType.REGULAR), true);
    scene.idle(5);
    ElementLink<WorldSectionElement> contraption = scene.world.showIndependentSection(chassis, Direction.DOWN);
    scene.idle(15);
    scene.overlay.showOutline(PonderPalette.GREEN, new Object(), util.select.position(assembler2), 60);
    scene.overlay.showSelectionWithText(util.select.position(assembler1), 60).colored(PonderPalette.GREEN).pointAt(util.vector.blockSurface(util.grid.at(2, 2, 4), Direction.NORTH)).placeNearTarget().text("Whenever two Cart Assembers share an attached structure...").attachKeyFrame();
    scene.idle(70);
    scene.overlay.showText(60).pointAt(util.vector.blockSurface(util.grid.at(2, 1, 4), Direction.NORTH)).placeNearTarget().text("Powering either of them will create a Carriage Contraption");
    scene.idle(70);
    scene.effects.indicateRedstone(util.grid.at(2, 1, 2));
    scene.world.toggleRedstonePower(util.select.fromTo(2, 1, 2, 2, 1, 4));
    ElementLink<WorldSectionElement> anchors = scene.world.showIndependentSectionImmediately(util.select.fromTo(assembler1.south(), assembler2.south()));
    scene.world.moveSection(anchors, util.vector.of(0, 0, -1), 0);
    scene.world.configureCenterOfRotation(anchors, util.vector.centerOf(util.grid.at(2, 2, 5)));
    scene.world.configureCenterOfRotation(contraption, util.vector.centerOf(util.grid.at(2, 2, 4)));
    scene.idle(5);
    Vec3 m = util.vector.of(-0.5, 0, 0);
    scene.special.moveCart(cart, m, 5);
    scene.special.moveCart(cart2, m, 5);
    scene.world.moveSection(contraption, m, 5);
    scene.world.moveSection(anchors, m, 5);
    scene.idle(5);
    scene.special.rotateCart(cart, -45, 2);
    scene.special.moveCart(cart2, util.vector.of(-.3, 0, 0), 8);
    m = util.vector.of(-.5, 0, -.5);
    scene.special.moveCart(cart, m, 8);
    scene.world.moveSection(anchors, m, 8);
    scene.world.moveSection(contraption, m, 8);
    scene.world.rotateSection(anchors, 0, -10, 0, 8);
    scene.world.rotateSection(contraption, 0, -10, 0, 8);
    scene.idle(8);
    scene.special.rotateCart(cart, -45, 2);
    scene.special.moveCart(cart2, util.vector.of(-.4, 0, 0), 5);
    m = util.vector.of(0, 0, -3.5);
    scene.special.moveCart(cart, m, 25);
    scene.world.moveSection(anchors, m, 25);
    scene.world.moveSection(contraption, m, 25);
    scene.world.rotateSection(anchors, 0, -33, 0, 10);
    scene.world.rotateSection(contraption, 0, -33, 0, 10);
    scene.idle(5);
    scene.special.moveCart(cart2, util.vector.of(-0.8, 0, 0), 5);
    scene.idle(5);
    scene.special.moveCart(cart2, util.vector.of(-1.5, 0, 0), 9);
    scene.world.rotateSection(anchors, 0, -42, 0, 9);
    scene.world.rotateSection(contraption, 0, -42, 0, 9);
    scene.idle(9);
    m = util.vector.of(-.5, 0, -.5);
    scene.special.moveCart(cart2, m, 2);
    scene.special.rotateCart(cart2, -45, 2);
    scene.world.rotateSection(anchors, 0, -5, 0, 5);
    scene.world.rotateSection(contraption, 0, -5, 0, 5);
    scene.idle(2);
    scene.special.moveCart(cart2, util.vector.of(0, 0, -.5), 5);
    scene.special.rotateCart(cart2, -45, 2);
    scene.idle(10);
    scene.overlay.showText(70).attachKeyFrame().pointAt(util.vector.blockSurface(util.grid.at(1, 1, 3), Direction.WEST)).placeNearTarget().text("The carts will behave like those connected via Minecart Coupling");
    scene.idle(80);
}
Also used : MinecartElement(com.simibubi.create.foundation.ponder.element.MinecartElement) Selection(com.simibubi.create.foundation.ponder.Selection) Vec3(net.minecraft.world.phys.Vec3) Minecart(net.minecraft.world.entity.vehicle.Minecart) MinecartChest(net.minecraft.world.entity.vehicle.MinecartChest) BlockPos(net.minecraft.core.BlockPos) WorldSectionElement(com.simibubi.create.foundation.ponder.element.WorldSectionElement)

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