Search in sources :

Example 6 with WorldSectionElement

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

the class ChuteScenes method downward.

public static void downward(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("chute", "Transporting Items downward via Chutes");
    scene.configureBasePlate(0, 0, 5);
    scene.scaleSceneView(.9f);
    scene.world.showSection(util.select.layer(0), Direction.UP);
    ElementLink<WorldSectionElement> top = scene.world.showIndependentSection(util.select.fromTo(3, 3, 3, 3, 4, 3), Direction.DOWN);
    ElementLink<WorldSectionElement> bottom = scene.world.showIndependentSection(util.select.fromTo(3, 2, 3, 3, 1, 3), Direction.DOWN);
    scene.world.moveSection(bottom, util.vector.of(-2, 0, -1), 0);
    scene.world.moveSection(top, util.vector.of(0, 0, -1), 0);
    scene.idle(20);
    ItemStack stack = new ItemStack(Items.COPPER_BLOCK);
    scene.world.createItemEntity(util.vector.centerOf(util.grid.at(3, 3, 2)), util.vector.of(0, -0.1, 0), stack);
    scene.idle(20);
    ElementLink<EntityElement> remove = scene.world.createItemEntity(util.vector.centerOf(util.grid.at(1, 5, 2)), util.vector.of(0, 0.1, 0), stack);
    scene.idle(15);
    scene.world.modifyEntity(remove, Entity::discard);
    scene.overlay.showText(60).attachKeyFrame().pointAt(util.vector.topOf(util.grid.at(1, 2, 2))).placeNearTarget().text("Chutes can transport items vertically from and to inventories");
    scene.idle(70);
    scene.world.modifyEntities(ItemEntity.class, Entity::discard);
    scene.world.moveSection(bottom, util.vector.of(1, 0, 0), 10);
    scene.world.moveSection(top, util.vector.of(-1, 0, 0), 10);
    scene.idle(20);
    scene.overlay.showControls(new InputWindowElement(util.vector.blockSurface(util.grid.at(2, 3, 2), Direction.NORTH), Pointing.RIGHT).rightClick().withWrench(), 40);
    scene.idle(7);
    scene.world.modifyBlock(util.grid.at(3, 3, 3), s -> s.setValue(ChuteBlock.SHAPE, ChuteBlock.Shape.WINDOW), false);
    scene.overlay.showText(50).attachKeyFrame().pointAt(util.vector.blockSurface(util.grid.at(2, 3, 2), Direction.WEST)).placeNearTarget().text("Using the Wrench, a window can be created");
    scene.idle(10);
    scene.world.modifyBlock(util.grid.at(3, 2, 3), s -> s.setValue(SHAPE, Shape.WINDOW), false);
    for (int i = 0; i < 8; i++) {
        scene.idle(10);
        scene.world.createItemOnBeltLike(util.grid.at(3, 3, 3), Direction.UP, stack);
    }
    scene.idle(20);
    scene.world.hideIndependentSection(bottom, Direction.EAST);
    scene.world.hideIndependentSection(top, Direction.EAST);
    scene.idle(15);
    scene.rotateCameraY(-90);
    scene.world.modifyBlock(util.grid.at(2, 2, 1), s -> s.setValue(SHAPE, Shape.NORMAL), false);
    scene.world.showSection(util.select.fromTo(2, 1, 1, 2, 2, 1), Direction.DOWN);
    scene.idle(30);
    ItemStack chuteItem = AllBlocks.CHUTE.asStack();
    scene.overlay.showControls(new InputWindowElement(util.vector.blockSurface(util.grid.at(2, 2, 1), Direction.SOUTH), Pointing.LEFT).rightClick().withItem(chuteItem), 30);
    scene.idle(7);
    scene.world.showSection(util.select.position(2, 3, 2), Direction.NORTH);
    scene.world.restoreBlocks(util.select.position(2, 2, 1));
    scene.idle(35);
    scene.overlay.showControls(new InputWindowElement(util.vector.blockSurface(util.grid.at(2, 3, 2), Direction.SOUTH), Pointing.LEFT).rightClick().withItem(chuteItem), 30);
    scene.idle(7);
    scene.world.showSection(util.select.position(2, 4, 3), Direction.NORTH);
    scene.idle(35);
    scene.overlay.showText(70).attachKeyFrame().pointAt(util.vector.blockSurface(util.grid.at(2, 4, 3), Direction.WEST)).placeNearTarget().text("Placing chutes targeting the side faces of another will make it diagonal");
    scene.idle(15);
    scene.rotateCameraY(90);
    scene.idle(35);
    Direction offset = Direction.NORTH;
    for (int i = 0; i < 3; i++) {
        remove = scene.world.createItemEntity(util.vector.centerOf(util.grid.at(2, 6, 3).relative(offset)), util.vector.of(0, 0.1, 0).add(Vec3.atLowerCornerOf(offset.getNormal()).scale(-.1)), stack);
        scene.idle(12);
        scene.world.createItemOnBeltLike(util.grid.at(2, 4, 3), Direction.UP, stack);
        scene.world.modifyEntity(remove, Entity::discard);
        scene.idle(3);
        offset = offset.getClockWise();
    }
    scene.idle(10);
    scene.overlay.showControls(new InputWindowElement(util.vector.blockSurface(util.grid.at(2, 1, 1), Direction.NORTH), Pointing.RIGHT).withItem(stack), 50);
}
Also used : Entity(net.minecraft.world.entity.Entity) ItemEntity(net.minecraft.world.entity.item.ItemEntity) SmartChuteTileEntity(com.simibubi.create.content.logistics.block.chute.SmartChuteTileEntity) InputWindowElement(com.simibubi.create.foundation.ponder.element.InputWindowElement) WorldSectionElement(com.simibubi.create.foundation.ponder.element.WorldSectionElement) EntityElement(com.simibubi.create.foundation.ponder.element.EntityElement) ItemStack(net.minecraft.world.item.ItemStack) Direction(net.minecraft.core.Direction)

Example 7 with WorldSectionElement

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

the class FunnelScenes method transposer.

public static void transposer(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("funnel_transfer", "Direct transfer");
    scene.configureBasePlate(0, 0, 5);
    scene.world.showSection(util.select.layer(0), Direction.UP);
    scene.idle(5);
    BlockPos funnelPos = util.grid.at(2, 2, 2);
    Selection funnelSelect = util.select.position(funnelPos);
    ElementLink<WorldSectionElement> rightChest = scene.world.showIndependentSection(util.select.position(0, 2, 2), Direction.DOWN);
    ElementLink<WorldSectionElement> leftChest = scene.world.showIndependentSection(util.select.position(4, 2, 2), Direction.DOWN);
    scene.world.moveSection(rightChest, util.vector.of(2, 1, 0), 0);
    scene.world.moveSection(leftChest, util.vector.of(-2, -1, 0), 0);
    scene.idle(5);
    scene.world.showSection(funnelSelect, Direction.DOWN);
    scene.idle(20);
    scene.overlay.showSelectionWithText(funnelSelect, 40).colored(PonderPalette.RED).text("Funnels cannot ever transfer between closed inventories directly.").attachKeyFrame().placeNearTarget();
    scene.idle(50);
    scene.world.hideSection(funnelSelect, Direction.SOUTH);
    scene.idle(20);
    scene.world.setBlocks(funnelSelect, AllBlocks.CHUTE.getDefaultState(), false);
    scene.world.showSection(funnelSelect, Direction.NORTH);
    scene.idle(10);
    scene.overlay.showText(40).colored(PonderPalette.GREEN).text("Chutes or Smart chutes might be more suitable for such purposes.").attachKeyFrame().pointAt(util.vector.centerOf(funnelPos)).placeNearTarget();
    scene.idle(50);
    scene.world.hideSection(funnelSelect, Direction.UP);
    scene.world.hideIndependentSection(leftChest, Direction.UP);
    scene.world.hideIndependentSection(rightChest, Direction.UP);
    scene.idle(20);
    Selection belt = util.select.layer(1);
    scene.world.setBlocks(funnelSelect, Blocks.AIR.defaultBlockState(), false);
    scene.world.showSection(belt, Direction.DOWN);
    scene.world.showSection(util.select.fromTo(0, 2, 2, 4, 2, 2), Direction.DOWN);
    scene.overlay.showText(120).colored(PonderPalette.GREEN).text("Same applies for horizontal movement. A mechanical belt should help here.").pointAt(util.vector.topOf(1, 2, 2)).placeNearTarget();
    scene.markAsFinished();
}
Also used : Selection(com.simibubi.create.foundation.ponder.Selection) BlockPos(net.minecraft.core.BlockPos) WorldSectionElement(com.simibubi.create.foundation.ponder.element.WorldSectionElement)

Example 8 with WorldSectionElement

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

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

the class GantryScenes method intro.

private static void intro(SceneBuilder scene, SceneBuildingUtil util, boolean pinion) {
    String id = "gantry_" + (pinion ? "carriage" : "shaft");
    String title = "Using Gantry " + (pinion ? "Carriages" : "Shafts");
    scene.title(id, title);
    scene.world.modifyKineticSpeed(util.select.everywhere(), f -> -2 * f);
    scene.configureBasePlate(0, 0, 5);
    scene.world.showSection(util.select.layer(0), Direction.UP);
    scene.idle(10);
    scene.world.showSection(util.select.layer(1), Direction.DOWN);
    scene.idle(10);
    ElementLink<WorldSectionElement> gantry = scene.world.showIndependentSection(util.select.layer(2), Direction.DOWN);
    scene.idle(10);
    BlockPos centralShaft = util.grid.at(2, 1, 2);
    scene.world.moveSection(gantry, util.vector.of(-4, 0, 0), 60);
    String text = pinion ? "Gantry Carriages can mount to and slide along a Gantry Shaft." : "Gantry Shafts form the basis of a gantry setup. Attached Carriages will move along them.";
    scene.overlay.showText(80).attachKeyFrame().text(text).pointAt(util.vector.centerOf(centralShaft));
    scene.idle(80);
    scene.world.hideIndependentSection(gantry, Direction.UP);
    scene.idle(10);
    gantry = scene.world.showIndependentSection(util.select.layer(2), Direction.DOWN);
    Vec3 gantryTop = util.vector.topOf(4, 2, 2);
    scene.world.modifyKineticSpeed(util.select.everywhere(), f -> 0f);
    scene.overlay.showText(40).attachKeyFrame().text("Gantry setups can move attached Blocks.").pointAt(gantryTop).placeNearTarget();
    scene.idle(30);
    Selection planks = util.select.position(5, 3, 1);
    scene.world.showSectionAndMerge(util.select.layersFrom(3).substract(planks), Direction.DOWN, gantry);
    scene.idle(10);
    scene.world.showSectionAndMerge(planks, Direction.SOUTH, gantry);
    scene.idle(10);
    scene.effects.superGlue(util.grid.at(5, 3, 1), Direction.SOUTH, true);
    scene.idle(20);
    scene.overlay.showText(80).attachKeyFrame().sharedText("movement_anchors").pointAt(gantryTop).placeNearTarget();
    scene.idle(80);
    scene.world.modifyKineticSpeed(util.select.layer(0), f -> 32f);
    scene.world.modifyKineticSpeed(util.select.layer(1), f -> -64f);
    scene.world.moveSection(gantry, util.vector.of(-4, 0, 0), 60);
    scene.idle(20);
    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)

Example 10 with WorldSectionElement

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

the class GantryScenes method direction.

public static void direction(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("gantry_direction", "Gantry Movement Direction");
    scene.configureBasePlate(0, 0, 5);
    scene.world.modifyKineticSpeed(util.select.everywhere(), f -> -f);
    scene.world.showSection(util.select.layer(0), Direction.UP);
    scene.idle(10);
    Selection shaftAndGearshiftAndLever = util.select.fromTo(0, 1, 2, 5, 2, 2);
    Selection shafts = util.select.fromTo(0, 1, 2, 3, 1, 2);
    scene.world.showSection(shaftAndGearshiftAndLever, Direction.DOWN);
    scene.overlay.showText(60).text("Gantry Shafts can have opposite orientations").pointAt(util.vector.of(2, 1.5, 2.5)).placeNearTarget();
    scene.idle(60);
    ElementLink<WorldSectionElement> gantry1 = scene.world.showIndependentSection(util.select.position(0, 1, 3), Direction.NORTH);
    ElementLink<WorldSectionElement> gantry2 = scene.world.showIndependentSection(util.select.position(3, 1, 3), Direction.NORTH);
    scene.idle(10);
    scene.world.moveSection(gantry1, util.vector.of(1, 0, 0), 20);
    scene.world.moveSection(gantry2, util.vector.of(-1, 0, 0), 20);
    scene.overlay.showText(80).attachKeyFrame().text("The movement direction of carriages depend on their shafts' orientation").pointAt(util.vector.topOf(1, 1, 3)).placeNearTarget();
    scene.idle(80);
    BlockPos lastShaft = util.grid.at(0, 1, 2);
    boolean flip = true;
    for (int i = 0; i < 3; i++) {
        scene.world.modifyBlocks(util.select.fromTo(4, 1, 2, 4, 2, 2), s -> s.cycle(BlockStateProperties.POWERED), false);
        scene.effects.indicateRedstone(util.grid.at(4, 2, 2));
        scene.world.moveSection(gantry1, util.vector.of(flip ? -1 : 1, 0, 0), 20);
        scene.world.moveSection(gantry2, util.vector.of(flip ? 1 : -1, 0, 0), 20);
        scene.world.modifyKineticSpeed(shafts, f -> -f);
        scene.effects.rotationDirectionIndicator(lastShaft.east(flip ? 1 : 0));
        scene.idle(20);
        if (i == 0) {
            scene.overlay.showText(80).attachKeyFrame().text("...as well as the rotation direction of the shaft").pointAt(util.vector.blockSurface(lastShaft, Direction.WEST)).placeNearTarget();
        }
        scene.idle(30);
        flip = !flip;
    }
    Selection kinetics = util.select.fromTo(0, 2, 3, 3, 3, 3);
    Selection gears1 = util.select.fromTo(0, 1, 3, 0, 3, 3);
    Selection gears2 = util.select.fromTo(3, 1, 3, 3, 3, 3);
    scene.world.showSection(kinetics, Direction.DOWN);
    scene.world.showSection(util.select.fromTo(0, 1, 0, 4, 1, 1), Direction.SOUTH);
    scene.idle(20);
    BlockPos leverPos = util.grid.at(4, 1, 0);
    scene.world.modifyBlocks(util.select.fromTo(1, 1, 0, 3, 1, 1), s -> s.hasProperty(RedStoneWireBlock.POWER) ? s.setValue(RedStoneWireBlock.POWER, 15) : s, false);
    scene.world.toggleRedstonePower(util.select.position(leverPos));
    scene.world.toggleRedstonePower(shafts);
    scene.effects.indicateRedstone(leverPos);
    scene.world.modifyKineticSpeed(gears1, f -> -32f);
    scene.world.modifyKineticSpeed(gears2, f -> 32f);
    scene.idle(20);
    scene.overlay.showText(120).attachKeyFrame().text("Same rules apply for the propagated rotation").pointAt(util.vector.topOf(0, 3, 3)).placeNearTarget();
    scene.idle(20);
    for (boolean flip2 : Iterate.trueAndFalse) {
        scene.effects.rotationDirectionIndicator(util.grid.at(0, 3, 3));
        scene.effects.rotationDirectionIndicator(util.grid.at(3, 3, 3));
        scene.idle(60);
        scene.world.modifyBlocks(util.select.fromTo(4, 1, 2, 4, 2, 2), s -> s.cycle(BlockStateProperties.POWERED), false);
        scene.effects.indicateRedstone(util.grid.at(4, 2, 2));
        scene.world.modifyKineticSpeed(gears1, f -> -f);
        scene.world.modifyKineticSpeed(gears2, f -> -f);
        if (!flip2) {
            scene.effects.rotationDirectionIndicator(util.grid.at(0, 3, 3));
            scene.effects.rotationDirectionIndicator(util.grid.at(3, 3, 3));
            scene.markAsFinished();
        }
    }
}
Also used : Selection(com.simibubi.create.foundation.ponder.Selection) 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