Search in sources :

Example 46 with WorldSectionElement

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

Example 47 with WorldSectionElement

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

the class CartAssemblerScenes method modes.

public static void modes(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("cart_assembler_modes", "Orientation Settings for Minecart Contraptions");
    scene.configureBasePlate(0, 0, 5);
    scene.world.showSection(util.select.layer(0), Direction.UP);
    scene.idle(5);
    for (int z = 0; z < 4; z++) {
        scene.world.showSection(util.select.position(1, 1, z), Direction.DOWN);
        scene.idle(2);
    }
    for (int x = 2; x < 5; x++) {
        scene.world.showSection(util.select.position(x, 1, 3), Direction.DOWN);
        scene.idle(2);
    }
    BlockPos assemblerPos = util.grid.at(3, 1, 3);
    scene.idle(5);
    scene.world.setBlock(assemblerPos, AllBlocks.CART_ASSEMBLER.getDefaultState().setValue(CartAssemblerBlock.RAIL_SHAPE, RailShape.EAST_WEST).setValue(CartAssemblerBlock.RAIL_TYPE, CartAssembleRailType.REGULAR), true);
    scene.idle(5);
    scene.world.showSection(util.select.fromTo(3, 1, 1, 3, 1, 2), Direction.SOUTH);
    ElementLink<WorldSectionElement> contraption = scene.world.showIndependentSection(util.select.position(3, 2, 3), Direction.DOWN);
    scene.idle(10);
    scene.world.glueBlockOnto(util.grid.at(2, 2, 3), Direction.EAST, contraption);
    scene.world.toggleRedstonePower(util.select.fromTo(3, 1, 1, 3, 1, 3));
    scene.effects.indicateRedstone(util.grid.at(3, 1, 1));
    scene.idle(10);
    ElementLink<MinecartElement> cart = scene.special.createCart(util.vector.topOf(util.grid.at(4, 0, 3)), 0, Minecart::new);
    scene.idle(20);
    scene.special.moveCart(cart, util.vector.of(-1, 0, 0), 10);
    scene.idle(10);
    ElementLink<WorldSectionElement> anchor = scene.world.showIndependentSectionImmediately(util.select.position(assemblerPos.south()));
    scene.world.moveSection(anchor, util.vector.of(0, 0, -1), 0);
    scene.idle(1);
    scene.world.setKineticSpeed(util.select.position(2, 2, 3), 32);
    scene.special.moveCart(cart, util.vector.of(-1.5, 0, 0), 15);
    scene.world.moveSection(anchor, util.vector.of(-1.5, 0, 0), 15);
    scene.world.moveSection(contraption, util.vector.of(-1.5, 0, 0), 15);
    scene.idle(16);
    scene.special.rotateCart(cart, -45, 2);
    scene.special.moveCart(cart, util.vector.of(-.5, 0, -.5), 8);
    scene.world.moveSection(anchor, util.vector.of(-.5, 0, -.5), 8);
    scene.world.moveSection(contraption, util.vector.of(-.5, 0, -.5), 8);
    scene.world.rotateSection(anchor, 0, -90, 0, 12);
    scene.world.rotateSection(contraption, 0, -90, 0, 12);
    scene.idle(9);
    scene.special.rotateCart(cart, -45, 2);
    scene.special.moveCart(cart, util.vector.of(0, 0, -1.5), 15);
    scene.world.moveSection(anchor, util.vector.of(0, 0, -1.5), 15);
    scene.world.moveSection(contraption, util.vector.of(0, 0, -1.5), 15);
    scene.idle(15);
    scene.world.setKineticSpeed(util.select.position(2, 2, 3), 0);
    scene.overlay.showText(80).attachKeyFrame().text("Cart Contraptions will rotate to face towards their carts' motion").pointAt(util.vector.of(1.5, 2.5, 0)).placeNearTarget();
    scene.idle(90);
    scene.overlay.showText(80).attachKeyFrame().text("This Arrow indicates which side of the Structure will be considered the front").pointAt(util.vector.topOf(assemblerPos)).placeNearTarget();
    scene.idle(90);
    scene.world.hideIndependentSection(contraption, Direction.UP);
    scene.world.hideIndependentSection(anchor, Direction.UP);
    scene.special.hideElement(cart, Direction.UP);
    scene.idle(25);
    Vec3 blockSurface = util.vector.blockSurface(assemblerPos, Direction.NORTH).add(0, 0, -2 / 16f);
    scene.overlay.showScrollInput(blockSurface, Direction.NORTH, 60);
    scene.overlay.showControls(new InputWindowElement(blockSurface, Pointing.DOWN).scroll().withWrench(), 60);
    scene.idle(10);
    scene.overlay.showText(60).pointAt(util.vector.of(3, 1.5, 3)).placeNearTarget().sharedText("behaviour_modify_wrench");
    scene.idle(70);
    contraption = scene.world.showIndependentSection(util.select.fromTo(3, 2, 3, 2, 2, 3), Direction.DOWN);
    cart = scene.special.createCart(util.vector.topOf(util.grid.at(4, 0, 3)), 0, Minecart::new);
    scene.idle(10);
    scene.special.moveCart(cart, util.vector.of(-1, 0, 0), 10);
    scene.idle(10);
    anchor = scene.world.showIndependentSectionImmediately(util.select.position(assemblerPos.south()));
    scene.world.moveSection(anchor, util.vector.of(0, 0, -1), 0);
    scene.idle(1);
    scene.world.setKineticSpeed(util.select.position(2, 2, 3), 32);
    scene.special.moveCart(cart, util.vector.of(-1.5, 0, 0), 15);
    scene.world.moveSection(anchor, util.vector.of(-1.5, 0, 0), 15);
    scene.world.moveSection(contraption, util.vector.of(-1.5, 0, 0), 15);
    scene.idle(16);
    scene.special.rotateCart(cart, -45, 2);
    scene.special.moveCart(cart, util.vector.of(-.5, 0, -.5), 8);
    scene.world.moveSection(anchor, util.vector.of(-.5, 0, -.5), 8);
    scene.world.moveSection(contraption, util.vector.of(-.5, 0, -.5), 8);
    scene.idle(9);
    scene.special.rotateCart(cart, -45, 2);
    scene.special.moveCart(cart, util.vector.of(0, 0, -1.5), 15);
    scene.world.moveSection(anchor, util.vector.of(0, 0, -1.5), 15);
    scene.world.moveSection(contraption, util.vector.of(0, 0, -1.5), 15);
    scene.idle(15);
    scene.world.setKineticSpeed(util.select.position(2, 2, 3), 0);
    scene.overlay.showText(80).attachKeyFrame().text("If the Assembler is set to Lock Rotation, the contraptions' orientation will never change").pointAt(util.vector.of(0, 2.5, 1.5)).placeNearTarget();
    scene.idle(90);
}
Also used : MinecartElement(com.simibubi.create.foundation.ponder.element.MinecartElement) Vec3(net.minecraft.world.phys.Vec3) Minecart(net.minecraft.world.entity.vehicle.Minecart) InputWindowElement(com.simibubi.create.foundation.ponder.element.InputWindowElement) BlockPos(net.minecraft.core.BlockPos) WorldSectionElement(com.simibubi.create.foundation.ponder.element.WorldSectionElement)

Example 48 with WorldSectionElement

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

the class KineticsScenes method cogwheelsCanBeEncased.

public static void cogwheelsCanBeEncased(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("cogwheel_casing", "Encasing Cogwheels");
    scene.configureBasePlate(0, 0, 5);
    scene.world.showSection(util.select.layer(0), Direction.UP);
    Selection large1 = util.select.position(4, 1, 3);
    Selection small1 = util.select.fromTo(3, 1, 2, 3, 2, 2);
    Selection small2 = util.select.position(2, 1, 2);
    Selection large2 = util.select.fromTo(1, 1, 3, 1, 1, 4);
    Selection shaft2 = util.select.position(2, 2, 2);
    scene.world.setKineticSpeed(shaft2, 0);
    scene.idle(10);
    scene.world.showSection(large1, Direction.DOWN);
    scene.idle(5);
    scene.world.showSection(small1, Direction.DOWN);
    scene.world.showSection(small2, Direction.DOWN);
    scene.idle(5);
    scene.world.showSection(large2, Direction.EAST);
    scene.idle(20);
    BlockEntry<EncasedCogwheelBlock> andesiteEncased = AllBlocks.ANDESITE_ENCASED_COGWHEEL;
    ItemStack andesiteCasingItem = AllBlocks.ANDESITE_CASING.asStack();
    scene.overlay.showControls(new InputWindowElement(util.vector.topOf(3, 0, 2), Pointing.UP).rightClick().withItem(andesiteCasingItem), 100);
    scene.idle(7);
    scene.world.setBlocks(util.select.position(3, 1, 2), andesiteEncased.getDefaultState().setValue(EncasedCogwheelBlock.AXIS, Axis.Y).setValue(EncasedCogwheelBlock.TOP_SHAFT, true), true);
    scene.world.setKineticSpeed(util.select.position(3, 1, 2), -32);
    scene.idle(15);
    scene.overlay.showControls(new InputWindowElement(util.vector.topOf(2, 1, 2), Pointing.DOWN).rightClick().withItem(andesiteCasingItem), 30);
    scene.idle(7);
    scene.world.setBlocks(small2, andesiteEncased.getDefaultState().setValue(EncasedCogwheelBlock.AXIS, Axis.Y), true);
    scene.world.setKineticSpeed(small2, 32);
    scene.idle(15);
    BlockEntry<EncasedCogwheelBlock> brassEncased = AllBlocks.BRASS_ENCASED_LARGE_COGWHEEL;
    ItemStack brassCasingItem = AllBlocks.BRASS_CASING.asStack();
    scene.overlay.showControls(new InputWindowElement(util.vector.topOf(1, 0, 3), Pointing.UP).rightClick().withItem(brassCasingItem), 60);
    scene.idle(7);
    scene.world.setBlocks(util.select.position(1, 1, 3), brassEncased.getDefaultState().setValue(EncasedCogwheelBlock.AXIS, Axis.Y), true);
    scene.world.setKineticSpeed(util.select.position(1, 1, 3), -16);
    scene.idle(10);
    scene.overlay.showText(70).placeNearTarget().attachKeyFrame().text("Brass or Andesite Casing can be used to decorate Cogwheels").pointAt(util.vector.topOf(1, 1, 3));
    scene.idle(80);
    ElementLink<WorldSectionElement> shaftLink = scene.world.showIndependentSection(shaft2, Direction.DOWN);
    scene.idle(15);
    scene.overlay.showText(90).placeNearTarget().colored(PonderPalette.RED).attachKeyFrame().text("Components added after encasing will not connect to the shaft outputs").pointAt(util.vector.centerOf(2, 2, 2));
    scene.idle(90);
    scene.world.moveSection(shaftLink, new Vec3(0, .5f, 0), 10);
    scene.idle(10);
    scene.addKeyframe();
    Vec3 wrenchHere = util.vector.topOf(2, 1, 2).add(.25, 0, -.25);
    scene.overlay.showControls(new InputWindowElement(wrenchHere, Pointing.RIGHT).rightClick().withWrench(), 25);
    scene.idle(7);
    scene.world.cycleBlockProperty(util.grid.at(2, 1, 2), EncasedCogwheelBlock.TOP_SHAFT);
    scene.idle(15);
    scene.world.moveSection(shaftLink, new Vec3(0, -.5f, 0), 10);
    scene.idle(10);
    scene.world.setKineticSpeed(shaft2, 32);
    scene.effects.rotationDirectionIndicator(util.grid.at(2, 2, 2));
    scene.idle(20);
    scene.overlay.showText(90).placeNearTarget().colored(PonderPalette.GREEN).text("The Wrench can be used to toggle connections").pointAt(wrenchHere.add(-.5, 0, .5));
    scene.idle(40);
    scene.overlay.showControls(new InputWindowElement(wrenchHere, Pointing.RIGHT).rightClick().withWrench(), 25);
    scene.idle(7);
    scene.world.cycleBlockProperty(util.grid.at(2, 1, 2), EncasedCogwheelBlock.TOP_SHAFT);
    scene.world.setKineticSpeed(shaft2, 0);
}
Also used : Selection(com.simibubi.create.foundation.ponder.Selection) Vec3(net.minecraft.world.phys.Vec3) InputWindowElement(com.simibubi.create.foundation.ponder.element.InputWindowElement) EncasedCogwheelBlock(com.simibubi.create.content.contraptions.relays.encased.EncasedCogwheelBlock) WorldSectionElement(com.simibubi.create.foundation.ponder.element.WorldSectionElement) ItemStack(net.minecraft.world.item.ItemStack)

Example 49 with WorldSectionElement

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

the class KineticsScenes method furnaceEngine.

private static void furnaceEngine(SceneBuilder scene, SceneBuildingUtil util, boolean flywheel) {
    scene.title(flywheel ? "flywheel" : "furnace_engine", "Generating Rotational Force using the " + (flywheel ? "Flywheel" : "Furnace Engine"));
    scene.configureBasePlate(0, 0, 6);
    scene.world.showSection(util.select.layer(0), Direction.UP);
    BlockPos furnacePos = util.grid.at(4, 1, 3);
    BlockPos cogPos = util.grid.at(1, 1, 2);
    BlockPos gaugePos = util.grid.at(1, 1, 1);
    scene.idle(5);
    Selection furnaceSelect = util.select.position(furnacePos);
    scene.world.showSection(furnaceSelect, Direction.DOWN);
    scene.idle(10);
    scene.world.showSection(util.select.position(furnacePos.west()), Direction.DOWN);
    scene.idle(10);
    scene.world.showSection(util.select.position(furnacePos.west(3)), Direction.EAST);
    scene.idle(10);
    String text = flywheel ? "Flywheels are required for generating rotational force with the Furnace Engine" : "Furnace Engines generate Rotational Force while their attached Furnace is running";
    scene.overlay.showText(80).attachKeyFrame().placeNearTarget().pointAt(util.vector.topOf(furnacePos.west(flywheel ? 3 : 1))).text(text);
    scene.idle(90);
    scene.overlay.showControls(new InputWindowElement(util.vector.topOf(furnacePos), Pointing.DOWN).withItem(new ItemStack(Items.OAK_LOG)), 30);
    scene.idle(5);
    scene.overlay.showControls(new InputWindowElement(util.vector.blockSurface(furnacePos, Direction.NORTH), Pointing.RIGHT).withItem(new ItemStack(Items.COAL)), 30);
    scene.idle(7);
    scene.world.cycleBlockProperty(furnacePos, FurnaceBlock.LIT);
    scene.effects.emitParticles(util.vector.of(4.5, 1.2, 2.9), Emitter.simple(ParticleTypes.LAVA, Vec3.ZERO), 4, 1);
    scene.world.setKineticSpeed(util.select.fromTo(1, 1, 3, 1, 1, 1), 16);
    scene.idle(40);
    scene.world.showSection(util.select.position(cogPos), Direction.SOUTH);
    scene.idle(15);
    scene.effects.rotationSpeedIndicator(cogPos);
    scene.world.showSection(util.select.position(gaugePos), Direction.SOUTH);
    scene.idle(15);
    scene.overlay.showText(80).attachKeyFrame().placeNearTarget().colored(PonderPalette.GREEN).pointAt(util.vector.blockSurface(gaugePos, Direction.WEST)).text("The provided Rotational Force has a very large stress capacity");
    scene.idle(90);
    ElementLink<WorldSectionElement> engine = scene.world.makeSectionIndependent(util.select.fromTo(3, 1, 3, 1, 1, 1));
    scene.world.moveSection(engine, util.vector.of(0, 1, 0), 15);
    scene.idle(10);
    scene.world.hideSection(furnaceSelect, Direction.NORTH);
    scene.idle(15);
    scene.world.setBlock(furnacePos, Blocks.BLAST_FURNACE.defaultBlockState().setValue(FurnaceBlock.FACING, Direction.NORTH).setValue(FurnaceBlock.LIT, true), false);
    scene.world.showSection(furnaceSelect, Direction.NORTH);
    scene.idle(10);
    scene.world.moveSection(engine, util.vector.of(0, -1, 0), 15);
    scene.idle(10);
    scene.world.setKineticSpeed(util.select.fromTo(1, 1, 3, 1, 1, 1), 32);
    scene.idle(5);
    scene.effects.rotationSpeedIndicator(cogPos);
    scene.overlay.showText(80).placeNearTarget().colored(PonderPalette.MEDIUM).pointAt(util.vector.topOf(furnacePos.west())).text("Using a Blast Furnace will double the efficiency of the Engine");
}
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 50 with WorldSectionElement

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

the class KineticsScenes method waterWheel.

public static void waterWheel(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("water_wheel", "Generating Rotational Force using Water Wheels");
    scene.configureBasePlate(0, 0, 5);
    scene.world.showSection(util.select.layer(0), Direction.UP);
    scene.idle(5);
    scene.world.showSection(util.select.fromTo(4, 1, 1, 4, 3, 3).add(util.select.fromTo(3, 1, 3, 3, 2, 3)), Direction.DOWN);
    scene.world.setKineticSpeed(util.select.everywhere(), 0);
    BlockPos gaugePos = util.grid.at(0, 2, 2);
    for (int i = 0; i < 4; i++) {
        scene.idle(5);
        scene.world.showSection(util.select.fromTo(gaugePos.east(i).below(), gaugePos.east(i)), Direction.DOWN);
    }
    scene.idle(10);
    for (int i = 0; i < 3; i++) {
        scene.idle(5);
        scene.world.showSection(util.select.position(3, 3, 3 - i), Direction.DOWN);
    }
    scene.world.setKineticSpeed(util.select.everywhere(), -12);
    scene.effects.indicateSuccess(gaugePos);
    for (int i = 0; i < 2; i++) {
        scene.idle(5);
        scene.world.showSection(util.select.position(3, 2 - i, 1), Direction.DOWN);
    }
    BlockPos wheel = util.grid.at(3, 2, 2);
    scene.effects.rotationSpeedIndicator(wheel);
    scene.overlay.showText(50).text("Water Wheels draw force from adjacent Water Currents").placeNearTarget().pointAt(util.vector.topOf(wheel));
    scene.idle(50);
    AABB bb = new AABB(wheel).inflate(.125f, 0, 0);
    scene.overlay.chaseBoundingBoxOutline(PonderPalette.MEDIUM, new Object(), bb.move(0, 1.2, 0).contract(0, .75, 0), 80);
    scene.idle(5);
    scene.overlay.chaseBoundingBoxOutline(PonderPalette.MEDIUM, new Object(), bb.move(0, 0, 1.2).contract(0, 0, .75), 80);
    scene.idle(5);
    scene.overlay.chaseBoundingBoxOutline(PonderPalette.MEDIUM, new Object(), bb.move(0, -1.2, 0).contract(0, -.75, 0), 80);
    scene.idle(5);
    scene.overlay.chaseBoundingBoxOutline(PonderPalette.MEDIUM, new Object(), bb.move(0, 0, -1.2).contract(0, 0, -.75), 80);
    scene.idle(5);
    scene.overlay.showText(50).text("The more faces are powered, the faster the Water Wheel will rotate").colored(PonderPalette.MEDIUM).placeNearTarget().pointAt(util.vector.topOf(wheel));
    scene.idle(80);
    scene.rotateCameraY(-30);
    scene.overlay.showText(70).text("The Wheels' blades should be oriented against the flow").attachKeyFrame().placeNearTarget().pointAt(util.vector.topOf(wheel));
    scene.idle(80);
    ElementLink<WorldSectionElement> water = scene.world.makeSectionIndependent(util.select.fromTo(3, 1, 1, 3, 3, 1).add(util.select.fromTo(3, 3, 2, 3, 3, 3)));
    ElementLink<WorldSectionElement> wheelElement = scene.world.makeSectionIndependent(util.select.position(wheel));
    scene.world.setKineticSpeed(util.select.everywhere(), 0);
    scene.world.moveSection(water, util.vector.of(0, 2, -2), 10);
    scene.world.moveSection(wheelElement, util.vector.of(0, 1, -1), 10);
    scene.idle(10);
    scene.world.rotateSection(wheelElement, 0, 180, 0, 5);
    scene.idle(10);
    scene.world.modifyBlock(wheel, s -> s.setValue(WaterWheelBlock.FACING, Direction.WEST), false);
    scene.world.rotateSection(wheelElement, 0, -180, 0, 0);
    scene.idle(1);
    scene.world.moveSection(water, util.vector.of(0, -2, 2), 10);
    scene.world.moveSection(wheelElement, util.vector.of(0, -1, 1), 10);
    scene.idle(10);
    scene.world.setKineticSpeed(util.select.everywhere(), -8);
    scene.overlay.showText(70).colored(PonderPalette.RED).text("Facing the opposite way, they will not be as effective").attachKeyFrame().placeNearTarget().pointAt(util.vector.topOf(wheel));
    scene.idle(80);
    scene.world.setKineticSpeed(util.select.everywhere(), 0);
    scene.world.moveSection(water, util.vector.of(0, 2, -2), 10);
    scene.world.moveSection(wheelElement, util.vector.of(0, 1, -1), 10);
    scene.idle(10);
    scene.rotateCameraY(30);
    scene.world.rotateSection(wheelElement, 0, 180, 0, 5);
    scene.idle(10);
    scene.world.modifyBlock(wheel, s -> s.setValue(WaterWheelBlock.FACING, Direction.EAST), false);
    scene.world.rotateSection(wheelElement, 0, -180, 0, 0);
    scene.idle(1);
    scene.world.moveSection(water, util.vector.of(0, -2, 2), 10);
    scene.world.moveSection(wheelElement, util.vector.of(0, -1, 1), 10);
    scene.idle(10);
    scene.world.setKineticSpeed(util.select.everywhere(), -12);
    scene.effects.indicateSuccess(gaugePos);
}
Also used : BlockPos(net.minecraft.core.BlockPos) WorldSectionElement(com.simibubi.create.foundation.ponder.element.WorldSectionElement) AABB(net.minecraft.world.phys.AABB)

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