Search in sources :

Example 1 with MechanicalPressTileEntity

use of com.simibubi.create.content.contraptions.components.press.MechanicalPressTileEntity in project Create by Creators-of-Create.

the class BeltScenes method depot.

public static void depot(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("depot", "Using Depots");
    scene.configureBasePlate(0, 0, 5);
    scene.showBasePlate();
    scene.idle(5);
    scene.world.setBlock(util.grid.at(3, 2, 2), Blocks.WATER.defaultBlockState(), false);
    BlockPos depotPos = util.grid.at(2, 1, 2);
    scene.world.showSection(util.select.position(2, 1, 2), Direction.DOWN);
    Vec3 topOf = util.vector.topOf(depotPos);
    scene.overlay.showText(60).attachKeyFrame().text("Depots can serve as 'stationary' belt elements").placeNearTarget().pointAt(topOf);
    scene.idle(70);
    scene.overlay.showControls(new InputWindowElement(topOf, Pointing.DOWN).rightClick().withItem(new ItemStack(Items.COPPER_BLOCK)), 20);
    scene.idle(7);
    scene.world.createItemOnBeltLike(depotPos, Direction.NORTH, new ItemStack(Items.COPPER_BLOCK));
    scene.idle(10);
    scene.overlay.showText(70).attachKeyFrame().text("Right-Click to manually place or remove Items from it").placeNearTarget().pointAt(topOf);
    scene.idle(80);
    scene.overlay.showControls(new InputWindowElement(topOf, Pointing.DOWN).rightClick(), 20);
    scene.idle(7);
    scene.world.removeItemsFromBelt(depotPos);
    scene.effects.indicateSuccess(depotPos);
    scene.idle(20);
    scene.world.showSection(util.select.position(depotPos.above(2)), Direction.SOUTH);
    scene.overlay.showText(70).attachKeyFrame().text("Just like Mechanical Belts, it can provide items to processing").placeNearTarget().pointAt(util.vector.blockSurface(depotPos.above(2), Direction.WEST));
    ItemStack bottle = new ItemStack(Items.BUCKET);
    scene.world.createItemOnBeltLike(depotPos, Direction.NORTH, bottle);
    scene.idle(20);
    scene.world.modifyTileNBT(util.select.position(depotPos.above(2)), SpoutTileEntity.class, nbt -> nbt.putInt("ProcessingTicks", 20));
    scene.idle(20);
    scene.world.removeItemsFromBelt(depotPos);
    scene.world.createItemOnBeltLike(depotPos, Direction.UP, new ItemStack(Items.WATER_BUCKET));
    scene.world.modifyTileNBT(util.select.position(depotPos.above(2)), SpoutTileEntity.class, nbt -> nbt.putBoolean("Splash", true));
    scene.idle(30);
    scene.world.removeItemsFromBelt(depotPos);
    scene.world.hideSection(util.select.position(depotPos.above(2)), Direction.SOUTH);
    scene.idle(20);
    ElementLink<WorldSectionElement> spout = scene.world.showIndependentSection(util.select.position(depotPos.above(2).west()), Direction.SOUTH);
    scene.world.moveSection(spout, util.vector.of(1, 0, 0), 0);
    BlockPos pressPos = depotPos.above(2).west();
    ItemStack copper = new ItemStack(Items.COPPER_INGOT);
    scene.world.createItemOnBeltLike(depotPos, Direction.NORTH, copper);
    Vec3 depotCenter = util.vector.centerOf(depotPos);
    scene.idle(10);
    Class<MechanicalPressTileEntity> type = MechanicalPressTileEntity.class;
    scene.world.modifyTileEntity(pressPos, type, pte -> pte.start(Mode.BELT));
    scene.idle(15);
    scene.world.modifyTileEntity(pressPos, type, pte -> pte.makePressingParticleEffect(depotCenter.add(0, 8 / 16f, 0), copper));
    scene.world.removeItemsFromBelt(depotPos);
    ItemStack sheet = AllItems.COPPER_SHEET.asStack();
    scene.world.createItemOnBeltLike(depotPos, Direction.UP, sheet);
    scene.idle(20);
    scene.world.hideIndependentSection(spout, Direction.SOUTH);
    scene.idle(10);
    Selection fanSelect = util.select.fromTo(4, 1, 3, 5, 2, 2).add(util.select.position(3, 1, 2)).add(util.select.position(5, 0, 2));
    scene.world.showSection(fanSelect, Direction.SOUTH);
    ElementLink<WorldSectionElement> water = scene.world.showIndependentSection(util.select.position(3, 1, 0), Direction.SOUTH);
    scene.world.moveSection(water, util.vector.of(0, 1, 2), 0);
    scene.idle(30);
    scene.world.hideSection(fanSelect, Direction.SOUTH);
    scene.world.hideIndependentSection(water, Direction.SOUTH);
    scene.idle(30);
    scene.world.showSection(util.select.fromTo(2, 1, 4, 2, 1, 5).add(util.select.position(2, 0, 5)), Direction.DOWN);
    BlockPos armPos = util.grid.at(2, 1, 4);
    scene.overlay.showText(70).attachKeyFrame().text("...as well as provide Items to Mechanical Arms").placeNearTarget().pointAt(util.vector.blockSurface(armPos, Direction.WEST));
    scene.idle(20);
    scene.world.instructArm(armPos, Phase.MOVE_TO_INPUT, ItemStack.EMPTY, 0);
    scene.idle(37);
    scene.world.removeItemsFromBelt(depotPos);
    scene.world.instructArm(armPos, Phase.SEARCH_OUTPUTS, sheet, -1);
}
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) MechanicalPressTileEntity(com.simibubi.create.content.contraptions.components.press.MechanicalPressTileEntity)

Example 2 with MechanicalPressTileEntity

use of com.simibubi.create.content.contraptions.components.press.MechanicalPressTileEntity in project Create by Creators-of-Create.

the class ProcessingScenes method basin.

public static void basin(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("basin", "Processing Items in the Basin");
    scene.configureBasePlate(0, 0, 5);
    scene.world.showSection(util.select.layer(0), Direction.UP);
    scene.idle(5);
    scene.world.showSection(util.select.position(1, 1, 2), Direction.DOWN);
    scene.idle(10);
    BlockPos basinPos = util.grid.at(1, 2, 2);
    scene.world.modifyBlock(basinPos, s -> s.setValue(BasinBlock.FACING, Direction.DOWN), false);
    scene.world.showSection(util.select.position(basinPos), Direction.DOWN);
    scene.idle(10);
    Vec3 basinSide = util.vector.blockSurface(basinPos, Direction.WEST);
    scene.overlay.showText(80).attachKeyFrame().text("A Basin can hold Items and Fluids for Processing").pointAt(basinSide).placeNearTarget();
    scene.idle(10);
    ItemStack stack = new ItemStack(Items.BRICK);
    for (int i = 0; i < 4; i++) {
        scene.world.createItemEntity(util.vector.centerOf(basinPos.above(3)), util.vector.of(0, 0, 0), stack);
        scene.idle(10);
    }
    scene.idle(10);
    scene.overlay.showControls(new InputWindowElement(util.vector.topOf(basinPos), Pointing.DOWN).withItem(stack), 30);
    scene.idle(30);
    for (Direction d : Iterate.horizontalDirections) {
        scene.overlay.showOutline(PonderPalette.GREEN, new Object(), util.select.position(basinPos.below().relative(d)), 60);
        scene.idle(4);
    }
    scene.overlay.showText(80).attachKeyFrame().colored(PonderPalette.GREEN).text("After a processing step, basins try to output below to the side of them").pointAt(basinSide).placeNearTarget();
    scene.idle(90);
    ElementLink<WorldSectionElement> depot = scene.world.showIndependentSection(util.select.position(3, 1, 1), Direction.EAST);
    scene.world.moveSection(depot, util.vector.of(-2, 0, 0), 0);
    scene.idle(10);
    scene.world.modifyBlock(basinPos, s -> s.setValue(BasinBlock.FACING, Direction.NORTH), false);
    scene.idle(10);
    scene.overlay.showText(80).attachKeyFrame().colored(PonderPalette.GREEN).text("When a valid component is present, the Basin will show an output faucet").pointAt(basinSide.add(0.15, 0, -0.5)).placeNearTarget();
    scene.idle(90);
    scene.world.hideIndependentSection(depot, Direction.EAST);
    scene.idle(15);
    depot = scene.world.showIndependentSection(util.select.position(0, 1, 1), Direction.EAST);
    scene.world.moveSection(depot, util.vector.of(1, 0, 0), 0);
    scene.idle(20);
    scene.world.hideIndependentSection(depot, Direction.EAST);
    scene.overlay.showText(80).text("A number of options are applicable here").pointAt(util.vector.centerOf(util.grid.at(1, 1, 1))).placeNearTarget();
    scene.idle(15);
    depot = scene.world.showIndependentSection(util.select.position(1, 1, 0), Direction.EAST);
    scene.world.moveSection(depot, util.vector.of(0, 0, 1), 0);
    scene.idle(20);
    scene.world.hideIndependentSection(depot, Direction.EAST);
    scene.idle(15);
    depot = scene.world.showIndependentSection(util.select.position(1, 1, 1), Direction.EAST);
    scene.idle(20);
    scene.world.hideIndependentSection(depot, Direction.EAST);
    scene.idle(15);
    depot = scene.world.showIndependentSection(util.select.fromTo(3, 1, 0, 2, 1, 0), Direction.EAST);
    scene.world.moveSection(depot, util.vector.of(-2, 0, 1), 0);
    scene.idle(20);
    scene.world.hideIndependentSection(depot, Direction.EAST);
    scene.idle(15);
    depot = scene.world.showIndependentSection(util.select.position(2, 1, 1), Direction.EAST);
    scene.world.moveSection(depot, util.vector.of(-1, 0, 0), 0);
    scene.idle(25);
    BlockPos pressPos = util.grid.at(1, 4, 2);
    scene.world.showSection(util.select.position(pressPos), Direction.DOWN);
    scene.idle(5);
    scene.world.showSection(util.select.fromTo(1, 4, 3, 1, 1, 5), Direction.NORTH);
    scene.idle(10);
    Class<MechanicalPressTileEntity> type = MechanicalPressTileEntity.class;
    scene.world.modifyTileEntity(pressPos, type, pte -> pte.start(Mode.BASIN));
    scene.idle(30);
    scene.world.modifyTileEntity(pressPos, type, pte -> pte.makeCompactingParticleEffect(util.vector.centerOf(basinPos), stack));
    scene.world.modifyTileNBT(util.select.position(basinPos), BasinTileEntity.class, nbt -> {
        nbt.put("VisualizedItems", NBTHelper.writeCompoundList(ImmutableList.of(IntAttached.with(1, new ItemStack(Blocks.BRICKS))), ia -> ia.getValue().serializeNBT()));
    });
    scene.idle(4);
    scene.overlay.showControls(new InputWindowElement(util.vector.topOf(basinPos.below().north()), Pointing.RIGHT).withItem(new ItemStack(Items.BRICKS)), 30);
    scene.overlay.showText(60).attachKeyFrame().colored(PonderPalette.GREEN).text("Outputs will be caught by the inventory below").pointAt(basinSide.add(0, -1, -1)).placeNearTarget();
    scene.idle(70);
    scene.world.hideIndependentSection(depot, Direction.NORTH);
    scene.idle(10);
    scene.world.modifyBlock(basinPos, s -> s.setValue(BasinBlock.FACING, Direction.DOWN), false);
    scene.idle(20);
    scene.overlay.showText(80).attachKeyFrame().text("Without output faucet, the Basin will retain items created in its processing").pointAt(basinSide).placeNearTarget();
    scene.idle(50);
    ItemStack nugget = AllItems.COPPER_NUGGET.asStack();
    scene.overlay.showControls(new InputWindowElement(util.vector.topOf(basinPos), Pointing.RIGHT).withItem(nugget), 30);
    scene.idle(30);
    scene.world.modifyTileEntity(pressPos, type, pte -> pte.start(Mode.BASIN));
    scene.idle(30);
    scene.world.modifyTileEntity(pressPos, type, pte -> pte.makeCompactingParticleEffect(util.vector.centerOf(basinPos), nugget));
    ItemStack ingot = new ItemStack(Items.COPPER_INGOT);
    scene.idle(30);
    scene.overlay.showControls(new InputWindowElement(util.vector.topOf(basinPos), Pointing.RIGHT).withItem(ingot), 30);
    scene.idle(30);
    scene.world.modifyTileEntity(pressPos, type, pte -> pte.start(Mode.BASIN));
    scene.idle(30);
    scene.world.modifyTileEntity(pressPos, type, pte -> pte.makeCompactingParticleEffect(util.vector.centerOf(basinPos), ingot));
    ItemStack block = new ItemStack(Items.COPPER_BLOCK);
    scene.idle(30);
    scene.overlay.showControls(new InputWindowElement(util.vector.topOf(basinPos), Pointing.RIGHT).withItem(block), 30);
    scene.overlay.showText(70).attachKeyFrame().colored(PonderPalette.GREEN).text("This can be useful if outputs should be re-used as ingredients").pointAt(basinSide).placeNearTarget();
    scene.idle(80);
    scene.world.showSection(util.select.fromTo(2, 2, 5, 4, 1, 2), Direction.DOWN);
    scene.rotateCameraY(70);
    scene.world.createItemOnBelt(util.grid.at(2, 1, 2), Direction.WEST, block);
    scene.idle(40);
    scene.overlay.showText(70).text("Desired outputs will then have to be extracted from the basin").pointAt(util.vector.topOf(util.grid.at(3, 1, 2)).subtract(0, 3 / 16f, 0)).placeNearTarget();
    scene.idle(80);
    Vec3 filter = util.vector.of(2.5, 2.85, 2.5);
    scene.overlay.showFilterSlotInput(filter, 80);
    scene.overlay.showText(70).text("A Filter might be necessary to avoid pulling out un-processed items").pointAt(filter).placeNearTarget();
    scene.idle(40);
    scene.markAsFinished();
}
Also used : Items(net.minecraft.world.item.Items) SceneBuilder(com.simibubi.create.foundation.ponder.SceneBuilder) InputWindowElement(com.simibubi.create.foundation.ponder.element.InputWindowElement) Direction(net.minecraft.core.Direction) EntityType(net.minecraft.world.entity.EntityType) BasinTileEntity(com.simibubi.create.content.contraptions.processing.BasinTileEntity) Pointing(com.simibubi.create.foundation.utility.Pointing) MechanicalPressTileEntity(com.simibubi.create.content.contraptions.components.press.MechanicalPressTileEntity) ItemParticleOption(net.minecraft.core.particles.ItemParticleOption) AllItems(com.simibubi.create.AllItems) ElementLink(com.simibubi.create.foundation.ponder.ElementLink) ImmutableList(com.google.common.collect.ImmutableList) BasinBlock(com.simibubi.create.content.contraptions.processing.BasinBlock) PonderPalette(com.simibubi.create.foundation.ponder.PonderPalette) BeltItemElement(com.simibubi.create.foundation.ponder.element.BeltItemElement) DeployerTileEntity(com.simibubi.create.content.contraptions.components.deployer.DeployerTileEntity) AllBlocks(com.simibubi.create.AllBlocks) Selection(com.simibubi.create.foundation.ponder.Selection) Iterate(com.simibubi.create.foundation.utility.Iterate) Mode(com.simibubi.create.content.contraptions.components.press.MechanicalPressTileEntity.Mode) EntityElement(com.simibubi.create.foundation.ponder.element.EntityElement) Emitter(com.simibubi.create.foundation.ponder.instruction.EmitParticlesInstruction.Emitter) Blaze(net.minecraft.world.entity.monster.Blaze) SceneBuildingUtil(com.simibubi.create.foundation.ponder.SceneBuildingUtil) BlazeBurnerBlock(com.simibubi.create.content.contraptions.processing.burner.BlazeBurnerBlock) HeatLevel(com.simibubi.create.content.contraptions.processing.burner.BlazeBurnerBlock.HeatLevel) IntAttached(com.simibubi.create.foundation.utility.IntAttached) Blocks(net.minecraft.world.level.block.Blocks) WorldSectionElement(com.simibubi.create.foundation.ponder.element.WorldSectionElement) Entity(net.minecraft.world.entity.Entity) BlockPos(net.minecraft.core.BlockPos) ItemEntity(net.minecraft.world.entity.item.ItemEntity) Vec3(net.minecraft.world.phys.Vec3) LitBlazeBurnerBlock(com.simibubi.create.content.contraptions.processing.burner.LitBlazeBurnerBlock) NBTHelper(com.simibubi.create.foundation.utility.NBTHelper) ItemStack(net.minecraft.world.item.ItemStack) MillstoneTileEntity(com.simibubi.create.content.contraptions.components.millstone.MillstoneTileEntity) MechanicalMixerTileEntity(com.simibubi.create.content.contraptions.components.mixer.MechanicalMixerTileEntity) ParticleTypes(net.minecraft.core.particles.ParticleTypes) 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) Direction(net.minecraft.core.Direction) MechanicalPressTileEntity(com.simibubi.create.content.contraptions.components.press.MechanicalPressTileEntity)

Example 3 with MechanicalPressTileEntity

use of com.simibubi.create.content.contraptions.components.press.MechanicalPressTileEntity in project FrostedHeart by TeamMoegMC.

the class MixinProcessingScenes method pressing.

/**
 * @author khjxiaogu
 * @reason change mechanical press scene to fit TWR
 */
@Overwrite(remap = false)
public static void pressing(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("mechanical_press", "Processing Items with the Mechanical Press");
    scene.configureBasePlate(0, 0, 5);
    scene.world.setBlock(util.grid.at(1, 1, 2), AllBlocks.ANDESITE_CASING.getDefaultState(), false);
    scene.world.showSection(util.select.layer(0), Direction.UP);
    scene.idle(5);
    scene.world.showSection(util.select.fromTo(1, 4, 3, 1, 1, 5), Direction.DOWN);
    scene.idle(5);
    scene.world.showSection(util.select.position(1, 1, 2), Direction.DOWN);
    scene.idle(5);
    scene.world.showSection(util.select.position(1, 2, 2), Direction.DOWN);
    scene.idle(5);
    scene.world.showSection(util.select.position(1, 4, 2), Direction.SOUTH);
    scene.idle(5);
    scene.world.showSection(util.select.fromTo(3, 1, 1, 1, 1, 1), Direction.SOUTH);
    scene.world.showSection(util.select.fromTo(3, 1, 5, 3, 1, 2), Direction.SOUTH);
    scene.idle(20);
    BlockPos basin = util.grid.at(1, 2, 2);
    BlockPos pressPos = util.grid.at(1, 4, 2);
    Vector3d basinSide = util.vector.blockSurface(basin, Direction.WEST);
    ItemStack copper = AllItems.COPPER_INGOT.asStack();
    ItemStack copperBlock = AllItems.COPPER_SHEET.asStack();
    scene.overlay.showText(60).pointAt(basinSide).placeNearTarget().attachKeyFrame().text("Pressing items held in a Basin will cause them to be Compacted");
    scene.idle(40);
    scene.overlay.showControls(new InputWindowElement(util.vector.topOf(basin), Pointing.DOWN).withItem(copper), 30);
    scene.idle(30);
    Class<MechanicalPressTileEntity> type = MechanicalPressTileEntity.class;
    scene.world.modifyTileEntity(pressPos, type, pte -> pte.start(Mode.BASIN));
    scene.idle(30);
    scene.world.modifyTileEntity(pressPos, type, pte -> pte.makeCompactingParticleEffect(util.vector.centerOf(basin), copper));
    scene.world.modifyTileNBT(util.select.position(basin), BasinTileEntity.class, nbt -> {
        nbt.put("VisualizedItems", NBTHelper.writeCompoundList(ImmutableList.of(IntAttached.with(1, copperBlock)), ia -> ia.getValue().serializeNBT()));
    });
    scene.idle(4);
    scene.world.createItemOnBelt(util.grid.at(1, 1, 1), Direction.UP, copperBlock);
    scene.idle(30);
    scene.overlay.showText(80).pointAt(basinSide).placeNearTarget().attachKeyFrame().text("Compacting includes any filled 2x2 or 3x3 Crafting Recipe, plus a couple extra ones");
    scene.idle(30);
    ItemStack log = new ItemStack(Items.OAK_LOG);
    ItemStack bark = new ItemStack(Items.OAK_WOOD);
    scene.overlay.showControls(new InputWindowElement(util.vector.topOf(basin), Pointing.DOWN).withItem(log), 30);
    scene.idle(30);
    scene.world.modifyTileEntity(pressPos, type, pte -> pte.start(Mode.BASIN));
    scene.idle(30);
    scene.world.modifyTileEntity(pressPos, type, pte -> pte.makeCompactingParticleEffect(util.vector.centerOf(basin), log));
    scene.world.modifyTileNBT(util.select.position(basin), BasinTileEntity.class, nbt -> {
        nbt.put("VisualizedItems", NBTHelper.writeCompoundList(ImmutableList.of(IntAttached.with(1, bark)), ia -> ia.getValue().serializeNBT()));
    });
    scene.idle(4);
    scene.world.createItemOnBelt(util.grid.at(1, 1, 1), Direction.UP, bark);
    scene.idle(30);
    scene.rotateCameraY(-30);
    scene.idle(10);
    scene.world.setBlock(util.grid.at(1, 1, 2), AllBlocks.BLAZE_BURNER.getDefaultState().with(BlazeBurnerBlock.HEAT_LEVEL, HeatLevel.KINDLED), true);
    scene.idle(10);
    scene.overlay.showText(80).pointAt(basinSide.subtract(0, 1, 0)).placeNearTarget().text("Some of those recipes may require the heat of a Blaze Burner");
    scene.idle(40);
    scene.rotateCameraY(30);
    scene.idle(60);
    Vector3d filterPos = util.vector.of(1, 2.75f, 2.5f);
    scene.overlay.showFilterSlotInput(filterPos, 100);
    scene.overlay.showText(120).pointAt(filterPos).placeNearTarget().attachKeyFrame().text("The filter slot can be used in case two recipes are conflicting.");
    scene.idle(60);
}
Also used : Mode(com.simibubi.create.content.contraptions.components.press.MechanicalPressTileEntity.Mode) SceneBuilder(com.simibubi.create.foundation.ponder.SceneBuilder) BasinTileEntity(com.simibubi.create.content.contraptions.processing.BasinTileEntity) SceneBuildingUtil(com.simibubi.create.foundation.ponder.SceneBuildingUtil) Pointing(com.simibubi.create.foundation.utility.Pointing) BlockPos(net.minecraft.util.math.BlockPos) Overwrite(org.spongepowered.asm.mixin.Overwrite) MechanicalPressTileEntity(com.simibubi.create.content.contraptions.components.press.MechanicalPressTileEntity) BlazeBurnerBlock(com.simibubi.create.content.contraptions.processing.burner.BlazeBurnerBlock) Items(net.minecraft.item.Items) Direction(net.minecraft.util.Direction) AllItems(com.simibubi.create.AllItems) HeatLevel(com.simibubi.create.content.contraptions.processing.burner.BlazeBurnerBlock.HeatLevel) IntAttached(com.simibubi.create.foundation.utility.IntAttached) ItemStack(net.minecraft.item.ItemStack) Vector3d(net.minecraft.util.math.vector.Vector3d) ImmutableList(com.google.common.collect.ImmutableList) Mixin(org.spongepowered.asm.mixin.Mixin) ProcessingScenes(com.simibubi.create.foundation.ponder.content.ProcessingScenes) NBTHelper(com.simibubi.create.foundation.utility.NBTHelper) InputWindowElement(com.simibubi.create.foundation.ponder.elements.InputWindowElement) AllBlocks(com.simibubi.create.AllBlocks) Vector3d(net.minecraft.util.math.vector.Vector3d) InputWindowElement(com.simibubi.create.foundation.ponder.elements.InputWindowElement) BlockPos(net.minecraft.util.math.BlockPos) ItemStack(net.minecraft.item.ItemStack) MechanicalPressTileEntity(com.simibubi.create.content.contraptions.components.press.MechanicalPressTileEntity) Overwrite(org.spongepowered.asm.mixin.Overwrite)

Example 4 with MechanicalPressTileEntity

use of com.simibubi.create.content.contraptions.components.press.MechanicalPressTileEntity in project Create by Creators-of-Create.

the class ProcessingScenes method pressing.

public static void pressing(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("mechanical_press", "Processing Items with the Mechanical Press");
    scene.configureBasePlate(0, 0, 5);
    scene.world.showSection(util.select.layer(0), Direction.UP);
    scene.idle(5);
    ElementLink<WorldSectionElement> depot = scene.world.showIndependentSection(util.select.position(2, 1, 1), Direction.DOWN);
    scene.world.moveSection(depot, util.vector.of(0, 0, 1), 0);
    scene.idle(10);
    Selection pressS = util.select.position(2, 3, 2);
    BlockPos pressPos = util.grid.at(2, 3, 2);
    BlockPos depotPos = util.grid.at(2, 1, 1);
    scene.world.setKineticSpeed(pressS, 0);
    scene.world.showSection(pressS, Direction.DOWN);
    scene.idle(10);
    scene.world.showSection(util.select.fromTo(2, 1, 3, 2, 1, 5), Direction.NORTH);
    scene.idle(3);
    scene.world.showSection(util.select.position(2, 2, 3), Direction.SOUTH);
    scene.idle(3);
    scene.world.showSection(util.select.position(2, 3, 3), Direction.NORTH);
    scene.world.setKineticSpeed(pressS, -32);
    scene.effects.indicateSuccess(pressPos);
    scene.idle(10);
    Vec3 pressSide = util.vector.blockSurface(pressPos, Direction.WEST);
    scene.overlay.showText(60).pointAt(pressSide).placeNearTarget().attachKeyFrame().text("The Mechanical Press can process items provided beneath it");
    scene.idle(70);
    scene.overlay.showText(60).pointAt(pressSide.subtract(0, 2, 0)).placeNearTarget().text("The Input items can be dropped or placed on a Depot under the Press");
    scene.idle(50);
    ItemStack copper = new ItemStack(Items.COPPER_INGOT);
    scene.world.createItemOnBeltLike(depotPos, Direction.NORTH, copper);
    Vec3 depotCenter = util.vector.centerOf(depotPos.south());
    scene.overlay.showControls(new InputWindowElement(depotCenter, Pointing.UP).withItem(copper), 30);
    scene.idle(10);
    Class<MechanicalPressTileEntity> type = MechanicalPressTileEntity.class;
    scene.world.modifyTileEntity(pressPos, type, pte -> pte.start(Mode.BELT));
    scene.idle(30);
    scene.world.modifyTileEntity(pressPos, type, pte -> pte.makePressingParticleEffect(depotCenter.add(0, 8 / 16f, 0), copper));
    scene.world.removeItemsFromBelt(depotPos);
    ItemStack sheet = AllItems.COPPER_SHEET.asStack();
    scene.world.createItemOnBeltLike(depotPos, Direction.UP, sheet);
    scene.idle(10);
    scene.overlay.showControls(new InputWindowElement(depotCenter, Pointing.UP).withItem(sheet), 50);
    scene.idle(60);
    scene.world.hideIndependentSection(depot, Direction.NORTH);
    scene.idle(5);
    scene.world.showSection(util.select.fromTo(0, 1, 3, 0, 2, 3), Direction.DOWN);
    scene.idle(10);
    scene.world.showSection(util.select.fromTo(4, 1, 2, 0, 2, 2), Direction.SOUTH);
    scene.idle(20);
    BlockPos beltPos = util.grid.at(0, 1, 2);
    scene.overlay.showText(40).pointAt(util.vector.blockSurface(beltPos, Direction.WEST)).placeNearTarget().attachKeyFrame().text("When items are provided on a belt...");
    scene.idle(30);
    ElementLink<BeltItemElement> ingot = scene.world.createItemOnBelt(beltPos, Direction.SOUTH, copper);
    scene.idle(15);
    ElementLink<BeltItemElement> ingot2 = scene.world.createItemOnBelt(beltPos, Direction.SOUTH, copper);
    scene.idle(15);
    scene.world.stallBeltItem(ingot, true);
    scene.world.modifyTileEntity(pressPos, type, pte -> pte.start(Mode.BELT));
    scene.overlay.showText(50).pointAt(pressSide).placeNearTarget().attachKeyFrame().text("The Press will hold and process them automatically");
    scene.idle(30);
    scene.world.modifyTileEntity(pressPos, type, pte -> pte.makePressingParticleEffect(depotCenter.add(0, 8 / 16f, 0), copper));
    scene.world.removeItemsFromBelt(pressPos.below(2));
    ingot = scene.world.createItemOnBelt(pressPos.below(2), Direction.UP, sheet);
    scene.world.stallBeltItem(ingot, true);
    scene.idle(15);
    scene.world.stallBeltItem(ingot, false);
    scene.idle(15);
    scene.world.stallBeltItem(ingot2, true);
    scene.world.modifyTileEntity(pressPos, type, pte -> pte.start(Mode.BELT));
    scene.idle(30);
    scene.world.modifyTileEntity(pressPos, type, pte -> pte.makePressingParticleEffect(depotCenter.add(0, 8 / 16f, 0), copper));
    scene.world.removeItemsFromBelt(pressPos.below(2));
    ingot2 = scene.world.createItemOnBelt(pressPos.below(2), Direction.UP, sheet);
    scene.world.stallBeltItem(ingot2, true);
    scene.idle(15);
    scene.world.stallBeltItem(ingot2, false);
}
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) MechanicalPressTileEntity(com.simibubi.create.content.contraptions.components.press.MechanicalPressTileEntity) BeltItemElement(com.simibubi.create.foundation.ponder.element.BeltItemElement)

Example 5 with MechanicalPressTileEntity

use of com.simibubi.create.content.contraptions.components.press.MechanicalPressTileEntity in project Create by Creators-of-Create.

the class ProcessingScenes method compacting.

public static void compacting(SceneBuilder scene, SceneBuildingUtil util) {
    scene.title("mechanical_press_compacting", "Compacting items with the Mechanical Press");
    scene.configureBasePlate(0, 0, 5);
    scene.world.setBlock(util.grid.at(1, 1, 2), AllBlocks.ANDESITE_CASING.getDefaultState(), false);
    scene.world.showSection(util.select.layer(0), Direction.UP);
    scene.idle(5);
    scene.world.showSection(util.select.fromTo(1, 4, 3, 1, 1, 5), Direction.DOWN);
    scene.idle(5);
    scene.world.showSection(util.select.position(1, 1, 2), Direction.DOWN);
    scene.idle(5);
    scene.world.showSection(util.select.position(1, 2, 2), Direction.DOWN);
    scene.idle(5);
    scene.world.showSection(util.select.position(1, 4, 2), Direction.SOUTH);
    scene.idle(5);
    scene.world.showSection(util.select.fromTo(3, 1, 1, 1, 1, 1), Direction.SOUTH);
    scene.world.showSection(util.select.fromTo(3, 1, 5, 3, 1, 2), Direction.SOUTH);
    scene.idle(20);
    BlockPos basin = util.grid.at(1, 2, 2);
    BlockPos pressPos = util.grid.at(1, 4, 2);
    Vec3 basinSide = util.vector.blockSurface(basin, Direction.WEST);
    ItemStack copper = new ItemStack(Items.COPPER_INGOT);
    ItemStack copperBlock = new ItemStack(Items.COPPER_BLOCK);
    scene.overlay.showText(60).pointAt(basinSide).placeNearTarget().attachKeyFrame().text("Pressing items held in a Basin will cause them to be Compacted");
    scene.idle(40);
    scene.overlay.showControls(new InputWindowElement(util.vector.topOf(basin), Pointing.DOWN).withItem(copper), 30);
    scene.idle(30);
    Class<MechanicalPressTileEntity> type = MechanicalPressTileEntity.class;
    scene.world.modifyTileEntity(pressPos, type, pte -> pte.start(Mode.BASIN));
    scene.idle(30);
    scene.world.modifyTileEntity(pressPos, type, pte -> pte.makeCompactingParticleEffect(util.vector.centerOf(basin), copper));
    scene.world.modifyTileNBT(util.select.position(basin), BasinTileEntity.class, nbt -> {
        nbt.put("VisualizedItems", NBTHelper.writeCompoundList(ImmutableList.of(IntAttached.with(1, copperBlock)), ia -> ia.getValue().serializeNBT()));
    });
    scene.idle(4);
    scene.world.createItemOnBelt(util.grid.at(1, 1, 1), Direction.UP, copperBlock);
    scene.idle(30);
    scene.overlay.showText(80).pointAt(basinSide).placeNearTarget().attachKeyFrame().text("Compacting includes any filled 2x2 or 3x3 Crafting Recipe, plus a couple extra ones");
    scene.idle(30);
    ItemStack log = new ItemStack(Items.OAK_LOG);
    ItemStack bark = new ItemStack(Items.OAK_WOOD);
    scene.overlay.showControls(new InputWindowElement(util.vector.topOf(basin), Pointing.DOWN).withItem(log), 30);
    scene.idle(30);
    scene.world.modifyTileEntity(pressPos, type, pte -> pte.start(Mode.BASIN));
    scene.idle(30);
    scene.world.modifyTileEntity(pressPos, type, pte -> pte.makeCompactingParticleEffect(util.vector.centerOf(basin), log));
    scene.world.modifyTileNBT(util.select.position(basin), BasinTileEntity.class, nbt -> {
        nbt.put("VisualizedItems", NBTHelper.writeCompoundList(ImmutableList.of(IntAttached.with(1, bark)), ia -> ia.getValue().serializeNBT()));
    });
    scene.idle(4);
    scene.world.createItemOnBelt(util.grid.at(1, 1, 1), Direction.UP, bark);
    scene.idle(30);
    scene.rotateCameraY(-30);
    scene.idle(10);
    scene.world.setBlock(util.grid.at(1, 1, 2), AllBlocks.BLAZE_BURNER.getDefaultState().setValue(BlazeBurnerBlock.HEAT_LEVEL, HeatLevel.KINDLED), true);
    scene.idle(10);
    scene.overlay.showText(80).pointAt(basinSide.subtract(0, 1, 0)).placeNearTarget().text("Some of those recipes may require the heat of a Blaze Burner");
    scene.idle(40);
    scene.rotateCameraY(30);
    scene.idle(60);
    Vec3 filterPos = util.vector.of(1, 2.75f, 2.5f);
    scene.overlay.showFilterSlotInput(filterPos, 100);
    scene.overlay.showText(120).pointAt(filterPos).placeNearTarget().attachKeyFrame().text("The filter slot can be used in case two recipes are conflicting.");
    scene.idle(60);
}
Also used : Items(net.minecraft.world.item.Items) SceneBuilder(com.simibubi.create.foundation.ponder.SceneBuilder) InputWindowElement(com.simibubi.create.foundation.ponder.element.InputWindowElement) Direction(net.minecraft.core.Direction) EntityType(net.minecraft.world.entity.EntityType) BasinTileEntity(com.simibubi.create.content.contraptions.processing.BasinTileEntity) Pointing(com.simibubi.create.foundation.utility.Pointing) MechanicalPressTileEntity(com.simibubi.create.content.contraptions.components.press.MechanicalPressTileEntity) ItemParticleOption(net.minecraft.core.particles.ItemParticleOption) AllItems(com.simibubi.create.AllItems) ElementLink(com.simibubi.create.foundation.ponder.ElementLink) ImmutableList(com.google.common.collect.ImmutableList) BasinBlock(com.simibubi.create.content.contraptions.processing.BasinBlock) PonderPalette(com.simibubi.create.foundation.ponder.PonderPalette) BeltItemElement(com.simibubi.create.foundation.ponder.element.BeltItemElement) DeployerTileEntity(com.simibubi.create.content.contraptions.components.deployer.DeployerTileEntity) AllBlocks(com.simibubi.create.AllBlocks) Selection(com.simibubi.create.foundation.ponder.Selection) Iterate(com.simibubi.create.foundation.utility.Iterate) Mode(com.simibubi.create.content.contraptions.components.press.MechanicalPressTileEntity.Mode) EntityElement(com.simibubi.create.foundation.ponder.element.EntityElement) Emitter(com.simibubi.create.foundation.ponder.instruction.EmitParticlesInstruction.Emitter) Blaze(net.minecraft.world.entity.monster.Blaze) SceneBuildingUtil(com.simibubi.create.foundation.ponder.SceneBuildingUtil) BlazeBurnerBlock(com.simibubi.create.content.contraptions.processing.burner.BlazeBurnerBlock) HeatLevel(com.simibubi.create.content.contraptions.processing.burner.BlazeBurnerBlock.HeatLevel) IntAttached(com.simibubi.create.foundation.utility.IntAttached) Blocks(net.minecraft.world.level.block.Blocks) WorldSectionElement(com.simibubi.create.foundation.ponder.element.WorldSectionElement) Entity(net.minecraft.world.entity.Entity) BlockPos(net.minecraft.core.BlockPos) ItemEntity(net.minecraft.world.entity.item.ItemEntity) Vec3(net.minecraft.world.phys.Vec3) LitBlazeBurnerBlock(com.simibubi.create.content.contraptions.processing.burner.LitBlazeBurnerBlock) NBTHelper(com.simibubi.create.foundation.utility.NBTHelper) ItemStack(net.minecraft.world.item.ItemStack) MillstoneTileEntity(com.simibubi.create.content.contraptions.components.millstone.MillstoneTileEntity) MechanicalMixerTileEntity(com.simibubi.create.content.contraptions.components.mixer.MechanicalMixerTileEntity) ParticleTypes(net.minecraft.core.particles.ParticleTypes) 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) MechanicalPressTileEntity(com.simibubi.create.content.contraptions.components.press.MechanicalPressTileEntity)

Aggregations

MechanicalPressTileEntity (com.simibubi.create.content.contraptions.components.press.MechanicalPressTileEntity)5 Selection (com.simibubi.create.foundation.ponder.Selection)4 InputWindowElement (com.simibubi.create.foundation.ponder.element.InputWindowElement)4 WorldSectionElement (com.simibubi.create.foundation.ponder.element.WorldSectionElement)4 BlockPos (net.minecraft.core.BlockPos)4 ItemStack (net.minecraft.world.item.ItemStack)4 Vec3 (net.minecraft.world.phys.Vec3)4 ImmutableList (com.google.common.collect.ImmutableList)3 AllBlocks (com.simibubi.create.AllBlocks)3 AllItems (com.simibubi.create.AllItems)3 Mode (com.simibubi.create.content.contraptions.components.press.MechanicalPressTileEntity.Mode)3 BasinTileEntity (com.simibubi.create.content.contraptions.processing.BasinTileEntity)3 BlazeBurnerBlock (com.simibubi.create.content.contraptions.processing.burner.BlazeBurnerBlock)3 HeatLevel (com.simibubi.create.content.contraptions.processing.burner.BlazeBurnerBlock.HeatLevel)3 SceneBuilder (com.simibubi.create.foundation.ponder.SceneBuilder)3 SceneBuildingUtil (com.simibubi.create.foundation.ponder.SceneBuildingUtil)3 BeltItemElement (com.simibubi.create.foundation.ponder.element.BeltItemElement)3 IntAttached (com.simibubi.create.foundation.utility.IntAttached)3 NBTHelper (com.simibubi.create.foundation.utility.NBTHelper)3 Pointing (com.simibubi.create.foundation.utility.Pointing)3