Search in sources :

Example 1 with DeployerTileEntity

use of com.simibubi.create.content.contraptions.components.deployer.DeployerTileEntity in project Create by Creators-of-Create.

the class ProcessingScenes method blazeBurner.

public static void blazeBurner(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("blaze_burner", "Feeding Blaze Burners");
    scene.configureBasePlate(0, 0, 5);
    scene.showBasePlate();
    scene.idle(10);
    BlockPos burner = util.grid.at(2, 1, 2);
    scene.world.showSection(util.select.position(burner), Direction.DOWN);
    scene.idle(10);
    scene.world.showSection(util.select.position(burner.above()), Direction.DOWN);
    scene.idle(10);
    scene.overlay.showText(70).attachKeyFrame().text("Blaze Burners can provide Heat to Items processed in a Basin").pointAt(util.vector.blockSurface(burner, Direction.WEST)).placeNearTarget();
    scene.idle(80);
    scene.world.hideSection(util.select.position(burner.above()), Direction.UP);
    scene.idle(20);
    scene.world.setBlock(burner.above(), Blocks.AIR.defaultBlockState(), false);
    scene.overlay.showControls(new InputWindowElement(util.vector.topOf(burner), Pointing.DOWN).rightClick().withItem(new ItemStack(Items.OAK_PLANKS)), 15);
    scene.idle(7);
    scene.world.modifyBlock(burner, s -> s.setValue(BlazeBurnerBlock.HEAT_LEVEL, HeatLevel.FADING), false);
    scene.idle(15);
    scene.overlay.showControls(new InputWindowElement(util.vector.topOf(burner), Pointing.DOWN).rightClick().withItem(new ItemStack(Items.OAK_PLANKS)), 15);
    scene.idle(7);
    scene.world.modifyBlock(burner, s -> s.setValue(BlazeBurnerBlock.HEAT_LEVEL, HeatLevel.KINDLED), false);
    scene.idle(20);
    scene.overlay.showText(70).attachKeyFrame().text("For this, the Blaze has to be fed with flammable items").pointAt(util.vector.blockSurface(burner, Direction.WEST)).placeNearTarget();
    scene.idle(80);
    scene.idle(20);
    scene.overlay.showControls(new InputWindowElement(util.vector.topOf(burner), Pointing.DOWN).rightClick().withItem(AllItems.BLAZE_CAKE.asStack()), 30);
    scene.idle(7);
    scene.world.modifyBlock(burner, s -> s.setValue(BlazeBurnerBlock.HEAT_LEVEL, HeatLevel.SEETHING), false);
    scene.idle(20);
    scene.overlay.showText(80).attachKeyFrame().colored(PonderPalette.MEDIUM).text("With a Blaze Cake, the Burner can reach an even stronger level of heat").pointAt(util.vector.blockSurface(burner, Direction.WEST)).placeNearTarget();
    scene.idle(90);
    Class<DeployerTileEntity> teType = DeployerTileEntity.class;
    scene.world.modifyTileNBT(util.select.position(4, 1, 2), teType, nbt -> nbt.put("HeldItem", AllItems.BLAZE_CAKE.asStack().serializeNBT()));
    scene.world.showSection(util.select.fromTo(3, 0, 5, 2, 0, 5), Direction.UP);
    scene.idle(5);
    scene.world.showSection(util.select.fromTo(4, 1, 2, 4, 1, 5), Direction.DOWN);
    scene.idle(5);
    scene.world.showSection(util.select.fromTo(2, 1, 4, 2, 1, 5), Direction.DOWN);
    scene.idle(10);
    scene.overlay.showText(80).attachKeyFrame().text("The feeding process can be automated using Deployers or Mechanical Arms").pointAt(util.vector.blockSurface(burner.east(2), Direction.UP));
    scene.idle(90);
}
Also used : InputWindowElement(com.simibubi.create.foundation.ponder.element.InputWindowElement) BlockPos(net.minecraft.core.BlockPos) DeployerTileEntity(com.simibubi.create.content.contraptions.components.deployer.DeployerTileEntity) ItemStack(net.minecraft.world.item.ItemStack)

Example 2 with DeployerTileEntity

use of com.simibubi.create.content.contraptions.components.deployer.DeployerTileEntity in project Create by Creators-of-Create.

the class DeployerScenes method filter.

public static void filter(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("deployer", "Using the Deployer");
    scene.configureBasePlate(0, 0, 5);
    BlockPos potPosition = util.grid.at(1, 1, 2);
    BlockPos deployerPos = util.grid.at(3, 1, 2);
    Selection deployerSelection = util.select.position(deployerPos);
    scene.world.setBlock(potPosition, Blocks.AIR.defaultBlockState(), false);
    scene.world.showSection(util.select.layer(0).add(util.select.position(1, 1, 2)), Direction.UP);
    scene.idle(5);
    scene.world.showSection(util.select.fromTo(3, 1, 3, 3, 1, 5), Direction.DOWN);
    scene.idle(10);
    scene.world.showSection(deployerSelection, Direction.SOUTH);
    scene.idle(10);
    scene.overlay.showText(60).placeNearTarget().pointAt(util.vector.topOf(deployerPos)).text("Given Rotational Force, a Deployer can imitate player interactions");
    scene.world.moveDeployer(deployerPos, 1, 25);
    scene.idle(26);
    scene.world.moveDeployer(deployerPos, -1, 25);
    scene.idle(44);
    scene.overlay.showSelectionWithText(util.select.position(deployerPos.west(2)), 60).text("It will always interact with the position 2 blocks in front of itself").attachKeyFrame().placeNearTarget().colored(PonderPalette.GREEN).attachKeyFrame();
    scene.world.moveDeployer(deployerPos, 1, 25);
    scene.idle(26);
    scene.world.moveDeployer(deployerPos, -1, 25);
    scene.idle(20);
    scene.world.showSection(util.select.fromTo(2, 1, 3, 2, 1, 1), Direction.DOWN);
    scene.idle(24);
    scene.overlay.showText(50).pointAt(util.vector.topOf(deployerPos.west())).text("Blocks directly in front will not obstruct it").placeNearTarget();
    scene.world.moveDeployer(deployerPos, 1, 25);
    scene.idle(26);
    scene.world.moveDeployer(deployerPos, -1, 25);
    scene.idle(34);
    scene.world.hideSection(util.select.fromTo(2, 1, 3, 2, 1, 1), Direction.UP);
    scene.idle(20);
    String[] actions = new String[] { "Place Blocks,", "Use Items,", "Activate Blocks,", "Harvest blocks", "and Attack Mobs" };
    scene.overlay.showText(80).attachKeyFrame().independent(40).placeNearTarget().text("Deployers can:");
    int y = 60;
    for (String s : actions) {
        scene.idle(15);
        scene.overlay.showText(50).colored(PonderPalette.MEDIUM).placeNearTarget().independent(y).text(s);
        y += 16;
    }
    scene.idle(50);
    ItemStack pot = new ItemStack(Items.FLOWER_POT);
    Vec3 frontVec = util.vector.blockSurface(deployerPos, Direction.WEST).add(-.125, 0, 0);
    scene.overlay.showControls(new InputWindowElement(frontVec, Pointing.DOWN).rightClick().withItem(pot), 40);
    scene.idle(7);
    Class<DeployerTileEntity> teType = DeployerTileEntity.class;
    scene.world.modifyTileNBT(deployerSelection, teType, nbt -> nbt.put("HeldItem", pot.serializeNBT()));
    scene.idle(10);
    scene.overlay.showText(40).attachKeyFrame().placeNearTarget().pointAt(frontVec).text("Right-click the front to give it an Item to use");
    scene.idle(40);
    scene.world.moveDeployer(deployerPos, 1, 25);
    scene.idle(26);
    scene.world.restoreBlocks(util.select.position(potPosition));
    scene.world.modifyTileNBT(deployerSelection, teType, nbt -> nbt.put("HeldItem", ItemStack.EMPTY.serializeNBT()));
    scene.world.moveDeployer(deployerPos, -1, 25);
    scene.idle(20);
    scene.world.showSection(util.select.position(deployerPos.above()), Direction.DOWN);
    ItemStack tulip = new ItemStack(Items.RED_TULIP);
    Vec3 entitySpawn = util.vector.topOf(deployerPos.above(3));
    ElementLink<EntityElement> entity1 = scene.world.createItemEntity(entitySpawn, util.vector.of(0, 0.2, 0), tulip);
    scene.idle(17);
    scene.world.modifyEntity(entity1, Entity::discard);
    scene.world.modifyTileNBT(deployerSelection, teType, nbt -> nbt.put("HeldItem", tulip.serializeNBT()));
    scene.idle(10);
    scene.overlay.showText(40).placeNearTarget().pointAt(util.vector.of(3, 2.5, 3)).text("Items can also be inserted automatically");
    scene.idle(30);
    scene.world.moveDeployer(deployerPos, 1, 25);
    scene.idle(26);
    scene.world.setBlock(potPosition, Blocks.POTTED_RED_TULIP.defaultBlockState(), false);
    scene.world.modifyTileNBT(deployerSelection, teType, nbt -> nbt.put("HeldItem", ItemStack.EMPTY.serializeNBT()));
    scene.world.moveDeployer(deployerPos, -1, 25);
    scene.idle(25);
    scene.world.hideSection(util.select.position(potPosition), Direction.UP);
    scene.world.hideSection(util.select.position(deployerPos.above()), Direction.EAST);
    scene.idle(20);
    Vec3 filterSlot = frontVec.add(0.375, 0.25, 0);
    scene.overlay.showFilterSlotInput(filterSlot, 80);
    scene.overlay.showText(40).attachKeyFrame().placeNearTarget().pointAt(filterSlot).text("Deployers carry a filter slot");
    scene.idle(50);
    ItemStack shears = new ItemStack(Items.SHEARS);
    scene.overlay.showControls(new InputWindowElement(filterSlot, Pointing.DOWN).rightClick().withItem(shears), 40);
    scene.idle(7);
    scene.world.setFilterData(deployerSelection, teType, shears);
    scene.overlay.showText(60).placeNearTarget().pointAt(filterSlot).text("When a filter is set, it activates only while holding a matching item");
    scene.idle(70);
    ElementLink<EntityElement> sheep = scene.world.createEntity(w -> {
        Sheep entity = EntityType.SHEEP.create(w);
        entity.setColor(DyeColor.PINK);
        Vec3 p = util.vector.topOf(util.grid.at(1, 0, 2));
        entity.setPos(p.x, p.y, p.z);
        entity.xo = p.x;
        entity.yo = p.y;
        entity.zo = p.z;
        entity.animationPosition = 0;
        entity.yRotO = 210;
        entity.setYRot(210);
        entity.yHeadRotO = 210;
        entity.yHeadRot = 210;
        return entity;
    });
    scene.idle(20);
    scene.world.showSection(util.select.position(deployerPos.above()), Direction.WEST);
    entity1 = scene.world.createItemEntity(entitySpawn, util.vector.of(0, 0.2, 0), shears);
    scene.idle(17);
    scene.world.modifyEntity(entity1, Entity::discard);
    scene.world.modifyTileNBT(deployerSelection, teType, nbt -> nbt.put("HeldItem", shears.serializeNBT()));
    scene.idle(10);
    scene.overlay.showText(60).placeNearTarget().pointAt(util.vector.of(3, 2.5, 3)).text("Only items matching the filter can now be inserted...");
    scene.idle(70);
    scene.world.moveDeployer(deployerPos, 1, 25);
    scene.idle(26);
    scene.world.modifyEntity(sheep, e -> ((Sheep) e).setSheared(true));
    scene.effects.emitParticles(util.vector.topOf(deployerPos.west(2)).add(0, -.25, 0), Emitter.withinBlockSpace(new BlockParticleOption(ParticleTypes.BLOCK, Blocks.PINK_WOOL.defaultBlockState()), util.vector.of(0, 0, 0)), 25, 1);
    scene.world.moveDeployer(deployerPos, -1, 25);
    scene.world.showSection(util.select.position(deployerPos.north()), Direction.SOUTH);
    scene.idle(25);
    scene.overlay.showText(80).placeNearTarget().pointAt(util.vector.of(3.5, 1.25, 1.25)).text("...and only non-matching items will be extracted");
    scene.world.flapFunnel(deployerPos.north(), true);
    scene.world.createItemEntity(util.vector.centerOf(deployerPos.north()).subtract(0, .45, 0), util.vector.of(0, 0, -0.1), new ItemStack(Items.PINK_WOOL));
    scene.markAsFinished();
    for (int i = 0; i < 10; i++) {
        scene.idle(26);
        scene.world.moveDeployer(deployerPos, 1, 25);
        scene.idle(26);
        scene.world.moveDeployer(deployerPos, -1, 25);
        scene.idle(26);
    }
}
Also used : DeployerTileEntity(com.simibubi.create.content.contraptions.components.deployer.DeployerTileEntity) Entity(net.minecraft.world.entity.Entity) BlockParticleOption(net.minecraft.core.particles.BlockParticleOption) Selection(com.simibubi.create.foundation.ponder.Selection) DeployerTileEntity(com.simibubi.create.content.contraptions.components.deployer.DeployerTileEntity) EntityElement(com.simibubi.create.foundation.ponder.element.EntityElement) Vec3(net.minecraft.world.phys.Vec3) InputWindowElement(com.simibubi.create.foundation.ponder.element.InputWindowElement) Sheep(net.minecraft.world.entity.animal.Sheep) BlockPos(net.minecraft.core.BlockPos) ItemStack(net.minecraft.world.item.ItemStack)

Aggregations

DeployerTileEntity (com.simibubi.create.content.contraptions.components.deployer.DeployerTileEntity)2 InputWindowElement (com.simibubi.create.foundation.ponder.element.InputWindowElement)2 BlockPos (net.minecraft.core.BlockPos)2 ItemStack (net.minecraft.world.item.ItemStack)2 Selection (com.simibubi.create.foundation.ponder.Selection)1 EntityElement (com.simibubi.create.foundation.ponder.element.EntityElement)1 BlockParticleOption (net.minecraft.core.particles.BlockParticleOption)1 Entity (net.minecraft.world.entity.Entity)1 Sheep (net.minecraft.world.entity.animal.Sheep)1 Vec3 (net.minecraft.world.phys.Vec3)1