Search in sources :

Example 31 with InputWindowElement

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

the class RedstoneScenes method poweredToggleLatch.

public static void poweredToggleLatch(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("powered_toggle_latch", "Controlling signals using the Powered Toggle Latch");
    scene.configureBasePlate(0, 0, 5);
    scene.world.showSection(util.select.layer(0), Direction.UP);
    BlockPos circuitPos = util.grid.at(2, 1, 2);
    BlockPos buttonPos = util.grid.at(4, 1, 2);
    Vec3 circuitTop = util.vector.blockSurface(circuitPos, Direction.DOWN).add(0, 3 / 16f, 0);
    scene.world.showSection(util.select.layersFrom(1).substract(util.select.position(circuitPos)), Direction.UP);
    scene.idle(10);
    scene.world.showSection(util.select.position(circuitPos), Direction.DOWN);
    scene.idle(20);
    scene.overlay.showText(40).attachKeyFrame().text("Powered Toggle Latches are redstone controllable Levers").placeNearTarget().pointAt(circuitTop);
    scene.idle(50);
    scene.effects.indicateRedstone(buttonPos);
    scene.world.toggleRedstonePower(util.select.fromTo(4, 1, 2, 0, 1, 2));
    scene.world.cycleBlockProperty(circuitPos, ToggleLatchBlock.POWERING);
    scene.idle(30);
    scene.world.toggleRedstonePower(util.select.fromTo(4, 1, 2, 3, 1, 2));
    AABB bb = new AABB(circuitPos).inflate(-.48f, -.45f, -.05f).move(.575, -.45, 0);
    scene.overlay.chaseBoundingBoxOutline(PonderPalette.GREEN, bb, bb, 40);
    scene.overlay.showText(40).colored(PonderPalette.GREEN).text("Signals at the back will toggle its state").placeNearTarget().pointAt(bb.getCenter());
    scene.idle(60);
    scene.effects.indicateRedstone(buttonPos);
    scene.world.toggleRedstonePower(util.select.fromTo(4, 1, 2, 0, 1, 2));
    scene.world.cycleBlockProperty(circuitPos, ToggleLatchBlock.POWERING);
    scene.idle(30);
    scene.world.toggleRedstonePower(util.select.fromTo(4, 1, 2, 3, 1, 2));
    scene.overlay.chaseBoundingBoxOutline(PonderPalette.RED, bb, bb, 40);
    scene.overlay.showText(30).colored(PonderPalette.RED).text("...on and back off").placeNearTarget().pointAt(bb.getCenter());
    scene.idle(50);
    scene.addKeyframe();
    scene.idle(10);
    scene.overlay.showControls(new InputWindowElement(circuitTop, Pointing.DOWN).rightClick(), 40);
    scene.idle(7);
    scene.world.toggleRedstonePower(util.select.fromTo(2, 1, 2, 0, 1, 2));
    scene.world.cycleBlockProperty(circuitPos, ToggleLatchBlock.POWERING);
    scene.idle(10);
    scene.overlay.showText(50).text("Powered toggle latches can also be toggled manually").placeNearTarget().pointAt(circuitTop);
    scene.idle(60);
    scene.overlay.showControls(new InputWindowElement(circuitTop, Pointing.DOWN).rightClick(), 40);
    scene.idle(7);
    scene.world.toggleRedstonePower(util.select.fromTo(2, 1, 2, 0, 1, 2));
    scene.world.cycleBlockProperty(circuitPos, ToggleLatchBlock.POWERING);
    scene.idle(10);
}
Also used : Vec3(net.minecraft.world.phys.Vec3) InputWindowElement(com.simibubi.create.foundation.ponder.element.InputWindowElement) BlockPos(net.minecraft.core.BlockPos) AABB(net.minecraft.world.phys.AABB)

Example 32 with InputWindowElement

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

the class TunnelScenes method brassModes.

public static void brassModes(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("brass_tunnel_modes", "Distribution Modes of the Brass Tunnel");
    scene.configureBasePlate(0, 1, 5);
    BlockState barrier = Blocks.BARRIER.defaultBlockState();
    scene.world.setBlock(util.grid.at(1, 1, 0), barrier, false);
    scene.world.showSection(util.select.layer(0), Direction.UP);
    scene.idle(5);
    scene.world.showSection(util.select.fromTo(1, 1, 1, 5, 1, 5).add(util.select.fromTo(3, 2, 5, 1, 2, 5)), Direction.DOWN);
    scene.idle(10);
    for (int i = 0; i < 3; i++) {
        scene.world.showSection(util.select.position(3 - i, 2, 3), Direction.DOWN);
        scene.idle(4);
    }
    Vec3 tunnelTop = util.vector.topOf(util.grid.at(2, 2, 3));
    scene.overlay.showControls(new InputWindowElement(tunnelTop, Pointing.DOWN).scroll().withWrench(), 80);
    scene.idle(7);
    scene.overlay.showCenteredScrollInput(util.grid.at(2, 2, 3), Direction.UP, 120);
    scene.overlay.showText(120).attachKeyFrame().pointAt(tunnelTop).placeNearTarget().text("Using a Wrench, the distribution behaviour of Brass Tunnels can be configured");
    scene.idle(130);
    Class<BrassTunnelTileEntity> tunnelClass = BrassTunnelTileEntity.class;
    ElementLink<WorldSectionElement> blockage = scene.world.showIndependentSection(util.select.position(4, 1, 0), Direction.UP);
    scene.world.moveSection(blockage, util.vector.of(-3, 0, 0), 0);
    Vec3 modeVec = util.vector.of(4, 2.5, 3);
    scene.overlay.showControls(new InputWindowElement(modeVec, Pointing.RIGHT).showing(AllIcons.I_TUNNEL_SPLIT), 140);
    ElementLink<WorldSectionElement> blockage2 = null;
    for (int i = 0; i < 32; i++) {
        if (i < 30)
            scene.world.createItemOnBelt(util.grid.at(1, 1, 5), Direction.EAST, new ItemStack(Items.SNOWBALL, 12));
        scene.idle(i > 8 ? 30 : 40);
        if (i == 0) {
            scene.overlay.showText(80).attachKeyFrame().pointAt(tunnelTop).placeNearTarget().text("'Split' will attempt to distribute the stack evenly between available outputs");
        }
        if (i == 2) {
            scene.overlay.showText(60).text("If an output is unable to take more items, it will be skipped").pointAt(util.vector.blockSurface(util.grid.at(1, 1, 2), Direction.UP)).placeNearTarget().colored(PonderPalette.GREEN);
        }
        if (i == 4) {
            scene.overlay.showControls(new InputWindowElement(modeVec, Pointing.RIGHT).showing(AllIcons.I_TUNNEL_FORCED_SPLIT), 140);
            scene.world.modifyTileEntity(util.grid.at(1, 2, 3), tunnelClass, te -> te.getBehaviour(ScrollOptionBehaviour.TYPE).setValue(BrassTunnelTileEntity.SelectionMode.FORCED_SPLIT.ordinal()));
        }
        if (i == 5) {
            scene.overlay.showText(80).attachKeyFrame().text("'Forced Split' will never skip outputs, and instead wait until they are free").pointAt(util.vector.blockSurface(util.grid.at(1, 1, 2), Direction.UP)).placeNearTarget().colored(PonderPalette.RED);
            scene.idle(60);
            scene.world.moveSection(blockage, util.vector.of(-1, 0, 0), 10);
            scene.world.setBlock(util.grid.at(1, 1, 0), Blocks.AIR.defaultBlockState(), false);
            scene.world.multiplyKineticSpeed(util.select.everywhere(), 1.5f);
        }
        if (i == 7) {
            scene.world.modifyTileEntity(util.grid.at(1, 2, 3), tunnelClass, te -> te.getBehaviour(ScrollOptionBehaviour.TYPE).setValue(BrassTunnelTileEntity.SelectionMode.ROUND_ROBIN.ordinal()));
            scene.overlay.showControls(new InputWindowElement(modeVec, Pointing.RIGHT).showing(AllIcons.I_TUNNEL_ROUND_ROBIN), 140);
            scene.overlay.showText(80).attachKeyFrame().pointAt(tunnelTop).placeNearTarget().text("'Round Robin' keeps stacks whole, and cycles through outputs iteratively");
        }
        if (i == 7) {
            scene.world.moveSection(blockage, util.vector.of(1, 0, 0), 10);
            scene.world.setBlock(util.grid.at(1, 1, 0), barrier, false);
        }
        if (i == 13) {
            scene.overlay.showText(60).text("Once Again, if an output is unable to take more items, it will be skipped").placeNearTarget().pointAt(util.vector.blockSurface(util.grid.at(1, 1, 2), Direction.UP)).colored(PonderPalette.GREEN);
        }
        if (i == 15) {
            scene.overlay.showControls(new InputWindowElement(modeVec, Pointing.RIGHT).showing(AllIcons.I_TUNNEL_FORCED_ROUND_ROBIN), 140);
            scene.world.modifyTileEntity(util.grid.at(1, 2, 3), tunnelClass, te -> te.getBehaviour(ScrollOptionBehaviour.TYPE).setValue(BrassTunnelTileEntity.SelectionMode.FORCED_ROUND_ROBIN.ordinal()));
        }
        if (i == 16) {
            scene.overlay.showText(50).attachKeyFrame().placeNearTarget().text("'Forced Round Robin' never skips outputs").pointAt(util.vector.blockSurface(util.grid.at(1, 1, 2), Direction.UP)).colored(PonderPalette.RED);
            scene.idle(30);
            scene.world.moveSection(blockage, util.vector.of(-1, 0, 0), 10);
            scene.world.setBlock(util.grid.at(1, 1, 0), Blocks.AIR.defaultBlockState(), false);
        }
        if (i == 19) {
            scene.overlay.showControls(new InputWindowElement(modeVec, Pointing.RIGHT).showing(AllIcons.I_TUNNEL_PREFER_NEAREST), 140);
            scene.world.modifyTileEntity(util.grid.at(1, 2, 3), tunnelClass, te -> te.getBehaviour(ScrollOptionBehaviour.TYPE).setValue(BrassTunnelTileEntity.SelectionMode.PREFER_NEAREST.ordinal()));
            scene.world.moveSection(blockage, util.vector.of(1, 0, 0), 10);
            scene.world.setBlock(util.grid.at(1, 1, 0), barrier, false);
            scene.overlay.showText(70).attachKeyFrame().text("'Prefer Nearest' prioritizes the outputs closest to the items' input location").pointAt(util.vector.blockSurface(util.grid.at(1, 1, 2), Direction.UP)).placeNearTarget().colored(PonderPalette.GREEN);
        }
        if (i == 21) {
            scene.world.setBlock(util.grid.at(2, 1, 0), Blocks.BARRIER.defaultBlockState(), false);
            blockage2 = scene.world.showIndependentSection(util.select.position(4, 1, 0), Direction.UP);
            scene.world.moveSection(blockage2, util.vector.of(-2, 0, 0), 0);
        }
        if (i == 25) {
            scene.world.hideIndependentSection(blockage, Direction.DOWN);
            scene.world.setBlock(util.grid.at(1, 1, 0), Blocks.AIR.defaultBlockState(), false);
            scene.world.hideIndependentSection(blockage2, Direction.DOWN);
            scene.world.setBlock(util.grid.at(2, 1, 0), Blocks.AIR.defaultBlockState(), false);
        }
        if (i == 26) {
            scene.overlay.showControls(new InputWindowElement(modeVec, Pointing.RIGHT).showing(AllIcons.I_TUNNEL_RANDOMIZE), 140);
            scene.world.modifyTileEntity(util.grid.at(1, 2, 3), tunnelClass, te -> te.getBehaviour(ScrollOptionBehaviour.TYPE).setValue(BrassTunnelTileEntity.SelectionMode.RANDOMIZE.ordinal()));
        }
        if (i == 27) {
            scene.overlay.showText(70).attachKeyFrame().text("'Randomize' will distribute whole stacks to randomly picked outputs").pointAt(tunnelTop).placeNearTarget();
        }
    }
    scene.world.hideSection(util.select.fromTo(3, 2, 5, 1, 2, 5), Direction.UP);
    scene.idle(10);
    scene.overlay.showControls(new InputWindowElement(modeVec, Pointing.RIGHT).showing(AllIcons.I_TUNNEL_SYNCHRONIZE), 140);
    scene.world.modifyTileEntity(util.grid.at(1, 2, 3), tunnelClass, te -> te.getBehaviour(ScrollOptionBehaviour.TYPE).setValue(BrassTunnelTileEntity.SelectionMode.SYNCHRONIZE.ordinal()));
    scene.idle(30);
    scene.overlay.showText(70).attachKeyFrame().text("'Synchronize Inputs' is a unique setting for Brass Tunnels").pointAt(tunnelTop).placeNearTarget();
    ItemStack item1 = new ItemStack(Items.CARROT);
    ItemStack item2 = new ItemStack(Items.HONEY_BOTTLE);
    ItemStack item3 = AllItems.POLISHED_ROSE_QUARTZ.asStack();
    scene.world.createItemOnBelt(util.grid.at(3, 1, 4), Direction.UP, item1);
    scene.world.createItemOnBelt(util.grid.at(2, 1, 4), Direction.UP, item2);
    scene.world.createItemOnBelt(util.grid.at(3, 1, 5), Direction.SOUTH, item1);
    scene.world.createItemOnBelt(util.grid.at(2, 1, 5), Direction.SOUTH, item2);
    scene.idle(80);
    scene.world.createItemOnBelt(util.grid.at(2, 1, 5), Direction.SOUTH, item2);
    scene.rotateCameraY(-90);
    scene.idle(20);
    scene.world.multiplyKineticSpeed(util.select.everywhere(), .5f);
    scene.overlay.showText(70).text("Items are only allowed past if every tunnel in the group has one waiting").pointAt(util.vector.blockSurface(util.grid.at(2, 1, 4), Direction.UP)).placeNearTarget().colored(PonderPalette.OUTPUT);
    scene.idle(60);
    scene.world.createItemOnBelt(util.grid.at(1, 1, 5), Direction.SOUTH, item3);
    scene.idle(90);
    scene.rotateCameraY(90);
    scene.overlay.showText(100).text("This ensures that all affected belts supply items at the same rate").pointAt(util.vector.blockSurface(util.grid.at(1, 2, 3), Direction.WEST)).placeNearTarget().colored(PonderPalette.GREEN);
}
Also used : BrassTunnelTileEntity(com.simibubi.create.content.logistics.block.belts.tunnel.BrassTunnelTileEntity) BlockState(net.minecraft.world.level.block.state.BlockState) Vec3(net.minecraft.world.phys.Vec3) InputWindowElement(com.simibubi.create.foundation.ponder.element.InputWindowElement) WorldSectionElement(com.simibubi.create.foundation.ponder.element.WorldSectionElement) ItemStack(net.minecraft.world.item.ItemStack)

Example 33 with InputWindowElement

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

the class TunnelScenes method brass.

public static void brass(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("brass_tunnel", "Using Brass Tunnels");
    scene.configureBasePlate(1, 0, 5);
    scene.world.cycleBlockProperty(util.grid.at(3, 1, 2), BeltBlock.CASING);
    scene.world.showSection(util.select.layer(0), Direction.UP);
    scene.idle(5);
    scene.world.showSection(util.select.fromTo(5, 1, 5, 5, 1, 3), Direction.DOWN);
    scene.idle(5);
    scene.world.showSection(util.select.fromTo(5, 1, 2, 1, 1, 2), Direction.SOUTH);
    scene.idle(10);
    Vector<ElementLink<WorldSectionElement>> tunnels = new Vector<>(3);
    for (int i = 0; i < 3; i++) {
        tunnels.add(scene.world.showIndependentSection(util.select.position(2 + i, 2, 4), Direction.DOWN));
        scene.world.moveSection(tunnels.get(i), util.vector.of(0, 0, -2), 0);
        scene.idle(4);
    }
    for (int i = 0; i < 3; i++) {
        scene.world.cycleBlockProperty(util.grid.at(2 + i, 1, 2), BeltBlock.CASING);
        scene.world.modifyTileNBT(util.select.position(2 + i, 1, 2), BeltTileEntity.class, nbt -> NBTHelper.writeEnum(nbt, "Casing", BeltTileEntity.CasingType.BRASS), true);
        scene.idle(4);
    }
    scene.overlay.showText(60).attachKeyFrame().pointAt(util.vector.topOf(util.grid.at(2, 2, 2))).placeNearTarget().text("Brass Tunnels can be used to cover up your belts");
    scene.idle(70);
    for (int i = 0; i < 3; i++) {
        scene.world.cycleBlockProperty(util.grid.at(2 + i, 1, 2), BeltBlock.CASING);
        scene.world.hideIndependentSection(tunnels.get(i), Direction.UP);
        scene.idle(4);
    }
    scene.idle(10);
    scene.world.showSection(util.select.fromTo(3, 1, 0, 1, 1, 1), Direction.SOUTH);
    scene.idle(10);
    scene.world.showSection(util.select.position(3, 2, 2), Direction.DOWN);
    scene.idle(10);
    scene.world.cycleBlockProperty(util.grid.at(3, 1, 2), BeltBlock.CASING);
    scene.idle(10);
    BlockPos tunnelPos = util.grid.at(3, 2, 2);
    for (Direction d : Iterate.horizontalDirections) {
        if (d == Direction.SOUTH)
            continue;
        Vec3 filter = getTunnelFilterVec(tunnelPos, d);
        scene.overlay.showFilterSlotInput(filter, 40);
        scene.idle(3);
    }
    scene.overlay.showText(60).attachKeyFrame().pointAt(getTunnelFilterVec(tunnelPos, Direction.WEST)).placeNearTarget().text("Brass Tunnels have filter slots on each open side");
    scene.idle(70);
    scene.rotateCameraY(70);
    scene.idle(20);
    Vec3 tunnelFilterVec = getTunnelFilterVec(tunnelPos, Direction.EAST);
    scene.overlay.showFilterSlotInput(tunnelFilterVec, 40);
    scene.overlay.showText(60).attachKeyFrame().pointAt(tunnelFilterVec).placeNearTarget().text("Filters on inbound connections simply block non-matching items");
    ItemStack copper = new ItemStack(Items.COPPER_INGOT);
    Class<BrassTunnelTileEntity> tunnelClass = BrassTunnelTileEntity.class;
    scene.world.modifyTileEntity(tunnelPos, tunnelClass, te -> te.getBehaviour(SidedFilteringBehaviour.TYPE).setFilter(Direction.EAST, copper));
    scene.overlay.showControls(new InputWindowElement(tunnelFilterVec, Pointing.DOWN).withItem(copper), 30);
    ItemStack zinc = AllItems.ZINC_INGOT.asStack();
    scene.world.createItemOnBelt(util.grid.at(5, 1, 2), Direction.EAST, zinc);
    scene.idle(70);
    scene.world.multiplyKineticSpeed(util.select.everywhere(), -2);
    scene.idle(20);
    scene.rotateCameraY(-70);
    scene.world.multiplyKineticSpeed(util.select.everywhere(), -.5f);
    scene.idle(20);
    scene.world.modifyTileEntity(tunnelPos, tunnelClass, te -> te.getBehaviour(SidedFilteringBehaviour.TYPE).setFilter(Direction.EAST, ItemStack.EMPTY));
    tunnelFilterVec = getTunnelFilterVec(tunnelPos, Direction.NORTH);
    scene.overlay.showFilterSlotInput(tunnelFilterVec, 40);
    tunnelFilterVec = getTunnelFilterVec(tunnelPos, Direction.WEST);
    scene.overlay.showFilterSlotInput(tunnelFilterVec, 40);
    scene.overlay.showText(60).attachKeyFrame().pointAt(tunnelFilterVec).placeNearTarget().text("Filters on outbound connections can be used to sort items by type");
    scene.idle(70);
    scene.overlay.showControls(new InputWindowElement(tunnelFilterVec, Pointing.LEFT).withItem(copper), 30);
    scene.world.modifyTileEntity(tunnelPos, tunnelClass, te -> te.getBehaviour(SidedFilteringBehaviour.TYPE).setFilter(Direction.WEST, copper));
    scene.idle(4);
    tunnelFilterVec = getTunnelFilterVec(tunnelPos, Direction.NORTH);
    scene.overlay.showControls(new InputWindowElement(tunnelFilterVec, Pointing.RIGHT).withItem(zinc), 30);
    scene.world.modifyTileEntity(tunnelPos, tunnelClass, te -> te.getBehaviour(SidedFilteringBehaviour.TYPE).setFilter(Direction.NORTH, zinc));
    scene.world.multiplyKineticSpeed(util.select.everywhere(), 1.5f);
    for (int i = 0; i < 6; i++) {
        scene.world.createItemOnBelt(util.grid.at(5, 1, 2), Direction.EAST, i % 2 == 0 ? zinc : copper);
        scene.idle(12);
    }
    scene.idle(30);
    scene.world.modifyTileEntity(tunnelPos, tunnelClass, te -> te.getBehaviour(SidedFilteringBehaviour.TYPE).setFilter(Direction.NORTH, ItemStack.EMPTY));
    scene.world.modifyTileEntity(tunnelPos, tunnelClass, te -> te.getBehaviour(SidedFilteringBehaviour.TYPE).setFilter(Direction.WEST, ItemStack.EMPTY));
    scene.idle(10);
    Vec3 tunnelTop = util.vector.topOf(tunnelPos);
    scene.overlay.showControls(new InputWindowElement(tunnelTop, Pointing.DOWN).scroll().withWrench(), 80);
    scene.idle(7);
    scene.overlay.showCenteredScrollInput(tunnelPos, Direction.UP, 120);
    scene.overlay.showText(120).attachKeyFrame().pointAt(tunnelTop).placeNearTarget().text("Whenever a passing item has multiple valid exits, the distribution mode will decide how to handle it");
    for (int i = 0; i < 3; i++) {
        scene.idle(40);
        scene.world.createItemOnBelt(util.grid.at(5, 1, 2), Direction.EAST, AllItems.BRASS_INGOT.asStack(63));
    }
    scene.idle(30);
    scene.world.hideSection(util.select.position(3, 2, 2), Direction.UP);
    scene.idle(5);
    scene.world.hideSection(util.select.fromTo(5, 1, 2, 1, 1, 0), Direction.UP);
    scene.idle(15);
    ElementLink<WorldSectionElement> newBelt = scene.world.showIndependentSection(util.select.fromTo(3, 3, 2, 0, 3, 4).add(util.select.fromTo(5, 3, 3, 4, 3, 3)), Direction.DOWN);
    scene.world.moveSection(newBelt, util.vector.of(0, -2, -1), 0);
    scene.idle(15);
    for (int i = 0; i < 3; i++) {
        scene.idle(4);
        scene.world.showSectionAndMerge(util.select.position(3, 4, 2 + i), Direction.DOWN, newBelt);
    }
    scene.overlay.showSelectionWithText(util.select.fromTo(3, 1, 1, 3, 2, 3), 80).attachKeyFrame().placeNearTarget().text("Brass Tunnels on parallel belts will form a group");
    scene.idle(90);
    ItemStack item1 = new ItemStack(Items.CARROT);
    ItemStack item2 = new ItemStack(Items.HONEY_BOTTLE);
    ItemStack item3 = new ItemStack(Items.SWEET_BERRIES);
    tunnelFilterVec = getTunnelFilterVec(tunnelPos, Direction.WEST);
    BlockPos newTunnelPos = tunnelPos.above(2).south();
    scene.overlay.showControls(new InputWindowElement(tunnelFilterVec.add(0, 0, -1), Pointing.RIGHT).withItem(item1), 20);
    scene.world.modifyTileEntity(newTunnelPos.north(), tunnelClass, te -> te.getBehaviour(SidedFilteringBehaviour.TYPE).setFilter(Direction.WEST, item1));
    scene.idle(4);
    scene.overlay.showControls(new InputWindowElement(tunnelFilterVec, Pointing.DOWN).withItem(item2), 20);
    scene.world.modifyTileEntity(newTunnelPos, tunnelClass, te -> te.getBehaviour(SidedFilteringBehaviour.TYPE).setFilter(Direction.WEST, item2));
    scene.idle(4);
    scene.overlay.showControls(new InputWindowElement(tunnelFilterVec.add(0, 0, 1), Pointing.LEFT).withItem(item3), 20);
    scene.world.modifyTileEntity(newTunnelPos.south(), tunnelClass, te -> te.getBehaviour(SidedFilteringBehaviour.TYPE).setFilter(Direction.WEST, item3));
    scene.idle(30);
    scene.overlay.showText(80).pointAt(tunnelTop).placeNearTarget().text("Incoming Items will now be distributed across all connected exits");
    scene.idle(90);
    BlockPos beltPos = util.grid.at(5, 3, 3);
    Vec3 m = util.vector.of(0, 0.1, 0);
    Vec3 spawn = util.vector.centerOf(util.grid.at(5, 3, 2));
    scene.world.createItemEntity(spawn, m, item1);
    scene.idle(12);
    scene.world.createItemOnBelt(beltPos, Direction.UP, item1);
    scene.world.modifyEntities(ItemEntity.class, Entity::discard);
    scene.world.createItemEntity(spawn, m, item2);
    scene.idle(12);
    scene.world.createItemOnBelt(beltPos, Direction.UP, item2);
    scene.world.modifyEntities(ItemEntity.class, Entity::discard);
    scene.world.createItemEntity(spawn, m, item3);
    scene.idle(12);
    scene.world.createItemOnBelt(beltPos, Direction.UP, item3);
    scene.world.modifyEntities(ItemEntity.class, Entity::discard);
    scene.idle(50);
    scene.world.showSectionAndMerge(util.select.position(3, 5, 2), Direction.DOWN, newBelt);
    scene.overlay.showText(80).pointAt(util.vector.blockSurface(tunnelPos.above().north(), Direction.WEST)).placeNearTarget().text("For this, items can also be inserted into the Tunnel block directly");
    scene.idle(20);
    beltPos = util.grid.at(3, 3, 3);
    spawn = util.vector.centerOf(util.grid.at(3, 5, 1));
    scene.world.createItemEntity(spawn, m, item1);
    scene.idle(12);
    scene.world.createItemOnBelt(beltPos, Direction.EAST, item1);
    scene.world.modifyEntities(ItemEntity.class, Entity::discard);
    scene.world.createItemEntity(spawn, m, item2);
    scene.idle(12);
    scene.world.createItemOnBelt(beltPos, Direction.EAST, item2);
    scene.world.modifyEntities(ItemEntity.class, Entity::discard);
    scene.world.createItemEntity(spawn, m, item3);
    scene.idle(12);
    scene.world.createItemOnBelt(beltPos, Direction.EAST, item3);
    scene.world.modifyEntities(ItemEntity.class, Entity::discard);
    scene.idle(30);
}
Also used : BrassTunnelTileEntity(com.simibubi.create.content.logistics.block.belts.tunnel.BrassTunnelTileEntity) BeltTileEntity(com.simibubi.create.content.contraptions.relays.belt.BeltTileEntity) Entity(net.minecraft.world.entity.Entity) ItemEntity(net.minecraft.world.entity.item.ItemEntity) ElementLink(com.simibubi.create.foundation.ponder.ElementLink) WorldSectionElement(com.simibubi.create.foundation.ponder.element.WorldSectionElement) Direction(net.minecraft.core.Direction) BrassTunnelTileEntity(com.simibubi.create.content.logistics.block.belts.tunnel.BrassTunnelTileEntity) 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) Vector(java.util.Vector)

Example 34 with InputWindowElement

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

the class FluidMovementActorScenes method transfer.

public static void transfer(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("portable_fluid_interface", "Contraption Fluid Exchange");
    scene.configureBasePlate(0, 0, 6);
    scene.scaleSceneView(0.95f);
    scene.setSceneOffsetY(-1);
    scene.showBasePlate();
    scene.idle(5);
    Selection pipes = util.select.fromTo(2, 1, 3, 0, 1, 3).add(util.select.position(0, 1, 4));
    BlockPos pumpPos = util.grid.at(0, 1, 4);
    Selection kinetics = util.select.fromTo(1, 1, 7, 1, 1, 4);
    Selection tank = util.select.fromTo(0, 1, 5, 0, 3, 5);
    Selection largeCog = util.select.position(2, 0, 7);
    FluidStack chocolate = new FluidStack(FluidHelper.convertToStill(AllFluids.CHOCOLATE.get()), 1000);
    BlockPos ct1 = util.grid.at(5, 3, 2);
    BlockPos ct2 = util.grid.at(6, 3, 2);
    BlockPos st = util.grid.at(0, 1, 5);
    Capability<IFluidHandler> fhc = CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY;
    Class<FluidTankTileEntity> type = FluidTankTileEntity.class;
    ItemStack bucket = AllFluids.CHOCOLATE.get().getAttributes().getBucket(chocolate);
    scene.world.modifyTileEntity(st, type, te -> te.getCapability(fhc).ifPresent(ifh -> ifh.fill(FluidHelper.copyStackWithAmount(chocolate, 10000), FluidAction.EXECUTE)));
    BlockPos bearing = util.grid.at(5, 1, 2);
    scene.world.showSection(util.select.position(bearing), Direction.DOWN);
    scene.idle(5);
    ElementLink<WorldSectionElement> contraption = scene.world.showIndependentSection(util.select.fromTo(5, 2, 2, 6, 4, 2), Direction.DOWN);
    scene.world.configureCenterOfRotation(contraption, util.vector.centerOf(bearing));
    scene.idle(10);
    scene.world.rotateBearing(bearing, 360, 70);
    scene.world.rotateSection(contraption, 0, 360, 0, 70);
    scene.overlay.showText(60).pointAt(util.vector.topOf(bearing.above(2))).colored(PonderPalette.RED).placeNearTarget().attachKeyFrame().text("Fluid Tanks on moving contraptions cannot be accessed by any pipes");
    scene.idle(70);
    BlockPos psi = util.grid.at(4, 2, 2);
    scene.world.showSectionAndMerge(util.select.position(psi), Direction.EAST, contraption);
    scene.idle(13);
    scene.effects.superGlue(psi, Direction.EAST, true);
    scene.overlay.showText(80).pointAt(util.vector.topOf(psi)).colored(PonderPalette.GREEN).placeNearTarget().attachKeyFrame().text("This component can interact with fluid tanks without the need to stop the contraption");
    scene.idle(90);
    BlockPos psi2 = psi.west(2);
    scene.world.showSection(util.select.position(psi2), Direction.DOWN);
    scene.overlay.showSelectionWithText(util.select.position(psi.west()), 50).colored(PonderPalette.RED).placeNearTarget().attachKeyFrame().text("Place a second one with a gap of 1 or 2 blocks inbetween");
    scene.idle(55);
    scene.world.rotateBearing(bearing, 360, 60);
    scene.world.rotateSection(contraption, 0, 360, 0, 60);
    scene.idle(20);
    scene.overlay.showText(40).placeNearTarget().pointAt(util.vector.of(3, 3, 2.5)).text("Whenever they pass by each other, they will engage in a connection");
    scene.idle(35);
    Selection both = util.select.fromTo(2, 2, 2, 4, 2, 2);
    Class<PortableFluidInterfaceTileEntity> psiClass = PortableFluidInterfaceTileEntity.class;
    scene.world.modifyTileNBT(both, psiClass, nbt -> {
        nbt.putFloat("Distance", 1);
        nbt.putFloat("Timer", 40);
    });
    scene.idle(20);
    scene.overlay.showOutline(PonderPalette.GREEN, psi, util.select.fromTo(5, 3, 2, 6, 4, 2), 80);
    scene.idle(10);
    scene.overlay.showSelectionWithText(util.select.position(psi2), 70).placeNearTarget().colored(PonderPalette.GREEN).attachKeyFrame().text("While engaged, the stationary interface will represent ALL Tanks on the contraption");
    scene.idle(80);
    ElementLink<WorldSectionElement> p = scene.world.showIndependentSection(tank, Direction.DOWN);
    scene.world.moveSection(p, util.vector.of(0, 0, -1), 0);
    scene.idle(5);
    scene.world.showSectionAndMerge(pipes, Direction.EAST, p);
    scene.idle(5);
    scene.world.showSectionAndMerge(largeCog, Direction.UP, p);
    scene.world.showSectionAndMerge(kinetics, Direction.NORTH, p);
    scene.idle(10);
    scene.overlay.showText(70).placeNearTarget().pointAt(util.vector.topOf(pumpPos)).attachKeyFrame().text("Fluid can now be inserted...");
    scene.idle(30);
    for (int i = 0; i < 16; i++) {
        if (i == 8)
            scene.overlay.showControls(new InputWindowElement(util.vector.blockSurface(util.grid.at(5, 3, 2), Direction.WEST).add(0, 0.5, 0), Pointing.LEFT).withItem(bucket), 30);
        scene.world.modifyTileEntity(st, type, te -> te.getCapability(fhc).ifPresent(ifh -> ifh.drain(1000, FluidAction.EXECUTE)));
        scene.world.modifyTileEntity(ct1, type, te -> te.getCapability(fhc).ifPresent(ifh -> ifh.fill(chocolate, FluidAction.EXECUTE)));
        scene.idle(2);
    }
    for (int i = 0; i < 8; i++) {
        scene.world.modifyTileEntity(st, type, te -> te.getCapability(fhc).ifPresent(ifh -> ifh.drain(1000, FluidAction.EXECUTE)));
        scene.world.modifyTileEntity(ct2, type, te -> te.getCapability(fhc).ifPresent(ifh -> ifh.fill(chocolate, FluidAction.EXECUTE)));
        scene.idle(2);
    }
    scene.idle(50);
    scene.overlay.showText(40).placeNearTarget().pointAt(util.vector.topOf(pumpPos)).text("...or extracted from the contraption");
    scene.world.multiplyKineticSpeed(util.select.everywhere(), -1);
    scene.world.propagatePipeChange(pumpPos);
    scene.idle(30);
    for (int i = 0; i < 8; i++) {
        scene.world.modifyTileEntity(ct2, type, te -> te.getCapability(fhc).ifPresent(ifh -> ifh.drain(1000, FluidAction.EXECUTE)));
        scene.world.modifyTileEntity(st, type, te -> te.getCapability(fhc).ifPresent(ifh -> ifh.fill(chocolate, FluidAction.EXECUTE)));
        scene.idle(2);
    }
    for (int i = 0; i < 16; i++) {
        scene.world.modifyTileEntity(ct1, type, te -> te.getCapability(fhc).ifPresent(ifh -> ifh.drain(1000, FluidAction.EXECUTE)));
        scene.world.modifyTileEntity(st, type, te -> te.getCapability(fhc).ifPresent(ifh -> ifh.fill(chocolate, FluidAction.EXECUTE)));
        scene.idle(2);
    }
    scene.world.modifyTileEntity(util.grid.at(2, 2, 3), type, te -> te.getCapability(fhc).ifPresent(ifh -> ifh.drain(8000, FluidAction.EXECUTE)));
    scene.idle(50);
    scene.overlay.showText(120).placeNearTarget().attachKeyFrame().pointAt(util.vector.topOf(psi2)).text("After no contents have been exchanged for a while, the contraption will continue on its way");
    scene.world.modifyTileNBT(both, psiClass, nbt -> nbt.putFloat("Timer", 9));
    scene.idle(15);
    scene.markAsFinished();
    scene.world.rotateBearing(bearing, 270, 120);
    scene.world.rotateSection(contraption, 0, 270, 0, 120);
}
Also used : AllFluids(com.simibubi.create.AllFluids) IFluidHandler(net.minecraftforge.fluids.capability.IFluidHandler) Selection(com.simibubi.create.foundation.ponder.Selection) SceneBuilder(com.simibubi.create.foundation.ponder.SceneBuilder) CapabilityFluidHandler(net.minecraftforge.fluids.capability.CapabilityFluidHandler) InputWindowElement(com.simibubi.create.foundation.ponder.element.InputWindowElement) Direction(net.minecraft.core.Direction) FluidAction(net.minecraftforge.fluids.capability.IFluidHandler.FluidAction) SceneBuildingUtil(com.simibubi.create.foundation.ponder.SceneBuildingUtil) Pointing(com.simibubi.create.foundation.utility.Pointing) FluidHelper(com.simibubi.create.foundation.fluid.FluidHelper) Capability(net.minecraftforge.common.capabilities.Capability) WorldSectionElement(com.simibubi.create.foundation.ponder.element.WorldSectionElement) ElementLink(com.simibubi.create.foundation.ponder.ElementLink) PonderPalette(com.simibubi.create.foundation.ponder.PonderPalette) BlockPos(net.minecraft.core.BlockPos) FluidStack(net.minecraftforge.fluids.FluidStack) FluidTankTileEntity(com.simibubi.create.content.contraptions.fluids.tank.FluidTankTileEntity) ItemStack(net.minecraft.world.item.ItemStack) PortableFluidInterfaceTileEntity(com.simibubi.create.content.contraptions.components.actors.PortableFluidInterfaceTileEntity) FluidTankTileEntity(com.simibubi.create.content.contraptions.fluids.tank.FluidTankTileEntity) Selection(com.simibubi.create.foundation.ponder.Selection) FluidStack(net.minecraftforge.fluids.FluidStack) PortableFluidInterfaceTileEntity(com.simibubi.create.content.contraptions.components.actors.PortableFluidInterfaceTileEntity) WorldSectionElement(com.simibubi.create.foundation.ponder.element.WorldSectionElement) IFluidHandler(net.minecraftforge.fluids.capability.IFluidHandler) InputWindowElement(com.simibubi.create.foundation.ponder.element.InputWindowElement) BlockPos(net.minecraft.core.BlockPos) ItemStack(net.minecraft.world.item.ItemStack)

Example 35 with InputWindowElement

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

the class FluidTankScenes method creative.

public static void creative(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("creative_fluid_tank", "Creative Fluid Tanks");
    scene.configureBasePlate(0, 0, 5);
    scene.showBasePlate();
    scene.idle(5);
    Selection largeCog = util.select.position(5, 0, 2);
    Selection cTank = util.select.fromTo(3, 1, 1, 3, 2, 1);
    Selection tank = util.select.fromTo(1, 1, 3, 1, 3, 3);
    Selection pipes = util.select.fromTo(3, 1, 2, 2, 1, 3);
    Selection cog = util.select.position(4, 1, 2);
    BlockPos cTankPos = util.grid.at(3, 1, 1);
    BlockPos pumpPos = util.grid.at(3, 1, 2);
    ElementLink<WorldSectionElement> cTankLink = scene.world.showIndependentSection(cTank, Direction.DOWN);
    scene.world.moveSection(cTankLink, util.vector.of(-1, 0, 1), 0);
    scene.overlay.showText(70).text("Creative Fluid Tanks can be used to provide a bottomless supply of fluid").attachKeyFrame().placeNearTarget().pointAt(util.vector.blockSurface(util.grid.at(2, 2, 2), Direction.WEST));
    scene.idle(80);
    ItemStack bucket = new ItemStack(Items.LAVA_BUCKET);
    scene.overlay.showControls(new InputWindowElement(util.vector.blockSurface(util.grid.at(2, 2, 2), Direction.NORTH), Pointing.RIGHT).rightClick().withItem(bucket), 40);
    scene.idle(7);
    scene.world.modifyTileEntity(cTankPos, CreativeFluidTankTileEntity.class, te -> ((CreativeSmartFluidTank) te.getTankInventory()).setContainedFluid(new FluidStack(Fluids.FLOWING_LAVA, 1000)));
    scene.idle(5);
    scene.overlay.showText(50).text("Right-Click with a fluid containing item to configure it").attachKeyFrame().placeNearTarget().pointAt(util.vector.blockSurface(util.grid.at(2, 2, 2), Direction.WEST));
    scene.idle(60);
    scene.world.moveSection(cTankLink, util.vector.of(1, 0, -1), 6);
    scene.idle(7);
    scene.world.showSection(tank, Direction.DOWN);
    scene.idle(5);
    scene.world.showSection(largeCog, Direction.UP);
    scene.world.showSection(cog, Direction.NORTH);
    scene.world.showSection(pipes, Direction.NORTH);
    scene.world.multiplyKineticSpeed(util.select.everywhere(), -1);
    scene.world.propagatePipeChange(pumpPos);
    scene.effects.rotationDirectionIndicator(pumpPos);
    scene.idle(40);
    scene.overlay.showText(70).text("Pipe Networks can now endlessly draw the assigned fluid from the tank").attachKeyFrame().placeNearTarget().pointAt(util.vector.blockSurface(util.grid.at(3, 1, 2), Direction.WEST));
    scene.idle(120);
    scene.world.multiplyKineticSpeed(util.select.everywhere(), -1);
    scene.world.propagatePipeChange(pumpPos);
    scene.effects.rotationDirectionIndicator(pumpPos);
    scene.idle(40);
    scene.overlay.showText(70).text("Any Fluids pushed back into a Creative Fluid Tank will be voided").attachKeyFrame().placeNearTarget().pointAt(util.vector.blockSurface(util.grid.at(3, 1, 2), Direction.WEST));
    scene.idle(40);
}
Also used : Selection(com.simibubi.create.foundation.ponder.Selection) FluidStack(net.minecraftforge.fluids.FluidStack) 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)

Aggregations

InputWindowElement (com.simibubi.create.foundation.ponder.element.InputWindowElement)85 BlockPos (net.minecraft.core.BlockPos)75 Vec3 (net.minecraft.world.phys.Vec3)63 Selection (com.simibubi.create.foundation.ponder.Selection)61 ItemStack (net.minecraft.world.item.ItemStack)60 WorldSectionElement (com.simibubi.create.foundation.ponder.element.WorldSectionElement)47 Entity (net.minecraft.world.entity.Entity)25 ItemEntity (net.minecraft.world.entity.item.ItemEntity)18 EntityElement (com.simibubi.create.foundation.ponder.element.EntityElement)17 AABB (net.minecraft.world.phys.AABB)16 Direction (net.minecraft.core.Direction)12 ElementLink (com.simibubi.create.foundation.ponder.ElementLink)11 MechanicalPressTileEntity (com.simibubi.create.content.contraptions.components.press.MechanicalPressTileEntity)9 PonderPalette (com.simibubi.create.foundation.ponder.PonderPalette)9 SceneBuilder (com.simibubi.create.foundation.ponder.SceneBuilder)9 SceneBuildingUtil (com.simibubi.create.foundation.ponder.SceneBuildingUtil)9 Pointing (com.simibubi.create.foundation.utility.Pointing)9 DeployerTileEntity (com.simibubi.create.content.contraptions.components.deployer.DeployerTileEntity)8 Items (net.minecraft.world.item.Items)8 BlockState (net.minecraft.world.level.block.state.BlockState)8