Search in sources :

Example 1 with Emitter

use of com.simibubi.create.foundation.ponder.instruction.EmitParticlesInstruction.Emitter in project Create by Creators-of-Create.

the class CartAssemblerScenes method rails.

public static void rails(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("cart_assembler_rails", "Other types of Minecarts and Rails");
    scene.configureBasePlate(0, 0, 6);
    scene.scaleSceneView(.9f);
    scene.world.showSection(util.select.layer(0), Direction.UP);
    scene.idle(5);
    for (int x = 0; x < 6; x++) {
        scene.world.showSection(util.select.position(x, 1, 3), Direction.DOWN);
        scene.idle(2);
    }
    BlockPos assembler = util.grid.at(3, 1, 3);
    Selection chassis = util.select.fromTo(4, 2, 3, 2, 2, 3);
    scene.idle(5);
    scene.overlay.showText(70).attachKeyFrame().pointAt(util.vector.blockSurface(assembler, Direction.DOWN)).placeNearTarget().text("Cart Assemblers on Regular Tracks will not affect the passing carts' motion");
    scene.idle(10);
    scene.world.setBlock(assembler, AllBlocks.CART_ASSEMBLER.getDefaultState().setValue(CartAssemblerBlock.RAIL_SHAPE, RailShape.EAST_WEST).setValue(CartAssemblerBlock.RAIL_TYPE, CartAssembleRailType.REGULAR), true);
    scene.idle(70);
    ElementLink<MinecartElement> cart = scene.special.createCart(util.vector.topOf(assembler.east(2).below()), 0, Minecart::new);
    ElementLink<WorldSectionElement> anchor = scene.world.showIndependentSection(util.select.position(assembler.south()), Direction.DOWN);
    ElementLink<WorldSectionElement> contraption = scene.world.showIndependentSection(util.select.position(assembler.south().above()), Direction.DOWN);
    scene.world.moveSection(contraption, util.vector.of(2, 0, -1), 0);
    scene.world.moveSection(anchor, util.vector.of(2, 0, -1), 0);
    scene.idle(10);
    scene.world.moveSection(contraption, util.vector.of(-2, 0, 0), 10);
    scene.world.moveSection(anchor, util.vector.of(-2, 0, 0), 10);
    scene.special.moveCart(cart, util.vector.of(-5, 0, 0), 25);
    scene.idle(30);
    scene.special.hideElement(cart, Direction.UP);
    scene.world.hideIndependentSection(contraption, Direction.UP);
    scene.world.moveSection(anchor, util.vector.of(0, -3, 0), 0);
    scene.idle(30);
    scene.overlay.showControls(new InputWindowElement(util.vector.topOf(assembler), Pointing.DOWN).withItem(new ItemStack(Items.POWERED_RAIL)), 50);
    scene.idle(7);
    scene.world.setBlock(assembler, AllBlocks.CART_ASSEMBLER.getDefaultState().setValue(CartAssemblerBlock.RAIL_SHAPE, RailShape.EAST_WEST).setValue(CartAssemblerBlock.RAIL_TYPE, CartAssembleRailType.POWERED_RAIL), true);
    scene.overlay.showText(100).attachKeyFrame().pointAt(util.vector.topOf(assembler)).placeNearTarget().text("When on Powered or Controller Rail, the carts will be held in place until it's Powered");
    scene.idle(110);
    scene.world.hideIndependentSection(anchor, Direction.DOWN);
    cart = scene.special.createCart(util.vector.topOf(assembler.east(2).below()), 0, Minecart::new);
    anchor = scene.world.showIndependentSection(util.select.position(assembler.south()), Direction.DOWN);
    contraption = scene.world.showIndependentSection(util.select.position(assembler.south().above()), Direction.DOWN);
    scene.world.moveSection(contraption, util.vector.of(2, 0, -1), 0);
    scene.world.moveSection(anchor, util.vector.of(2, 0, -1), 0);
    scene.idle(10);
    scene.world.moveSection(contraption, util.vector.of(-2, 0, 0), 10);
    scene.world.moveSection(anchor, util.vector.of(-2, 0, 0), 10);
    scene.special.moveCart(cart, util.vector.of(-2, 0, 0), 10);
    scene.world.showSection(util.select.fromTo(3, 1, 1, 3, 1, 2), Direction.SOUTH);
    scene.idle(30);
    scene.world.toggleRedstonePower(util.select.fromTo(3, 1, 1, 3, 1, 3));
    scene.effects.indicateRedstone(util.grid.at(3, 1, 1));
    scene.idle(5);
    scene.world.moveSection(contraption, util.vector.of(-3, 0, 0), 15);
    scene.world.moveSection(anchor, util.vector.of(-3, 0, 0), 15);
    scene.special.moveCart(cart, util.vector.of(-3, 0, 0), 15);
    scene.idle(30);
    scene.special.hideElement(cart, Direction.UP);
    scene.world.hideIndependentSection(anchor, Direction.UP);
    scene.world.hideIndependentSection(contraption, Direction.UP);
    scene.idle(20);
    cart = scene.special.createCart(util.vector.topOf(assembler.east(2).below()), 0, MinecartFurnace::new);
    scene.idle(10);
    scene.overlay.showText(50).attachKeyFrame().pointAt(util.vector.topOf(assembler.east(2))).placeNearTarget().text("Other types of Minecarts can be used as the anchor");
    scene.idle(50);
    contraption = scene.world.showIndependentSection(chassis, Direction.DOWN);
    scene.idle(5);
    scene.world.glueBlockOnto(assembler.above(2), Direction.DOWN, contraption);
    scene.idle(15);
    scene.overlay.showControls(new InputWindowElement(util.vector.topOf(assembler.above()), Pointing.UP).withItem(new ItemStack(Items.CHARCOAL)), 40);
    scene.idle(7);
    scene.overlay.showText(80).pointAt(util.vector.blockSurface(assembler.above(2), Direction.WEST)).placeNearTarget().text("Furnace Carts will keep themselves powered, pulling fuel from any attached inventories");
    scene.idle(85);
    Emitter smoke = Emitter.simple(ParticleTypes.LARGE_SMOKE, util.vector.of(0, 0, 0));
    scene.special.moveCart(cart, util.vector.of(-5, 0, 0), 50);
    scene.idle(20);
    anchor = scene.world.showIndependentSectionImmediately(util.select.position(assembler.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.world.moveSection(contraption, util.vector.of(-3, 0, 0), 30);
    scene.world.moveSection(anchor, util.vector.of(-3, 0, 0), 30);
    Vec3 vec = util.vector.centerOf(assembler).add(.25, .25, -0.5);
    for (int i = 0; i < 7; i++) {
        scene.effects.emitParticles(vec = vec.add(-.5, 0, 0), smoke, 2, 1);
        scene.idle(5);
    }
    scene.world.setKineticSpeed(util.select.position(2, 2, 3), 0);
}
Also used : Emitter(com.simibubi.create.foundation.ponder.instruction.EmitParticlesInstruction.Emitter) MinecartElement(com.simibubi.create.foundation.ponder.element.MinecartElement) Selection(com.simibubi.create.foundation.ponder.Selection) Vec3(net.minecraft.world.phys.Vec3) Minecart(net.minecraft.world.entity.vehicle.Minecart) 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 2 with Emitter

use of com.simibubi.create.foundation.ponder.instruction.EmitParticlesInstruction.Emitter in project Create by Creators-of-Create.

the class ProcessingScenes method crushingWheels.

public static void crushingWheels(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("crushing_wheels", "Processing Items with Crushing Wheels");
    scene.configureBasePlate(0, 0, 5);
    scene.scaleSceneView(.9f);
    Selection wheels = util.select.fromTo(3, 2, 2, 1, 2, 2);
    Selection kinetics = util.select.fromTo(0, 1, 5, 4, 1, 3);
    Selection kinetics2 = util.select.fromTo(0, 2, 5, 4, 2, 3);
    Selection beltCog = util.select.position(5, 0, 1);
    scene.world.setKineticSpeed(wheels, 0);
    scene.world.setBlock(util.grid.at(2, 3, 2), Blocks.AIR.defaultBlockState(), false);
    scene.world.showSection(util.select.layer(0).substract(beltCog), Direction.UP);
    scene.idle(5);
    Selection belt = util.select.fromTo(4, 1, 2, 4, 4, 2).add(util.select.fromTo(4, 3, 3, 4, 4, 3)).add(util.select.position(3, 3, 2)).add(util.select.position(2, 3, 2));
    Selection bottomBelt = util.select.fromTo(5, 1, 0, 2, 1, 0).add(util.select.fromTo(2, 1, 2, 2, 1, 1));
    BlockPos center = util.grid.at(2, 2, 2);
    Selection wWheel = util.select.position(center.west());
    Selection eWheel = util.select.position(center.east());
    scene.world.showSection(wWheel, Direction.SOUTH);
    scene.idle(3);
    scene.world.showSection(eWheel, Direction.SOUTH);
    scene.idle(10);
    Vec3 centerTop = util.vector.topOf(center);
    scene.overlay.showText(60).attachKeyFrame().text("A pair of Crushing Wheels can grind items very effectively").pointAt(centerTop).placeNearTarget();
    scene.idle(70);
    scene.world.showSection(kinetics, Direction.DOWN);
    scene.idle(3);
    scene.world.showSection(kinetics2, Direction.DOWN);
    scene.world.setKineticSpeed(wWheel, -16);
    scene.world.setKineticSpeed(eWheel, 16);
    scene.idle(5);
    scene.effects.rotationDirectionIndicator(center.west());
    scene.effects.rotationDirectionIndicator(center.east());
    scene.idle(10);
    scene.overlay.showText(60).attachKeyFrame().text("Their Rotational Input has to make them spin into each other").pointAt(util.vector.blockSurface(center.west(), Direction.NORTH)).placeNearTarget();
    scene.idle(40);
    scene.effects.rotationDirectionIndicator(center.west());
    scene.effects.rotationDirectionIndicator(center.east());
    scene.idle(30);
    ItemStack input = new ItemStack(Items.GOLD_ORE);
    ItemStack output = new ItemStack(Items.RAW_GOLD);
    Vec3 entitySpawn = util.vector.topOf(center.above(2));
    ElementLink<EntityElement> entity1 = scene.world.createItemEntity(entitySpawn, util.vector.of(0, 0.2, 0), input);
    scene.idle(18);
    scene.world.modifyEntity(entity1, Entity::discard);
    Emitter blockSpace = Emitter.withinBlockSpace(new ItemParticleOption(ParticleTypes.ITEM, input), util.vector.of(0, 0, 0));
    scene.effects.emitParticles(util.vector.centerOf(center).add(0, -0.2, 0), blockSpace, 3, 40);
    scene.idle(10);
    scene.overlay.showControls(new InputWindowElement(centerTop, Pointing.DOWN).withItem(input), 30);
    scene.idle(7);
    scene.overlay.showText(50).attachKeyFrame().text("Items thrown or inserted into the top will get processed").pointAt(centerTop).placeNearTarget();
    scene.idle(60);
    scene.world.createItemEntity(centerTop.add(0, -1.4, 0), util.vector.of(0, 0, 0), output);
    scene.idle(10);
    scene.world.createItemEntity(centerTop.add(0, -1.4, 0), util.vector.of(0, 0, 0), output);
    scene.overlay.showControls(new InputWindowElement(centerTop.add(0, -2, 0), Pointing.UP).withItem(output), 30);
    scene.idle(40);
    scene.world.restoreBlocks(util.select.position(2, 3, 2));
    scene.world.showSection(belt, Direction.DOWN);
    scene.idle(5);
    scene.world.showSection(beltCog, Direction.UP);
    scene.idle(5);
    scene.world.modifyEntities(ItemEntity.class, Entity::discard);
    scene.world.showSection(bottomBelt, Direction.SOUTH);
    scene.idle(5);
    scene.overlay.showText(50).attachKeyFrame().text("Items can be inserted and picked up through automated means as well").pointAt(centerTop.add(0, .5, 0)).placeNearTarget();
    scene.idle(40);
    for (int i = 0; i < 5; i++) {
        if (i < 4)
            scene.world.createItemOnBelt(util.grid.at(4, 4, 2), Direction.EAST, input);
        scene.idle(15);
        if (i < 3)
            scene.world.createItemOnBelt(util.grid.at(4, 4, 2), Direction.EAST, input);
        scene.idle(15);
        if (i > 0) {
            scene.world.createItemOnBelt(center.below(), Direction.UP, output);
            scene.idle(15);
            scene.world.createItemOnBelt(center.below(), Direction.UP, output);
        }
        scene.world.removeItemsFromBelt(util.grid.at(3, 3, 2));
        if (i < 4)
            scene.effects.emitParticles(util.vector.centerOf(center).add(0, -0.2, 0), blockSpace, 3, 28);
        if (i == 0)
            scene.markAsFinished();
    }
}
Also used : BasinTileEntity(com.simibubi.create.content.contraptions.processing.BasinTileEntity) MechanicalPressTileEntity(com.simibubi.create.content.contraptions.components.press.MechanicalPressTileEntity) DeployerTileEntity(com.simibubi.create.content.contraptions.components.deployer.DeployerTileEntity) Entity(net.minecraft.world.entity.Entity) ItemEntity(net.minecraft.world.entity.item.ItemEntity) MillstoneTileEntity(com.simibubi.create.content.contraptions.components.millstone.MillstoneTileEntity) MechanicalMixerTileEntity(com.simibubi.create.content.contraptions.components.mixer.MechanicalMixerTileEntity) Emitter(com.simibubi.create.foundation.ponder.instruction.EmitParticlesInstruction.Emitter) Selection(com.simibubi.create.foundation.ponder.Selection) Vec3(net.minecraft.world.phys.Vec3) ItemParticleOption(net.minecraft.core.particles.ItemParticleOption) InputWindowElement(com.simibubi.create.foundation.ponder.element.InputWindowElement) BlockPos(net.minecraft.core.BlockPos) EntityElement(com.simibubi.create.foundation.ponder.element.EntityElement) ItemStack(net.minecraft.world.item.ItemStack)

Example 3 with Emitter

use of com.simibubi.create.foundation.ponder.instruction.EmitParticlesInstruction.Emitter in project Create by Creators-of-Create.

the class DebugScenes method particleScene.

public static void particleScene(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("debug_particles", "Emitting particles");
    scene.showBasePlate();
    scene.idle(10);
    scene.world.showSection(util.select.layersFrom(1), Direction.DOWN);
    scene.idle(10);
    Vec3 emitterPos = util.vector.of(2.5, 2.25, 2.5);
    Emitter emitter = Emitter.simple(ParticleTypes.LAVA, util.vector.of(0, .1, 0));
    Emitter rotation = Emitter.simple(new RotationIndicatorParticleData(SpeedLevel.MEDIUM.getColor(), 12, 1, 1, 20, 'Y'), util.vector.of(0, .1, 0));
    scene.overlay.showText(20).text("Incoming...").pointAt(emitterPos);
    scene.idle(30);
    scene.effects.emitParticles(emitterPos, emitter, 1, 60);
    scene.effects.emitParticles(emitterPos, rotation, 20, 1);
    scene.idle(30);
    scene.rotateCameraY(180);
}
Also used : Emitter(com.simibubi.create.foundation.ponder.instruction.EmitParticlesInstruction.Emitter) Vec3(net.minecraft.world.phys.Vec3) RotationIndicatorParticleData(com.simibubi.create.content.contraptions.particle.RotationIndicatorParticleData)

Aggregations

Emitter (com.simibubi.create.foundation.ponder.instruction.EmitParticlesInstruction.Emitter)3 Vec3 (net.minecraft.world.phys.Vec3)3 Selection (com.simibubi.create.foundation.ponder.Selection)2 InputWindowElement (com.simibubi.create.foundation.ponder.element.InputWindowElement)2 BlockPos (net.minecraft.core.BlockPos)2 ItemStack (net.minecraft.world.item.ItemStack)2 DeployerTileEntity (com.simibubi.create.content.contraptions.components.deployer.DeployerTileEntity)1 MillstoneTileEntity (com.simibubi.create.content.contraptions.components.millstone.MillstoneTileEntity)1 MechanicalMixerTileEntity (com.simibubi.create.content.contraptions.components.mixer.MechanicalMixerTileEntity)1 MechanicalPressTileEntity (com.simibubi.create.content.contraptions.components.press.MechanicalPressTileEntity)1 RotationIndicatorParticleData (com.simibubi.create.content.contraptions.particle.RotationIndicatorParticleData)1 BasinTileEntity (com.simibubi.create.content.contraptions.processing.BasinTileEntity)1 EntityElement (com.simibubi.create.foundation.ponder.element.EntityElement)1 MinecartElement (com.simibubi.create.foundation.ponder.element.MinecartElement)1 WorldSectionElement (com.simibubi.create.foundation.ponder.element.WorldSectionElement)1 ItemParticleOption (net.minecraft.core.particles.ItemParticleOption)1 Entity (net.minecraft.world.entity.Entity)1 ItemEntity (net.minecraft.world.entity.item.ItemEntity)1 Minecart (net.minecraft.world.entity.vehicle.Minecart)1