Search in sources :

Example 11 with WorldSectionElement

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

the class GantryScenes method redstone.

public static void redstone(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("gantry_redstone", "Gantry Power Propagation");
    scene.world.modifyKineticSpeed(util.select.everywhere(), f -> -f);
    Selection leverRedstone = util.select.fromTo(3, 1, 0, 3, 1, 1);
    Selection shaft = util.select.fromTo(0, 1, 2, 4, 1, 2);
    Selection shaftAndCog = util.select.fromTo(0, 1, 2, 5, 1, 2);
    scene.configureBasePlate(0, 0, 5);
    scene.world.showSection(util.select.layer(0).add(leverRedstone), Direction.UP);
    scene.idle(10);
    scene.world.showSection(shaftAndCog, Direction.DOWN);
    scene.idle(10);
    BlockPos gantryPos = util.grid.at(4, 2, 2);
    ElementLink<WorldSectionElement> gantry = scene.world.showIndependentSection(util.select.position(gantryPos), Direction.DOWN);
    scene.idle(15);
    scene.world.moveSection(gantry, util.vector.of(-3, 0, 0), 40);
    scene.idle(40);
    scene.world.toggleRedstonePower(shaft);
    scene.world.toggleRedstonePower(util.select.position(3, 1, 0));
    scene.world.toggleRedstonePower(util.select.position(3, 1, 1));
    scene.effects.indicateRedstone(util.grid.at(3, 1, 0));
    scene.world.modifyKineticSpeed(util.select.position(gantryPos), f -> 32f);
    scene.idle(40);
    BlockPos cogPos = util.grid.at(1, 2, 1);
    scene.overlay.showText(60).attachKeyFrame().colored(PonderPalette.RED).pointAt(util.vector.centerOf(cogPos.below().south())).text("Redstone-powered gantry shafts stop moving their carriages").placeNearTarget();
    scene.idle(70);
    Selection cogSelection = util.select.position(cogPos);
    scene.world.showSection(cogSelection, Direction.SOUTH);
    scene.world.modifyKineticSpeed(cogSelection, f -> 32f);
    scene.overlay.showText(180).colored(PonderPalette.GREEN).pointAt(util.vector.blockSurface(cogPos, Direction.NORTH)).text("Instead, its rotational force is relayed to the carriages' output shaft").placeNearTarget();
    scene.idle(10);
    scene.effects.rotationSpeedIndicator(cogPos);
    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 12 with WorldSectionElement

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

the class ItemVaultScenes method sizes.

public static void sizes(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("item_vault_sizes", "Dimensions of an Item Vault");
    scene.configureBasePlate(0, 0, 6);
    scene.scaleSceneView(0.9f);
    scene.showBasePlate();
    scene.idle(5);
    Selection single = util.select.position(2, 4, 2);
    Selection single2 = util.select.fromTo(2, 4, 3, 3, 5, 3);
    Selection single3 = util.select.fromTo(2, 4, 4, 4, 6, 4);
    ElementLink<WorldSectionElement> s1 = scene.world.showIndependentSection(single, Direction.DOWN);
    scene.world.moveSection(s1, util.vector.of(0, -3, 0), 0);
    scene.idle(10);
    scene.overlay.showText(60).text("Item Vaults can be combined to increase the total capacity").attachKeyFrame().placeNearTarget().pointAt(util.vector.topOf(2, 1, 2));
    scene.idle(40);
    ElementLink<WorldSectionElement> s2 = scene.world.showIndependentSection(single, Direction.DOWN);
    scene.world.moveSection(s2, util.vector.of(1, -3, 0), 0);
    scene.idle(5);
    ElementLink<WorldSectionElement> s3 = scene.world.showIndependentSection(single, Direction.DOWN);
    scene.world.moveSection(s3, util.vector.of(1, -2, 0), 0);
    scene.idle(5);
    ElementLink<WorldSectionElement> s4 = scene.world.showIndependentSection(single, Direction.DOWN);
    scene.world.moveSection(s4, util.vector.of(0, -2, 0), 0);
    scene.idle(10);
    scene.world.moveSection(s1, util.vector.of(0, -100, 0), 0);
    scene.world.moveSection(s2, util.vector.of(0, -100, 0), 0);
    scene.world.moveSection(s3, util.vector.of(0, -100, 0), 0);
    scene.world.moveSection(s4, util.vector.of(0, -100, 0), 0);
    ElementLink<WorldSectionElement> d = scene.world.showIndependentSectionImmediately(single2);
    scene.world.moveSection(d, util.vector.of(0, -3, -1), 0);
    scene.effects.indicateSuccess(util.grid.at(2, 1, 2));
    scene.effects.indicateSuccess(util.grid.at(2, 2, 2));
    scene.effects.indicateSuccess(util.grid.at(3, 2, 2));
    scene.effects.indicateSuccess(util.grid.at(3, 1, 2));
    scene.world.hideIndependentSection(s1, Direction.DOWN);
    scene.world.hideIndependentSection(s2, Direction.DOWN);
    scene.world.hideIndependentSection(s3, Direction.DOWN);
    scene.world.hideIndependentSection(s4, Direction.DOWN);
    scene.idle(25);
    scene.overlay.showText(60).text("Their base square can be up to 3 blocks wide...").attachKeyFrame().placeNearTarget().pointAt(util.vector.blockSurface(util.grid.at(2, 2, 2), Direction.NORTH));
    scene.idle(40);
    s1 = scene.world.showIndependentSection(single, Direction.DOWN);
    scene.world.moveSection(s1, util.vector.of(2, -3, 0), 0);
    scene.idle(3);
    s2 = scene.world.showIndependentSection(single, Direction.DOWN);
    scene.world.moveSection(s2, util.vector.of(2, -2, 0), 0);
    scene.idle(3);
    s3 = scene.world.showIndependentSection(single, Direction.DOWN);
    scene.world.moveSection(s3, util.vector.of(2, -1, 0), 0);
    scene.idle(3);
    s4 = scene.world.showIndependentSection(single, Direction.DOWN);
    scene.world.moveSection(s4, util.vector.of(1, -1, 0), 0);
    scene.idle(3);
    ElementLink<WorldSectionElement> s5 = scene.world.showIndependentSection(single, Direction.DOWN);
    scene.world.moveSection(s5, util.vector.of(0, -1, 0), 0);
    scene.idle(10);
    scene.world.moveSection(d, util.vector.of(0, -100, 0), 0);
    scene.world.moveSection(s1, util.vector.of(0, -100, 0), 0);
    scene.world.moveSection(s2, util.vector.of(0, -100, 0), 0);
    scene.world.moveSection(s3, util.vector.of(0, -100, 0), 0);
    scene.world.moveSection(s4, util.vector.of(0, -100, 0), 0);
    scene.world.moveSection(s5, util.vector.of(0, -100, 0), 0);
    ElementLink<WorldSectionElement> t = scene.world.showIndependentSectionImmediately(single3);
    scene.world.moveSection(t, util.vector.of(0, -3, -2), 0);
    for (int i = 1; i < 4; i++) for (int j = 2; j < 5; j++) scene.effects.indicateSuccess(util.grid.at(j, i, 2));
    scene.world.hideIndependentSection(d, Direction.DOWN);
    scene.world.hideIndependentSection(s1, Direction.DOWN);
    scene.world.hideIndependentSection(s2, Direction.DOWN);
    scene.world.hideIndependentSection(s3, Direction.DOWN);
    scene.world.hideIndependentSection(s4, Direction.DOWN);
    scene.world.hideIndependentSection(s5, Direction.DOWN);
    scene.idle(25);
    scene.world.hideIndependentSection(t, Direction.DOWN);
    scene.idle(15);
    Selection full1 = util.select.fromTo(2, 1, 0, 4, 1, 0);
    Selection full2 = util.select.fromTo(0, 1, 1, 3, 2, 2);
    Selection full3 = util.select.fromTo(1, 1, 5, 5, 3, 3);
    scene.world.showSection(full3, Direction.WEST);
    scene.idle(5);
    scene.world.showSection(full2, Direction.EAST);
    scene.idle(5);
    scene.world.showSection(full1, Direction.WEST);
    scene.idle(10);
    Vec3 blockSurface = util.vector.blockSurface(util.grid.at(1, 3, 3), Direction.NORTH);
    scene.overlay.showText(60).text("...and grow in length up to 3x their diameter").attachKeyFrame().placeNearTarget().pointAt(blockSurface);
    scene.idle(40);
}
Also used : Selection(com.simibubi.create.foundation.ponder.Selection) Vec3(net.minecraft.world.phys.Vec3) WorldSectionElement(com.simibubi.create.foundation.ponder.element.WorldSectionElement)

Example 13 with WorldSectionElement

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

the class DebugScenes method sectionsScene.

public static void sectionsScene(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("debug_sections", "Sections");
    scene.showBasePlate();
    scene.idle(10);
    scene.rotateCameraY(95);
    BlockPos mergePos = util.grid.at(1, 1, 1);
    BlockPos independentPos = util.grid.at(3, 1, 1);
    Selection toMerge = util.select.position(mergePos);
    Selection independent = util.select.position(independentPos);
    Selection start = util.select.layersFrom(1).substract(toMerge).substract(independent);
    scene.world.showSection(start, Direction.DOWN);
    scene.idle(20);
    scene.world.showSection(toMerge, Direction.DOWN);
    ElementLink<WorldSectionElement> link = scene.world.showIndependentSection(independent, Direction.DOWN);
    scene.idle(20);
    scene.overlay.showText(40).colored(PonderPalette.GREEN).text("This Section got merged to base.").pointAt(util.vector.topOf(mergePos));
    scene.idle(10);
    scene.overlay.showText(40).colored(PonderPalette.RED).text("This Section renders independently.").pointAt(util.vector.topOf(independentPos));
    scene.idle(40);
    scene.world.hideIndependentSection(link, Direction.DOWN);
    scene.world.hideSection(util.select.fromTo(mergePos, util.grid.at(1, 1, 4)), Direction.DOWN);
    scene.idle(20);
    Selection hiddenReplaceArea = util.select.fromTo(2, 1, 2, 4, 1, 4).substract(util.select.position(4, 1, 3)).substract(util.select.position(2, 1, 3));
    scene.world.hideSection(hiddenReplaceArea, Direction.UP);
    scene.idle(20);
    scene.world.setBlocks(hiddenReplaceArea, AllBlocks.REFINED_RADIANCE_CASING.getDefaultState(), false);
    scene.world.showSection(hiddenReplaceArea, Direction.DOWN);
    scene.idle(20);
    scene.overlay.showSelectionWithText(hiddenReplaceArea, 30).colored(PonderPalette.BLUE).text("Seamless substitution of blocks");
    scene.idle(40);
    ElementLink<WorldSectionElement> helicopter = scene.world.makeSectionIndependent(hiddenReplaceArea);
    scene.world.rotateSection(helicopter, 50, 5 * 360, 0, 60);
    scene.world.moveSection(helicopter, util.vector.of(0, 4, 5), 50);
    scene.overlay.showText(30).colored(PonderPalette.BLUE).text("Up, up and away.").independent(30);
    scene.idle(40);
    scene.world.hideIndependentSection(helicopter, Direction.UP);
}
Also used : Selection(com.simibubi.create.foundation.ponder.Selection) BlockPos(net.minecraft.core.BlockPos) WorldSectionElement(com.simibubi.create.foundation.ponder.element.WorldSectionElement)

Example 14 with WorldSectionElement

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

the class DeployerScenes method contraption.

public static void contraption(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("deployer_contraption", "Using Deployers on Contraptions");
    scene.configureBasePlate(0, 0, 6);
    scene.scaleSceneView(.9f);
    Selection flowers = util.select.fromTo(4, 1, 1, 1, 1, 1);
    scene.world.replaceBlocks(flowers, Blocks.AIR.defaultBlockState(), false);
    Selection kinetics = util.select.fromTo(5, 1, 6, 5, 1, 3);
    BlockPos deployerPos = util.grid.at(4, 1, 3);
    Selection deployerSelection = util.select.position(deployerPos);
    scene.world.showSection(util.select.layer(0).add(flowers), Direction.UP);
    scene.idle(5);
    ElementLink<WorldSectionElement> pistonHead = scene.world.showIndependentSection(util.select.fromTo(5, 1, 2, 8, 1, 2), Direction.DOWN);
    scene.world.moveSection(pistonHead, util.vector.of(0, 0, 1), 0);
    scene.world.showSection(kinetics, Direction.DOWN);
    scene.idle(5);
    ElementLink<WorldSectionElement> contraption = scene.world.showIndependentSection(deployerSelection, Direction.DOWN);
    scene.idle(5);
    scene.world.glueBlockOnto(util.grid.at(4, 2, 3), Direction.DOWN, contraption);
    scene.overlay.showText(60).attachKeyFrame().placeNearTarget().pointAt(util.vector.blockSurface(deployerPos, Direction.WEST)).text("Whenever Deployers are moved as part of an animated Contraption...");
    scene.idle(70);
    scene.world.setKineticSpeed(util.select.position(4, 0, 6), -8);
    scene.world.setKineticSpeed(kinetics, 16);
    scene.world.moveSection(pistonHead, util.vector.of(-3, 0, 0), 100);
    scene.world.moveSection(contraption, util.vector.of(-3, 0, 0), 100);
    for (int x = 0; x < 4; x++) {
        scene.world.moveDeployer(deployerPos, 1, 9);
        scene.idle(10);
        scene.world.moveDeployer(deployerPos, -1, 9);
        scene.world.restoreBlocks(util.select.position(4 - x, 1, 1));
        scene.idle(18);
    }
    scene.overlay.showSelectionWithText(flowers, 90).attachKeyFrame().colored(PonderPalette.GREEN).text("They activate at each visited location, using items from inventories anywhere on the contraption");
    scene.idle(100);
    scene.world.hideSection(flowers, Direction.UP);
    scene.idle(15);
    scene.world.replaceBlocks(flowers, Blocks.AIR.defaultBlockState(), false);
    scene.world.showSection(flowers, Direction.UP);
    Vec3 frontVec = util.vector.blockSurface(deployerPos.west(3), Direction.NORTH).add(0, 0, -.125);
    Vec3 filterSlot = frontVec.add(0, 0.25, 0.375);
    scene.overlay.showFilterSlotInput(filterSlot, 80);
    scene.overlay.showText(60).attachKeyFrame().placeNearTarget().pointAt(filterSlot).text("The Filter slot can be used to specify which items to pull");
    scene.idle(70);
    ItemStack poppy = new ItemStack(Items.POPPY);
    scene.overlay.showControls(new InputWindowElement(filterSlot, Pointing.DOWN).withItem(poppy), 30);
    scene.idle(7);
    scene.world.setFilterData(deployerSelection, DeployerTileEntity.class, poppy);
    scene.idle(25);
    scene.world.setKineticSpeed(util.select.position(4, 0, 6), 8);
    scene.world.setKineticSpeed(kinetics, -16);
    scene.world.moveSection(pistonHead, util.vector.of(3, 0, 0), 100);
    scene.world.moveSection(contraption, util.vector.of(3, 0, 0), 100);
    for (int x = 0; x < 4; x++) {
        scene.world.moveDeployer(deployerPos, 1, 9);
        scene.idle(10);
        scene.world.moveDeployer(deployerPos, -1, 9);
        scene.world.setBlock(util.grid.at(1 + x, 1, 1), Blocks.POPPY.defaultBlockState(), false);
        scene.idle(18);
    }
}
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)

Example 15 with WorldSectionElement

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

the class EjectorScenes method redstone.

public static void redstone(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("weighted_ejector_redstone", "Controlling Weighted Ejectors with Redstone");
    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, 3, 4, 1, 5), Direction.DOWN);
    scene.idle(5);
    scene.world.showSection(util.select.fromTo(0, 1, 2, 0, 2, 2), Direction.DOWN);
    scene.idle(10);
    scene.world.showSection(util.select.position(4, 1, 2), Direction.SOUTH);
    scene.idle(5);
    Selection redstone = util.select.fromTo(3, 1, 2, 2, 1, 2);
    scene.world.showSection(redstone, Direction.EAST);
    BlockPos ejectorPos = util.grid.at(4, 1, 2);
    Vec3 topOf = util.vector.topOf(ejectorPos.above(2));
    ItemStack copper = new ItemStack(Items.COPPER_INGOT);
    for (int i = 0; i < 3; i++) {
        scene.world.createItemEntity(topOf, util.vector.of(0, 0.1, 0), copper);
        scene.idle(12);
        scene.world.modifyEntities(ItemEntity.class, Entity::discard);
        scene.world.createItemOnBeltLike(ejectorPos, Direction.UP, copper);
        scene.idle(20);
        if (i == 1) {
            scene.world.toggleRedstonePower(redstone);
            scene.effects.indicateRedstone(util.grid.at(2, 1, 2));
            scene.world.modifyTileNBT(util.select.position(4, 1, 2), EjectorTileEntity.class, nbt -> nbt.putBoolean("Powered", true));
        }
    }
    scene.idle(10);
    scene.overlay.showText(60).colored(PonderPalette.RED).attachKeyFrame().pointAt(util.vector.topOf(ejectorPos)).placeNearTarget().text("When powered by Redstone, Ejectors will not activate");
    scene.idle(70);
    scene.world.toggleRedstonePower(redstone);
    scene.idle(2);
    scene.world.modifyTileNBT(util.select.position(4, 1, 2), EjectorTileEntity.class, nbt -> nbt.putBoolean("Powered", false));
    scene.idle(5);
    scene.world.hideSection(redstone, Direction.WEST);
    scene.idle(10);
    ElementLink<WorldSectionElement> observer = scene.world.showIndependentSection(util.select.position(4, 1, 1), Direction.SOUTH);
    scene.world.moveSection(observer, util.vector.of(0.5, 1.5, -0.5), 0);
    scene.world.rotateSection(observer, 0, 30 - 180, 0, 0);
    scene.idle(20);
    scene.world.moveSection(observer, util.vector.of(-0.5, -1.5, 0.5), 10);
    scene.world.rotateSection(observer, 0, -30 + 180, 0, 10);
    scene.world.showSection(util.select.position(4, 1, 0), Direction.SOUTH);
    Selection observerRedstone = util.select.fromTo(4, 1, 1, 4, 1, 0);
    for (int i = 0; i < 6; i++) {
        scene.world.createItemEntity(topOf, util.vector.of(0, 0.1, 0), copper);
        scene.idle(12);
        scene.world.modifyEntities(ItemEntity.class, Entity::discard);
        scene.world.createItemOnBeltLike(ejectorPos, Direction.UP, copper);
        scene.idle(1);
        scene.world.toggleRedstonePower(observerRedstone);
        scene.effects.indicateRedstone(util.grid.at(4, 1, 1));
        scene.idle(3);
        scene.world.toggleRedstonePower(observerRedstone);
        scene.idle(16);
        if (i == 3)
            scene.markAsFinished();
        if (i == 1) {
            scene.overlay.showText(60).attachKeyFrame().pointAt(util.vector.blockSurface(util.grid.at(4, 1, 1), Direction.NORTH)).placeNearTarget().text("Furthermore, Observers can detect when Ejectors activate");
        }
    }
}
Also used : EjectorTileEntity(com.simibubi.create.content.logistics.block.depot.EjectorTileEntity) Entity(net.minecraft.world.entity.Entity) ItemEntity(net.minecraft.world.entity.item.ItemEntity) 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) ItemStack(net.minecraft.world.item.ItemStack)

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