From 01b214b28d6293d193d13c6c2dbef8120257ee56 Mon Sep 17 00:00:00 2001 From: zelophed Date: Sun, 5 Nov 2023 15:21:23 +0100 Subject: [PATCH] all the elements - even more ponder API refactors --- .../content/kinetics/belt/BeltBlock.java | 2 +- .../trains/track/TrackTargetingBehaviour.java | 2 +- .../foundation/ponder/CreatePonderPlugin.java | 6 +- .../foundation/ponder/CreateSceneBuilder.java | 22 +++-- .../ponder/PonderWorldBlockEntityFix.java | 2 +- .../ponder/element/BeltItemElement.java | 4 +- .../ponder/element/ExpandedParrotElement.java | 5 +- .../AnimateBlockEntityInstruction.java | 6 +- .../ponder/scenes/ArmScenes.java | 52 +++++----- .../ponder/scenes/BearingScenes.java | 89 ++++++++--------- .../ponder/scenes/BeltScenes.java | 74 +++++++-------- .../ponder/scenes/CartAssemblerScenes.java | 44 ++++----- .../ponder/scenes/ChainDriveScenes.java | 21 ++-- .../ponder/scenes/ChassisScenes.java | 83 +++++++--------- .../ponder/scenes/ChuteScenes.java | 54 ++++------- .../ponder/scenes/CrafterScenes.java | 73 ++++++-------- .../ponder/scenes/DeployerScenes.java | 49 +++++----- .../ponder/scenes/DetectorScenes.java | 24 ++--- .../ponder/scenes/DisplayScenes.java | 39 ++++---- .../ponder/scenes/EjectorScenes.java | 39 ++++---- .../ponder/scenes/ElevatorScenes.java | 59 +++++------- .../ponder/scenes/FanScenes.java | 45 +++++---- .../ponder/scenes/FunnelScenes.java | 31 +++--- .../ponder/scenes/GantryScenes.java | 13 ++- .../ponder/scenes/ItemVaultScenes.java | 14 ++- .../ponder/scenes/KineticsScenes.java | 95 +++++++++---------- .../ponder/scenes/MechanicalDrillScenes.java | 13 ++- .../ponder/scenes/MechanicalSawScenes.java | 24 ++--- .../ponder/scenes/MovementActorScenes.java | 49 ++++------ .../ponder/scenes/PistonScenes.java | 32 +++---- .../ponder/scenes/ProcessingScenes.java | 86 +++++++---------- .../ponder/scenes/PulleyScenes.java | 20 ++-- .../ponder/scenes/RedstoneScenes.java | 63 ++++++------ .../ponder/scenes/RedstoneScenes2.java | 16 ++-- .../ponder/scenes/RollerScenes.java | 43 ++++----- .../ponder/scenes/SteamScenes.java | 80 ++++++++-------- .../ponder/scenes/TunnelScenes.java | 50 ++++------ .../ponder/scenes/fluid/DrainScenes.java | 16 ++-- .../fluid/FluidMovementActorScenes.java | 21 ++-- .../ponder/scenes/fluid/FluidTankScenes.java | 32 +++---- .../ponder/scenes/fluid/HosePulleyScenes.java | 12 +-- .../ponder/scenes/fluid/PipeScenes.java | 37 ++++---- .../ponder/scenes/fluid/PumpScenes.java | 20 ++-- .../ponder/scenes/fluid/SpoutScenes.java | 28 +++--- .../scenes/trains/TrackObserverScenes.java | 24 ++--- .../ponder/scenes/trains/TrackScenes.java | 91 ++++++++---------- .../ponder/scenes/trains/TrainScenes.java | 44 ++++----- .../scenes/trains/TrainSignalScenes.java | 46 ++++----- .../scenes/trains/TrainStationScenes.java | 82 ++++++++-------- 49 files changed, 839 insertions(+), 1037 deletions(-) diff --git a/src/main/java/com/simibubi/create/content/kinetics/belt/BeltBlock.java b/src/main/java/com/simibubi/create/content/kinetics/belt/BeltBlock.java index aaceb916d..74223662e 100644 --- a/src/main/java/com/simibubi/create/content/kinetics/belt/BeltBlock.java +++ b/src/main/java/com/simibubi/create/content/kinetics/belt/BeltBlock.java @@ -533,7 +533,7 @@ public class BeltBlock extends HorizontalKineticBlock ((BeltTunnelBlock) tunnelBlock).updateTunnel(world, pos); } - public static List getBeltChain(Level world, BlockPos controllerPos) { + public static List getBeltChain(LevelAccessor world, BlockPos controllerPos) { List positions = new LinkedList<>(); BlockState blockState = world.getBlockState(controllerPos); diff --git a/src/main/java/com/simibubi/create/content/trains/track/TrackTargetingBehaviour.java b/src/main/java/com/simibubi/create/content/trains/track/TrackTargetingBehaviour.java index 6d43c7366..e7887f51b 100644 --- a/src/main/java/com/simibubi/create/content/trains/track/TrackTargetingBehaviour.java +++ b/src/main/java/com/simibubi/create/content/trains/track/TrackTargetingBehaviour.java @@ -27,7 +27,7 @@ import net.createmod.catnip.render.CachedBuffers; import net.createmod.catnip.utility.Iterate; import net.createmod.catnip.utility.VecHelper; import net.createmod.catnip.utility.levelWrappers.SchematicLevel; -import net.createmod.ponder.foundation.PonderLevel; +import net.createmod.ponder.api.level.PonderLevel; import net.minecraft.client.renderer.LevelRenderer; import net.minecraft.client.renderer.MultiBufferSource; import net.minecraft.client.renderer.RenderType; diff --git a/src/main/java/com/simibubi/create/foundation/ponder/CreatePonderPlugin.java b/src/main/java/com/simibubi/create/foundation/ponder/CreatePonderPlugin.java index 6d4961132..6b7632bd3 100644 --- a/src/main/java/com/simibubi/create/foundation/ponder/CreatePonderPlugin.java +++ b/src/main/java/com/simibubi/create/foundation/ponder/CreatePonderPlugin.java @@ -6,12 +6,12 @@ import com.simibubi.create.content.kinetics.crank.ValveHandleBlock; import com.simibubi.create.infrastructure.ponder.AllCreatePonderScenes; import com.simibubi.create.infrastructure.ponder.AllCreatePonderTags; +import net.createmod.ponder.api.level.PonderLevel; import net.createmod.ponder.api.registration.IndexExclusionHelper; import net.createmod.ponder.api.registration.PonderPlugin; import net.createmod.ponder.api.registration.PonderSceneRegistrationHelper; import net.createmod.ponder.api.registration.PonderTagRegistrationHelper; import net.createmod.ponder.api.registration.SharedTextRegistrationHelper; -import net.createmod.ponder.foundation.PonderLevel; import net.minecraft.resources.ResourceLocation; public class CreatePonderPlugin implements PonderPlugin { @@ -44,8 +44,8 @@ public class CreatePonderPlugin implements PonderPlugin { } @Override - public void onPonderWorldRestore(PonderLevel world) { - PonderWorldBlockEntityFix.fixControllerBlockEntities(world); + public void onPonderLevelRestore(PonderLevel ponderLevel) { + PonderWorldBlockEntityFix.fixControllerBlockEntities(ponderLevel); } @Override diff --git a/src/main/java/com/simibubi/create/foundation/ponder/CreateSceneBuilder.java b/src/main/java/com/simibubi/create/foundation/ponder/CreateSceneBuilder.java index f357ad98e..2c6a48a1b 100644 --- a/src/main/java/com/simibubi/create/foundation/ponder/CreateSceneBuilder.java +++ b/src/main/java/com/simibubi/create/foundation/ponder/CreateSceneBuilder.java @@ -31,14 +31,16 @@ import com.simibubi.create.foundation.ponder.instruction.AnimateBlockEntityInstr import net.createmod.catnip.utility.FunctionalHelper; import net.createmod.catnip.utility.NBTHelper; import net.createmod.catnip.utility.VecHelper; +import net.createmod.ponder.api.element.ElementLink; +import net.createmod.ponder.api.element.ParrotElement; +import net.createmod.ponder.api.element.ParrotPose; +import net.createmod.ponder.api.element.WorldSectionElement; +import net.createmod.ponder.api.level.PonderLevel; import net.createmod.ponder.api.scene.SceneBuilder; -import net.createmod.ponder.foundation.ElementLink; -import net.createmod.ponder.foundation.PonderLevel; +import net.createmod.ponder.api.scene.Selection; import net.createmod.ponder.foundation.PonderScene; import net.createmod.ponder.foundation.PonderSceneBuilder; -import net.createmod.ponder.foundation.Selection; -import net.createmod.ponder.foundation.element.ParrotElement; -import net.createmod.ponder.foundation.element.WorldSectionElement; +import net.createmod.ponder.foundation.element.ElementLinkImpl; import net.createmod.ponder.foundation.instruction.CreateParrotInstruction; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; @@ -159,7 +161,7 @@ public class CreateSceneBuilder extends PonderSceneBuilder { public ElementLink createItemOnBelt(BlockPos beltLocation, Direction insertionSide, ItemStack stack) { - ElementLink link = new ElementLink<>(BeltItemElement.class); + ElementLink link = new ElementLinkImpl<>(BeltItemElement.class); addInstruction(scene -> { PonderLevel world = scene.getWorld(); BlockEntity blockEntity = world.getBlockEntity(beltLocation); @@ -308,8 +310,8 @@ public class CreateSceneBuilder extends PonderSceneBuilder { public class SpecialInstructions extends PonderSpecialInstructions { @Override - public ElementLink createBirb(Vec3 location, Supplier pose) { - ElementLink link = new ElementLink<>(ParrotElement.class); + public ElementLink createBirb(Vec3 location, Supplier pose) { + ElementLink link = new ElementLinkImpl<>(ParrotElement.class); ParrotElement parrot = ExpandedParrotElement.create(location, pose); addInstruction(new CreateParrotInstruction(10, Direction.DOWN, parrot)); addInstruction(scene -> scene.linkElement(parrot, link)); @@ -331,7 +333,7 @@ public class CreateSceneBuilder extends PonderSceneBuilder { .ifPresent(expandedBirb -> expandedBirb.setConductor(conductor))); } - public static class ParrotSpinOnComponentPose extends ParrotElement.ParrotPose { + public static class ParrotSpinOnComponentPose extends ParrotPose { private final BlockPos componentPos; public ParrotSpinOnComponentPose(BlockPos componentPos) { @@ -339,7 +341,7 @@ public class CreateSceneBuilder extends PonderSceneBuilder { } @Override - protected void tick(PonderScene scene, Parrot entity, Vec3 location) { + public void tick(PonderScene scene, Parrot entity, Vec3 location) { BlockEntity blockEntity = scene.getWorld().getBlockEntity(componentPos); if (!(blockEntity instanceof KineticBlockEntity)) return; diff --git a/src/main/java/com/simibubi/create/foundation/ponder/PonderWorldBlockEntityFix.java b/src/main/java/com/simibubi/create/foundation/ponder/PonderWorldBlockEntityFix.java index 3ffac694e..6802f16fb 100644 --- a/src/main/java/com/simibubi/create/foundation/ponder/PonderWorldBlockEntityFix.java +++ b/src/main/java/com/simibubi/create/foundation/ponder/PonderWorldBlockEntityFix.java @@ -4,7 +4,7 @@ import com.simibubi.create.content.kinetics.belt.BeltBlock; import com.simibubi.create.content.kinetics.belt.BeltBlockEntity; import com.simibubi.create.foundation.blockEntity.IMultiBlockEntityContainer; -import net.createmod.ponder.foundation.PonderLevel; +import net.createmod.ponder.api.level.PonderLevel; import net.minecraft.core.BlockPos; import net.minecraft.world.level.block.entity.BlockEntity; diff --git a/src/main/java/com/simibubi/create/foundation/ponder/element/BeltItemElement.java b/src/main/java/com/simibubi/create/foundation/ponder/element/BeltItemElement.java index 9a60cb9ed..4b5bf28c3 100644 --- a/src/main/java/com/simibubi/create/foundation/ponder/element/BeltItemElement.java +++ b/src/main/java/com/simibubi/create/foundation/ponder/element/BeltItemElement.java @@ -2,9 +2,9 @@ package com.simibubi.create.foundation.ponder.element; import com.simibubi.create.content.kinetics.belt.transport.TransportedItemStack; -import net.createmod.ponder.foundation.element.TrackedElement; +import net.createmod.ponder.foundation.element.TrackedElementBase; -public class BeltItemElement extends TrackedElement { +public class BeltItemElement extends TrackedElementBase { public BeltItemElement(TransportedItemStack wrapped) { super(wrapped); diff --git a/src/main/java/com/simibubi/create/foundation/ponder/element/ExpandedParrotElement.java b/src/main/java/com/simibubi/create/foundation/ponder/element/ExpandedParrotElement.java index fc3471588..c95de858e 100644 --- a/src/main/java/com/simibubi/create/foundation/ponder/element/ExpandedParrotElement.java +++ b/src/main/java/com/simibubi/create/foundation/ponder/element/ExpandedParrotElement.java @@ -2,12 +2,13 @@ package com.simibubi.create.foundation.ponder.element; import java.util.function.Supplier; +import net.createmod.ponder.api.element.ParrotPose; import net.createmod.ponder.foundation.PonderScene; -import net.createmod.ponder.foundation.element.ParrotElement; +import net.createmod.ponder.foundation.element.ParrotElementImpl; import net.minecraft.nbt.CompoundTag; import net.minecraft.world.phys.Vec3; -public class ExpandedParrotElement extends ParrotElement { +public class ExpandedParrotElement extends ParrotElementImpl { protected boolean deferConductor = false; diff --git a/src/main/java/com/simibubi/create/foundation/ponder/instruction/AnimateBlockEntityInstruction.java b/src/main/java/com/simibubi/create/foundation/ponder/instruction/AnimateBlockEntityInstruction.java index aebf5af0c..466812dd9 100644 --- a/src/main/java/com/simibubi/create/foundation/ponder/instruction/AnimateBlockEntityInstruction.java +++ b/src/main/java/com/simibubi/create/foundation/ponder/instruction/AnimateBlockEntityInstruction.java @@ -9,7 +9,7 @@ import com.simibubi.create.content.contraptions.pulley.PulleyBlockEntity; import com.simibubi.create.content.kinetics.deployer.DeployerBlockEntity; import com.simibubi.create.content.trains.bogey.AbstractBogeyBlockEntity; -import net.createmod.ponder.foundation.PonderLevel; +import net.createmod.ponder.api.level.PonderLevel; import net.createmod.ponder.foundation.PonderScene; import net.createmod.ponder.foundation.instruction.TickingInstruction; import net.minecraft.core.BlockPos; @@ -22,8 +22,8 @@ public class AnimateBlockEntityInstruction extends TickingInstruction { protected double target; protected final BlockPos location; - private BiConsumer setter; - private Function getter; + private final BiConsumer setter; + private final Function getter; public static AnimateBlockEntityInstruction bearing(BlockPos location, float totalDelta, int ticks) { return new AnimateBlockEntityInstruction(location, totalDelta, ticks, diff --git a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/ArmScenes.java b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/ArmScenes.java index d6e2bb723..0dcdf97e7 100644 --- a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/ArmScenes.java +++ b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/ArmScenes.java @@ -8,13 +8,12 @@ import com.simibubi.create.content.logistics.funnel.FunnelBlockEntity; import com.simibubi.create.foundation.ponder.CreateSceneBuilder; import net.createmod.catnip.utility.Pointing; +import net.createmod.ponder.api.PonderPalette; +import net.createmod.ponder.api.element.ElementLink; +import net.createmod.ponder.api.element.WorldSectionElement; import net.createmod.ponder.api.scene.SceneBuilder; import net.createmod.ponder.api.scene.SceneBuildingUtil; -import net.createmod.ponder.foundation.ElementLink; -import net.createmod.ponder.foundation.PonderPalette; -import net.createmod.ponder.foundation.Selection; -import net.createmod.ponder.foundation.element.InputWindowElement; -import net.createmod.ponder.foundation.element.WorldSectionElement; +import net.createmod.ponder.api.scene.Selection; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.world.item.ItemStack; @@ -44,7 +43,7 @@ public class ArmScenes { scene.world().showSection(armSel, Direction.DOWN); scene.idle(10); scene.effects().indicateRedstone(armPos); - scene.overlay().showSelectionWithText(armSel, 70) + scene.overlay().showOutlineWithText(armSel, 70) .attachKeyFrame() .colored(PonderPalette.RED) .text("Mechanical Arms have to be assigned their in- and outputs before they are placed") @@ -55,8 +54,9 @@ public class ArmScenes { scene.world().showSection(util.select().fromTo(0, 1, 1, 0, 2, 1), Direction.DOWN); scene.world().hideSection(armSel, Direction.UP); scene.idle(20); - scene.overlay().showControls(new InputWindowElement(depotSurface, Pointing.RIGHT).rightClick() - .withItem(armItem), 50); + scene.overlay().showControls(depotSurface, Pointing.RIGHT, 50) + .rightClick() + .withItem(armItem); scene.idle(7); AABB depotBounds = AllShapes.CASING_13PX.get(Direction.UP) .bounds(); @@ -71,15 +71,14 @@ public class ArmScenes { scene.idle(80); BlockPos outputDepot = util.grid().at(0, 2, 1); - InputWindowElement input = - new InputWindowElement(util.vector().blockSurface(outputDepot, Direction.NORTH), Pointing.RIGHT).rightClick() - .withItem(armItem); - scene.overlay().showControls(input, 20); + scene.overlay().showControls(util.vector().blockSurface(outputDepot, Direction.NORTH), Pointing.RIGHT, 20).rightClick() + .withItem(armItem); scene.idle(7); Object second = new Object(); scene.overlay().chaseBoundingBoxOutline(PonderPalette.INPUT, second, depotBounds.move(0, 2, 1), 100); scene.idle(25); - scene.overlay().showControls(input, 30); + scene.overlay().showControls(util.vector().blockSurface(outputDepot, Direction.NORTH), Pointing.RIGHT, 30).rightClick() + .withItem(armItem); scene.idle(7); scene.overlay().chaseBoundingBoxOutline(PonderPalette.OUTPUT, second, depotBounds.move(0, 2, 1), 280); scene.overlay().showText(70) @@ -100,9 +99,8 @@ public class ArmScenes { .placeNearTarget(); scene.idle(35); - scene.overlay() - .showControls(new InputWindowElement(util.vector().topOf(util.grid().at(1, 1, 0)), Pointing.DOWN).leftClick() - .withItem(armItem), 30); + scene.overlay().showControls(util.vector().topOf(util.grid().at(1, 1, 0)), Pointing.DOWN, 30).leftClick() + .withItem(armItem); scene.idle(50); scene.world().showSection(armSel, Direction.DOWN); @@ -223,8 +221,7 @@ public class ArmScenes { scene.idle(70); ItemStack sword = new ItemStack(Items.GOLDEN_SWORD); inputDepot = util.grid().at(4, 1, 2); - scene.overlay() - .showControls(new InputWindowElement(util.vector().topOf(inputDepot), Pointing.RIGHT).withItem(sword), 30); + scene.overlay().showControls(util.vector().topOf(inputDepot), Pointing.RIGHT, 30).withItem(sword); scene.world().createItemOnBeltLike(inputDepot, Direction.SOUTH, sword); scene.idle(20); @@ -238,10 +235,8 @@ public class ArmScenes { scene.world().flapFunnel(util.grid().at(0, 2, 2), false); scene.world().instructArm(armPos, Phase.SEARCH_INPUTS, ItemStack.EMPTY, -1); scene.idle(5); - scene.overlay().showControls( - new InputWindowElement(util.vector().blockSurface(util.grid().at(0, 2, 3), Direction.WEST), Pointing.LEFT) - .withItem(sword), - 30); + scene.overlay().showControls(util.vector().blockSurface(util.grid().at(0, 2, 3), Direction.WEST), Pointing.LEFT, 30) + .withItem(sword); } @@ -276,12 +271,12 @@ public class ArmScenes { scene.world().createItemOnBeltLike(util.grid().at(2, 1, 4), Direction.SOUTH, sand); scene.world().createItemOnBeltLike(util.grid().at(1, 1, 4), Direction.SOUTH, sulphur); - scene.overlay().showSelectionWithText(util.select().fromTo(2, 1, 4, 1, 1, 4), 60) + scene.overlay().showOutlineWithText(util.select().fromTo(2, 1, 4, 1, 1, 4), 60) .text("Inputs") .placeNearTarget() .colored(PonderPalette.INPUT); scene.idle(50); - scene.overlay().showSelectionWithText(util.select().fromTo(5, 3, 1, 3, 1, 1), 40) + scene.overlay().showOutlineWithText(util.select().fromTo(5, 3, 1, 3, 1, 1), 40) .text("Outputs") .placeNearTarget() .colored(PonderPalette.OUTPUT); @@ -297,7 +292,7 @@ public class ArmScenes { scene.rotateCameraY(-90 - 30); scene.idle(20); - scene.overlay().showSelectionWithText(util.select().position(4, 1, 4), 80) + scene.overlay().showOutlineWithText(util.select().position(4, 1, 4), 80) .colored(PonderPalette.RED) .text("Mechanical Arms by themselves do not provide any options for filtering") .placeNearTarget(); @@ -322,9 +317,8 @@ public class ArmScenes { for (int y = 0; y < 3; y++) { for (int x = 0; x < 3; x++) { ItemStack item = (x + y) % 2 == 0 ? sulphur : sand; - scene.overlay() - .showControls(new InputWindowElement(filterSlot.add(2 - x, -y, 0), Pointing.LEFT).rightClick() - .withItem(item), 5); + scene.overlay().showControls(filterSlot.add(2 - x, -y, 0), Pointing.LEFT, 5).rightClick() + .withItem(item); scene.idle(7); scene.world().setFilterData(util.select().position(5 - x, 3 - y, 2), FunnelBlockEntity.class, item); scene.idle(4); @@ -440,7 +434,7 @@ public class ArmScenes { .placeNearTarget(); scene.idle(60); - scene.overlay().showControls(new InputWindowElement(scrollSlot, Pointing.RIGHT).rightClick(), 40); + scene.overlay().showControls(scrollSlot, Pointing.RIGHT, 40).rightClick(); scene.idle(10); scene.overlay().showText(50) .text("The value panel will allow you to configure it") diff --git a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/BearingScenes.java b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/BearingScenes.java index a6084e910..f36cfc2ea 100644 --- a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/BearingScenes.java +++ b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/BearingScenes.java @@ -9,13 +9,12 @@ import com.simibubi.create.foundation.ponder.CreateSceneBuilder; import net.createmod.catnip.utility.Iterate; import net.createmod.catnip.utility.Pointing; +import net.createmod.ponder.api.PonderPalette; +import net.createmod.ponder.api.element.ElementLink; +import net.createmod.ponder.api.element.WorldSectionElement; import net.createmod.ponder.api.scene.SceneBuilder; import net.createmod.ponder.api.scene.SceneBuildingUtil; -import net.createmod.ponder.foundation.ElementLink; -import net.createmod.ponder.foundation.PonderPalette; -import net.createmod.ponder.foundation.Selection; -import net.createmod.ponder.foundation.element.InputWindowElement; -import net.createmod.ponder.foundation.element.WorldSectionElement; +import net.createmod.ponder.api.scene.Selection; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.core.Direction.Axis; @@ -52,7 +51,7 @@ public class BearingScenes { scene.idle(10); BlockPos anchorPos = windmill.north(); - scene.overlay().showSelectionWithText(util.select().position(anchorPos), 60) + scene.overlay().showOutlineWithText(util.select().position(anchorPos), 60) .colored(PonderPalette.GREEN) .pointAt(util.vector().blockSurface(windmill, Direction.WEST)) .attachKeyFrame() @@ -104,8 +103,8 @@ public class BearingScenes { scene.overlay().chaseBoundingBoxOutline(PonderPalette.GREEN, bb2, bb2, 1); scene.overlay().chaseBoundingBoxOutline(PonderPalette.GREEN, bb2, bb2.expandTowards(0, -4, 0), 80); scene.idle(10); - scene.overlay().showControls(new InputWindowElement(util.vector().centerOf(util.grid().at(5, 2, 0)), Pointing.RIGHT) - .withItem(AllItems.SUPER_GLUE.asStack()), 40); + scene.overlay().showControls(util.vector().centerOf(util.grid().at(5, 2, 0)), Pointing.RIGHT, 40) + .withItem(AllItems.SUPER_GLUE.asStack()); scene.idle(15); scene.overlay().showText(60) @@ -125,8 +124,7 @@ public class BearingScenes { scene.rotateCameraY(-90); scene.idle(20); - scene.overlay().showControls(new InputWindowElement(util.vector().topOf(windmill) - .subtract(.5, 0, 0), Pointing.DOWN).rightClick(), 60); + scene.overlay().showControls(util.vector().topOf(windmill).subtract(.5, 0, 0), Pointing.DOWN, 60).rightClick(); scene.idle(7); scene.world().rotateBearing(windmill, 360, 200); scene.world().rotateSection(structure, 0, 0, 360, 200); @@ -154,7 +152,7 @@ public class BearingScenes { Vec3 surface = util.vector().blockSurface(windmill, Direction.WEST) .add(0, 0, 2 / 16f); - scene.overlay().showControls(new InputWindowElement(surface, Pointing.DOWN).rightClick(), 60); + scene.overlay().showControls(surface, Pointing.DOWN, 60).rightClick(); scene.overlay().showFilterSlotInput(surface, Direction.WEST, 50); scene.overlay().showText(60) .pointAt(surface) @@ -170,8 +168,8 @@ public class BearingScenes { scene.effects().rotationDirectionIndicator(windmill.south()); scene.idle(69); - scene.overlay().showControls(new InputWindowElement(util.vector().topOf(windmill) - .subtract(.5, 0, 0), Pointing.DOWN).rightClick(), 60); + scene.overlay().showControls(util.vector().topOf(windmill).subtract(.5, 0, 0), Pointing.DOWN, 60) + .rightClick(); scene.idle(7); scene.world().rotateBearing(windmill, -45, 0); scene.world().rotateSection(structure, 0, 0, -45, 0); @@ -220,15 +218,13 @@ public class BearingScenes { scene.idle(10); scene.overlay().showOutline(PonderPalette.BLUE, bearingPos, util.select().fromTo(3, 2, 1, 3, 3, 2), 80); - scene.overlay().showSelectionWithText(util.select().fromTo(3, 2, 4, 3, 3, 5), 80) + scene.overlay().showOutlineWithText(util.select().fromTo(3, 2, 4, 3, 3, 5), 80) .colored(PonderPalette.BLUE) .attachKeyFrame() .text("Any Structure can count as a valid Windmill, as long as it contains at least 8 sail-like Blocks."); scene.idle(90); - scene.overlay().showControls( - new InputWindowElement(util.vector().blockSurface(bearingPos, Direction.WEST), Pointing.LEFT).rightClick(), - 40); + scene.overlay().showControls(util.vector().blockSurface(bearingPos, Direction.WEST), Pointing.LEFT, 40).rightClick(); scene.idle(7); scene.markAsFinished(); scene.world().rotateBearing(bearingPos, -720, 400); @@ -262,7 +258,7 @@ public class BearingScenes { .add(cog4); BlockPos bearingPos = util.grid().at(3, 2, 3); - scene.overlay().showSelectionWithText(util.select().position(bearingPos.above()), 60) + scene.overlay().showOutlineWithText(util.select().position(bearingPos.above()), 60) .colored(PonderPalette.GREEN) .pointAt(util.vector().blockSurface(bearingPos, Direction.WEST)) .placeNearTarget() @@ -305,8 +301,8 @@ public class BearingScenes { scene.overlay().showOutline(PonderPalette.GREEN, "glue", util.select().position(2, 4, 3) .add(util.select().fromTo(4, 3, 3, 2, 3, 3)) .add(util.select().position(4, 3, 2)), 40); - scene.overlay().showControls(new InputWindowElement(util.vector().centerOf(util.grid().at(4, 3, 3)), Pointing.RIGHT) - .withItem(AllItems.SUPER_GLUE.asStack()), 40); + scene.overlay().showControls(util.vector().centerOf(util.grid().at(4, 3, 3)), Pointing.RIGHT, 40) + .withItem(AllItems.SUPER_GLUE.asStack()); scene.idle(10); scene.world().showSectionAndMerge(plank2, Direction.SOUTH, contraption); @@ -392,8 +388,8 @@ public class BearingScenes { Vec3 blockSurface = util.vector().blockSurface(bearingPos, Direction.NORTH) .add(0, 2 / 16f, 0); scene.overlay().showFilterSlotInput(blockSurface, Direction.NORTH, 60); - scene.overlay().showControls(new InputWindowElement(blockSurface, Pointing.DOWN).scroll() - .withItem(AllItems.WRENCH.asStack()), 60); + scene.overlay().showControls(blockSurface, Pointing.DOWN, 60).scroll() + .withItem(AllItems.WRENCH.asStack()); scene.idle(10); scene.overlay().showText(60) .pointAt(blockSurface) @@ -446,7 +442,7 @@ public class BearingScenes { scene.idle(15); - scene.overlay().showSelectionWithText(util.select().position(bearingPos), 60) + scene.overlay().showOutlineWithText(util.select().position(bearingPos), 60) .text("Whenever Mechanical Bearings are themselves part of a moving Structure..") .attachKeyFrame() .placeNearTarget(); @@ -467,7 +463,7 @@ public class BearingScenes { .placeNearTarget(); scene.idle(70); - scene.overlay().showSelectionWithText(util.select().position(bearingPos.north()), 60) + scene.overlay().showOutlineWithText(util.select().position(bearingPos.north()), 60) .colored(PonderPalette.GREEN) .text("Once again, the bearing will attach to the block in front of it") .attachKeyFrame() @@ -513,7 +509,7 @@ public class BearingScenes { scene.world().showSection(util.select().position(bearingPos), Direction.DOWN); scene.idle(10); - scene.overlay().showSelectionWithText(util.select().position(bearingPos.north()), 60) + scene.overlay().showOutlineWithText(util.select().position(bearingPos.north()), 60) .colored(PonderPalette.GREEN) .pointAt(util.vector().blockSurface(bearingPos, Direction.WEST)) .placeNearTarget() @@ -554,11 +550,7 @@ public class BearingScenes { scene.world().rotateBearing(bearingPos, 30, 12); scene.idle(42); - InputWindowElement clickTheBearing = new InputWindowElement(util.vector().topOf(bearingPos), Pointing.DOWN); - InputWindowElement clickTheBearingSide = - new InputWindowElement(util.vector().blockSurface(bearingPos, Direction.WEST), Pointing.LEFT); - - scene.overlay().showControls(clickTheBearing.rightClick(), 60); + scene.overlay().showControls(util.vector().topOf(bearingPos), Pointing.DOWN, 60).rightClick(); scene.idle(7); scene.world().rotateSection(plank, 0, 0, -120, 0); scene.world().rotateBearing(bearingPos, -120, 0); @@ -577,28 +569,28 @@ public class BearingScenes { scene.world().showIndependentSection(util.select().fromTo(3, 3, 1, 3, 5, 2), Direction.SOUTH); scene.world().configureCenterOfRotation(hourHand, util.vector().centerOf(bearingPos)); scene.idle(15); - scene.overlay().showControls(new InputWindowElement(util.vector().centerOf(util.grid().at(3, 4, 1)), Pointing.RIGHT) - .withItem(AllItems.SUPER_GLUE.asStack()), 40); - scene.overlay().showSelectionWithText(util.select().fromTo(3, 3, 1, 3, 4, 2), 80) + scene.overlay().showControls(util.vector().centerOf(util.grid().at(3, 4, 1)), Pointing.RIGHT, 40) + .withItem(AllItems.SUPER_GLUE.asStack()); + scene.overlay().showOutlineWithText(util.select().fromTo(3, 3, 1, 3, 4, 2), 80) .placeNearTarget() .attachKeyFrame() .colored(PonderPalette.GREEN) .sharedText("movement_anchors"); scene.idle(90); - scene.overlay().showControls(clickTheBearingSide.rightClick(), 20); + scene.overlay().showControls(util.vector().blockSurface(bearingPos, Direction.WEST), Pointing.LEFT, 20).rightClick(); scene.idle(7); scene.world().rotateSection(hourHand, 0, 0, 120, 50); scene.world().rotateBearing(bearingPos, 120, 50); scene.idle(60); - scene.overlay().showSelectionWithText(util.select().position(bearingPos.north(3)), 80) + scene.overlay().showOutlineWithText(util.select().position(bearingPos.north(3)), 80) .placeNearTarget() .colored(PonderPalette.BLUE) .attachKeyFrame() .text("In front of the Hour Hand, a second structure can be added"); scene.idle(90); - scene.overlay().showControls(clickTheBearingSide.rightClick(), 20); + scene.overlay().showControls(util.vector().blockSurface(bearingPos, Direction.WEST), Pointing.LEFT, 20).rightClick(); scene.idle(7); scene.world().rotateSection(hourHand, 0, 0, -120, 0); scene.world().rotateBearing(bearingPos, -120, 0); @@ -612,13 +604,13 @@ public class BearingScenes { scene.idle(30); scene.overlay().showOutline(PonderPalette.BLUE, minuteHand, util.select().fromTo(3, 3, 0, 3, 6, 0), 85); - scene.overlay().showSelectionWithText(util.select().fromTo(3, 3, 1, 3, 4, 2), 80) + scene.overlay().showOutlineWithText(util.select().fromTo(3, 3, 1, 3, 4, 2), 80) .placeNearTarget() .colored(PonderPalette.GREEN) .text("Ensure that the two Structures are not glued to each other"); scene.idle(90); - scene.overlay().showControls(clickTheBearingSide.rightClick(), 20); + scene.overlay().showControls(util.vector().blockSurface(bearingPos, Direction.WEST), Pointing.LEFT, 20).rightClick(); scene.idle(7); scene.world().rotateSection(hourHand, 0, 0, 120, 50); @@ -685,7 +677,7 @@ public class BearingScenes { .attachKeyFrame(); scene.idle(80); - scene.overlay().showSelectionWithText(util.select().position(bearingPos.above()), 80) + scene.overlay().showOutlineWithText(util.select().position(bearingPos.above()), 80) .colored(PonderPalette.GREEN) .text("They will attach to blocks and each other without the need of Super Glue or Chassis Blocks") .attachKeyFrame() @@ -701,10 +693,8 @@ public class BearingScenes { scene.world().rotateSection(plank, 0, 180, 0, 0); scene.rotateCameraY(-30); scene.idle(10); - InputWindowElement input = - new InputWindowElement(util.vector().blockSurface(util.grid().at(2, 3, 1), Direction.NORTH), Pointing.RIGHT) - .withItem(new ItemStack(Items.BLUE_DYE)); - scene.overlay().showControls(input, 30); + scene.overlay().showControls(util.vector().blockSurface(util.grid().at(2, 3, 1), Direction.NORTH), Pointing.RIGHT, 30) + .withItem(new ItemStack(Items.BLUE_DYE)); scene.idle(7); scene.world().setBlock(util.grid().at(2, 3, 1), AllBlocks.DYED_SAILS.get(DyeColor.BLUE) .getDefaultState() @@ -717,7 +707,8 @@ public class BearingScenes { .pointAt(util.vector().blockSurface(util.grid().at(2, 3, 1), Direction.WEST)) .placeNearTarget(); scene.idle(20); - scene.overlay().showControls(input, 30); + scene.overlay().showControls(util.vector().blockSurface(util.grid().at(2, 3, 1), Direction.NORTH), Pointing.RIGHT, 30) + .withItem(new ItemStack(Items.BLUE_DYE)); scene.idle(7); scene.world().replaceBlocks(util.select().fromTo(2, 2, 1, 2, 4, 1), AllBlocks.DYED_SAILS.get(DyeColor.BLUE) .getDefaultState() @@ -728,11 +719,8 @@ public class BearingScenes { scene.world().rotateSection(plank, 0, 90, 0, 33); scene.idle(40); - input = - new InputWindowElement(util.vector().blockSurface(util.grid().at(2, 3, 1), Direction.NORTH), Pointing.RIGHT) - .withItem(new ItemStack(Items.SHEARS)); - - scene.overlay().showControls(input, 30); + scene.overlay().showControls(util.vector().blockSurface(util.grid().at(2, 3, 1), Direction.NORTH), Pointing.RIGHT, 30) + .withItem(new ItemStack(Items.SHEARS)); scene.idle(7); scene.world().setBlock(util.grid().at(3, 3, 2), AllBlocks.SAIL_FRAME.getDefaultState() .setValue(SailBlock.FACING, Direction.NORTH), false); @@ -743,7 +731,8 @@ public class BearingScenes { .pointAt(util.vector().blockSurface(util.grid().at(2, 3, 1), Direction.WEST)) .placeNearTarget(); scene.idle(20); - scene.overlay().showControls(input, 30); + scene.overlay().showControls(util.vector().blockSurface(util.grid().at(2, 3, 1), Direction.NORTH), Pointing.RIGHT, 30) + .withItem(new ItemStack(Items.SHEARS)); scene.idle(7); scene.world().replaceBlocks(util.select().fromTo(3, 2, 2, 3, 4, 2), AllBlocks.SAIL_FRAME.getDefaultState() .setValue(SailBlock.FACING, Direction.NORTH), false); diff --git a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/BeltScenes.java b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/BeltScenes.java index 82f070b82..97e73d943 100644 --- a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/BeltScenes.java +++ b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/BeltScenes.java @@ -18,15 +18,15 @@ import com.simibubi.create.foundation.ponder.CreateSceneBuilder; import net.createmod.catnip.utility.NBTHelper; import net.createmod.catnip.utility.Pointing; +import net.createmod.ponder.api.PonderPalette; +import net.createmod.ponder.api.element.ElementLink; +import net.createmod.ponder.api.element.EntityElement; +import net.createmod.ponder.api.element.ParrotElement; +import net.createmod.ponder.api.element.ParrotPose; +import net.createmod.ponder.api.element.WorldSectionElement; import net.createmod.ponder.api.scene.SceneBuilder; import net.createmod.ponder.api.scene.SceneBuildingUtil; -import net.createmod.ponder.foundation.ElementLink; -import net.createmod.ponder.foundation.PonderPalette; -import net.createmod.ponder.foundation.Selection; -import net.createmod.ponder.foundation.element.EntityElement; -import net.createmod.ponder.foundation.element.InputWindowElement; -import net.createmod.ponder.foundation.element.ParrotElement; -import net.createmod.ponder.foundation.element.WorldSectionElement; +import net.createmod.ponder.api.scene.Selection; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.core.Direction.Axis; @@ -66,16 +66,16 @@ public class BeltScenes { .getShape(null, null) .bounds(); - scene.overlay().showControls(new InputWindowElement(util.vector().topOf(backEnd), Pointing.DOWN).rightClick() - .withItem(beltItem), 57); + scene.overlay().showControls(util.vector().topOf(backEnd), Pointing.DOWN, 57).rightClick() + .withItem(beltItem); scene.idle(7); scene.overlay().chaseBoundingBoxOutline(PonderPalette.GREEN, backEnd, shaftBB.move(backEnd), 42); scene.overlay().chaseBoundingBoxOutline(PonderPalette.BLACK, backEndCenter, connectBB, 50); scene.idle(20); - scene.overlay().showControls(new InputWindowElement(util.vector().topOf(frontEnd), Pointing.DOWN).rightClick() - .withItem(beltItem), 37); + scene.overlay().showControls(util.vector().topOf(frontEnd), Pointing.DOWN, 37).rightClick() + .withItem(beltItem); scene.idle(7); scene.overlay().chaseBoundingBoxOutline(PonderPalette.GREEN, frontEnd, shaftBB.move(frontEnd), 17); @@ -95,8 +95,8 @@ public class BeltScenes { scene.idle(90); Vec3 falseSelection = util.vector().topOf(backEnd.south(1)); - scene.overlay().showControls(new InputWindowElement(falseSelection, Pointing.DOWN).rightClick() - .withItem(beltItem), 37); + scene.overlay().showControls(falseSelection, Pointing.DOWN, 37).rightClick() + .withItem(beltItem); scene.idle(7); scene.overlay().chaseBoundingBoxOutline(PonderPalette.RED, backEnd, shaftBB.move(backEnd.south(1)), 50); @@ -108,14 +108,14 @@ public class BeltScenes { .pointAt(util.vector().centerOf(backEnd.south(1))); scene.idle(43); - scene.overlay().showControls(new InputWindowElement(falseSelection, Pointing.DOWN).rightClick() + scene.overlay().showControls(falseSelection, Pointing.DOWN, 20).rightClick() .withItem(beltItem) - .whileSneaking(), 20); + .whileSneaking(); scene.idle(60); BlockPos shaftLocation = frontEnd.east(); - scene.overlay().showControls(new InputWindowElement(util.vector().topOf(shaftLocation), Pointing.DOWN).rightClick() - .withItem(AllBlocks.SHAFT.asStack()), 50); + scene.overlay().showControls(util.vector().topOf(shaftLocation), Pointing.DOWN, 50).rightClick() + .withItem(AllBlocks.SHAFT.asStack()); scene.idle(7); scene.world().modifyBlock(shaftLocation, s -> s.setValue(BeltBlock.PART, BeltPart.PULLEY), true); scene.idle(10); @@ -144,8 +144,8 @@ public class BeltScenes { scene.world().hideSection(attachedShafts, Direction.NORTH); scene.idle(20); - scene.overlay().showControls(new InputWindowElement(util.vector().topOf(shaftLocation), Pointing.DOWN).rightClick() - .withItem(AllItems.WRENCH.asStack()), 50); + scene.overlay().showControls(util.vector().topOf(shaftLocation), Pointing.DOWN, 50).rightClick() + .withItem(AllItems.WRENCH.asStack()); scene.idle(7); scene.world().modifyBlock(shaftLocation, s -> s.setValue(BeltBlock.PART, BeltPart.MIDDLE), true); scene.idle(10); @@ -156,9 +156,8 @@ public class BeltScenes { .pointAt(util.vector().blockSurface(shaftLocation, Direction.NORTH)); scene.idle(70); - scene.overlay() - .showControls(new InputWindowElement(util.vector().topOf(shaftLocation.east()), Pointing.DOWN).rightClick() - .withItem(new ItemStack(Items.BLUE_DYE)), 50); + scene.overlay().showControls(util.vector().topOf(shaftLocation.east()), Pointing.DOWN, 50).rightClick() + .withItem(new ItemStack(Items.BLUE_DYE)); scene.idle(7); scene.world().modifyBlockEntityNBT(util.select().fromTo(0, 1, 2, 4, 1, 2), BeltBlockEntity.class, nbt -> NBTHelper.writeEnum(nbt, "Dye", DyeColor.BLUE)); @@ -348,7 +347,7 @@ public class BeltScenes { scene.idle(20); ElementLink parrot = scene.special().createBirb(util.vector().topOf(0, 1, 2) - .add(0, -3 / 16f, 0), ParrotElement.FacePointOfInterestPose::new); + .add(0, -3 / 16f, 0), ParrotPose.FacePointOfInterestPose::new); scene.special().moveParrot(parrot, util.vector().of(1.78, 0, 0), 40); scene.special().movePointOfInterest(util.grid().at(1, 1, 3)); @@ -383,7 +382,7 @@ public class BeltScenes { Vec3 topOf = util.vector().topOf(util.grid().at(3, 2, 2)) .add(-0.1, 0.3, 0); - scene.overlay().showControls(new InputWindowElement(topOf, Pointing.DOWN).rightClick(), 60); + scene.overlay().showControls(topOf, Pointing.DOWN, 60).rightClick(); scene.idle(10); scene.overlay().showText(60) .placeNearTarget() @@ -395,7 +394,7 @@ public class BeltScenes { scene.effects().indicateSuccess(util.grid().at(3, 2, 2)); scene.idle(20); - scene.special().changeBirbPose(parrot, ParrotElement.FaceCursorPose::new); + scene.special().changeBirbPose(parrot, ParrotPose.FaceCursorPose::new); } public static void beltsCanBeEncased(SceneBuilder builder, SceneBuildingUtil util) { @@ -415,14 +414,14 @@ public class BeltScenes { BlockPos beltPos2 = util.grid().at(0, 2, 3); BlockPos beltPos3 = util.grid().at(1, 4, 4); - scene.overlay().showControls(new InputWindowElement(util.vector().topOf(beltPos), Pointing.DOWN).rightClick() - .withItem(brassCasingItem), 20); + scene.overlay().showControls(util.vector().topOf(beltPos), Pointing.DOWN, 20).rightClick() + .withItem(brassCasingItem); scene.idle(7); scene.world().modifyBlock(beltPos, s -> s.setValue(BeltBlock.CASING, true), true); scene.idle(20); - scene.overlay().showControls(new InputWindowElement(util.vector().topOf(beltPos2), Pointing.DOWN).rightClick() - .withItem(andesiteCasingItem), 20); + scene.overlay().showControls(util.vector().topOf(beltPos2), Pointing.DOWN, 20).rightClick() + .withItem(andesiteCasingItem); scene.idle(7); scene.world().modifyBlock(beltPos2, s -> s.setValue(BeltBlock.CASING, true), true); scene.world().modifyBlockEntityNBT(util.select().position(beltPos2), BeltBlockEntity.class, nbt -> { @@ -430,10 +429,8 @@ public class BeltScenes { }); scene.idle(20); - scene.overlay().showControls( - new InputWindowElement(util.vector().blockSurface(beltPos3, Direction.EAST), Pointing.RIGHT).rightClick() - .withItem(brassCasingItem), - 20); + scene.overlay().showControls(util.vector().blockSurface(beltPos3, Direction.EAST), Pointing.RIGHT, 20).rightClick() + .withItem(brassCasingItem); scene.idle(7); scene.world().modifyBlock(beltPos3, s -> s.setValue(BeltBlock.CASING, true), true); scene.idle(20); @@ -473,9 +470,8 @@ public class BeltScenes { scene.idle(30); scene.addKeyframe(); - scene.overlay() - .showControls(new InputWindowElement(util.vector().topOf(beltPos.south()), Pointing.DOWN).rightClick() - .withItem(AllItems.WRENCH.asStack()), 40); + scene.overlay().showControls(util.vector().topOf(beltPos.south()), Pointing.DOWN, 40).rightClick() + .withItem(AllItems.WRENCH.asStack()); scene.idle(7); scene.world().modifyBlock(beltPos.south(), s -> s.setValue(BeltBlock.CASING, false), true); scene.overlay().showText(80) @@ -502,8 +498,8 @@ public class BeltScenes { .pointAt(topOf); scene.idle(70); - scene.overlay().showControls(new InputWindowElement(topOf, Pointing.DOWN).rightClick() - .withItem(new ItemStack(Items.COPPER_BLOCK)), 20); + scene.overlay().showControls(topOf, Pointing.DOWN, 20).rightClick() + .withItem(new ItemStack(Items.COPPER_BLOCK)); scene.idle(7); scene.world().createItemOnBeltLike(depotPos, Direction.NORTH, new ItemStack(Items.COPPER_BLOCK)); scene.idle(10); @@ -514,7 +510,7 @@ public class BeltScenes { .pointAt(topOf); scene.idle(80); - scene.overlay().showControls(new InputWindowElement(topOf, Pointing.DOWN).rightClick(), 20); + scene.overlay().showControls(topOf, Pointing.DOWN, 20).rightClick(); scene.idle(7); scene.world().removeItemsFromBelt(depotPos); scene.effects().indicateSuccess(depotPos); diff --git a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/CartAssemblerScenes.java b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/CartAssemblerScenes.java index e4873fe0a..cd127c005 100644 --- a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/CartAssemblerScenes.java +++ b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/CartAssemblerScenes.java @@ -7,16 +7,15 @@ import com.simibubi.create.content.contraptions.mounted.CartAssemblerBlock; import com.simibubi.create.foundation.ponder.CreateSceneBuilder; import net.createmod.catnip.utility.Pointing; +import net.createmod.ponder.api.ParticleEmitter; +import net.createmod.ponder.api.PonderPalette; +import net.createmod.ponder.api.element.ElementLink; +import net.createmod.ponder.api.element.EntityElement; +import net.createmod.ponder.api.element.WorldSectionElement; import net.createmod.ponder.api.scene.SceneBuilder; import net.createmod.ponder.api.scene.SceneBuildingUtil; -import net.createmod.ponder.foundation.ElementLink; -import net.createmod.ponder.foundation.PonderPalette; -import net.createmod.ponder.foundation.Selection; -import net.createmod.ponder.foundation.element.EntityElement; -import net.createmod.ponder.foundation.element.InputWindowElement; +import net.createmod.ponder.api.scene.Selection; import net.createmod.ponder.foundation.element.MinecartElement; -import net.createmod.ponder.foundation.element.WorldSectionElement; -import net.createmod.ponder.foundation.instruction.EmitParticlesInstruction.Emitter; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.core.particles.ParticleTypes; @@ -52,9 +51,8 @@ public class CartAssemblerScenes { scene.idle(10); - scene.overlay() - .showControls(new InputWindowElement(util.vector().centerOf(assemblerPos), Pointing.DOWN).rightClick() - .withItem(AllBlocks.CART_ASSEMBLER.asStack()), 30); + scene.overlay().showControls(util.vector().centerOf(assemblerPos), Pointing.DOWN, 30).rightClick() + .withItem(AllBlocks.CART_ASSEMBLER.asStack()); scene.idle(7); scene.world().setBlock(assemblerPos, AllBlocks.CART_ASSEMBLER.getDefaultState() .setValue(CartAssemblerBlock.RAIL_SHAPE, RailShape.NORTH_SOUTH) @@ -126,8 +124,8 @@ public class CartAssemblerScenes { scene.overlay().showOutline(PonderPalette.GREEN, "glue", util.select().position(1, 3, 2) .add(util.select().fromTo(3, 2, 2, 1, 2, 2)) .add(util.select().position(3, 2, 1)), 40); - scene.overlay().showControls(new InputWindowElement(util.vector().centerOf(util.grid().at(3, 2, 2)), Pointing.RIGHT) - .withItem(AllItems.SUPER_GLUE.asStack()), 40); + scene.overlay().showControls(util.vector().centerOf(util.grid().at(3, 2, 2)), Pointing.RIGHT, 40) + .withItem(AllItems.SUPER_GLUE.asStack()); scene.effects().superGlue(util.grid().at(3, 2, 1), Direction.SOUTH, true); scene.overlay().showText(80) @@ -149,8 +147,8 @@ public class CartAssemblerScenes { scene.idle(25); Vec3 cartCenter = util.vector().centerOf(assemblerPos.north(2)); - scene.overlay().showControls(new InputWindowElement(cartCenter, Pointing.LEFT).rightClick() - .withItem(AllItems.WRENCH.asStack()), 40); + scene.overlay().showControls(cartCenter, Pointing.LEFT, 40).rightClick() + .withItem(AllItems.WRENCH.asStack()); scene.idle(7); scene.special().moveCart(cart, util.vector().of(0, -100, 4), 0); scene.world().moveSection(anchor, util.vector().of(0, -100, 4), 0); @@ -167,8 +165,8 @@ public class CartAssemblerScenes { scene.idle(80); scene.world().modifyEntity(itemEntity, Entity::discard); - scene.overlay().showControls(new InputWindowElement(cartCenter.add(0, 0, 4), Pointing.DOWN).rightClick() - .withItem(asStack), 20); + scene.overlay().showControls(cartCenter.add(0, 0, 4), Pointing.DOWN, 20).rightClick() + .withItem(asStack); scene.idle(20); scene.special().moveCart(cart, util.vector().of(0, 100.5, 0), 0); scene.world().moveSection(anchor, util.vector().of(0, 100.5, 0), 0); @@ -261,7 +259,7 @@ public class CartAssemblerScenes { Vec3 blockSurface = util.vector().blockSurface(assemblerPos, Direction.NORTH) .add(0, -1 / 16f, -2 / 16f); scene.overlay().showFilterSlotInput(blockSurface, Direction.NORTH, 60); - scene.overlay().showControls(new InputWindowElement(blockSurface, Pointing.DOWN).rightClick(), 60); + scene.overlay().showControls(blockSurface, Pointing.DOWN, 60).rightClick(); scene.idle(10); scene.overlay().showText(60) .pointAt(util.vector().of(3, 1.5, 3)) @@ -344,7 +342,7 @@ public class CartAssemblerScenes { ElementLink contraption = scene.world().showIndependentSection(chassis, Direction.DOWN); scene.idle(15); scene.overlay().showOutline(PonderPalette.GREEN, new Object(), util.select().position(assembler2), 60); - scene.overlay().showSelectionWithText(util.select().position(assembler1), 60) + scene.overlay().showOutlineWithText(util.select().position(assembler1), 60) .colored(PonderPalette.GREEN) .pointAt(util.vector().blockSurface(util.grid().at(2, 2, 4), Direction.NORTH)) .placeNearTarget() @@ -464,8 +462,8 @@ public class CartAssemblerScenes { 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.overlay().showControls(util.vector().topOf(assembler), Pointing.DOWN, 50) + .withItem(new ItemStack(Items.POWERED_RAIL)); scene.idle(7); scene.world().setBlock(assembler, AllBlocks.CART_ASSEMBLER.getDefaultState() .setValue(CartAssemblerBlock.RAIL_SHAPE, RailShape.EAST_WEST) @@ -520,8 +518,8 @@ public class CartAssemblerScenes { 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.overlay().showControls(util.vector().topOf(assembler.above()), Pointing.UP, 40) + .withItem(new ItemStack(Items.CHARCOAL)); scene.idle(7); scene.overlay().showText(80) .pointAt(util.vector().blockSurface(assembler.above(2), Direction.WEST)) @@ -529,7 +527,7 @@ public class CartAssemblerScenes { .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)); + ParticleEmitter smoke = scene.effects().simpleParticleEmitter(ParticleTypes.LARGE_SMOKE, util.vector().of(0, 0, 0)); scene.special().moveCart(cart, util.vector().of(-5, 0, 0), 50); scene.idle(20); diff --git a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/ChainDriveScenes.java b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/ChainDriveScenes.java index 3b1584dd7..45fcb2729 100644 --- a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/ChainDriveScenes.java +++ b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/ChainDriveScenes.java @@ -6,14 +6,13 @@ import com.simibubi.create.content.redstone.analogLever.AnalogLeverBlockEntity; import com.simibubi.create.foundation.ponder.CreateSceneBuilder; import net.createmod.catnip.utility.Pointing; +import net.createmod.ponder.api.PonderPalette; +import net.createmod.ponder.api.element.ElementLink; +import net.createmod.ponder.api.element.TextElementBuilder; +import net.createmod.ponder.api.element.WorldSectionElement; import net.createmod.ponder.api.scene.SceneBuilder; import net.createmod.ponder.api.scene.SceneBuildingUtil; -import net.createmod.ponder.foundation.ElementLink; -import net.createmod.ponder.foundation.PonderPalette; -import net.createmod.ponder.foundation.Selection; -import net.createmod.ponder.foundation.element.InputWindowElement; -import net.createmod.ponder.foundation.element.TextWindowElement.Builder; -import net.createmod.ponder.foundation.element.WorldSectionElement; +import net.createmod.ponder.api.scene.Selection; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.core.Direction.Axis; @@ -78,8 +77,8 @@ public class ChainDriveScenes { scene.idle(25); scene.addKeyframe(); - scene.overlay().showControls(new InputWindowElement(util.vector().topOf(rotatedECD), Pointing.DOWN).rightClick() - .withItem(AllItems.WRENCH.asStack()), 30); + scene.overlay().showControls(util.vector().topOf(rotatedECD), Pointing.DOWN, 30).rightClick() + .withItem(AllItems.WRENCH.asStack()); scene.idle(7); scene.world().modifyBlock(rotatedECD, s -> s.setValue(ChainDriveBlock.AXIS, Axis.Y), true); scene.idle(40); @@ -240,9 +239,7 @@ public class ChainDriveScenes { scene.world().showSection(util.select().fromTo(analogPos, analogPos.south()), Direction.DOWN); scene.idle(15); - scene.world().modifyBlockEntityNBT(util.select().position(analogPos), AnalogLeverBlockEntity.class, nbt -> { - nbt.putInt("State", 8); - }); + scene.world().modifyBlockEntityNBT(util.select().position(analogPos), AnalogLeverBlockEntity.class, nbt -> nbt.putInt("State", 8)); scene.world().modifyBlock(analogPos.south(), s -> s.setValue(RedStoneWireBlock.POWER, 8), false); scene.world().toggleRedstonePower(util.select().position(1, 1, 4)); scene.world().modifyKineticSpeed(util.select().position(westGauge), f -> .75f * f); @@ -259,7 +256,7 @@ public class ChainDriveScenes { for (BlockPos gauge : new BlockPos[] { eastGauge, middleGauge, westGauge }) { scene.idle(5); - Builder textBuilder = scene.overlay().showText(180) + TextElementBuilder textBuilder = scene.overlay().showText(180) .colored(gauge == westGauge ? PonderPalette.SLOW : PonderPalette.MEDIUM) .placeNearTarget() .pointAt(util.vector().blockSurface(gauge, Direction.NORTH)); diff --git a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/ChassisScenes.java b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/ChassisScenes.java index 867876170..0db35ab9d 100644 --- a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/ChassisScenes.java +++ b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/ChassisScenes.java @@ -8,13 +8,12 @@ import com.simibubi.create.content.contraptions.chassis.RadialChassisBlock; import com.simibubi.create.foundation.ponder.CreateSceneBuilder; import net.createmod.catnip.utility.Pointing; +import net.createmod.ponder.api.PonderPalette; +import net.createmod.ponder.api.element.ElementLink; +import net.createmod.ponder.api.element.WorldSectionElement; import net.createmod.ponder.api.scene.SceneBuilder; import net.createmod.ponder.api.scene.SceneBuildingUtil; -import net.createmod.ponder.foundation.ElementLink; -import net.createmod.ponder.foundation.PonderPalette; -import net.createmod.ponder.foundation.Selection; -import net.createmod.ponder.foundation.element.InputWindowElement; -import net.createmod.ponder.foundation.element.WorldSectionElement; +import net.createmod.ponder.api.scene.Selection; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.world.item.ItemStack; @@ -80,7 +79,7 @@ public class ChassisScenes { scene.world().showSection(wrong1, Direction.DOWN); scene.idle(10); scene.overlay().showOutline(PonderPalette.RED, wrong2, wrong2, 80); - scene.overlay().showSelectionWithText(wrong1, 80) + scene.overlay().showOutlineWithText(wrong1, 80) .colored(PonderPalette.RED) .placeNearTarget() .text("Chassis of a different type or facing another direction will not attach"); @@ -106,10 +105,8 @@ public class ChassisScenes { scene.world().showSection(chassis, Direction.DOWN); scene.idle(10); - InputWindowElement input = - new InputWindowElement(util.vector().blockSurface(chassisPos, Direction.WEST), Pointing.LEFT).rightClick() - .withItem(new ItemStack(Items.SLIME_BALL)); - scene.overlay().showControls(input, 30); + scene.overlay().showControls(util.vector().blockSurface(chassisPos, Direction.WEST), Pointing.LEFT, 30).rightClick() + .withItem(new ItemStack(Items.SLIME_BALL)); scene.idle(7); scene.world().modifyBlock(chassisPos, s -> s.setValue(LinearChassisBlock.STICKY_BOTTOM, true), false); scene.effects().superGlue(chassisPos, Direction.WEST, false); @@ -121,7 +118,8 @@ public class ChassisScenes { .pointAt(util.vector().blockSurface(chassisPos, Direction.WEST)); scene.idle(70); - scene.overlay().showControls(input, 15); + scene.overlay().showControls(util.vector().blockSurface(chassisPos, Direction.WEST), Pointing.LEFT, 15).rightClick() + .withItem(new ItemStack(Items.SLIME_BALL)); scene.idle(7); scene.world().modifyBlock(chassisPos, s -> s.setValue(LinearChassisBlock.STICKY_TOP, true), false); scene.effects().superGlue(chassisPos, Direction.EAST, false); @@ -137,10 +135,8 @@ public class ChassisScenes { scene.rotateCameraY(-60); scene.idle(25); - scene.overlay().showControls( - new InputWindowElement(util.vector().blockSurface(chassisPos, Direction.WEST), Pointing.LEFT).rightClick() - .whileSneaking(), - 30); + scene.overlay().showControls(util.vector().blockSurface(chassisPos, Direction.WEST), Pointing.LEFT, 30).rightClick() + .whileSneaking(); scene.idle(7); scene.world().modifyBlock(chassisPos, s -> s.setValue(LinearChassisBlock.STICKY_BOTTOM, false), false); scene.effects().superGlue(chassisPos, Direction.WEST, false); @@ -170,7 +166,7 @@ public class ChassisScenes { Selection column2 = util.select().fromTo(2, 3, 2, 2, 4, 2); Selection column3 = util.select().fromTo(2, 3, 2, 2, 5, 2); - scene.overlay().showSelectionWithText(column3, 80) + scene.overlay().showOutlineWithText(column3, 80) .colored(PonderPalette.GREEN) .text("Stickied faces of the Linear Chassis will attach a line of blocks in front of it") .placeNearTarget(); @@ -185,8 +181,8 @@ public class ChassisScenes { Vec3 blockSurface = util.vector().blockSurface(chassisPos, Direction.NORTH); scene.overlay().showCenteredScrollInput(chassisPos, Direction.NORTH, 50); - scene.overlay().showControls(new InputWindowElement(blockSurface, Pointing.UP).rightClick() - .withItem(AllItems.WRENCH.asStack()), 50); + scene.overlay().showControls(blockSurface, Pointing.UP, 50).rightClick() + .withItem(AllItems.WRENCH.asStack()); scene.idle(10); scene.overlay().showOutline(PonderPalette.WHITE, chassis, column3, 20); @@ -217,9 +213,9 @@ public class ChassisScenes { scene.idle(20); scene.overlay().showCenteredScrollInput(chassisPos, Direction.NORTH, 50); - scene.overlay().showControls(new InputWindowElement(blockSurface, Pointing.UP).whileCTRL() + scene.overlay().showControls(blockSurface, Pointing.UP, 50).whileCTRL() .rightClick() - .withItem(AllItems.WRENCH.asStack()), 50); + .withItem(AllItems.WRENCH.asStack()); column1 = util.select().fromTo(1, 3, 2, 3, 3, 2); column2 = util.select().fromTo(1, 3, 2, 3, 4, 2); @@ -253,8 +249,8 @@ public class ChassisScenes { .text("Attaching blocks to any other side requires the use of Super Glue") .placeNearTarget(); scene.idle(90); - scene.overlay().showControls(new InputWindowElement(glueSurface, Pointing.DOWN).rightClick() - .withItem(AllItems.SUPER_GLUE.asStack()), 30); + scene.overlay().showControls(glueSurface, Pointing.DOWN, 30).rightClick() + .withItem(AllItems.SUPER_GLUE.asStack()); scene.idle(7); scene.overlay().chaseBoundingBoxOutline(PonderPalette.GREEN, glueSurface, new AABB(util.grid().at(1, 2, 2)).expandTowards(0, 0, -1), 40); @@ -340,10 +336,8 @@ public class ChassisScenes { scene.idle(15); scene.addKeyframe(); - InputWindowElement input = - new InputWindowElement(util.vector().blockSurface(chassisPos, Direction.WEST), Pointing.LEFT).rightClick() - .withItem(new ItemStack(Items.SLIME_BALL)); - scene.overlay().showControls(input, 30); + scene.overlay().showControls(util.vector().blockSurface(chassisPos, Direction.WEST), Pointing.LEFT, 30).rightClick() + .withItem(new ItemStack(Items.SLIME_BALL)); scene.idle(7); scene.world().modifyBlock(chassisPos, s -> s.setValue(RadialChassisBlock.STICKY_WEST, true), false); scene.effects().superGlue(chassisPos, Direction.WEST, false); @@ -355,7 +349,8 @@ public class ChassisScenes { .pointAt(util.vector().blockSurface(chassisPos, Direction.WEST)); scene.idle(70); - scene.overlay().showControls(input, 15); + scene.overlay().showControls(util.vector().blockSurface(chassisPos, Direction.WEST), Pointing.LEFT, 15).rightClick() + .withItem(new ItemStack(Items.SLIME_BALL)); scene.idle(7); scene.world().modifyBlock(chassisPos, s -> s.setValue(RadialChassisBlock.STICKY_EAST, true) .setValue(RadialChassisBlock.STICKY_NORTH, true) @@ -375,10 +370,8 @@ public class ChassisScenes { scene.rotateCameraY(-60); scene.idle(25); - scene.overlay().showControls( - new InputWindowElement(util.vector().blockSurface(chassisPos, Direction.WEST), Pointing.LEFT).rightClick() - .whileSneaking(), - 30); + scene.overlay().showControls(util.vector().blockSurface(chassisPos, Direction.WEST), Pointing.LEFT, 30).rightClick() + .whileSneaking(); scene.idle(7); scene.world().modifyBlock(chassisPos, s -> s.setValue(RadialChassisBlock.STICKY_WEST, false), false); scene.effects().superGlue(chassisPos, Direction.WEST, false); @@ -431,7 +424,7 @@ public class ChassisScenes { obj.setValue(add); }); - scene.overlay().showSelectionWithText(obj.getValue(), 60) + scene.overlay().showOutlineWithText(obj.getValue(), 60) .colored(PonderPalette.GREEN) .text("...it will attach all reachable blocks within a radius on that layer"); scene.idle(70); @@ -445,8 +438,8 @@ public class ChassisScenes { scene.addKeyframe(); blockSurface = util.vector().topOf(chassisPos); scene.overlay().showCenteredScrollInput(chassisPos, Direction.UP, 50); - scene.overlay().showControls(new InputWindowElement(blockSurface, Pointing.DOWN).rightClick() - .withItem(AllItems.WRENCH.asStack()), 50); + scene.overlay().showControls(blockSurface, Pointing.DOWN, 50).rightClick() + .withItem(AllItems.WRENCH.asStack()); scene.idle(10); scene.overlay().showOutline(PonderPalette.WHITE, chassis, r2, 20); @@ -482,7 +475,7 @@ public class ChassisScenes { scene.overlay().showOutline(PonderPalette.GREEN, r2, r2.copy() .substract(util.select().fromTo(0, 2, 0, 1, 2, 4)), 80); scene.markAsFinished(); - scene.overlay().showSelectionWithText(ignored, 80) + scene.overlay().showOutlineWithText(ignored, 80) .colored(PonderPalette.RED) .text("Blocks not reachable by any sticky face will not attach"); } @@ -519,19 +512,15 @@ public class ChassisScenes { .pointAt(util.vector().topOf(util.grid().at(2, 1, 2))); scene.idle(70); - scene.overlay().showControls( - new InputWindowElement(util.vector().topOf(2, 2, 3), Pointing.DOWN).withItem(AllItems.SUPER_GLUE.asStack()) - .rightClick(), - 40); + scene.overlay().showControls(util.vector().topOf(2, 2, 3), Pointing.DOWN, 40).withItem(AllItems.SUPER_GLUE.asStack()) + .rightClick(); scene.idle(6); scene.effects().indicateSuccess(util.grid().at(2, 2, 3)); scene.idle(45); - scene.overlay().showControls( - new InputWindowElement(util.vector().blockSurface(util.grid().at(1, 1, 2), Direction.DOWN), Pointing.UP) + scene.overlay().showControls(util.vector().blockSurface(util.grid().at(1, 1, 2), Direction.DOWN), Pointing.UP, 40) .withItem(AllItems.SUPER_GLUE.asStack()) - .rightClick(), - 40); + .rightClick(); scene.idle(6); AABB bb = new AABB(util.grid().at(2, 2, 3)); @@ -559,16 +548,14 @@ public class ChassisScenes { .pointAt(util.vector().blockSurface(util.grid().at(3, 1, 1), Direction.WEST)); scene.idle(40); - scene.overlay().showControls( - new InputWindowElement(util.vector().blockSurface(util.grid().at(3, 1, 1), Direction.UP), Pointing.DOWN) + scene.overlay().showControls(util.vector().blockSurface(util.grid().at(3, 1, 1), Direction.UP), Pointing.DOWN, 40) .withItem(AllItems.SUPER_GLUE.asStack()) - .leftClick(), - 40); + .leftClick(); scene.idle(50); Selection toMove = util.select().fromTo(1, 1, 2, 2, 1, 2) .add(util.select().fromTo(2, 2, 3, 2, 1, 3)); - scene.overlay().showSelectionWithText(toMove, 70) + scene.overlay().showOutlineWithText(toMove, 70) .text("Adjacent blocks sharing an area will pull each other along") .placeNearTarget() .attachKeyFrame() diff --git a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/ChuteScenes.java b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/ChuteScenes.java index 4c0e064a2..91104d6c7 100644 --- a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/ChuteScenes.java +++ b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/ChuteScenes.java @@ -10,14 +10,13 @@ import com.simibubi.create.content.logistics.chute.SmartChuteBlockEntity; import com.simibubi.create.foundation.ponder.CreateSceneBuilder; import net.createmod.catnip.utility.Pointing; +import net.createmod.ponder.api.PonderPalette; +import net.createmod.ponder.api.element.ElementLink; +import net.createmod.ponder.api.element.EntityElement; +import net.createmod.ponder.api.element.WorldSectionElement; import net.createmod.ponder.api.scene.SceneBuilder; import net.createmod.ponder.api.scene.SceneBuildingUtil; -import net.createmod.ponder.foundation.ElementLink; -import net.createmod.ponder.foundation.PonderPalette; -import net.createmod.ponder.foundation.Selection; -import net.createmod.ponder.foundation.element.EntityElement; -import net.createmod.ponder.foundation.element.InputWindowElement; -import net.createmod.ponder.foundation.element.WorldSectionElement; +import net.createmod.ponder.api.scene.Selection; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.world.entity.Entity; @@ -62,11 +61,9 @@ public class ChuteScenes { scene.world().moveSection(bottom, util.vector().of(1, 0, 0), 10); scene.world().moveSection(top, util.vector().of(-1, 0, 0), 10); scene.idle(20); - scene.overlay().showControls( - new InputWindowElement(util.vector().blockSurface(util.grid().at(2, 3, 2), Direction.NORTH), Pointing.RIGHT) + scene.overlay().showControls(util.vector().blockSurface(util.grid().at(2, 3, 2), Direction.NORTH), Pointing.RIGHT, 40) .rightClick() - .withItem(AllItems.WRENCH.asStack()), - 40); + .withItem(AllItems.WRENCH.asStack()); scene.idle(7); scene.world().modifyBlock(util.grid().at(3, 3, 3), s -> s.setValue(ChuteBlock.SHAPE, ChuteBlock.Shape.WINDOW), false); @@ -77,11 +74,9 @@ public class ChuteScenes { .text("Using the Wrench, a window can be created"); scene.idle(60); - scene.overlay().showControls( - new InputWindowElement(util.vector().blockSurface(util.grid().at(2, 2, 2), Direction.NORTH), Pointing.RIGHT) + scene.overlay().showControls(util.vector().blockSurface(util.grid().at(2, 2, 2), Direction.NORTH), Pointing.RIGHT, 40) .rightClick() - .withItem(AllBlocks.INDUSTRIAL_IRON_BLOCK.asStack()), - 40); + .withItem(AllBlocks.INDUSTRIAL_IRON_BLOCK.asStack()); scene.idle(7); scene.world().modifyBlock(util.grid().at(3, 2, 3), s -> s.setValue(ChuteBlock.SHAPE, ChuteBlock.Shape.ENCASED), false); @@ -108,21 +103,17 @@ public class ChuteScenes { scene.world().showSection(util.select().fromTo(2, 1, 1, 2, 2, 1), Direction.DOWN); scene.idle(30); ItemStack chuteItem = AllBlocks.CHUTE.asStack(); - scene.overlay().showControls( - new InputWindowElement(util.vector().blockSurface(util.grid().at(2, 2, 1), Direction.SOUTH), Pointing.LEFT) + scene.overlay().showControls(util.vector().blockSurface(util.grid().at(2, 2, 1), Direction.SOUTH), Pointing.LEFT, 30) .rightClick() - .withItem(chuteItem), - 30); + .withItem(chuteItem); scene.idle(7); scene.world().showSection(util.select().position(2, 3, 2), Direction.NORTH); scene.world().restoreBlocks(util.select().position(2, 2, 1)); scene.idle(15); scene.idle(20); - scene.overlay().showControls( - new InputWindowElement(util.vector().blockSurface(util.grid().at(2, 3, 2), Direction.SOUTH), Pointing.LEFT) + scene.overlay().showControls(util.vector().blockSurface(util.grid().at(2, 3, 2), Direction.SOUTH), Pointing.LEFT, 30) .rightClick() - .withItem(chuteItem), - 30); + .withItem(chuteItem); scene.idle(7); scene.world().showSection(util.select().position(2, 4, 3), Direction.NORTH); scene.idle(10); @@ -154,10 +145,8 @@ public class ChuteScenes { } scene.idle(10); - scene.overlay().showControls( - new InputWindowElement(util.vector().blockSurface(util.grid().at(2, 1, 1), Direction.NORTH), Pointing.RIGHT) - .withItem(stack), - 50); + scene.overlay().showControls(util.vector().blockSurface(util.grid().at(2, 1, 1), Direction.NORTH), Pointing.RIGHT, 50) + .withItem(stack); scene.markAsFinished(); } @@ -183,10 +172,8 @@ public class ChuteScenes { .pointAt(surface) .placeNearTarget(); scene.idle(80); - scene.overlay().showControls( - new InputWindowElement(util.vector().blockSurface(util.grid().at(1, 2, 2), Direction.NORTH), Pointing.RIGHT) - .withItem(AllItems.GOGGLES.asStack()), - 50); + scene.overlay().showControls(util.vector().blockSurface(util.grid().at(1, 2, 2), Direction.NORTH), Pointing.RIGHT, 50) + .withItem(AllItems.GOGGLES.asStack()); scene.overlay().showText(70) .text("Inspecting chutes with Engineers' Goggles reveals information about the movement direction") .attachKeyFrame() @@ -250,8 +237,8 @@ public class ChuteScenes { scene.idle(15); ItemStack copper = new ItemStack(Items.IRON_INGOT); - scene.overlay().showControls(new InputWindowElement(filter.add(0, 0.125, 0), Pointing.DOWN).rightClick() - .withItem(copper), 40); + scene.overlay().showControls(filter.add(0, 0.125, 0), Pointing.DOWN, 40).rightClick() + .withItem(copper); scene.idle(7); scene.world().setFilterData(util.select().position(smarty), SmartChuteBlockEntity.class, copper); @@ -260,8 +247,7 @@ public class ChuteScenes { scene.world().createItemOnBeltLike(util.grid().at(2, 2, 2), Direction.UP, copper); if (i == 8) { scene.rotateCameraY(-20); - scene.overlay().showControls(new InputWindowElement(filter.add(0, 0.125, 0), Pointing.DOWN).rightClick(), - 40); + scene.overlay().showControls(filter.add(0, 0.125, 0), Pointing.DOWN, 40).rightClick(); scene.overlay().showText(50) .text("Use the value panel to specify the extracted stack size") .attachKeyFrame() diff --git a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/CrafterScenes.java b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/CrafterScenes.java index 0e6ff8b57..507511dca 100644 --- a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/CrafterScenes.java +++ b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/CrafterScenes.java @@ -10,13 +10,12 @@ import com.simibubi.create.foundation.ponder.CreateSceneBuilder; import net.createmod.catnip.utility.Couple; import net.createmod.catnip.utility.Pointing; +import net.createmod.ponder.api.PonderPalette; +import net.createmod.ponder.api.element.ElementLink; +import net.createmod.ponder.api.element.EntityElement; import net.createmod.ponder.api.scene.SceneBuilder; import net.createmod.ponder.api.scene.SceneBuildingUtil; -import net.createmod.ponder.foundation.ElementLink; -import net.createmod.ponder.foundation.PonderPalette; -import net.createmod.ponder.foundation.Selection; -import net.createmod.ponder.foundation.element.EntityElement; -import net.createmod.ponder.foundation.element.InputWindowElement; +import net.createmod.ponder.api.scene.Selection; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.world.entity.Entity; @@ -58,11 +57,9 @@ public class CrafterScenes { .placeNearTarget(); scene.idle(80); - scene.overlay().showControls( - new InputWindowElement(util.vector().blockSurface(util.grid().at(2, 3, 2), Direction.NORTH), Pointing.RIGHT) + scene.overlay().showControls(util.vector().blockSurface(util.grid().at(2, 3, 2), Direction.NORTH), Pointing.RIGHT, 40) .rightClick() - .withItem(AllItems.WRENCH.asStack()), - 40); + .withItem(AllItems.WRENCH.asStack()); scene.idle(7); scene.world().cycleBlockProperty(util.grid().at(2, 3, 2), MechanicalCrafterBlock.POINTING); scene.idle(10); @@ -76,10 +73,8 @@ public class CrafterScenes { BlockPos[] positions = new BlockPos[] { util.grid().at(3, 1, 2), util.grid().at(2, 1, 2), util.grid().at(1, 1, 2) }; for (BlockPos pos : positions) { - scene.overlay().showControls( - new InputWindowElement(util.vector().blockSurface(pos, Direction.NORTH), Pointing.RIGHT).rightClick() - .withItem(AllItems.WRENCH.asStack()), - 10); + scene.overlay().showControls(util.vector().blockSurface(pos, Direction.NORTH), Pointing.RIGHT, 10).rightClick() + .withItem(AllItems.WRENCH.asStack()); scene.idle(7); scene.world().cycleBlockProperty(pos, MechanicalCrafterBlock.POINTING); scene.idle(15); @@ -145,11 +140,9 @@ public class CrafterScenes { scene.idle(40); ItemStack planks = new ItemStack(Items.OAK_PLANKS); - scene.overlay().showControls( - new InputWindowElement(util.vector().blockSurface(util.grid().at(1, 3, 2), Direction.NORTH), Pointing.RIGHT) + scene.overlay().showControls(util.vector().blockSurface(util.grid().at(1, 3, 2), Direction.NORTH), Pointing.RIGHT, 40) .rightClick() - .withItem(planks), - 40); + .withItem(planks); scene.idle(7); Class type = MechanicalCrafterBlockEntity.class; scene.world().modifyBlockEntity(util.grid().at(1, 3, 2), type, mct -> mct.getInventory() @@ -272,7 +265,7 @@ public class CrafterScenes { scene.world().removeItemsFromBelt(util.grid().at(3, 1, 2)); scene.world().flapFunnel(util.grid().at(3, 2, 2), false); - scene.overlay().showSelectionWithText(util.select().position(2, 2, 2), 70) + scene.overlay().showOutlineWithText(util.select().position(2, 2, 2), 70) .attachKeyFrame() .placeNearTarget() .pointAt(util.vector().blockSurface(util.grid().at(2, 2, 2), Direction.NORTH)) @@ -287,47 +280,46 @@ public class CrafterScenes { v = v.add(0, 0, .5); scene.overlay().chaseBoundingBoxOutline(PonderPalette.WHITE, new Object(), bb, 45); - scene.overlay().showControls(new InputWindowElement(v, Pointing.LEFT).rightClick() - .withItem(AllItems.WRENCH.asStack()), 40); + scene.overlay().showControls(v, Pointing.LEFT, 40).rightClick() + .withItem(AllItems.WRENCH.asStack()); scene.idle(7); scene.world().connectCrafterInvs(util.grid().at(2, 2, 2), util.grid().at(1, 2, 2)); scene.idle(40); - scene.overlay().showSelectionWithText(util.select().fromTo(2, 2, 2, 1, 2, 2), 70) + scene.overlay().showOutlineWithText(util.select().fromTo(2, 2, 2, 1, 2, 2), 70) .attachKeyFrame() .placeNearTarget() .pointAt(v) .text("Using the Wrench at their backs, Mechanical Crafter inputs can be combined"); scene.idle(80); - scene.overlay().showControls(new InputWindowElement(v.add(0, 1, 0), Pointing.LEFT).rightClick() - .withItem(AllItems.WRENCH.asStack()), 20); + scene.overlay().showControls(v.add(0, 1, 0), Pointing.LEFT, 20).rightClick() + .withItem(AllItems.WRENCH.asStack()); scene.idle(7); scene.world().connectCrafterInvs(util.grid().at(2, 3, 2), util.grid().at(1, 3, 2)); scene.idle(20); - scene.overlay().showControls(new InputWindowElement(v.add(0, -1, 0), Pointing.LEFT).rightClick() - .withItem(AllItems.WRENCH.asStack()), 20); + scene.overlay().showControls(v.add(0, -1, 0), Pointing.LEFT, 20).rightClick() + .withItem(AllItems.WRENCH.asStack()); scene.idle(7); scene.world().connectCrafterInvs(util.grid().at(2, 1, 2), util.grid().at(1, 1, 2)); scene.idle(20); - scene.overlay().showControls(new InputWindowElement(v.add(.5, -.5, 0), Pointing.LEFT).rightClick() - .withItem(AllItems.WRENCH.asStack()), 20); + scene.overlay().showControls(v.add(.5, -.5, 0), Pointing.LEFT, 20).rightClick() + .withItem(AllItems.WRENCH.asStack()); scene.idle(7); scene.world().connectCrafterInvs(util.grid().at(2, 1, 2), util.grid().at(2, 2, 2)); scene.idle(10); - scene.overlay().showControls(new InputWindowElement(v.add(.5, .5, 0), Pointing.LEFT).rightClick() - .withItem(AllItems.WRENCH.asStack()), 20); + scene.overlay().showControls(v.add(.5, .5, 0), Pointing.LEFT, 20).rightClick() + .withItem(AllItems.WRENCH.asStack()); scene.idle(7); scene.world().connectCrafterInvs(util.grid().at(2, 2, 2), util.grid().at(2, 3, 2)); scene.idle(20); scene.rotateCameraY(90 + 30); scene.idle(40); - scene.overlay().showSelectionWithText(util.select().fromTo(1, 1, 2, 2, 3, 2), 70) + scene.overlay().showOutlineWithText(util.select().fromTo(1, 1, 2, 2, 3, 2), 70) .attachKeyFrame() .placeNearTarget() .text("All connected Crafters can now be accessed by the same input location"); scene.idle(60); - scene.overlay().showControls( - new InputWindowElement(util.vector().centerOf(util.grid().at(4, 2, 2)), Pointing.DOWN).withItem(planks), 40); + scene.overlay().showControls(util.vector().centerOf(util.grid().at(4, 2, 2)), Pointing.DOWN, 40).withItem(planks); scene.idle(7); scene.world().createItemOnBelt(util.grid().at(4, 1, 2), Direction.EAST, ItemHandlerHelper.copyStackWithSize(planks, 16)); @@ -378,7 +370,7 @@ public class CrafterScenes { scene.idle(5); Selection emptyCrafter = util.select().position(2, 2, 2); - scene.overlay().showSelectionWithText(emptyCrafter, 90) + scene.overlay().showOutlineWithText(emptyCrafter, 90) .attachKeyFrame() .colored(PonderPalette.RED) .text("Some recipes will require additional Crafters to bridge gaps in the path") @@ -404,19 +396,14 @@ public class CrafterScenes { .text("Using Slot Covers, Crafters can be set to act as an Empty Slot in the arrangement") .placeNearTarget(); scene.idle(100); - scene.overlay() - .showControls(new InputWindowElement(util.vector().blockSurface(util.grid().at(2, 2, 2), Direction.NORTH) - .add(0.5, 0, 0), Pointing.RIGHT).withItem(AllItems.CRAFTER_SLOT_COVER.asStack()) - .rightClick(), - 50); + scene.overlay().showControls(util.vector().blockSurface(util.grid().at(2, 2, 2), Direction.NORTH).add(0.5, 0, 0), Pointing.RIGHT, 50).withItem(AllItems.CRAFTER_SLOT_COVER.asStack()) + .rightClick(); scene.idle(7); scene.world().modifyBlockEntityNBT(emptyCrafter, type, compound -> compound.putBoolean("Cover", true)); scene.idle(130); - scene.overlay().showControls( - new InputWindowElement(util.vector().blockSurface(util.grid().at(2, 3, 2), Direction.WEST), Pointing.LEFT) - .withItem(new ItemStack(Items.BUCKET)), - 40); + scene.overlay().showControls(util.vector().blockSurface(util.grid().at(2, 3, 2), Direction.WEST), Pointing.LEFT, 40) + .withItem(new ItemStack(Items.BUCKET)); scene.idle(50); scene.world().showSection(util.select().position(4, 2, 2), Direction.DOWN); @@ -427,7 +414,7 @@ public class CrafterScenes { scene.world().connectCrafterInvs(util.grid().at(1, 2, 2), util.grid().at(2, 2, 2)); scene.idle(10); - scene.overlay().showSelectionWithText(util.select().fromTo(3, 2, 2, 1, 2, 2) + scene.overlay().showOutlineWithText(util.select().fromTo(3, 2, 2, 1, 2, 2) .add(util.select().position(2, 1, 2)), 80) .attachKeyFrame() .pointAt(util.vector().blockSurface(util.grid().at(2, 2, 2), Direction.NORTH)) diff --git a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/DeployerScenes.java b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/DeployerScenes.java index c627a4d6d..f5857c42f 100644 --- a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/DeployerScenes.java +++ b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/DeployerScenes.java @@ -8,15 +8,13 @@ import com.simibubi.create.foundation.ponder.CreateSceneBuilder; import com.simibubi.create.foundation.ponder.element.BeltItemElement; import net.createmod.catnip.utility.Pointing; +import net.createmod.ponder.api.PonderPalette; +import net.createmod.ponder.api.element.ElementLink; +import net.createmod.ponder.api.element.EntityElement; +import net.createmod.ponder.api.element.WorldSectionElement; import net.createmod.ponder.api.scene.SceneBuilder; import net.createmod.ponder.api.scene.SceneBuildingUtil; -import net.createmod.ponder.foundation.ElementLink; -import net.createmod.ponder.foundation.PonderPalette; -import net.createmod.ponder.foundation.Selection; -import net.createmod.ponder.foundation.element.EntityElement; -import net.createmod.ponder.foundation.element.InputWindowElement; -import net.createmod.ponder.foundation.element.WorldSectionElement; -import net.createmod.ponder.foundation.instruction.EmitParticlesInstruction.Emitter; +import net.createmod.ponder.api.scene.Selection; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.core.particles.BlockParticleOption; @@ -60,7 +58,7 @@ public class DeployerScenes { scene.world().moveDeployer(deployerPos, -1, 25); scene.idle(44); - scene.overlay().showSelectionWithText(util.select().position(deployerPos.west(2)), 60) + scene.overlay().showOutlineWithText(util.select().position(deployerPos.west(2)), 60) .text("It will always interact with the position 2 blocks in front of itself") .attachKeyFrame() .placeNearTarget() @@ -109,8 +107,8 @@ public class DeployerScenes { 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.overlay().showControls(frontVec, Pointing.DOWN, 40).rightClick() + .withItem(pot); scene.idle(7); Class teType = DeployerBlockEntity.class; scene.world().modifyBlockEntityNBT(deployerSelection, teType, nbt -> nbt.put("HeldItem", pot.serializeNBT())); @@ -169,8 +167,8 @@ public class DeployerScenes { ItemStack shears = new ItemStack(Items.SHEARS); - scene.overlay().showControls(new InputWindowElement(filterSlot, Pointing.DOWN).rightClick() - .withItem(shears), 40); + scene.overlay().showControls(filterSlot, Pointing.DOWN, 40).rightClick() + .withItem(shears); scene.idle(7); scene.world().setFilterData(deployerSelection, teType, shears); scene.overlay().showText(60) @@ -212,10 +210,10 @@ public class DeployerScenes { 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); + .add(0, -.25, 0), + scene.effects().particleEmitterWithinBlockSpace(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); @@ -259,8 +257,7 @@ public class DeployerScenes { scene.idle(10); ItemStack tool = new ItemStack(Items.GOLDEN_HOE); - scene.overlay().showControls(new InputWindowElement(util.vector().topOf(deployerPos), Pointing.DOWN).withItem(tool), - 30); + scene.overlay().showControls(util.vector().topOf(deployerPos), Pointing.DOWN, 30).withItem(tool); scene.idle(7); scene.world().modifyBlockEntityNBT(deployerSelection, DeployerBlockEntity.class, nbt -> nbt.put("HeldItem", tool.serializeNBT())); @@ -281,8 +278,8 @@ public class DeployerScenes { scene.world().moveDeployer(deployerPos, -1, 25); scene.idle(46); - scene.overlay().showControls(new InputWindowElement(frontVec, Pointing.LEFT).rightClick() - .withItem(AllItems.WRENCH.asStack()), 40); + scene.overlay().showControls(frontVec, Pointing.LEFT, 40).rightClick() + .withItem(AllItems.WRENCH.asStack()); scene.idle(7); scene.world().modifyBlockEntityNBT(deployerSelection, DeployerBlockEntity.class, nbt -> nbt.putString("Mode", "PUNCH")); @@ -342,8 +339,8 @@ public class DeployerScenes { scene.idle(10); ItemStack tool = AllItems.SAND_PAPER.asStack(); - scene.overlay().showControls(new InputWindowElement(util.vector().blockSurface(pressPos.below(), Direction.EAST) - .add(0, 0.15, 0), Pointing.RIGHT).withItem(tool), 30); + scene.overlay().showControls(util.vector().blockSurface(pressPos.below(), Direction.EAST).add(0, 0.15, 0), Pointing.RIGHT, 30) + .withItem(tool); scene.idle(7); scene.world().modifyBlockEntityNBT(pressS, DeployerBlockEntity.class, nbt -> nbt.put("HeldItem", tool.serializeNBT())); @@ -365,7 +362,7 @@ public class DeployerScenes { ItemStack quartz = AllItems.ROSE_QUARTZ.asStack(); scene.world().createItemOnBeltLike(depotPos, Direction.NORTH, quartz); Vec3 depotCenter = util.vector().centerOf(depotPos.south()); - scene.overlay().showControls(new InputWindowElement(depotCenter, Pointing.UP).withItem(quartz), 30); + scene.overlay().showControls(depotCenter, Pointing.UP, 30).withItem(quartz); scene.idle(10); Vec3 targetV = util.vector().centerOf(pressPos) @@ -380,7 +377,7 @@ public class DeployerScenes { ItemStack polished = AllItems.POLISHED_ROSE_QUARTZ.asStack(); scene.world().createItemOnBeltLike(depotPos, Direction.UP, polished); scene.idle(10); - scene.overlay().showControls(new InputWindowElement(depotCenter, Pointing.UP).withItem(polished), 50); + scene.overlay().showControls(depotCenter, Pointing.UP, 50).withItem(polished); scene.idle(60); scene.world().hideIndependentSection(depot, Direction.NORTH); @@ -547,7 +544,7 @@ public class DeployerScenes { scene.idle(18); } - scene.overlay().showSelectionWithText(flowers, 90) + scene.overlay().showOutlineWithText(flowers, 90) .attachKeyFrame() .colored(PonderPalette.GREEN) .text("They activate at each visited location, using items from inventories anywhere on the contraption"); @@ -569,7 +566,7 @@ public class DeployerScenes { scene.idle(70); ItemStack poppy = new ItemStack(Items.POPPY); - scene.overlay().showControls(new InputWindowElement(filterSlot, Pointing.DOWN).withItem(poppy), 30); + scene.overlay().showControls(filterSlot, Pointing.DOWN, 30).withItem(poppy); scene.idle(7); scene.world().setFilterData(deployerSelection, DeployerBlockEntity.class, poppy); scene.idle(25); diff --git a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/DetectorScenes.java b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/DetectorScenes.java index 5c0c8f74f..d4828efd0 100644 --- a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/DetectorScenes.java +++ b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/DetectorScenes.java @@ -5,13 +5,12 @@ import com.simibubi.create.content.redstone.thresholdSwitch.ThresholdSwitchBlock import com.simibubi.create.foundation.ponder.CreateSceneBuilder; import net.createmod.catnip.utility.Pointing; +import net.createmod.ponder.api.PonderPalette; +import net.createmod.ponder.api.element.ElementLink; +import net.createmod.ponder.api.element.WorldSectionElement; import net.createmod.ponder.api.scene.SceneBuilder; import net.createmod.ponder.api.scene.SceneBuildingUtil; -import net.createmod.ponder.foundation.ElementLink; -import net.createmod.ponder.foundation.PonderPalette; -import net.createmod.ponder.foundation.Selection; -import net.createmod.ponder.foundation.element.InputWindowElement; -import net.createmod.ponder.foundation.element.WorldSectionElement; +import net.createmod.ponder.api.scene.Selection; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.world.item.ItemStack; @@ -60,10 +59,8 @@ public class DetectorScenes { ItemStack copperIngot = new ItemStack(Items.COPPER_INGOT); ItemStack amethystItem = new ItemStack(Blocks.AMETHYST_BLOCK); - scene.overlay().showControls( - new InputWindowElement(util.vector().blockSurface(observerPos.north(), Direction.NORTH), Pointing.RIGHT) - .withItem(copperIngot), - 40); + scene.overlay().showControls(util.vector().blockSurface(observerPos.north(), Direction.NORTH), Pointing.RIGHT, 40) + .withItem(copperIngot); scene.idle(7); scene.world().toggleRedstonePower(util.select().position(observerPos)); scene.world().toggleRedstonePower(redstoneDust); @@ -79,10 +76,8 @@ public class DetectorScenes { scene.overlay().showCenteredScrollInput(observerPos, Direction.UP, 10); scene.idle(5); - scene.overlay().showControls( - new InputWindowElement(util.vector().blockSurface(observerPos, Direction.UP), Pointing.DOWN).rightClick() - .withItem(amethystItem), - 60); + scene.overlay().showControls(util.vector().blockSurface(observerPos, Direction.UP), Pointing.DOWN, 60).rightClick() + .withItem(amethystItem); scene.idle(7); scene.world().setFilterData(util.select().position(observerPos), SmartObserverBlockEntity.class, amethystItem); scene.world().toggleRedstonePower(util.select().position(observerPos)); @@ -320,8 +315,7 @@ public class DetectorScenes { scene.idle(5); scene.overlay().showLine(PonderPalette.RED, upper.add(2 / 16f, 0, 0), upper.subtract(2 / 16f, 0, 0), 100); scene.idle(15); - scene.overlay().showControls( - new InputWindowElement(util.vector().blockSurface(switchPos, Direction.UP), Pointing.DOWN).rightClick(), 60); + scene.overlay().showControls(util.vector().blockSurface(switchPos, Direction.UP), Pointing.DOWN, 60).rightClick(); scene.idle(7); scene.overlay().showText(70) .text("The specific thresholds can be changed in the UI") diff --git a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/DisplayScenes.java b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/DisplayScenes.java index 06da6fc9b..29a475e6a 100644 --- a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/DisplayScenes.java +++ b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/DisplayScenes.java @@ -9,13 +9,12 @@ import com.simibubi.create.foundation.utility.CreateLang; import net.createmod.catnip.utility.Pointing; import net.createmod.catnip.utility.lang.Components; +import net.createmod.ponder.api.PonderPalette; +import net.createmod.ponder.api.element.ElementLink; +import net.createmod.ponder.api.element.WorldSectionElement; import net.createmod.ponder.api.scene.SceneBuilder; import net.createmod.ponder.api.scene.SceneBuildingUtil; -import net.createmod.ponder.foundation.ElementLink; -import net.createmod.ponder.foundation.PonderPalette; -import net.createmod.ponder.foundation.Selection; -import net.createmod.ponder.foundation.element.InputWindowElement; -import net.createmod.ponder.foundation.element.WorldSectionElement; +import net.createmod.ponder.api.scene.Selection; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.world.item.DyeColor; @@ -73,9 +72,8 @@ public class DisplayScenes { scene.idle(25); Vec3 target = util.vector().of(3.5, 2.75, 3.25); - scene.overlay() - .showControls(new InputWindowElement(target, Pointing.RIGHT).withItem(AllBlocks.DISPLAY_LINK.asStack()) - .rightClick(), 60); + scene.overlay().showControls(target, Pointing.RIGHT, 60).withItem(AllBlocks.DISPLAY_LINK.asStack()) + .rightClick(); scene.idle(6); scene.overlay().chaseBoundingBoxOutline(PonderPalette.OUTPUT, link, new AABB(board).expandTowards(-2, -1, 0) .deflate(0, 0, 3 / 16f), 60); @@ -92,7 +90,7 @@ public class DisplayScenes { scene.idle(10); scene.world().showSection(link, Direction.EAST); scene.idle(20); - scene.overlay().showSelectionWithText(depot, 70) + scene.overlay().showOutlineWithText(depot, 70) .text("...then attach it to the block to read from") .pointAt(util.vector().centerOf(linkPos)) .colored(PonderPalette.INPUT) @@ -103,7 +101,7 @@ public class DisplayScenes { scene.world().createItemOnBeltLike(depotPos, Direction.SOUTH, item); scene.idle(20); - scene.overlay().showControls(new InputWindowElement(util.vector().topOf(linkPos), Pointing.DOWN).rightClick(), 60); + scene.overlay().showControls(util.vector().topOf(linkPos), Pointing.DOWN, 60).rightClick(); scene.idle(20); scene.overlay().showText(80) .text("Open the Interface to select and configure what is sent") @@ -146,7 +144,7 @@ public class DisplayScenes { scene.world().moveSection(dirtElement, util.vector().of(0, -4, 0), 0); scene.idle(25); - scene.overlay().showSelectionWithText(depot, 50) + scene.overlay().showOutlineWithText(depot, 50) .text("Not every block can act as a source") .pointAt(util.vector().topOf(depotPos)) .attachKeyFrame() @@ -286,8 +284,8 @@ public class DisplayScenes { Vec3 target = util.vector().of(3.95, 2.75, 3.25); ItemStack clipboard = AllBlocks.CLIPBOARD.asStack(); ClipboardOverrides.switchTo(ClipboardType.WRITTEN, clipboard); - scene.overlay().showControls(new InputWindowElement(target, Pointing.RIGHT).withItem(clipboard) - .rightClick(), 40); + scene.overlay().showControls(target, Pointing.RIGHT, 40).withItem(clipboard) + .rightClick(); scene.idle(6); scene.world().setDisplayBoardText(board, 0, Components.literal("Create")); scene.idle(25); @@ -337,9 +335,8 @@ public class DisplayScenes { scene.world().flashDisplayLink(linkPos); scene.idle(50); - scene.overlay() - .showControls(new InputWindowElement(target, Pointing.RIGHT).withItem(new ItemStack(Items.PINK_DYE)) - .rightClick(), 40); + scene.overlay().showControls(target, Pointing.RIGHT, 40).withItem(new ItemStack(Items.PINK_DYE)) + .rightClick(); scene.idle(6); scene.world().dyeDisplayBoard(board, 0, DyeColor.PINK); scene.idle(25); @@ -351,15 +348,13 @@ public class DisplayScenes { .placeNearTarget(); scene.idle(25); - scene.overlay().showControls( - new InputWindowElement(target.add(0, -.5f, 0), Pointing.RIGHT).withItem(new ItemStack(Items.LIME_DYE)) - .rightClick(), - 40); + scene.overlay().showControls(target.add(0, -.5f, 0), Pointing.RIGHT, 40).withItem(new ItemStack(Items.LIME_DYE)) + .rightClick(); scene.idle(6); scene.world().dyeDisplayBoard(board, 1, DyeColor.LIME); scene.idle(55); - scene.overlay().showControls(new InputWindowElement(target, Pointing.RIGHT).rightClick(), 40); + scene.overlay().showControls(target, Pointing.RIGHT, 40).rightClick(); scene.idle(6); scene.world().setDisplayBoardText(board, 0, Components.immutableEmpty()); scene.idle(25); @@ -457,7 +452,7 @@ public class DisplayScenes { scene.world().setDisplayBoardText(board, 1, Components.immutableEmpty()); scene.idle(25); - scene.overlay().showSelectionWithText(depot, 80) + scene.overlay().showOutlineWithText(depot, 80) .colored(PonderPalette.RED) .attachKeyFrame() .pointAt(util.vector().topOf(linkPos)) diff --git a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/EjectorScenes.java b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/EjectorScenes.java index 17aa99eed..d4efb9cb5 100644 --- a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/EjectorScenes.java +++ b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/EjectorScenes.java @@ -7,14 +7,14 @@ import com.simibubi.create.foundation.ponder.CreateSceneBuilder; import net.createmod.catnip.utility.NBTHelper; import net.createmod.catnip.utility.Pointing; +import net.createmod.ponder.api.PonderPalette; +import net.createmod.ponder.api.element.ElementLink; +import net.createmod.ponder.api.element.ParrotElement; +import net.createmod.ponder.api.element.ParrotPose; +import net.createmod.ponder.api.element.WorldSectionElement; import net.createmod.ponder.api.scene.SceneBuilder; import net.createmod.ponder.api.scene.SceneBuildingUtil; -import net.createmod.ponder.foundation.ElementLink; -import net.createmod.ponder.foundation.PonderPalette; -import net.createmod.ponder.foundation.Selection; -import net.createmod.ponder.foundation.element.InputWindowElement; -import net.createmod.ponder.foundation.element.ParrotElement; -import net.createmod.ponder.foundation.element.WorldSectionElement; +import net.createmod.ponder.api.scene.Selection; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.world.entity.Entity; @@ -44,9 +44,9 @@ public class EjectorScenes { scene.idle(10); ItemStack asStack = AllBlocks.WEIGHTED_EJECTOR.asStack(); - scene.overlay().showControls(new InputWindowElement(util.vector().topOf(targetPos), Pointing.DOWN).rightClick() + scene.overlay().showControls(util.vector().topOf(targetPos), Pointing.DOWN, 50).rightClick() .whileSneaking() - .withItem(asStack), 50); + .withItem(asStack); scene.idle(7); Object slot = new Object(); scene.overlay().chaseBoundingBoxOutline(PonderPalette.OUTPUT, slot, new AABB(targetPos), 160); @@ -58,8 +58,8 @@ public class EjectorScenes { .pointAt(util.vector().blockSurface(targetPos, Direction.WEST)) .placeNearTarget(); scene.idle(80); - scene.overlay().showControls(new InputWindowElement(util.vector().topOf(ejectorPos), Pointing.DOWN).rightClick() - .withItem(asStack), 50); + scene.overlay().showControls(util.vector().topOf(ejectorPos), Pointing.DOWN, 50).rightClick() + .withItem(asStack); scene.idle(7); scene.world().setKineticSpeed(ejectorS, 0); scene.world().modifyBlockEntityNBT(ejectorS, EjectorBlockEntity.class, nbt -> { @@ -99,7 +99,7 @@ public class EjectorScenes { .east(), Direction.WEST)) .placeNearTarget(); scene.idle(70); - scene.overlay().showSelectionWithText(util.select().position(ejectorPos.west()), 70) + scene.overlay().showOutlineWithText(util.select().position(ejectorPos.west()), 70) .colored(PonderPalette.OUTPUT) .text("If no valid Target was selected, it will simply target the block directly in front") .placeNearTarget(); @@ -119,8 +119,7 @@ public class EjectorScenes { ItemStack copperBlock = new ItemStack(Items.COPPER_BLOCK); ItemStack copperIngot = new ItemStack(Items.COPPER_INGOT); - scene.overlay().showControls(new InputWindowElement(util.vector().topOf(ejectorPos) - .add(0.5, 0, 0), Pointing.RIGHT).withItem(copperBlock), 30); + scene.overlay().showControls(util.vector().topOf(ejectorPos).add(0.5, 0, 0), Pointing.RIGHT, 30).withItem(copperBlock); scene.idle(7); scene.world().createItemOnBeltLike(ejectorPos, Direction.NORTH, copperBlock); scene.idle(20); @@ -156,7 +155,7 @@ public class EjectorScenes { Vec3 input = util.vector().blockSurface(ejectorPos, Direction.WEST) .add(0, -2 / 16f, 0); Vec3 topOfSlot = input.add(0, 2 / 16f, 0); - scene.overlay().showControls(new InputWindowElement(topOfSlot, Pointing.DOWN).rightClick(), 60); + scene.overlay().showControls(topOfSlot, Pointing.DOWN, 60).rightClick(); scene.overlay().showFilterSlotInput(input, Direction.WEST, 80); scene.idle(10); scene.overlay().showText(80) @@ -194,7 +193,7 @@ public class EjectorScenes { scene.addKeyframe(); ElementLink birb = scene.special().createBirb(util.vector().topOf(ejectorPos) - .add(0, -3 / 16f, 0), ParrotElement.FlappyPose::new); + .add(0, -3 / 16f, 0), ParrotPose.FlappyPose::new); scene.idle(15); scene.world().modifyBlockEntity(ejectorPos, EjectorBlockEntity.class, ejector -> ejector.activateDeferred()); scene.special().moveParrot(birb, util.vector().of(-2, 3, 0), 5); @@ -206,7 +205,7 @@ public class EjectorScenes { scene.idle(6); scene.special().moveParrot(birb, util.vector().of(-0.25, -2 + 3 / 16f, 0), 12); scene.idle(15); - scene.special().changeBirbPose(birb, ParrotElement.FaceCursorPose::new); + scene.special().changeBirbPose(birb, ParrotPose.FaceCursorPose::new); scene.overlay().showText(80) .text("Mobs and Players will always trigger an Ejector when stepping on it") .pointAt(util.vector().topOf(targetPos)) @@ -241,9 +240,7 @@ public class EjectorScenes { scene.idle(90); BlockPos tunnel = util.grid().at(2, 2, 3); - scene.overlay().showControls( - new InputWindowElement(util.vector().topOf(tunnel), Pointing.DOWN).showing(AllIcons.I_TUNNEL_PREFER_NEAREST), - 80); + scene.overlay().showControls(util.vector().topOf(tunnel), Pointing.DOWN, 80).showing(AllIcons.I_TUNNEL_PREFER_NEAREST); scene.idle(10); scene.overlay().showCenteredScrollInput(tunnel, Direction.UP, 100); scene.idle(10); @@ -270,8 +267,8 @@ public class EjectorScenes { }); scene.idle(90); - scene.overlay().showControls(new InputWindowElement(util.vector().topOf(util.grid().at(4, 1, 3)), Pointing.DOWN) - .withItem(new ItemStack(Items.COPPER_INGOT)), 20); + scene.overlay().showControls(util.vector().topOf(util.grid().at(4, 1, 3)), Pointing.DOWN, 20) + .withItem(new ItemStack(Items.COPPER_INGOT)); scene.world().showSection(coverbelt, Direction.SOUTH); scene.idle(7); diff --git a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/ElevatorScenes.java b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/ElevatorScenes.java index 394659606..7f16873b4 100644 --- a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/ElevatorScenes.java +++ b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/ElevatorScenes.java @@ -10,13 +10,12 @@ import com.simibubi.create.foundation.ponder.CreateSceneBuilder; import net.createmod.catnip.utility.Pointing; import net.createmod.catnip.utility.lang.Components; +import net.createmod.ponder.api.PonderPalette; +import net.createmod.ponder.api.element.ElementLink; +import net.createmod.ponder.api.element.WorldSectionElement; import net.createmod.ponder.api.scene.SceneBuilder; import net.createmod.ponder.api.scene.SceneBuildingUtil; -import net.createmod.ponder.foundation.ElementLink; -import net.createmod.ponder.foundation.PonderPalette; -import net.createmod.ponder.foundation.Selection; -import net.createmod.ponder.foundation.element.InputWindowElement; -import net.createmod.ponder.foundation.element.WorldSectionElement; +import net.createmod.ponder.api.scene.Selection; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.network.chat.Component; @@ -112,15 +111,15 @@ public class ElevatorScenes { AABB glue2 = glue1.inflate(1, 0, 1) .expandTowards(0, -4, 0); - scene.overlay().showControls(new InputWindowElement(util.vector().centerOf(4, 3, 1), Pointing.RIGHT) - .withItem(AllItems.SUPER_GLUE.asStack()), 60); + scene.overlay().showControls(util.vector().centerOf(4, 3, 1), Pointing.RIGHT, 60) + .withItem(AllItems.SUPER_GLUE.asStack()); scene.idle(7); scene.overlay().chaseBoundingBoxOutline(PonderPalette.GREEN, glue1, glue1, 5); scene.idle(1); scene.overlay().chaseBoundingBoxOutline(PonderPalette.GREEN, glue1, glue2, 90); scene.idle(10); - scene.overlay().showSelectionWithText(util.select().position(2, 1, 2), 80) + scene.overlay().showOutlineWithText(util.select().position(2, 1, 2), 80) .placeNearTarget() .colored(PonderPalette.GREEN) .pointAt(util.vector().blockSurface(util.grid().at(1, 2, 1), Direction.UP)) @@ -150,10 +149,8 @@ public class ElevatorScenes { .text("Ensure that the pulley is supplied with Rotational Power"); scene.idle(75); - scene.overlay().showControls( - new InputWindowElement(util.vector().blockSurface(util.grid().at(3, 6, 2), Direction.NORTH), Pointing.RIGHT) - .rightClick(), - 60); + scene.overlay().showControls(util.vector().blockSurface(util.grid().at(3, 6, 2), Direction.NORTH), Pointing.RIGHT, 60) + .rightClick(); scene.idle(7); scene.effects().indicateSuccess(util.grid().at(3, 6, 2)); scene.world().toggleRedstonePower(util.select().position(1, 13, 2)); @@ -175,12 +172,10 @@ public class ElevatorScenes { .text("The stationary contact now turns into an Elevator Contact"); scene.idle(80); - scene.overlay().showControls( - new InputWindowElement(util.vector().blockSurface(util.grid().at(1, 1, 2), Direction.UP), Pointing.DOWN) - .rightClick(), - 60); + scene.overlay().showControls(util.vector().blockSurface(util.grid().at(1, 1, 2), Direction.UP), Pointing.DOWN, 60) + .rightClick(); scene.idle(7); - scene.overlay().showSelectionWithText(util.select().position(1, 1, 2), 60) + scene.overlay().showOutlineWithText(util.select().position(1, 1, 2), 60) .placeNearTarget() .colored(PonderPalette.BLUE) .pointAt(util.vector().blockSurface(util.grid().at(1, 1, 2), Direction.UP)) @@ -245,10 +240,8 @@ public class ElevatorScenes { scene.addLazyKeyframe(); scene.idle(10); - scene.overlay().showControls( - new InputWindowElement(util.vector().blockSurface(util.grid().at(4, 2, 2), Direction.UP), Pointing.DOWN) - .scroll(), - 60); + scene.overlay().showControls(util.vector().blockSurface(util.grid().at(4, 2, 2), Direction.UP), Pointing.DOWN, 60) + .scroll(); scene.idle(15); scene.overlay().showText(90) .placeNearTarget() @@ -256,10 +249,8 @@ public class ElevatorScenes { .text("Scroll and click on the controls block to choose a floor while on-board"); scene.idle(85); - scene.overlay().showControls( - new InputWindowElement(util.vector().blockSurface(util.grid().at(4, 2, 2), Direction.UP), Pointing.DOWN) - .rightClick(), - 10); + scene.overlay().showControls(util.vector().blockSurface(util.grid().at(4, 2, 2), Direction.UP), Pointing.DOWN, 10) + .rightClick(); scene.idle(7); scene.world().cycleBlockProperty(midContact, ElevatorContactBlock.POWERING); scene.world().cycleBlockProperty(topContact, ElevatorContactBlock.CALLING); @@ -274,10 +265,8 @@ public class ElevatorScenes { scene.world().cycleBlockProperty(topContact, ElevatorContactBlock.CALLING); scene.idle(15); - scene.overlay().showControls( - new InputWindowElement(util.vector().blockSurface(util.grid().at(3, 6, 2), Direction.NORTH), Pointing.RIGHT) - .rightClick(), - 60); + scene.overlay().showControls(util.vector().blockSurface(util.grid().at(3, 6, 2), Direction.NORTH), Pointing.RIGHT, 60) + .rightClick(); scene.idle(7); scene.effects().indicateSuccess(util.grid().at(3, 6, 2)); scene.world().movePulley(pulleyPos, -1, 0); @@ -292,10 +281,8 @@ public class ElevatorScenes { scene.world().showSectionAndMerge(util.select().fromTo(doorPos, doorPos.above()), Direction.DOWN, elevatorLink); scene.idle(20); - scene.overlay().showControls( - new InputWindowElement(util.vector().blockSurface(util.grid().at(3, 6, 2), Direction.NORTH), Pointing.RIGHT) - .rightClick(), - 60); + scene.overlay().showControls(util.vector().blockSurface(util.grid().at(3, 6, 2), Direction.NORTH), Pointing.RIGHT, 60) + .rightClick(); scene.idle(7); scene.effects().indicateSuccess(util.grid().at(3, 6, 2)); scene.world().movePulley(pulleyPos, 1, 0); @@ -373,11 +360,9 @@ public class ElevatorScenes { scene.idle(30); scene.world().showSectionAndMerge(util.select().position(nixiePos), Direction.DOWN, camLink); scene.idle(15); - scene.overlay().showControls( - new InputWindowElement(util.vector().blockSurface(util.grid().at(4, 1, 0), Direction.UP), Pointing.DOWN) + scene.overlay().showControls(util.vector().blockSurface(util.grid().at(4, 1, 0), Direction.UP), Pointing.DOWN, 15) .rightClick() - .withItem(AllBlocks.DISPLAY_LINK.asStack()), - 15); + .withItem(AllBlocks.DISPLAY_LINK.asStack()); scene.world().toggleRedstonePower(util.select().position(1, 14, 2)); scene.idle(15); scene.world().showSectionAndMerge(util.select().position(linkPos), Direction.DOWN, camLink); diff --git a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/FanScenes.java b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/FanScenes.java index 288f1d03c..8c0917317 100644 --- a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/FanScenes.java +++ b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/FanScenes.java @@ -6,16 +6,15 @@ import com.simibubi.create.foundation.ponder.CreateSceneBuilder; import com.simibubi.create.foundation.ponder.element.BeltItemElement; import net.createmod.catnip.utility.Pointing; +import net.createmod.ponder.api.PonderPalette; +import net.createmod.ponder.api.element.ElementLink; +import net.createmod.ponder.api.element.EntityElement; +import net.createmod.ponder.api.element.ParrotElement; +import net.createmod.ponder.api.element.ParrotPose; +import net.createmod.ponder.api.element.WorldSectionElement; import net.createmod.ponder.api.scene.SceneBuilder; import net.createmod.ponder.api.scene.SceneBuildingUtil; -import net.createmod.ponder.foundation.ElementLink; -import net.createmod.ponder.foundation.PonderPalette; -import net.createmod.ponder.foundation.Selection; -import net.createmod.ponder.foundation.element.EntityElement; -import net.createmod.ponder.foundation.element.InputWindowElement; -import net.createmod.ponder.foundation.element.ParrotElement; -import net.createmod.ponder.foundation.element.WorldSectionElement; -import net.createmod.ponder.foundation.instruction.EmitParticlesInstruction.Emitter; +import net.createmod.ponder.api.scene.Selection; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.core.particles.ParticleTypes; @@ -46,7 +45,7 @@ public class FanScenes { scene.idle(40); scene.effects().rotationDirectionIndicator(fanPos.south()); - ElementLink flappyBirb = scene.special().createBirb(util.vector().topOf(1, 0, 3), ParrotElement.FlappyPose::new); + ElementLink flappyBirb = scene.special().createBirb(util.vector().topOf(1, 0, 3), ParrotPose.FlappyPose::new); scene.idle(2); scene.special().rotateParrot(flappyBirb, 0, 235, 0, 30); scene.special().moveParrot(flappyBirb, util.vector().of(0, 0, -2.5), 30); @@ -108,7 +107,7 @@ public class FanScenes { scene.world().setBlock(blockPos, Blocks.LAVA.defaultBlockState(), false); scene.idle(10); - scene.overlay().showSelectionWithText(util.select().fromTo(blockPos, blockPos.west(2)), 80) + scene.overlay().showOutlineWithText(util.select().fromTo(blockPos, blockPos.west(2)), 80) .colored(PonderPalette.RED) .text("When passing through lava, the Air Flow becomes Heated"); scene.idle(80); @@ -122,10 +121,10 @@ public class FanScenes { scene.world().modifyEntity(entityLink, e -> e.setDeltaMovement(-0.2f, 0, 0)); Vec3 itemVec = util.vector().blockSurface(util.grid().at(1, 1, 2), Direction.EAST) .add(0.1, 0, 0); - scene.overlay().showControls(new InputWindowElement(itemVec, Pointing.DOWN).withItem(stack), 20); + scene.overlay().showControls(itemVec, Pointing.DOWN, 20).withItem(stack); scene.idle(20); - scene.effects().emitParticles(itemVec.add(0, 0.2f, 0), Emitter.simple(ParticleTypes.LARGE_SMOKE, Vec3.ZERO), 1, - 60); + scene.effects().emitParticles(itemVec.add(0, 0.2f, 0), scene.effects().simpleParticleEmitter(ParticleTypes.LARGE_SMOKE, Vec3.ZERO), 1, + 60); scene.overlay().showText(80) .colored(PonderPalette.WHITE) @@ -137,7 +136,7 @@ public class FanScenes { scene.idle(60); scene.world().modifyEntities(ItemEntity.class, ie -> ie.setItem(smelted)); scene.idle(40); - scene.overlay().showControls(new InputWindowElement(itemVec, Pointing.DOWN).withItem(smelted), 20); + scene.overlay().showControls(itemVec, Pointing.DOWN, 20).withItem(smelted); scene.idle(20); scene.world().modifyEntities(ItemEntity.class, Entity::discard); scene.idle(20); @@ -160,7 +159,7 @@ public class FanScenes { scene.world().moveSection(blockInFront, util.vector().of(1, 0, 2), 0); scene.idle(50); - scene.overlay().showSelectionWithText(util.select().fromTo(blockPos, blockPos.west(2)), 60) + scene.overlay().showOutlineWithText(util.select().fromTo(blockPos, blockPos.west(2)), 60) .colored(PonderPalette.BLACK) .attachKeyFrame() .text("Instead, a setup for Smoking using Fire should be used for them"); @@ -177,7 +176,7 @@ public class FanScenes { scene.world().moveSection(blockInFront, util.vector().of(1, 0, 2), 0); scene.idle(20); - scene.overlay().showSelectionWithText(util.select().fromTo(blockPos, blockPos.west(2)), 60) + scene.overlay().showOutlineWithText(util.select().fromTo(blockPos, blockPos.west(2)), 60) .colored(PonderPalette.MEDIUM) .attachKeyFrame() .text("Air Flows passing through water create a Washing Setup"); @@ -190,9 +189,9 @@ public class FanScenes { .above(2)), util.vector().of(0, 0.1, 0), stack); scene.idle(15); scene.world().modifyEntity(entityLink, e -> e.setDeltaMovement(-0.2f, 0, 0)); - scene.overlay().showControls(new InputWindowElement(itemVec, Pointing.DOWN).withItem(stack), 20); + scene.overlay().showControls(itemVec, Pointing.DOWN, 20).withItem(stack); scene.idle(20); - scene.effects().emitParticles(itemVec.add(0, 0.2f, 0), Emitter.simple(ParticleTypes.SPIT, Vec3.ZERO), 1, 60); + scene.effects().emitParticles(itemVec.add(0, 0.2f, 0), scene.effects().simpleParticleEmitter(ParticleTypes.SPIT, Vec3.ZERO), 1, 60); scene.overlay().showText(50) .colored(PonderPalette.WHITE) @@ -202,7 +201,7 @@ public class FanScenes { scene.idle(60); scene.world().modifyEntities(ItemEntity.class, ie -> ie.setItem(washed)); - scene.overlay().showControls(new InputWindowElement(itemVec, Pointing.DOWN).withItem(washed), 20); + scene.overlay().showControls(itemVec, Pointing.DOWN, 20).withItem(washed); scene.idle(20); scene.world().modifyEntities(ItemEntity.class, Entity::discard); scene.idle(20); @@ -239,11 +238,11 @@ public class FanScenes { scene.idle(10); Vec3 depotTop = util.vector().topOf(2, 1, 2) .add(0, 0.25, 0); - scene.effects().emitParticles(depotTop, Emitter.simple(ParticleTypes.SPIT, Vec3.ZERO), .5f, 30); + scene.effects().emitParticles(depotTop, scene.effects().simpleParticleEmitter(ParticleTypes.SPIT, Vec3.ZERO), .5f, 30); scene.idle(30); scene.world().modifyBlockEntityNBT(util.select().position(depos), DepotBlockEntity.class, nbt -> nbt.put("HeldItem", new TransportedItemStack(clay).serializeNBT())); - scene.effects().emitParticles(depotTop, Emitter.simple(ParticleTypes.SPIT, Vec3.ZERO), .5f, 30); + scene.effects().emitParticles(depotTop, scene.effects().simpleParticleEmitter(ParticleTypes.SPIT, Vec3.ZERO), .5f, 30); scene.overlay().showText(90) .pointAt(depotTop) .attachKeyFrame() @@ -261,10 +260,10 @@ public class FanScenes { ElementLink transported = scene.world().createItemOnBelt(util.grid().at(3, 3, 3), Direction.SOUTH, sand); scene.idle(60); - scene.effects().emitParticles(depotTop, Emitter.simple(ParticleTypes.SPIT, Vec3.ZERO), .5f, 25); + scene.effects().emitParticles(depotTop, scene.effects().simpleParticleEmitter(ParticleTypes.SPIT, Vec3.ZERO), .5f, 25); scene.idle(25); scene.world().changeBeltItemTo(transported, new ItemStack(Items.CLAY_BALL)); - scene.effects().emitParticles(depotTop, Emitter.simple(ParticleTypes.SPIT, Vec3.ZERO), .5f, 25); + scene.effects().emitParticles(depotTop, scene.effects().simpleParticleEmitter(ParticleTypes.SPIT, Vec3.ZERO), .5f, 25); scene.idle(60); scene.world().setKineticSpeed(util.select().position(1, 2, 4) diff --git a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/FunnelScenes.java b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/FunnelScenes.java index 4090e8524..82af5c1bb 100644 --- a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/FunnelScenes.java +++ b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/FunnelScenes.java @@ -8,14 +8,13 @@ import com.simibubi.create.content.logistics.funnel.FunnelBlockEntity; import com.simibubi.create.foundation.ponder.CreateSceneBuilder; import net.createmod.catnip.utility.Pointing; +import net.createmod.ponder.api.PonderPalette; +import net.createmod.ponder.api.element.ElementLink; +import net.createmod.ponder.api.element.EntityElement; +import net.createmod.ponder.api.element.WorldSectionElement; import net.createmod.ponder.api.scene.SceneBuilder; import net.createmod.ponder.api.scene.SceneBuildingUtil; -import net.createmod.ponder.foundation.ElementLink; -import net.createmod.ponder.foundation.PonderPalette; -import net.createmod.ponder.foundation.Selection; -import net.createmod.ponder.foundation.element.EntityElement; -import net.createmod.ponder.foundation.element.InputWindowElement; -import net.createmod.ponder.foundation.element.WorldSectionElement; +import net.createmod.ponder.api.scene.Selection; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.world.entity.Entity; @@ -127,9 +126,6 @@ public class FunnelScenes { Vec3 topCenter = util.vector().centerOf(topFunnel); Vec3 topSide = util.vector().blockSurface(topFunnel, Direction.EAST); - InputWindowElement controlsSneak = new InputWindowElement(topCenter, Pointing.DOWN).rightClick() - .whileSneaking(); - // Placing funnels without sneak scene.world().showSection(topFunnelSelection, Direction.DOWN); scene.overlay().showText(80) @@ -152,7 +148,8 @@ public class FunnelScenes { scene.idle(5); scene.world().showSection(topFunnelSelection, Direction.DOWN); - scene.overlay().showControls(controlsSneak, 35); + scene.overlay().showControls(topCenter, Pointing.DOWN, 35).rightClick() + .whileSneaking(); scene.overlay().showText(80) .text("Placed while sneaking, it puts items into the inventory.") .attachKeyFrame() @@ -167,9 +164,8 @@ public class FunnelScenes { scene.idle(45); // Wrench interaction - InputWindowElement wrenchControls = new InputWindowElement(topSide, Pointing.RIGHT).rightClick() + scene.overlay().showControls(topSide, Pointing.RIGHT, 40).rightClick() .withItem(AllItems.WRENCH.asStack()); - scene.overlay().showControls(wrenchControls, 40); scene.idle(10); scene.world().modifyBlock(topFunnel, s -> s.cycle(FunnelBlock.EXTRACTING), true); scene.idle(10); @@ -182,7 +178,8 @@ public class FunnelScenes { itemLink = scene.world().createItemEntity(topCenter, util.vector().of(0, 4 / 16f, 0), itemStack); scene.idle(30); - scene.overlay().showControls(wrenchControls, 40); + scene.overlay().showControls(topSide, Pointing.RIGHT, 40).rightClick() + .withItem(AllItems.WRENCH.asStack()); scene.idle(10); scene.world().modifyBlock(topFunnel, s -> s.cycle(FunnelBlock.EXTRACTING), true); scene.idle(10); @@ -404,7 +401,7 @@ public class FunnelScenes { filter = filter.add(0, -5 / 16f, -1.5 / 16f); scene.overlay().showFilterSlotInput(filter, Direction.NORTH, 80); - scene.overlay().showControls(new InputWindowElement(filter, Pointing.DOWN).rightClick(), 60); + scene.overlay().showControls(filter, Pointing.DOWN, 60).rightClick(); scene.idle(10); scene.overlay().showText(80) .text("The value panel allows for precise control over the extracted stack size.") @@ -446,8 +443,8 @@ public class FunnelScenes { if (i == 2) { scene.overlay().showFilterSlotInput(filter, Direction.NORTH, 40); - scene.overlay().showControls(new InputWindowElement(filter, Pointing.DOWN).rightClick() - .withItem(emerald), 60); + scene.overlay().showControls(filter, Pointing.DOWN, 60).rightClick() + .withItem(emerald); scene.idle(10); scene.overlay().showText(80) .text("Using items on the filter slot will restrict the funnel to only transfer matching stacks.") @@ -484,7 +481,7 @@ public class FunnelScenes { scene.world().showSection(funnelSelect, Direction.DOWN); scene.idle(20); - scene.overlay().showSelectionWithText(funnelSelect, 40) + scene.overlay().showOutlineWithText(funnelSelect, 40) .colored(PonderPalette.RED) .text("Funnels cannot ever transfer between closed inventories directly.") .attachKeyFrame() diff --git a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/GantryScenes.java b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/GantryScenes.java index adc7a953a..2f1464cfc 100644 --- a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/GantryScenes.java +++ b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/GantryScenes.java @@ -5,13 +5,12 @@ import com.simibubi.create.foundation.ponder.CreateSceneBuilder; import net.createmod.catnip.utility.Iterate; import net.createmod.catnip.utility.Pointing; +import net.createmod.ponder.api.PonderPalette; +import net.createmod.ponder.api.element.ElementLink; +import net.createmod.ponder.api.element.WorldSectionElement; import net.createmod.ponder.api.scene.SceneBuilder; import net.createmod.ponder.api.scene.SceneBuildingUtil; -import net.createmod.ponder.foundation.ElementLink; -import net.createmod.ponder.foundation.PonderPalette; -import net.createmod.ponder.foundation.Selection; -import net.createmod.ponder.foundation.element.InputWindowElement; -import net.createmod.ponder.foundation.element.WorldSectionElement; +import net.createmod.ponder.api.scene.Selection; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.world.level.block.Blocks; @@ -82,8 +81,8 @@ public class GantryScenes { scene.overlay().showOutline(PonderPalette.GREEN, "glue", util.select().position(3, 4, 2) .add(util.select().fromTo(3, 3, 2, 5, 3, 2)) .add(util.select().position(5, 3, 1)), 40); - scene.overlay().showControls(new InputWindowElement(util.vector().centerOf(util.grid().at(3, 3, 2)), Pointing.UP) - .withItem(AllItems.SUPER_GLUE.asStack()), 40); + scene.overlay().showControls(util.vector().centerOf(util.grid().at(3, 3, 2)), Pointing.UP, 40) + .withItem(AllItems.SUPER_GLUE.asStack()); scene.effects().superGlue(util.grid().at(5, 3, 1), Direction.SOUTH, true); scene.idle(20); scene.overlay().showText(80) diff --git a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/ItemVaultScenes.java b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/ItemVaultScenes.java index f7f61879c..8eeb84ba0 100644 --- a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/ItemVaultScenes.java +++ b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/ItemVaultScenes.java @@ -5,13 +5,12 @@ import com.simibubi.create.foundation.gui.AllIcons; import com.simibubi.create.foundation.ponder.CreateSceneBuilder; import net.createmod.catnip.utility.Pointing; +import net.createmod.ponder.api.PonderPalette; +import net.createmod.ponder.api.element.ElementLink; +import net.createmod.ponder.api.element.WorldSectionElement; import net.createmod.ponder.api.scene.SceneBuilder; import net.createmod.ponder.api.scene.SceneBuildingUtil; -import net.createmod.ponder.foundation.ElementLink; -import net.createmod.ponder.foundation.PonderPalette; -import net.createmod.ponder.foundation.Selection; -import net.createmod.ponder.foundation.element.InputWindowElement; -import net.createmod.ponder.foundation.element.WorldSectionElement; +import net.createmod.ponder.api.scene.Selection; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.world.item.ItemStack; @@ -60,10 +59,9 @@ public class ItemVaultScenes { scene.idle(15); ItemStack hand = AllItems.BRASS_HAND.asStack(); - scene.overlay() - .showControls(new InputWindowElement(util.vector().blockSurface(frontVault, Direction.NORTH), Pointing.RIGHT) + scene.overlay().showControls(util.vector().blockSurface(frontVault, Direction.NORTH), Pointing.RIGHT, 40) .showing(AllIcons.I_MTD_CLOSE) - .withItem(hand), 40); + .withItem(hand); scene.idle(7); scene.overlay().showText(60) diff --git a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/KineticsScenes.java b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/KineticsScenes.java index b2531c61a..6490e0ea5 100644 --- a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/KineticsScenes.java +++ b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/KineticsScenes.java @@ -18,13 +18,12 @@ import com.simibubi.create.foundation.ponder.CreateSceneBuilder; import com.tterrag.registrate.util.entry.BlockEntry; import net.createmod.catnip.utility.Pointing; +import net.createmod.ponder.api.PonderPalette; +import net.createmod.ponder.api.element.ElementLink; +import net.createmod.ponder.api.element.WorldSectionElement; import net.createmod.ponder.api.scene.SceneBuilder; import net.createmod.ponder.api.scene.SceneBuildingUtil; -import net.createmod.ponder.foundation.ElementLink; -import net.createmod.ponder.foundation.PonderPalette; -import net.createmod.ponder.foundation.Selection; -import net.createmod.ponder.foundation.element.InputWindowElement; -import net.createmod.ponder.foundation.element.WorldSectionElement; +import net.createmod.ponder.api.scene.Selection; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.core.Direction.Axis; @@ -89,8 +88,8 @@ public class KineticsScenes { BlockEntry andesiteEncased = AllBlocks.ANDESITE_ENCASED_SHAFT; ItemStack andesiteCasingItem = AllBlocks.ANDESITE_CASING.asStack(); - scene.overlay().showControls(new InputWindowElement(util.vector().topOf(3, 1, 2), Pointing.DOWN).rightClick() - .withItem(andesiteCasingItem), 60); + scene.overlay().showControls(util.vector().topOf(3, 1, 2), Pointing.DOWN, 60).rightClick() + .withItem(andesiteCasingItem); scene.idle(7); scene.world().setBlocks(andesite, andesiteEncased.getDefaultState() .setValue(EncasedShaftBlock.AXIS, Axis.X), true); @@ -100,8 +99,8 @@ public class KineticsScenes { BlockEntry brassEncased = AllBlocks.BRASS_ENCASED_SHAFT; ItemStack brassCasingItem = AllBlocks.BRASS_CASING.asStack(); - scene.overlay().showControls(new InputWindowElement(util.vector().topOf(1, 0, 2), Pointing.UP).rightClick() - .withItem(brassCasingItem), 60); + scene.overlay().showControls(util.vector().topOf(1, 0, 2), Pointing.UP, 60).rightClick() + .withItem(brassCasingItem); scene.idle(7); scene.world().setBlocks(brass, brassEncased.getDefaultState() .setValue(EncasedShaftBlock.AXIS, Axis.X), true); @@ -327,8 +326,8 @@ public class KineticsScenes { BlockEntry andesiteEncased = AllBlocks.ANDESITE_ENCASED_COGWHEEL; ItemStack andesiteCasingItem = AllBlocks.ANDESITE_CASING.asStack(); - scene.overlay().showControls(new InputWindowElement(util.vector().topOf(3, 0, 2), Pointing.UP).rightClick() - .withItem(andesiteCasingItem), 100); + scene.overlay().showControls(util.vector().topOf(3, 0, 2), Pointing.UP, 100).rightClick() + .withItem(andesiteCasingItem); scene.idle(7); scene.world().setBlocks(util.select().position(3, 1, 2), andesiteEncased.getDefaultState() .setValue(EncasedCogwheelBlock.AXIS, Axis.Y) @@ -336,8 +335,8 @@ public class KineticsScenes { scene.world().setKineticSpeed(util.select().position(3, 1, 2), -32); scene.idle(15); - scene.overlay().showControls(new InputWindowElement(util.vector().topOf(2, 1, 2), Pointing.DOWN).rightClick() - .withItem(andesiteCasingItem), 30); + scene.overlay().showControls(util.vector().topOf(2, 1, 2), Pointing.DOWN, 30).rightClick() + .withItem(andesiteCasingItem); scene.idle(7); scene.world().setBlocks(small2, andesiteEncased.getDefaultState() .setValue(EncasedCogwheelBlock.AXIS, Axis.Y), true); @@ -347,8 +346,8 @@ public class KineticsScenes { BlockEntry brassEncased = AllBlocks.BRASS_ENCASED_LARGE_COGWHEEL; ItemStack brassCasingItem = AllBlocks.BRASS_CASING.asStack(); - scene.overlay().showControls(new InputWindowElement(util.vector().topOf(1, 0, 3), Pointing.UP).rightClick() - .withItem(brassCasingItem), 60); + scene.overlay().showControls(util.vector().topOf(1, 0, 3), Pointing.UP, 60).rightClick() + .withItem(brassCasingItem); scene.idle(7); scene.world().setBlocks(util.select().position(1, 1, 3), brassEncased.getDefaultState() .setValue(EncasedCogwheelBlock.AXIS, Axis.Y), true); @@ -378,8 +377,8 @@ public class KineticsScenes { scene.addKeyframe(); Vec3 wrenchHere = util.vector().topOf(2, 1, 2) .add(.25, 0, -.25); - scene.overlay().showControls(new InputWindowElement(wrenchHere, Pointing.RIGHT).rightClick() - .withItem(AllItems.WRENCH.asStack()), 25); + scene.overlay().showControls(wrenchHere, Pointing.RIGHT, 25).rightClick() + .withItem(AllItems.WRENCH.asStack()); scene.idle(7); scene.world().cycleBlockProperty(util.grid().at(2, 1, 2), EncasedCogwheelBlock.TOP_SHAFT); scene.idle(15); @@ -396,8 +395,8 @@ public class KineticsScenes { .pointAt(wrenchHere.add(-.5, 0, .5)); scene.idle(40); - scene.overlay().showControls(new InputWindowElement(wrenchHere, Pointing.RIGHT).rightClick() - .withItem(AllItems.WRENCH.asStack()), 25); + scene.overlay().showControls(wrenchHere, Pointing.RIGHT, 25).rightClick() + .withItem(AllItems.WRENCH.asStack()); scene.idle(7); scene.world().cycleBlockProperty(util.grid().at(2, 1, 2), EncasedCogwheelBlock.TOP_SHAFT); scene.world().setKineticSpeed(shaft2, 0); @@ -612,7 +611,7 @@ public class KineticsScenes { Vec3 blockSurface = util.vector().blockSurface(motor, Direction.NORTH) .add(1 / 16f, 0, 3 / 16f); scene.overlay().showFilterSlotInput(blockSurface, Direction.NORTH, 80); - scene.overlay().showControls(new InputWindowElement(blockSurface, Pointing.DOWN).rightClick(), 60); + scene.overlay().showControls(blockSurface, Pointing.DOWN, 60).rightClick(); scene.idle(20); scene.overlay().showText(60) @@ -703,8 +702,8 @@ public class KineticsScenes { scene.idle(5); ItemStack crimsonPlanks = new ItemStack(Items.CRIMSON_PLANKS); - scene.overlay().showControls(new InputWindowElement(util.vector().topOf(wheel), Pointing.DOWN).rightClick() - .withItem(crimsonPlanks), 20); + scene.overlay().showControls(util.vector().topOf(wheel), Pointing.DOWN, 20).rightClick() + .withItem(crimsonPlanks); scene.idle(7); scene.world().modifyBlockEntity(wheel, WaterWheelBlockEntity.class, be -> be.applyMaterialIfValid(crimsonPlanks)); scene.overlay().showText(50) @@ -715,15 +714,15 @@ public class KineticsScenes { scene.idle(40); ItemStack birchPlanks = new ItemStack(Items.BIRCH_PLANKS); - scene.overlay().showControls(new InputWindowElement(util.vector().topOf(wheel), Pointing.DOWN).rightClick() - .withItem(birchPlanks), 20); + scene.overlay().showControls(util.vector().topOf(wheel), Pointing.DOWN, 20).rightClick() + .withItem(birchPlanks); scene.idle(7); scene.world().modifyBlockEntity(wheel, WaterWheelBlockEntity.class, be -> be.applyMaterialIfValid(birchPlanks)); scene.idle(40); ItemStack junglePlanks = new ItemStack(Items.JUNGLE_PLANKS); - scene.overlay().showControls(new InputWindowElement(util.vector().topOf(wheel), Pointing.DOWN).rightClick() - .withItem(junglePlanks), 20); + scene.overlay().showControls(util.vector().topOf(wheel), Pointing.DOWN, 20).rightClick() + .withItem(junglePlanks); scene.idle(7); scene.world().modifyBlockEntity(wheel, WaterWheelBlockEntity.class, be -> be.applyMaterialIfValid(junglePlanks)); scene.idle(20); @@ -834,8 +833,8 @@ public class KineticsScenes { scene.idle(5); ItemStack crimsonPlanks = new ItemStack(Items.CRIMSON_PLANKS); - scene.overlay().showControls(new InputWindowElement(util.vector().topOf(target), Pointing.DOWN).rightClick() - .withItem(crimsonPlanks), 20); + scene.overlay().showControls(util.vector().topOf(target), Pointing.DOWN, 20).rightClick() + .withItem(crimsonPlanks); scene.idle(7); scene.world().modifyBlockEntity(wheel, WaterWheelBlockEntity.class, be -> be.applyMaterialIfValid(crimsonPlanks)); scene.overlay().showText(50) @@ -846,15 +845,15 @@ public class KineticsScenes { scene.idle(40); ItemStack birchPlanks = new ItemStack(Items.BIRCH_PLANKS); - scene.overlay().showControls(new InputWindowElement(util.vector().topOf(target), Pointing.DOWN).rightClick() - .withItem(birchPlanks), 20); + scene.overlay().showControls(util.vector().topOf(target), Pointing.DOWN, 20).rightClick() + .withItem(birchPlanks); scene.idle(7); scene.world().modifyBlockEntity(wheel, WaterWheelBlockEntity.class, be -> be.applyMaterialIfValid(birchPlanks)); scene.idle(40); ItemStack junglePlanks = new ItemStack(Items.JUNGLE_PLANKS); - scene.overlay().showControls(new InputWindowElement(util.vector().topOf(target), Pointing.DOWN).rightClick() - .withItem(junglePlanks), 20); + scene.overlay().showControls(util.vector().topOf(target), Pointing.DOWN, 20).rightClick() + .withItem(junglePlanks); scene.idle(7); scene.world().modifyBlockEntity(wheel, WaterWheelBlockEntity.class, be -> be.applyMaterialIfValid(junglePlanks)); scene.idle(20); @@ -891,7 +890,7 @@ public class KineticsScenes { .pointAt(sideOf); scene.idle(80); - scene.overlay().showControls(new InputWindowElement(centerOf, Pointing.DOWN).rightClick(), 40); + scene.overlay().showControls(centerOf, Pointing.DOWN, 40).rightClick(); scene.idle(7); scene.world().setKineticSpeed(util.select().everywhere(), 32); scene.world().modifyKineticSpeed(util.select().column(1, 3), f -> f * -2); @@ -908,8 +907,8 @@ public class KineticsScenes { scene.world().setKineticSpeed(util.select().everywhere(), 0); scene.idle(15); - scene.overlay().showControls(new InputWindowElement(centerOf, Pointing.DOWN).rightClick() - .whileSneaking(), 40); + scene.overlay().showControls(centerOf, Pointing.DOWN, 40).rightClick() + .whileSneaking(); scene.idle(7); scene.world().setKineticSpeed(util.select().everywhere(), -32); scene.world().modifyKineticSpeed(util.select().column(1, 3), f -> f * -2); @@ -972,7 +971,7 @@ public class KineticsScenes { scene.overlay().chaseBoundingBoxOutline(PonderPalette.WHITE, blockSurface, point, 1); scene.idle(1); scene.overlay().chaseBoundingBoxOutline(PonderPalette.WHITE, blockSurface, expanded, 80); - scene.overlay().showControls(new InputWindowElement(blockSurface, Pointing.DOWN).rightClick(), 60); + scene.overlay().showControls(blockSurface, Pointing.DOWN, 60).rightClick(); scene.idle(10); scene.overlay().showText(60) @@ -982,7 +981,7 @@ public class KineticsScenes { .pointAt(blockSurface); scene.idle(70); - scene.overlay().showControls(new InputWindowElement(topOf, Pointing.DOWN).rightClick(), 40); + scene.overlay().showControls(topOf, Pointing.DOWN, 40).rightClick(); scene.idle(7); scene.world().rotateSection(valve, 0, 0, 90, 30); scene.world().rotateSection(contraption, 0, 0, 90, 30); @@ -1000,8 +999,8 @@ public class KineticsScenes { scene.world().setKineticSpeed(util.select().everywhere(), 0); scene.idle(25); - scene.overlay().showControls(new InputWindowElement(topOf, Pointing.DOWN).rightClick() - .whileSneaking(), 40); + scene.overlay().showControls(topOf, Pointing.DOWN, 40).rightClick() + .whileSneaking(); scene.idle(7); scene.world().rotateSection(valve, 0, 0, -90, 30); scene.world().rotateSection(contraption, 0, 0, -90, 30); @@ -1035,8 +1034,8 @@ public class KineticsScenes { scene.idle(90); scene.addKeyframe(); - scene.overlay().showControls(new InputWindowElement(topOf, Pointing.DOWN).rightClick() - .withItem(new ItemStack(Items.BLUE_DYE)), 40); + scene.overlay().showControls(topOf, Pointing.DOWN, 40).rightClick() + .withItem(new ItemStack(Items.BLUE_DYE)); scene.idle(7); scene.world().modifyBlock(valvePos, s -> AllBlocks.DYED_VALVE_HANDLES.get(DyeColor.BLUE) .getDefaultState() @@ -1086,9 +1085,9 @@ public class KineticsScenes { .placeNearTarget(); scene.idle(80); - scene.overlay().showControls(new InputWindowElement(top, Pointing.DOWN).rightClick(), 40); + scene.overlay().showControls(top, Pointing.DOWN, 40).rightClick(); scene.idle(7); - scene.overlay().showSelectionWithText(gearshiftSelection, 50) + scene.overlay().showOutlineWithText(gearshiftSelection, 50) .colored(PonderPalette.BLUE) .text("Right-click it to open the Configuration UI") .pointAt(top) @@ -1259,21 +1258,20 @@ public class KineticsScenes { .text("Using the value panel on its side, the conveyed speed can be configured"); scene.idle(80); - InputWindowElement input = new InputWindowElement(inputVec, Pointing.UP).rightClick(); - scene.overlay().showControls(input, 40); + scene.overlay().showControls(inputVec, Pointing.UP, 40).rightClick(); scene.idle(15); scene.world().multiplyKineticSpeed(util.select().fromTo(1, 2, 1, 1, 2, 3), 4); scene.effects().rotationSpeedIndicator(cogPos); scene.idle(55); scene.markAsFinished(); - scene.overlay().showControls(input, 30); + scene.overlay().showControls(inputVec, Pointing.UP, 30).rightClick(); scene.idle(15); scene.world().multiplyKineticSpeed(util.select().fromTo(1, 2, 1, 1, 2, 3), 4); scene.effects().rotationSpeedIndicator(cogPos); scene.idle(55); - scene.overlay().showControls(input, 30); + scene.overlay().showControls(inputVec, Pointing.UP, 30).rightClick(); scene.idle(15); scene.world().multiplyKineticSpeed(util.select().fromTo(1, 2, 1, 1, 2, 3), -.05f); scene.effects().rotationSpeedIndicator(cogPos); @@ -1345,8 +1343,7 @@ public class KineticsScenes { scene.idle(30); Vec3 blockSurface = util.vector().blockSurface(gaugePos, Direction.NORTH); - scene.overlay().showControls( - new InputWindowElement(blockSurface, Pointing.RIGHT).withItem(AllItems.GOGGLES.asStack()), 80); + scene.overlay().showControls(blockSurface, Pointing.RIGHT, 80).withItem(AllItems.GOGGLES.asStack()); scene.idle(7); scene.overlay().showText(80) .text("When wearing Engineers' Goggles, the player can get more detailed information from the Gauge") diff --git a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/MechanicalDrillScenes.java b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/MechanicalDrillScenes.java index 4e95a7025..74ebd73df 100644 --- a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/MechanicalDrillScenes.java +++ b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/MechanicalDrillScenes.java @@ -3,13 +3,12 @@ package com.simibubi.create.infrastructure.ponder.scenes; import com.simibubi.create.foundation.ponder.CreateSceneBuilder; import net.createmod.catnip.utility.Pointing; +import net.createmod.ponder.api.element.ElementLink; +import net.createmod.ponder.api.element.EntityElement; +import net.createmod.ponder.api.element.WorldSectionElement; import net.createmod.ponder.api.scene.SceneBuilder; import net.createmod.ponder.api.scene.SceneBuildingUtil; -import net.createmod.ponder.foundation.ElementLink; -import net.createmod.ponder.foundation.Selection; -import net.createmod.ponder.foundation.element.EntityElement; -import net.createmod.ponder.foundation.element.InputWindowElement; -import net.createmod.ponder.foundation.element.WorldSectionElement; +import net.createmod.ponder.api.scene.Selection; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.world.entity.Entity; @@ -199,8 +198,8 @@ public class MechanicalDrillScenes { scene.idle(20); scene.world().setKineticSpeed(drills, 0); scene.idle(10); - scene.overlay().showControls(new InputWindowElement(util.vector().topOf(2, 3, 2), Pointing.DOWN) - .withItem(new ItemStack(Blocks.OAK_PLANKS)), 60); + scene.overlay().showControls(util.vector().topOf(2, 3, 2), Pointing.DOWN, 60) + .withItem(new ItemStack(Blocks.OAK_PLANKS)); scene.idle(20); } diff --git a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/MechanicalSawScenes.java b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/MechanicalSawScenes.java index 6e111b494..1a0cefd8e 100644 --- a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/MechanicalSawScenes.java +++ b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/MechanicalSawScenes.java @@ -6,14 +6,13 @@ import com.simibubi.create.content.kinetics.simpleRelays.ShaftBlock; import com.simibubi.create.foundation.ponder.CreateSceneBuilder; import net.createmod.catnip.utility.Pointing; +import net.createmod.ponder.api.PonderPalette; +import net.createmod.ponder.api.element.ElementLink; +import net.createmod.ponder.api.element.EntityElement; +import net.createmod.ponder.api.element.WorldSectionElement; import net.createmod.ponder.api.scene.SceneBuilder; import net.createmod.ponder.api.scene.SceneBuildingUtil; -import net.createmod.ponder.foundation.ElementLink; -import net.createmod.ponder.foundation.PonderPalette; -import net.createmod.ponder.foundation.Selection; -import net.createmod.ponder.foundation.element.EntityElement; -import net.createmod.ponder.foundation.element.InputWindowElement; -import net.createmod.ponder.foundation.element.WorldSectionElement; +import net.createmod.ponder.api.scene.Selection; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.core.Direction.Axis; @@ -62,7 +61,7 @@ public class MechanicalSawScenes { ElementLink logItem = scene.world().createItemEntity(itemSpawn, util.vector().of(0, 0, 0), log); scene.idle(12); - scene.overlay().showControls(new InputWindowElement(itemSpawn, Pointing.DOWN).withItem(log), 20); + scene.overlay().showControls(itemSpawn, Pointing.DOWN, 20).withItem(log); scene.idle(10); scene.world().modifyEntity(logItem, e -> e.setDeltaMovement(util.vector().of(0.05, 0.2, 0))); @@ -75,8 +74,7 @@ public class MechanicalSawScenes { logItem = scene.world().createItemEntity(util.vector().topOf(sawPos) .add(0.5, -.1, 0), util.vector().of(0.05, 0.18, 0), strippedLog); scene.idle(12); - scene.overlay().showControls(new InputWindowElement(itemSpawn.add(2, 0, 0), Pointing.DOWN).withItem(strippedLog), - 20); + scene.overlay().showControls(itemSpawn.add(2, 0, 0), Pointing.DOWN, 20).withItem(strippedLog); scene.idle(30); scene.overlay().showText(60) @@ -154,7 +152,7 @@ public class MechanicalSawScenes { scene.idle(90); ItemStack bricks = new ItemStack(Blocks.STONE_BRICKS); - scene.overlay().showControls(new InputWindowElement(filter, Pointing.DOWN).withItem(bricks), 30); + scene.overlay().showControls(filter, Pointing.DOWN, 30).withItem(bricks); scene.world().modifyEntities(ItemEntity.class, Entity::discard); scene.idle(7); scene.world().setFilterData(util.select().position(sawPos), SawBlockEntity.class, bricks); @@ -240,7 +238,7 @@ public class MechanicalSawScenes { scene.world().hideSection(util.select().fromTo(2, 1, 2, 1, 1, 3) .substract(util.select().position(breakingPos)), Direction.WEST); scene.idle(10); - scene.overlay().showSelectionWithText(util.select().position(breakingPos), 90) + scene.overlay().showOutlineWithText(util.select().position(breakingPos), 90) .attachKeyFrame() .colored(PonderPalette.GREEN) .placeNearTarget() @@ -392,9 +390,7 @@ public class MechanicalSawScenes { scene.idle(20); scene.world().setKineticSpeed(saws, 0); scene.idle(10); - scene.overlay().showControls( - new InputWindowElement(util.vector().topOf(3, 2, 2), Pointing.DOWN).withItem(new ItemStack(Blocks.OAK_LOG)), - 60); + scene.overlay().showControls(util.vector().topOf(3, 2, 2), Pointing.DOWN, 60).withItem(new ItemStack(Blocks.OAK_LOG)); scene.idle(20); } diff --git a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/MovementActorScenes.java b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/MovementActorScenes.java index 61fb3744d..100875d89 100644 --- a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/MovementActorScenes.java +++ b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/MovementActorScenes.java @@ -9,15 +9,15 @@ import com.simibubi.create.content.contraptions.chassis.LinearChassisBlock; import com.simibubi.create.foundation.ponder.CreateSceneBuilder; import net.createmod.catnip.utility.Pointing; +import net.createmod.ponder.api.PonderPalette; +import net.createmod.ponder.api.element.ElementLink; +import net.createmod.ponder.api.element.EntityElement; +import net.createmod.ponder.api.element.ParrotElement; +import net.createmod.ponder.api.element.ParrotPose; +import net.createmod.ponder.api.element.WorldSectionElement; import net.createmod.ponder.api.scene.SceneBuilder; import net.createmod.ponder.api.scene.SceneBuildingUtil; -import net.createmod.ponder.foundation.ElementLink; -import net.createmod.ponder.foundation.PonderPalette; -import net.createmod.ponder.foundation.Selection; -import net.createmod.ponder.foundation.element.EntityElement; -import net.createmod.ponder.foundation.element.InputWindowElement; -import net.createmod.ponder.foundation.element.ParrotElement; -import net.createmod.ponder.foundation.element.WorldSectionElement; +import net.createmod.ponder.api.scene.Selection; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.world.entity.Entity; @@ -72,7 +72,7 @@ public class MovementActorScenes { BlockPos psi2 = psi.west(2); scene.world().showSection(util.select().position(psi2), Direction.DOWN); - scene.overlay().showSelectionWithText(util.select().position(psi.west()), 50) + scene.overlay().showOutlineWithText(util.select().position(psi.west()), 50) .colored(PonderPalette.RED) .placeNearTarget() .attachKeyFrame() @@ -101,7 +101,7 @@ public class MovementActorScenes { scene.overlay().showOutline(PonderPalette.GREEN, psi, util.select().fromTo(5, 3, 2, 6, 3, 2), 80); scene.idle(10); - scene.overlay().showSelectionWithText(util.select().position(psi2), 70) + scene.overlay().showOutlineWithText(util.select().position(psi2), 70) .placeNearTarget() .colored(PonderPalette.GREEN) .attachKeyFrame() @@ -130,8 +130,7 @@ public class MovementActorScenes { scene.idle(10); scene.world().modifyEntity(entity2, Entity::discard); - scene.overlay() - .showControls(new InputWindowElement(util.vector().topOf(5, 3, 2), Pointing.DOWN).withItem(itemStack), 40); + scene.overlay().showControls(util.vector().topOf(5, 3, 2), Pointing.DOWN, 40).withItem(itemStack); scene.idle(30); scene.world().hideSection(util.select().position(hopper), Direction.UP); @@ -198,7 +197,7 @@ public class MovementActorScenes { scene.idle(10); - scene.overlay().showSelectionWithText(util.select().position(1, 1, 3), 120) + scene.overlay().showOutlineWithText(util.select().position(1, 1, 3), 120) .colored(PonderPalette.RED) .text("Redstone power will prevent the stationary interface from engaging"); @@ -331,8 +330,7 @@ public class MovementActorScenes { scene.world().setBlock(current, harvested, true); scene.idle(116); - scene.overlay() - .showControls(new InputWindowElement(util.vector().topOf(1, 2, 5), Pointing.DOWN).withItem(wheatItem), 50); + scene.overlay().showControls(util.vector().topOf(1, 2, 5), Pointing.DOWN, 50).withItem(wheatItem); for (int i = 0; i < 3; i++) scene.world().modifyBlockEntity(util.grid().at(i, 1, 4), HarvesterBlockEntity.class, hte -> hte.setAnimatedSpeed(0)); @@ -432,9 +430,7 @@ public class MovementActorScenes { scene.world().destroyBlock(util.grid().at(1, 1, 2)); scene.idle(15); - scene.overlay().showControls( - new InputWindowElement(util.vector().topOf(2, 2, 2), Pointing.DOWN).withItem(new ItemStack(Items.SNOWBALL)), - 40); + scene.overlay().showControls(util.vector().topOf(2, 2, 2), Pointing.DOWN, 40).withItem(new ItemStack(Items.SNOWBALL)); scene.idle(40); scene.world().hideIndependentSection(chest, Direction.UP); scene.world().modifyKineticSpeed(util.select().everywhere(), f -> -f); @@ -497,7 +493,7 @@ public class MovementActorScenes { scene.idle(10); ElementLink birb = scene.special().createBirb(util.vector().topOf(3, 0, 2) - .add(0, 0, 0.5), ParrotElement.FlappyPose::new); + .add(0, 0, 0.5), ParrotPose.FlappyPose::new); scene.idle(11); scene.world().modifyKineticSpeed(util.select().everywhere(), f -> -2 * f); @@ -617,8 +613,7 @@ public class MovementActorScenes { scene.idle(10); scene.world().modifyBlockEntity(harvesterPos, HarvesterBlockEntity.class, hte -> hte.setAnimatedSpeed(0)); scene.world().setKineticSpeed(util.select().position(drillPos), 0); - scene.overlay().showControls(new InputWindowElement(util.vector().of(1.5, 2.75, 4.5), Pointing.DOWN).rightClick(), - 15); + scene.overlay().showControls(util.vector().of(1.5, 2.75, 4.5), Pointing.DOWN, 15).rightClick(); scene.idle(7); scene.world().modifyBlockEntity(controlsPos1, ContraptionControlsBlockEntity.class, ccte -> ccte.disabled = true); scene.effects().indicateRedstone(util.grid().at(1, 2, 4)); @@ -627,8 +622,7 @@ public class MovementActorScenes { scene.world().rotateSection(contraptionLink, 0, -60, 0, 40); scene.idle(40); - scene.overlay().showControls(new InputWindowElement(util.vector().of(3.5, 2.75, 1), Pointing.DOWN).rightClick(), - 15); + scene.overlay().showControls(util.vector().of(3.5, 2.75, 1), Pointing.DOWN, 15).rightClick(); scene.idle(7); scene.world().modifyBlockEntity(controlsPos1, ContraptionControlsBlockEntity.class, ccte -> ccte.disabled = false); @@ -663,11 +657,11 @@ public class MovementActorScenes { .text("They can be attached anywhere on the contraption"); scene.idle(75); - scene.overlay().showControls(new InputWindowElement(util.vector().topOf(controlsPos2), Pointing.DOWN).rightClick() - .withItem(AllBlocks.MECHANICAL_DRILL.asStack()), 30); + scene.overlay().showControls(util.vector().topOf(controlsPos2), Pointing.DOWN, 30).rightClick() + .withItem(AllBlocks.MECHANICAL_DRILL.asStack()); scene.idle(5); - scene.overlay().showControls(new InputWindowElement(util.vector().centerOf(controlsPos1), Pointing.UP).rightClick() - .withItem(AllBlocks.MECHANICAL_HARVESTER.asStack()), 25); + scene.overlay().showControls(util.vector().centerOf(controlsPos1), Pointing.UP, 25).rightClick() + .withItem(AllBlocks.MECHANICAL_HARVESTER.asStack()); scene.idle(2); scene.world().setFilterData(util.select().position(controlsPos2), ContraptionControlsBlockEntity.class, AllBlocks.MECHANICAL_DRILL.asStack()); @@ -683,8 +677,7 @@ public class MovementActorScenes { .text("While disassembled, the filter can be changed to target specific types of actors"); scene.idle(90); - scene.overlay().showControls(new InputWindowElement(util.vector().topOf(controlsPos2), Pointing.RIGHT).rightClick(), - 15); + scene.overlay().showControls(util.vector().topOf(controlsPos2), Pointing.RIGHT, 15).rightClick(); scene.idle(7); scene.world().modifyBlockEntity(controlsPos2, ContraptionControlsBlockEntity.class, ccte -> ccte.disabled = true); scene.effects().indicateRedstone(controlsPos2); diff --git a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/PistonScenes.java b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/PistonScenes.java index 36d3519fb..5ff861952 100644 --- a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/PistonScenes.java +++ b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/PistonScenes.java @@ -5,14 +5,14 @@ import com.simibubi.create.content.contraptions.piston.MechanicalPistonHeadBlock import com.simibubi.create.foundation.ponder.CreateSceneBuilder; import net.createmod.catnip.utility.Pointing; +import net.createmod.ponder.api.PonderPalette; +import net.createmod.ponder.api.element.ElementLink; +import net.createmod.ponder.api.element.ParrotElement; +import net.createmod.ponder.api.element.ParrotPose; +import net.createmod.ponder.api.element.WorldSectionElement; import net.createmod.ponder.api.scene.SceneBuilder; import net.createmod.ponder.api.scene.SceneBuildingUtil; -import net.createmod.ponder.foundation.ElementLink; -import net.createmod.ponder.foundation.PonderPalette; -import net.createmod.ponder.foundation.Selection; -import net.createmod.ponder.foundation.element.InputWindowElement; -import net.createmod.ponder.foundation.element.ParrotElement; -import net.createmod.ponder.foundation.element.WorldSectionElement; +import net.createmod.ponder.api.scene.Selection; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.world.item.ItemStack; @@ -79,10 +79,8 @@ public class PistonScenes { scene.world().moveSection(contraption, util.vector().of(2, 0, 0), 40); scene.idle(60); - scene.overlay().showControls( - new InputWindowElement(util.vector().blockSurface(piston, Direction.WEST), Pointing.DOWN).rightClick() - .withItem(new ItemStack(Items.SLIME_BALL)), - 30); + scene.overlay().showControls(util.vector().blockSurface(piston, Direction.WEST), Pointing.DOWN, 30).rightClick() + .withItem(new ItemStack(Items.SLIME_BALL)); scene.idle(7); scene.world().modifyBlock(piston.north(), s -> s.setValue(MechanicalPistonHeadBlock.TYPE, PistonType.STICKY), false); @@ -117,8 +115,8 @@ public class PistonScenes { scene.overlay().showOutline(PonderPalette.GREEN, "glue", util.select().fromTo(2, 2, 3, 2, 1, 3) .add(util.select().fromTo(2, 1, 3, 2, 1, 1)) .add(util.select().position(1, 1, 1)), 40); - scene.overlay().showControls(new InputWindowElement(util.vector().centerOf(util.grid().at(2, 2, 0)), Pointing.RIGHT) - .withItem(AllItems.SUPER_GLUE.asStack()), 40); + scene.overlay().showControls(util.vector().centerOf(util.grid().at(2, 2, 0)), Pointing.RIGHT, 40) + .withItem(AllItems.SUPER_GLUE.asStack()); ElementLink chassis = scene.world().showIndependentSection(util.select().fromTo(2, 2, 0, 2, 3, 2), Direction.DOWN); @@ -168,7 +166,7 @@ public class PistonScenes { scene.world().setKineticSpeed(kinetics, 16); scene.idle(10); - scene.overlay().showSelectionWithText(util.select().position(piston), 50) + scene.overlay().showOutlineWithText(util.select().position(piston), 50) .colored(PonderPalette.RED) .placeNearTarget() .attachKeyFrame() @@ -188,7 +186,7 @@ public class PistonScenes { scene.overlay().showOutline(PonderPalette.RED, new Object(), util.select().fromTo(piston.east(), piston.east(2)), 100); - scene.overlay().showSelectionWithText(util.select().fromTo(piston.west(), piston.west(2)), 100) + scene.overlay().showOutlineWithText(util.select().fromTo(piston.west(), piston.west(2)), 100) .text("The Length of pole added at its back determines the Extension Range") .attachKeyFrame() .placeNearTarget() @@ -199,7 +197,7 @@ public class PistonScenes { .west()), Direction.EAST, contraption); scene.idle(10); ElementLink birb = - scene.special().createBirb(util.vector().topOf(piston.west()), ParrotElement.FaceCursorPose::new); + scene.special().createBirb(util.vector().topOf(piston.west()), ParrotPose.FaceCursorPose::new); scene.idle(15); scene.effects().indicateRedstone(leverPos); @@ -256,7 +254,7 @@ public class PistonScenes { scene.world().destroyBlock(util.grid().at(0, 1, 2)); scene.world().destroyBlock(util.grid().at(0, 2, 2)); scene.idle(10); - scene.overlay().showSelectionWithText(rose, 70) + scene.overlay().showOutlineWithText(rose, 70) .text("Whenever Pistons stop moving, the moved structure reverts to blocks") .attachKeyFrame() .colored(PonderPalette.RED); @@ -277,7 +275,7 @@ public class PistonScenes { Vec3 filter = util.vector().topOf(piston) .add(.125, 0, 0); scene.overlay().showFilterSlotInput(filter, Direction.UP, 60); - scene.overlay().showControls(new InputWindowElement(filter.add(0, .125, 0), Pointing.DOWN).rightClick(), 60); + scene.overlay().showControls(filter.add(0, .125, 0), Pointing.DOWN, 60).rightClick(); scene.overlay().showText(70) .pointAt(filter.add(-.125, 0, 0)) .placeNearTarget() diff --git a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/ProcessingScenes.java b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/ProcessingScenes.java index a10f2a09e..f564545af 100644 --- a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/ProcessingScenes.java +++ b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/ProcessingScenes.java @@ -20,15 +20,14 @@ import net.createmod.catnip.utility.IntAttached; import net.createmod.catnip.utility.Iterate; import net.createmod.catnip.utility.NBTHelper; import net.createmod.catnip.utility.Pointing; +import net.createmod.ponder.api.ParticleEmitter; +import net.createmod.ponder.api.PonderPalette; +import net.createmod.ponder.api.element.ElementLink; +import net.createmod.ponder.api.element.EntityElement; +import net.createmod.ponder.api.element.WorldSectionElement; import net.createmod.ponder.api.scene.SceneBuilder; import net.createmod.ponder.api.scene.SceneBuildingUtil; -import net.createmod.ponder.foundation.ElementLink; -import net.createmod.ponder.foundation.PonderPalette; -import net.createmod.ponder.foundation.Selection; -import net.createmod.ponder.foundation.element.EntityElement; -import net.createmod.ponder.foundation.element.InputWindowElement; -import net.createmod.ponder.foundation.element.WorldSectionElement; -import net.createmod.ponder.foundation.instruction.EmitParticlesInstruction.Emitter; +import net.createmod.ponder.api.scene.Selection; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.core.particles.ItemParticleOption; @@ -99,7 +98,7 @@ public class ProcessingScenes { scene.world().modifyBlockEntity(millstone, MillstoneBlockEntity.class, ms -> ms.inputInv.setStackInSlot(0, itemStack)); scene.idle(10); - scene.overlay().showControls(new InputWindowElement(millstoneTop, Pointing.DOWN).withItem(itemStack), 30); + scene.overlay().showControls(millstoneTop, Pointing.DOWN, 30).withItem(itemStack); scene.idle(7); scene.overlay().showText(40) @@ -119,10 +118,8 @@ public class ProcessingScenes { scene.idle(60); ItemStack flour = AllItems.WHEAT_FLOUR.asStack(); - scene.overlay().showControls( - new InputWindowElement(util.vector().blockSurface(millstone, Direction.NORTH), Pointing.RIGHT).rightClick() - .withItem(flour), - 40); + scene.overlay().showControls(util.vector().blockSurface(millstone, Direction.NORTH), Pointing.RIGHT, 40).rightClick() + .withItem(flour); scene.idle(50); scene.addKeyframe(); @@ -213,12 +210,12 @@ public class ProcessingScenes { 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)); + ParticleEmitter blockSpace = + scene.effects().particleEmitterWithinBlockSpace(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.overlay().showControls(centerTop, Pointing.DOWN, 30).withItem(input); scene.idle(7); scene.overlay().showText(50) @@ -231,7 +228,7 @@ public class ProcessingScenes { 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.overlay().showControls(centerTop.add(0, -2, 0), Pointing.UP, 30).withItem(output); scene.idle(40); scene.world().restoreBlocks(util.select().position(2, 3, 2)); @@ -314,7 +311,7 @@ public class ProcessingScenes { 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.overlay().showControls(depotCenter, Pointing.UP, 30).withItem(copper); scene.idle(10); Class type = MechanicalPressBlockEntity.class; @@ -327,7 +324,7 @@ public class ProcessingScenes { 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.overlay().showControls(depotCenter, Pointing.UP, 50).withItem(sheet); scene.idle(60); scene.world().hideIndependentSection(depot, Direction.NORTH); @@ -415,8 +412,8 @@ public class ProcessingScenes { .text("With a Mixer and Basin, some Crafting Recipes can be automated"); scene.idle(40); - scene.overlay().showControls(new InputWindowElement(util.vector().topOf(basin), Pointing.LEFT).withItem(blue), 30); - scene.overlay().showControls(new InputWindowElement(util.vector().topOf(basin), Pointing.RIGHT).withItem(red), 30); + scene.overlay().showControls(util.vector().topOf(basin), Pointing.LEFT, 30).withItem(blue); + scene.overlay().showControls(util.vector().topOf(basin), Pointing.RIGHT, 30).withItem(red); scene.idle(30); Class type = MechanicalMixerBlockEntity.class; scene.world().modifyBlockEntity(pressPos, type, pte -> pte.startProcessingBasin()); @@ -497,8 +494,7 @@ public class ProcessingScenes { .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.overlay().showControls(util.vector().topOf(basin), Pointing.DOWN, 30).withItem(copper); scene.idle(30); Class type = MechanicalPressBlockEntity.class; scene.world().modifyBlockEntity(pressPos, type, pte -> pte.getPressingBehaviour() @@ -525,7 +521,7 @@ public class ProcessingScenes { 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.overlay().showControls(util.vector().topOf(basin), Pointing.DOWN, 30).withItem(log); scene.idle(30); scene.world().modifyBlockEntity(pressPos, type, pte -> pte.getPressingBehaviour() .start(Mode.BASIN)); @@ -582,9 +578,8 @@ public class ProcessingScenes { }); scene.idle(20); - scene.overlay() - .showControls(new InputWindowElement(util.vector().centerOf(center.above(2)), Pointing.DOWN).rightClick() - .withItem(AllItems.EMPTY_BLAZE_BURNER.asStack()), 40); + scene.overlay().showControls(util.vector().centerOf(center.above(2)), Pointing.DOWN, 40).rightClick() + .withItem(AllItems.EMPTY_BLAZE_BURNER.asStack()); scene.idle(10); scene.overlay().showText(60) .text("Right-click a Blaze with the empty burner to capture it") @@ -598,8 +593,8 @@ public class ProcessingScenes { scene.world().showSection(util.select().position(2, 1, 2), Direction.DOWN); scene.idle(20); - scene.overlay().showControls(new InputWindowElement(util.vector().topOf(center.above()), Pointing.DOWN).rightClick() - .withItem(AllItems.EMPTY_BLAZE_BURNER.asStack()), 40); + scene.overlay().showControls(util.vector().topOf(center.above()), Pointing.DOWN, 40).rightClick() + .withItem(AllItems.EMPTY_BLAZE_BURNER.asStack()); scene.idle(10); scene.overlay().showText(60) .text("Alternatively, Blazes can be collected from their Spawners directly") @@ -624,10 +619,8 @@ public class ProcessingScenes { scene.world().showSection(util.select().position(3, 1, 2), Direction.DOWN); scene.idle(20); - scene.overlay().showControls(new InputWindowElement(util.vector().topOf(center.east() - .above()), Pointing.DOWN).rightClick() - .withItem(new ItemStack(Items.FLINT_AND_STEEL)), - 40); + scene.overlay().showControls(util.vector().topOf(center.east().above()), Pointing.DOWN, 40).rightClick() + .withItem(new ItemStack(Items.FLINT_AND_STEEL)); scene.idle(7); scene.world().setBlock(util.grid().at(3, 1, 2), AllBlocks.LIT_BLAZE_BURNER.getDefaultState(), false); scene.idle(10); @@ -638,10 +631,8 @@ public class ProcessingScenes { .above(), Direction.UP)) .placeNearTarget(); scene.idle(80); - scene.overlay().showControls(new InputWindowElement(util.vector().topOf(center.east() - .above()), Pointing.DOWN).rightClick() - .withItem(new ItemStack(Items.SOUL_SAND)), - 40); + scene.overlay().showControls(util.vector().topOf(center.east().above()), Pointing.DOWN, 40).rightClick() + .withItem(new ItemStack(Items.SOUL_SAND)); scene.idle(7); scene.world().modifyBlock(util.grid().at(3, 1, 2), s -> s.setValue(LitBlazeBurnerBlock.FLAME_TYPE, LitBlazeBurnerBlock.FlameType.SOUL), false); @@ -682,8 +673,8 @@ public class ProcessingScenes { 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.overlay().showControls(util.vector().topOf(burner), Pointing.DOWN, 15).rightClick() + .withItem(new ItemStack(Items.OAK_PLANKS)); scene.idle(7); scene.world().modifyBlock(burner, s -> s.setValue(BlazeBurnerBlock.HEAT_LEVEL, HeatLevel.KINDLED), false); scene.idle(20); @@ -696,8 +687,8 @@ public class ProcessingScenes { 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.overlay().showControls(util.vector().topOf(burner), Pointing.DOWN, 30).rightClick() + .withItem(AllItems.BLAZE_CAKE.asStack()); scene.idle(7); scene.world().modifyBlock(burner, s -> s.setValue(BlazeBurnerBlock.HEAT_LEVEL, HeatLevel.SEETHING), false); scene.idle(20); @@ -756,8 +747,7 @@ public class ProcessingScenes { scene.idle(10); } scene.idle(10); - scene.overlay().showControls(new InputWindowElement(util.vector().topOf(basinPos), Pointing.DOWN).withItem(stack), - 30); + scene.overlay().showControls(util.vector().topOf(basinPos), Pointing.DOWN, 30).withItem(stack); scene.idle(30); for (Direction d : Iterate.horizontalDirections) { @@ -840,8 +830,7 @@ public class ProcessingScenes { .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().showControls(util.vector().topOf(basinPos.below().north()), Pointing.RIGHT, 30).withItem(new ItemStack(Items.BRICKS)); scene.overlay().showText(60) .attachKeyFrame() @@ -864,8 +853,7 @@ public class ProcessingScenes { scene.idle(50); ItemStack nugget = AllItems.COPPER_NUGGET.asStack(); - scene.overlay().showControls(new InputWindowElement(util.vector().topOf(basinPos), Pointing.RIGHT).withItem(nugget), - 30); + scene.overlay().showControls(util.vector().topOf(basinPos), Pointing.RIGHT, 30).withItem(nugget); scene.idle(30); scene.world().modifyBlockEntity(pressPos, type, pte -> pte.getPressingBehaviour() .start(Mode.BASIN)); @@ -875,8 +863,7 @@ public class ProcessingScenes { 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.overlay().showControls(util.vector().topOf(basinPos), Pointing.RIGHT, 30).withItem(ingot); scene.idle(30); scene.world().modifyBlockEntity(pressPos, type, pte -> pte.getPressingBehaviour() .start(Mode.BASIN)); @@ -886,8 +873,7 @@ public class ProcessingScenes { 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().showControls(util.vector().topOf(basinPos), Pointing.RIGHT, 30).withItem(block); scene.overlay().showText(70) .attachKeyFrame() .colored(PonderPalette.GREEN) diff --git a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/PulleyScenes.java b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/PulleyScenes.java index e33ab324d..4435fd99f 100644 --- a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/PulleyScenes.java +++ b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/PulleyScenes.java @@ -4,13 +4,12 @@ import com.simibubi.create.AllItems; import com.simibubi.create.foundation.ponder.CreateSceneBuilder; import net.createmod.catnip.utility.Pointing; +import net.createmod.ponder.api.PonderPalette; +import net.createmod.ponder.api.element.ElementLink; +import net.createmod.ponder.api.element.WorldSectionElement; import net.createmod.ponder.api.scene.SceneBuilder; import net.createmod.ponder.api.scene.SceneBuildingUtil; -import net.createmod.ponder.foundation.ElementLink; -import net.createmod.ponder.foundation.PonderPalette; -import net.createmod.ponder.foundation.Selection; -import net.createmod.ponder.foundation.element.InputWindowElement; -import net.createmod.ponder.foundation.element.WorldSectionElement; +import net.createmod.ponder.api.scene.Selection; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.world.level.block.Blocks; @@ -86,8 +85,8 @@ public class PulleyScenes { scene.overlay().showOutline(PonderPalette.GREEN, "glue", util.select().position(3, 1, 1) .add(util.select().fromTo(1, 1, 2, 3, 1, 2)) .add(util.select().position(1, 2, 2)), 40); - scene.overlay().showControls(new InputWindowElement(util.vector().centerOf(util.grid().at(2, 2, 0)), Pointing.RIGHT) - .withItem(AllItems.SUPER_GLUE.asStack()), 40); + scene.overlay().showControls(util.vector().centerOf(util.grid().at(2, 2, 0)), Pointing.RIGHT, 40) + .withItem(AllItems.SUPER_GLUE.asStack()); scene.idle(15); scene.effects().superGlue(util.grid().at(3, 1, 1), Direction.SOUTH, true); scene.overlay().showText(80) @@ -148,7 +147,7 @@ public class PulleyScenes { scene.world().destroyBlock(flowerPos); scene.idle(10); - scene.overlay().showSelectionWithText(util.select().position(flowerPos), 70) + scene.overlay().showOutlineWithText(util.select().position(flowerPos), 70) .text("Whenever Pulleys stop moving, the moved structure reverts to blocks") .attachKeyFrame() .placeNearTarget() @@ -167,8 +166,7 @@ public class PulleyScenes { scene.world().setBlock(flowerPos, Blocks.BLUE_ORCHID.defaultBlockState(), false); scene.world().showSection(util.select().position(flowerPos), Direction.DOWN); scene.overlay().showCenteredScrollInput(pulleyPos, Direction.UP, 60); - scene.overlay().showControls(new InputWindowElement(util.vector().topOf(pulleyPos), Pointing.DOWN).rightClick(), - 60); + scene.overlay().showControls(util.vector().topOf(pulleyPos), Pointing.DOWN, 60).rightClick(); scene.overlay().showText(70) .pointAt(util.vector().topOf(pulleyPos)) .placeNearTarget() @@ -231,7 +229,7 @@ public class PulleyScenes { scene.world().moveSection(pulley, util.vector().of(-2, 0, 0), 40); scene.idle(40); - scene.overlay().showSelectionWithText(util.select().fromTo(1, 1, 1, 1, 1, 2), 50) + scene.overlay().showOutlineWithText(util.select().fromTo(1, 1, 1, 1, 1, 2), 50) .colored(PonderPalette.GREEN) .placeNearTarget() .attachKeyFrame() diff --git a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/RedstoneScenes.java b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/RedstoneScenes.java index 3e71ceece..a06088d65 100644 --- a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/RedstoneScenes.java +++ b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/RedstoneScenes.java @@ -20,14 +20,13 @@ import com.simibubi.create.foundation.ponder.CreateSceneBuilder; import net.createmod.catnip.utility.Pointing; import net.createmod.catnip.utility.lang.Components; +import net.createmod.ponder.api.PonderPalette; +import net.createmod.ponder.api.element.ElementLink; +import net.createmod.ponder.api.element.ParrotPose; +import net.createmod.ponder.api.element.WorldSectionElement; import net.createmod.ponder.api.scene.SceneBuilder; import net.createmod.ponder.api.scene.SceneBuildingUtil; -import net.createmod.ponder.foundation.ElementLink; -import net.createmod.ponder.foundation.PonderPalette; -import net.createmod.ponder.foundation.Selection; -import net.createmod.ponder.foundation.element.InputWindowElement; -import net.createmod.ponder.foundation.element.ParrotElement; -import net.createmod.ponder.foundation.element.WorldSectionElement; +import net.createmod.ponder.api.scene.Selection; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.nbt.CompoundTag; @@ -250,7 +249,7 @@ public class RedstoneScenes { scene.idle(50); scene.overlay().showRepeaterScrollInput(circuitPos, 60); - scene.overlay().showControls(new InputWindowElement(circuitTop, Pointing.DOWN).rightClick(), 60); + scene.overlay().showControls(circuitTop, Pointing.DOWN, 60).rightClick(); scene.idle(10); scene.overlay().showText(60) .text("Using the value panel, the discharge time can be configured") @@ -323,7 +322,7 @@ public class RedstoneScenes { scene.idle(70); scene.overlay().showRepeaterScrollInput(circuitPos, 60); - scene.overlay().showControls(new InputWindowElement(circuitTop, Pointing.DOWN).rightClick(), 60); + scene.overlay().showControls(circuitTop, Pointing.DOWN, 60).rightClick(); scene.idle(10); scene.overlay().showText(60) .text("Using the value panel, the charge time can be configured") @@ -412,7 +411,7 @@ public class RedstoneScenes { scene.addKeyframe(); scene.idle(10); - scene.overlay().showControls(new InputWindowElement(circuitTop, Pointing.DOWN).rightClick(), 40); + scene.overlay().showControls(circuitTop, Pointing.DOWN, 40).rightClick(); scene.idle(7); scene.world().toggleRedstonePower(util.select().fromTo(2, 1, 2, 0, 1, 2)); scene.world().cycleBlockProperty(circuitPos, PoweredLatchBlock.POWERING); @@ -424,7 +423,7 @@ public class RedstoneScenes { .pointAt(circuitTop); scene.idle(60); - scene.overlay().showControls(new InputWindowElement(circuitTop, Pointing.DOWN).rightClick(), 40); + scene.overlay().showControls(circuitTop, Pointing.DOWN, 40).rightClick(); scene.idle(7); scene.world().toggleRedstonePower(util.select().fromTo(2, 1, 2, 0, 1, 2)); scene.world().cycleBlockProperty(circuitPos, PoweredLatchBlock.POWERING); @@ -485,7 +484,7 @@ public class RedstoneScenes { scene.addKeyframe(); scene.idle(10); - scene.overlay().showControls(new InputWindowElement(circuitTop, Pointing.DOWN).rightClick(), 40); + scene.overlay().showControls(circuitTop, Pointing.DOWN, 40).rightClick(); scene.idle(7); scene.world().toggleRedstonePower(util.select().fromTo(2, 1, 2, 0, 1, 2)); scene.world().cycleBlockProperty(circuitPos, ToggleLatchBlock.POWERING); @@ -497,7 +496,7 @@ public class RedstoneScenes { .pointAt(circuitTop); scene.idle(60); - scene.overlay().showControls(new InputWindowElement(circuitTop, Pointing.DOWN).rightClick(), 40); + scene.overlay().showControls(circuitTop, Pointing.DOWN, 40).rightClick(); scene.idle(7); scene.world().toggleRedstonePower(util.select().fromTo(2, 1, 2, 0, 1, 2)); scene.world().cycleBlockProperty(circuitPos, ToggleLatchBlock.POWERING); @@ -537,7 +536,7 @@ public class RedstoneScenes { scene.idle(70); IntegerProperty power = RedStoneWireBlock.POWER; - scene.overlay().showControls(new InputWindowElement(leverVec, Pointing.DOWN).rightClick(), 40); + scene.overlay().showControls(leverVec, Pointing.DOWN, 40).rightClick(); scene.idle(7); for (int i = 0; i < 7; i++) { scene.idle(2); @@ -556,8 +555,8 @@ public class RedstoneScenes { .pointAt(leverVec); scene.idle(70); - scene.overlay().showControls(new InputWindowElement(leverVec, Pointing.DOWN).rightClick() - .whileSneaking(), 40); + scene.overlay().showControls(leverVec, Pointing.DOWN, 40).rightClick() + .whileSneaking(); scene.idle(7); for (int i = 7; i > 0; i--) { scene.idle(2); @@ -579,7 +578,7 @@ public class RedstoneScenes { .pointAt(leverVec); scene.idle(70); - scene.overlay().showControls(new InputWindowElement(leverVec, Pointing.DOWN).rightClick(), 40); + scene.overlay().showControls(leverVec, Pointing.DOWN, 40).rightClick(); scene.idle(7); for (int i = 0; i < 15; i++) { scene.idle(2); @@ -635,8 +634,8 @@ public class RedstoneScenes { ItemStack clipboard = AllBlocks.CLIPBOARD.asStack(); ClipboardOverrides.switchTo(ClipboardType.WRITTEN, clipboard); - scene.overlay().showControls(new InputWindowElement(centerTube.add(1, .35, 0), Pointing.DOWN).rightClick() - .withItem(clipboard), 40); + scene.overlay().showControls(centerTube.add(1, .35, 0), Pointing.DOWN, 40).rightClick() + .withItem(clipboard); scene.idle(7); Component component = Components.literal("CREATE"); @@ -652,7 +651,7 @@ public class RedstoneScenes { scene.idle(10); scene.world().showSection(util.select().position(4, 1, 3), Direction.DOWN); scene.idle(10); - scene.special().createBirb(util.vector().topOf(util.grid().at(0, 0, 3)), ParrotElement.DancePose::new); + scene.special().createBirb(util.vector().topOf(util.grid().at(0, 0, 3)), ParrotPose.DancePose::new); scene.idle(20); scene.overlay().showText(80) @@ -663,10 +662,8 @@ public class RedstoneScenes { .add(-.75, -.05f, 0)); scene.idle(90); - InputWindowElement input = - new InputWindowElement(util.vector().blockSurface(util.grid().at(3, 1, 3), Direction.UP), Pointing.DOWN) - .withItem(new ItemStack(Items.BLUE_DYE)); - scene.overlay().showControls(input, 30); + scene.overlay().showControls(util.vector().blockSurface(util.grid().at(3, 1, 3), Direction.UP), Pointing.DOWN, 30) + .withItem(new ItemStack(Items.BLUE_DYE)); scene.idle(7); scene.world().setBlocks(util.select().fromTo(1, 1, 3, 3, 1, 3), AllBlocks.NIXIE_TUBES.get(DyeColor.BLUE) .getDefaultState() @@ -720,8 +717,8 @@ public class RedstoneScenes { .pointAt(link1Vec); scene.idle(60); - scene.overlay().showControls(new InputWindowElement(link2Vec, Pointing.UP).rightClick() - .whileSneaking(), 40); + scene.overlay().showControls(link2Vec, Pointing.UP, 40).rightClick() + .whileSneaking(); scene.idle(7); scene.world().modifyBlock(link2Pos, s -> s.cycle(RedstoneLinkBlock.RECEIVER), true); scene.idle(10); @@ -731,8 +728,8 @@ public class RedstoneScenes { .pointAt(link2Vec); scene.idle(60); - scene.overlay().showControls(new InputWindowElement(link3Vec, Pointing.UP).rightClick() - .withItem(AllItems.WRENCH.asStack()), 40); + scene.overlay().showControls(link3Vec, Pointing.UP, 40).rightClick() + .withItem(AllItems.WRENCH.asStack()); scene.idle(7); scene.world().modifyBlock(link3Pos, s -> s.cycle(RedstoneLinkBlock.RECEIVER), true); scene.idle(10); @@ -786,9 +783,9 @@ public class RedstoneScenes { ItemStack gold = new ItemStack(Items.GOLD_INGOT); ItemStack sapling = new ItemStack(Items.OAK_SAPLING); - scene.overlay().showControls(new InputWindowElement(frontSlot, Pointing.UP).withItem(iron), 30); + scene.overlay().showControls(frontSlot, Pointing.UP, 30).withItem(iron); scene.idle(7); - scene.overlay().showControls(new InputWindowElement(backSlot, Pointing.DOWN).withItem(sapling), 30); + scene.overlay().showControls(backSlot, Pointing.DOWN, 30).withItem(sapling); scene.world().modifyBlockEntityNBT(link1Select, RedstoneLinkBlockEntity.class, nbt -> nbt.put("FrequencyLast", iron.save(new CompoundTag()))); scene.idle(7); @@ -796,9 +793,9 @@ public class RedstoneScenes { nbt -> nbt.put("FrequencyFirst", sapling.save(new CompoundTag()))); scene.idle(20); - scene.overlay().showControls(new InputWindowElement(bottom2Slot, Pointing.UP).withItem(iron), 30); + scene.overlay().showControls(bottom2Slot, Pointing.UP, 30).withItem(iron); scene.idle(7); - scene.overlay().showControls(new InputWindowElement(top2Slot, Pointing.DOWN).withItem(sapling), 30); + scene.overlay().showControls(top2Slot, Pointing.DOWN, 30).withItem(sapling); scene.world().modifyBlockEntityNBT(link2Select, RedstoneLinkBlockEntity.class, nbt -> nbt.put("FrequencyLast", iron.save(new CompoundTag()))); scene.idle(7); @@ -806,9 +803,9 @@ public class RedstoneScenes { nbt -> nbt.put("FrequencyFirst", sapling.save(new CompoundTag()))); scene.idle(20); - scene.overlay().showControls(new InputWindowElement(bottom3Slot, Pointing.UP).withItem(gold), 30); + scene.overlay().showControls(bottom3Slot, Pointing.UP, 30).withItem(gold); scene.idle(7); - scene.overlay().showControls(new InputWindowElement(top3Slot, Pointing.DOWN).withItem(sapling), 30); + scene.overlay().showControls(top3Slot, Pointing.DOWN, 30).withItem(sapling); scene.world().modifyBlockEntityNBT(link3Select, RedstoneLinkBlockEntity.class, nbt -> nbt.put("FrequencyLast", gold.save(new CompoundTag()))); scene.idle(7); diff --git a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/RedstoneScenes2.java b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/RedstoneScenes2.java index e321ed16c..e500120a8 100644 --- a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/RedstoneScenes2.java +++ b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/RedstoneScenes2.java @@ -6,12 +6,11 @@ import com.simibubi.create.content.redstone.nixieTube.NixieTubeBlockEntity; import com.simibubi.create.foundation.ponder.CreateSceneBuilder; import net.createmod.catnip.utility.Pointing; +import net.createmod.ponder.api.element.ElementLink; +import net.createmod.ponder.api.element.WorldSectionElement; import net.createmod.ponder.api.scene.SceneBuilder; import net.createmod.ponder.api.scene.SceneBuildingUtil; -import net.createmod.ponder.foundation.ElementLink; -import net.createmod.ponder.foundation.Selection; -import net.createmod.ponder.foundation.element.InputWindowElement; -import net.createmod.ponder.foundation.element.WorldSectionElement; +import net.createmod.ponder.api.scene.Selection; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; @@ -116,9 +115,8 @@ public class RedstoneScenes2 { .text("Comparators output based on the distance to a powered lamp"); scene.idle(90); - scene.overlay() - .showControls(new InputWindowElement(util.vector().topOf(centerLamp.east(2)), Pointing.DOWN).rightClick() - .withItem(AllItems.WRENCH.asStack()), 20); + scene.overlay().showControls(util.vector().topOf(centerLamp.east(2)), Pointing.DOWN, 20).rightClick() + .withItem(AllItems.WRENCH.asStack()); scene.idle(6); scene.world().cycleBlockProperty(centerLamp.east(), RoseQuartzLampBlock.POWERING); scene.world().toggleRedstonePower(comparator); @@ -126,8 +124,8 @@ public class RedstoneScenes2 { .modifyBlockEntityNBT(comparator, NixieTubeBlockEntity.class, nbt -> nbt.putInt("RedstoneStrength", 0)); scene.idle(20); - scene.overlay().showControls(new InputWindowElement(util.vector().topOf(centerLamp), Pointing.DOWN).rightClick() - .withItem(AllItems.WRENCH.asStack()), 20); + scene.overlay().showControls(util.vector().topOf(centerLamp), Pointing.DOWN, 20).rightClick() + .withItem(AllItems.WRENCH.asStack()); scene.idle(6); scene.world().cycleBlockProperty(centerLamp.west(), RoseQuartzLampBlock.POWERING); scene.world().toggleRedstonePower(comparator); diff --git a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/RollerScenes.java b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/RollerScenes.java index 174cb4ddc..7b04545e6 100644 --- a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/RollerScenes.java +++ b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/RollerScenes.java @@ -6,14 +6,14 @@ import com.simibubi.create.foundation.gui.AllIcons; import com.simibubi.create.foundation.ponder.CreateSceneBuilder; import net.createmod.catnip.utility.Pointing; +import net.createmod.ponder.api.PonderPalette; +import net.createmod.ponder.api.element.ElementLink; +import net.createmod.ponder.api.element.ParrotElement; +import net.createmod.ponder.api.element.ParrotPose; +import net.createmod.ponder.api.element.WorldSectionElement; import net.createmod.ponder.api.scene.SceneBuilder; import net.createmod.ponder.api.scene.SceneBuildingUtil; -import net.createmod.ponder.foundation.ElementLink; -import net.createmod.ponder.foundation.PonderPalette; -import net.createmod.ponder.foundation.Selection; -import net.createmod.ponder.foundation.element.InputWindowElement; -import net.createmod.ponder.foundation.element.ParrotElement; -import net.createmod.ponder.foundation.element.WorldSectionElement; +import net.createmod.ponder.api.scene.Selection; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.world.item.ItemStack; @@ -54,7 +54,7 @@ public class RollerScenes { scene.world().showSection(util.select().position(stationPos), Direction.DOWN); scene.idle(5); ElementLink birbLink = - scene.special().createBirb(util.vector().centerOf(8, 3, 4), ParrotElement.FacePointOfInterestPose::new); + scene.special().createBirb(util.vector().centerOf(8, 3, 4), ParrotPose.FacePointOfInterestPose::new); ElementLink trainLink = scene.world().showIndependentSection(train, Direction.DOWN); scene.idle(5); scene.world().showSectionAndMerge(rollers, Direction.EAST, trainLink); @@ -85,8 +85,8 @@ public class RollerScenes { scene.world().modifyBlockEntity(util.grid().at(6, 2, 3 + i), RollerBlockEntity.class, rte -> rte.setAnimatedSpeed(0)); - scene.overlay().showControls(new InputWindowElement(util.vector().topOf(util.grid().at(2, 2, 4)), Pointing.DOWN) - .showing(AllIcons.I_ROLLER_PAVE), 70); + scene.overlay().showControls(util.vector().topOf(util.grid().at(2, 2, 4)), Pointing.DOWN, 70) + .showing(AllIcons.I_ROLLER_PAVE); scene.overlay().showText(80) .pointAt(util.vector().topOf(util.grid().at(2, 2, 4))) @@ -133,7 +133,7 @@ public class RollerScenes { scene.world().hideIndependentSection(trainLink, Direction.UP); scene.idle(15); - birbLink = scene.special().createBirb(util.vector().centerOf(8, 3, 4), ParrotElement.FacePointOfInterestPose::new); + birbLink = scene.special().createBirb(util.vector().centerOf(8, 3, 4), ParrotPose.FacePointOfInterestPose::new); trainLink = scene.world().showIndependentSection(train, Direction.DOWN); scene.world().toggleControls(controlsPos); scene.idle(5); @@ -154,7 +154,7 @@ public class RollerScenes { Block paveMaterial = Blocks.TUFF; ItemStack paveItem = new ItemStack(paveMaterial); - scene.overlay().showControls(new InputWindowElement(filterSlot, Pointing.DOWN).withItem(paveItem), 40); + scene.overlay().showControls(filterSlot, Pointing.DOWN, 40).withItem(paveItem); scene.idle(7); scene.world().setFilterData(rollers, RollerBlockEntity.class, paveItem); scene.idle(20); @@ -246,7 +246,7 @@ public class RollerScenes { scene.world().hideSection(util.select().position(stationPos), Direction.UP); scene.idle(10); - scene.overlay().showSelectionWithText(util.select().fromTo(5, 0, 3, 0, 0, 5), 90) + scene.overlay().showOutlineWithText(util.select().fromTo(5, 0, 3, 0, 0, 5), 90) .pointAt(util.vector().topOf(util.grid().at(3, 0, 4))) .attachKeyFrame() .colored(PonderPalette.RED) @@ -268,7 +268,7 @@ public class RollerScenes { paveMaterial = Blocks.GRASS_BLOCK; paveItem = new ItemStack(paveMaterial); - scene.overlay().showControls(new InputWindowElement(filterSlot, Pointing.DOWN).withItem(paveItem), 40); + scene.overlay().showControls(filterSlot, Pointing.DOWN, 40).withItem(paveItem); scene.idle(7); scene.world().setFilterData(rollers, RollerBlockEntity.class, paveItem); scene.idle(20); @@ -339,7 +339,7 @@ public class RollerScenes { ElementLink trainLink = scene.world().showIndependentSection(train, Direction.DOWN); ElementLink birbLink = - scene.special().createBirb(util.vector().centerOf(8, 7, 4), ParrotElement.FacePointOfInterestPose::new); + scene.special().createBirb(util.vector().centerOf(8, 7, 4), ParrotPose.FacePointOfInterestPose::new); scene.idle(5); scene.world().showSectionAndMerge(rollers, Direction.EAST, trainLink); scene.idle(15); @@ -353,20 +353,18 @@ public class RollerScenes { .placeNearTarget(); scene.idle(70); - scene.overlay().showSelectionWithText(util.select().fromTo(5, 3, 3, 0, 1, 5), 90) + scene.overlay().showOutlineWithText(util.select().fromTo(5, 3, 3, 0, 1, 5), 90) .attachKeyFrame() .colored(PonderPalette.BLUE) .text("The 'fill' modes can help to bridge gaps between pavement and terrain") .placeNearTarget(); scene.idle(100); - scene.overlay().showControls(new InputWindowElement(filterSlot, Pointing.DOWN).showing(AllIcons.I_ROLLER_FILL), - 50); + scene.overlay().showControls(filterSlot, Pointing.DOWN, 50).showing(AllIcons.I_ROLLER_FILL); scene.idle(15); Block paveMaterial = Blocks.COARSE_DIRT; ItemStack paveItem = new ItemStack(paveMaterial); - scene.overlay() - .showControls(new InputWindowElement(filterSlot.add(0, 0, -6 / 16f), Pointing.UP).withItem(paveItem), 35); + scene.overlay().showControls(filterSlot.add(0, 0, -6 / 16f), Pointing.UP, 35).withItem(paveItem); scene.idle(7); scene.world().setFilterData(rollers, RollerBlockEntity.class, paveItem); scene.idle(10); @@ -423,14 +421,13 @@ public class RollerScenes { scene.world().cycleBlockProperty(stationPos, StationBlock.ASSEMBLING); scene.world().animateTrainStation(stationPos, true); - birbLink = scene.special().createBirb(util.vector().centerOf(8, 7, 4), ParrotElement.FacePointOfInterestPose::new); + birbLink = scene.special().createBirb(util.vector().centerOf(8, 7, 4), ParrotPose.FacePointOfInterestPose::new); trainLink = scene.world().showIndependentSection(train, Direction.DOWN); scene.idle(5); scene.world().showSectionAndMerge(rollers, Direction.EAST, trainLink); scene.idle(25); - scene.overlay() - .showControls(new InputWindowElement(filterSlot, Pointing.DOWN).showing(AllIcons.I_ROLLER_WIDE_FILL), 40); + scene.overlay().showControls(filterSlot, Pointing.DOWN, 40).showing(AllIcons.I_ROLLER_WIDE_FILL); scene.idle(45); scene.world().cycleBlockProperty(stationPos, StationBlock.ASSEMBLING); @@ -488,7 +485,7 @@ public class RollerScenes { scene.world().cycleBlockProperty(stationPos, StationBlock.ASSEMBLING); scene.world().animateTrainStation(stationPos, true); scene.world().showSection(util.select().fromTo(5, 1, 3, 0, 3, 5), Direction.NORTH); - birbLink = scene.special().createBirb(util.vector().centerOf(8, 7, 4), ParrotElement.FacePointOfInterestPose::new); + birbLink = scene.special().createBirb(util.vector().centerOf(8, 7, 4), ParrotPose.FacePointOfInterestPose::new); trainLink = scene.world().showIndependentSection(train, Direction.DOWN); scene.idle(5); scene.world().showSectionAndMerge(rollers, Direction.EAST, trainLink); diff --git a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/SteamScenes.java b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/SteamScenes.java index f36d07cdf..37aba99e7 100644 --- a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/SteamScenes.java +++ b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/SteamScenes.java @@ -12,13 +12,12 @@ import com.simibubi.create.foundation.ponder.CreateSceneBuilder; import net.createmod.catnip.utility.Iterate; import net.createmod.catnip.utility.Pointing; +import net.createmod.ponder.api.PonderPalette; +import net.createmod.ponder.api.element.ElementLink; +import net.createmod.ponder.api.element.WorldSectionElement; import net.createmod.ponder.api.scene.SceneBuilder; import net.createmod.ponder.api.scene.SceneBuildingUtil; -import net.createmod.ponder.foundation.ElementLink; -import net.createmod.ponder.foundation.PonderPalette; -import net.createmod.ponder.foundation.Selection; -import net.createmod.ponder.foundation.element.InputWindowElement; -import net.createmod.ponder.foundation.element.WorldSectionElement; +import net.createmod.ponder.api.scene.Selection; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.core.Direction.Axis; @@ -103,12 +102,9 @@ public class SteamScenes { scene.world().toggleRedstonePower(lever); scene.idle(40); - InputWindowElement rightClick = - new InputWindowElement(util.vector().blockSurface(util.grid().at(2, 3, 1), Direction.EAST), Pointing.RIGHT) - .withItem(AllBlocks.STEAM_WHISTLE.asStack()) - .rightClick(); - - scene.overlay().showControls(rightClick, 50); + scene.overlay().showControls(util.vector().blockSurface(util.grid().at(2, 3, 1), Direction.EAST), Pointing.RIGHT, 50) + .withItem(AllBlocks.STEAM_WHISTLE.asStack()) + .rightClick(); scene.idle(6); BlockState extension = AllBlocks.STEAM_WHISTLE_EXTENSION.getDefaultState(); scene.world().setBlock(whistlePos.above(), extension, false); @@ -122,31 +118,36 @@ public class SteamScenes { scene.idle(40); - scene.overlay().showControls(rightClick, 2); + scene.overlay().showControls(util.vector().blockSurface(util.grid().at(2, 3, 1), Direction.EAST), Pointing.RIGHT, 2) + .withItem(AllBlocks.STEAM_WHISTLE.asStack()) + .rightClick(); scene.idle(6); scene.world().cycleBlockProperty(whistlePos.above(), WhistleExtenderBlock.SHAPE); scene.idle(4); - scene.overlay().showControls(rightClick, 2); + scene.overlay().showControls(util.vector().blockSurface(util.grid().at(2, 3, 1), Direction.EAST), Pointing.RIGHT, 2) + .withItem(AllBlocks.STEAM_WHISTLE.asStack()) + .rightClick(); scene.idle(6); scene.world().setBlock(whistlePos.above(2), extension, false); scene.world().cycleBlockProperty(whistlePos.above(), WhistleExtenderBlock.SHAPE); scene.idle(4); - scene.overlay().showControls(rightClick, 2); + scene.overlay().showControls(util.vector().blockSurface(util.grid().at(2, 3, 1), Direction.EAST), Pointing.RIGHT, 2) + .withItem(AllBlocks.STEAM_WHISTLE.asStack()) + .rightClick(); scene.idle(6); scene.world().cycleBlockProperty(whistlePos.above(2), WhistleExtenderBlock.SHAPE); scene.idle(4); - scene.overlay().showControls(rightClick, 2); + scene.overlay().showControls(util.vector().blockSurface(util.grid().at(2, 3, 1), Direction.EAST), Pointing.RIGHT, 2) + .withItem(AllBlocks.STEAM_WHISTLE.asStack()) + .rightClick(); scene.idle(6); scene.world().cycleBlockProperty(whistlePos.above(2), WhistleExtenderBlock.SHAPE); scene.world().setBlock(whistlePos.above(3), extension, false); scene.idle(20); - rightClick = - new InputWindowElement(util.vector().blockSurface(util.grid().at(2, 3, 1), Direction.EAST), Pointing.RIGHT) - .withItem(AllItems.WRENCH.asStack()) - .rightClick(); - - scene.overlay().showControls(rightClick, 50); + scene.overlay().showControls(util.vector().blockSurface(util.grid().at(2, 3, 1), Direction.EAST), Pointing.RIGHT, 50) + .withItem(AllItems.WRENCH.asStack()) + .rightClick(); scene.idle(6); for (int i = 0; i < 4; i++) { scene.world().cycleBlockProperty(whistlePos.above(i), WhistleBlock.SIZE); @@ -161,7 +162,9 @@ public class SteamScenes { .placeNearTarget(); scene.idle(40); - scene.overlay().showControls(rightClick, 4); + scene.overlay().showControls(util.vector().blockSurface(util.grid().at(2, 3, 1), Direction.EAST), Pointing.RIGHT, 4) + .withItem(AllItems.WRENCH.asStack()) + .rightClick(); scene.idle(6); for (int i = 0; i < 4; i++) { scene.world().cycleBlockProperty(whistlePos.above(i), WhistleBlock.SIZE); @@ -177,10 +180,8 @@ public class SteamScenes { scene.world().toggleRedstonePower(lever); scene.idle(20); - scene.overlay().showControls( - new InputWindowElement(util.vector().blockSurface(util.grid().at(2, 3, 1), Direction.DOWN), Pointing.UP) - .withItem(AllItems.GOGGLES.asStack()), - 80); + scene.overlay().showControls(util.vector().blockSurface(util.grid().at(2, 3, 1), Direction.DOWN), Pointing.UP, 80) + .withItem(AllItems.GOGGLES.asStack()); scene.idle(6); scene.overlay().showText(70) @@ -253,11 +254,9 @@ public class SteamScenes { .placeNearTarget(); scene.idle(60); - scene.overlay().showControls( - new InputWindowElement(util.vector().blockSurface(util.grid().at(3, 1, 3), Direction.UP), Pointing.DOWN) + scene.overlay().showControls(util.vector().blockSurface(util.grid().at(3, 1, 3), Direction.UP), Pointing.DOWN, 60) .withItem(AllBlocks.SHAFT.asStack()) - .rightClick(), - 60); + .rightClick(); scene.idle(10); scene.world().setBlock(engine1ShaftPos, AllBlocks.SHAFT.getDefaultState() .setValue(ShaftBlock.AXIS, Axis.Z), false); @@ -317,7 +316,7 @@ public class SteamScenes { .placeNearTarget(); scene.idle(70); - scene.overlay().showSelectionWithText(util.select().fromTo(5, 2, 3, 4, 2, 4), 50) + scene.overlay().showOutlineWithText(util.select().fromTo(5, 2, 3, 4, 2, 4), 50) .attachKeyFrame() .text("The minimal setup requires 4 Fluid Tanks") .pointAt(util.vector().blockSurface(util.grid().at(4, 2, 4), Direction.UP)) @@ -330,11 +329,9 @@ public class SteamScenes { scene.world().moveSection(burnersElement, util.vector().of(2, 0, 0), 0); scene.idle(25); - scene.overlay().showControls( - new InputWindowElement(util.vector().blockSurface(util.grid().at(4, 1, 3), Direction.EAST), Pointing.RIGHT) + scene.overlay().showControls(util.vector().blockSurface(util.grid().at(4, 1, 3), Direction.EAST), Pointing.RIGHT, 60) .withItem(new ItemStack(Items.OAK_LOG)) - .rightClick(), - 60); + .rightClick(); scene.idle(10); scene.world().setBlocks(burners, AllBlocks.BLAZE_BURNER.getDefaultState() .setValue(BlazeBurnerBlock.HEAT_LEVEL, HeatLevel.KINDLED), false); @@ -370,8 +367,7 @@ public class SteamScenes { .placeNearTarget(); scene.idle(90); - scene.overlay().showControls( - new InputWindowElement(target.add(0, 0, 0.5), Pointing.DOWN).withItem(AllItems.GOGGLES.asStack()), 60); + scene.overlay().showControls(target.add(0, 0, 0.5), Pointing.DOWN, 60).withItem(AllItems.GOGGLES.asStack()); scene.idle(6); scene.overlay().showText(80) .text("The boiler's current power level can be inspected with Engineer's Goggles") @@ -410,7 +406,7 @@ public class SteamScenes { .pointAt(util.vector().blockSurface(util.grid().at(4, 4, 4), Direction.WEST)) .placeNearTarget(); scene.idle(40); - scene.overlay().showSelectionWithText(util.select().fromTo(3, 2, 3, 3, 3, 4), 30) + scene.overlay().showOutlineWithText(util.select().fromTo(3, 2, 3, 3, 3, 4), 30) .text("4 Engines") .colored(PonderPalette.BLUE) .pointAt(util.vector().blockSurface(util.grid().at(3, 3, 4), Direction.UP)) @@ -424,10 +420,8 @@ public class SteamScenes { scene.world().hideIndependentSection(engineShaftElement, Direction.SOUTH); scene.idle(20); - scene.overlay().showControls( - new InputWindowElement(util.vector().of(5, 2, 4), Pointing.DOWN).withItem(AllItems.BLAZE_CAKE.asStack()) - .rightClick(), - 10); + scene.overlay().showControls(util.vector().of(5, 2, 4), Pointing.DOWN, 10).withItem(AllItems.BLAZE_CAKE.asStack()) + .rightClick(); scene.idle(6); scene.world().setBlocks(burners, AllBlocks.BLAZE_BURNER.getDefaultState() .setValue(BlazeBurnerBlock.HEAT_LEVEL, HeatLevel.SEETHING), false); @@ -470,7 +464,7 @@ public class SteamScenes { .pointAt(util.vector().blockSurface(util.grid().at(4, 4, 3), Direction.NORTH)) .placeNearTarget(); scene.idle(40); - scene.overlay().showSelectionWithText(util.select().fromTo(3, 2, 3, 3, 6, 4), 30) + scene.overlay().showOutlineWithText(util.select().fromTo(3, 2, 3, 3, 6, 4), 30) .text("8 Engines") .colored(PonderPalette.BLUE) .pointAt(util.vector().blockSurface(util.grid().at(3, 3, 4), Direction.UP)) diff --git a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/TunnelScenes.java b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/TunnelScenes.java index ff4e27581..6c9c22d8f 100644 --- a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/TunnelScenes.java +++ b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/TunnelScenes.java @@ -15,12 +15,11 @@ import net.createmod.catnip.utility.Iterate; import net.createmod.catnip.utility.NBTHelper; import net.createmod.catnip.utility.Pointing; import net.createmod.catnip.utility.VecHelper; +import net.createmod.ponder.api.PonderPalette; +import net.createmod.ponder.api.element.ElementLink; +import net.createmod.ponder.api.element.WorldSectionElement; import net.createmod.ponder.api.scene.SceneBuilder; import net.createmod.ponder.api.scene.SceneBuildingUtil; -import net.createmod.ponder.foundation.ElementLink; -import net.createmod.ponder.foundation.PonderPalette; -import net.createmod.ponder.foundation.element.InputWindowElement; -import net.createmod.ponder.foundation.element.WorldSectionElement; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.world.entity.Entity; @@ -87,8 +86,8 @@ public class TunnelScenes { .text("Whenever an Andesite Tunnel has connections to the sides..."); scene.idle(70); - scene.overlay().showControls(new InputWindowElement(util.vector().topOf(util.grid().at(4, 1, 2)), Pointing.DOWN) - .withItem(new ItemStack(Items.COPPER_INGOT)), 20); + scene.overlay().showControls(util.vector().topOf(util.grid().at(4, 1, 2)), Pointing.DOWN, 20) + .withItem(new ItemStack(Items.COPPER_INGOT)); scene.idle(7); scene.world().createItemOnBelt(util.grid().at(4, 1, 2), Direction.UP, new ItemStack(Items.COPPER_INGOT, 64)); scene.idle(40); @@ -184,7 +183,7 @@ public class TunnelScenes { Class tunnelClass = BrassTunnelBlockEntity.class; scene.world().modifyBlockEntity(tunnelPos, tunnelClass, be -> be.getBehaviour(SidedFilteringBehaviour.TYPE) .setFilter(Direction.EAST, copper)); - scene.overlay().showControls(new InputWindowElement(tunnelFilterVec, Pointing.DOWN).withItem(copper), 30); + scene.overlay().showControls(tunnelFilterVec, Pointing.DOWN, 30).withItem(copper); ItemStack zinc = AllItems.ZINC_INGOT.asStack(); scene.world().createItemOnBelt(util.grid().at(5, 1, 2), Direction.EAST, zinc); scene.idle(70); @@ -207,12 +206,12 @@ public class TunnelScenes { .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.overlay().showControls(tunnelFilterVec, Pointing.LEFT, 30).withItem(copper); scene.world().modifyBlockEntity(tunnelPos, tunnelClass, be -> be.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.overlay().showControls(tunnelFilterVec, Pointing.RIGHT, 30).withItem(zinc); scene.world().modifyBlockEntity(tunnelPos, tunnelClass, be -> be.getBehaviour(SidedFilteringBehaviour.TYPE) .setFilter(Direction.NORTH, zinc)); @@ -258,7 +257,7 @@ public class TunnelScenes { 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) + scene.overlay().showOutlineWithText(util.select().fromTo(3, 1, 1, 3, 2, 3), 80) .attachKeyFrame() .placeNearTarget() .text("Brass Tunnels on parallel belts will form a group"); @@ -271,18 +270,16 @@ public class TunnelScenes { 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.overlay().showControls(tunnelFilterVec.add(0, 0, -1), Pointing.RIGHT, 20).withItem(item1); scene.world().modifyBlockEntity(newTunnelPos.north(), tunnelClass, be -> be.getBehaviour(SidedFilteringBehaviour.TYPE) .setFilter(Direction.WEST, item1)); scene.idle(4); - scene.overlay().showControls(new InputWindowElement(tunnelFilterVec, Pointing.DOWN).withItem(item2), 20); + scene.overlay().showControls(tunnelFilterVec, Pointing.DOWN, 20).withItem(item2); scene.world().modifyBlockEntity(newTunnelPos, tunnelClass, be -> be.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.overlay().showControls(tunnelFilterVec.add(0, 0, 1), Pointing.LEFT, 20).withItem(item3); scene.world().modifyBlockEntity(newTunnelPos.south(), tunnelClass, be -> be.getBehaviour(SidedFilteringBehaviour.TYPE) .setFilter(Direction.WEST, item3)); @@ -362,7 +359,7 @@ public class TunnelScenes { } Vec3 tunnelTop = util.vector().topOf(util.grid().at(2, 2, 3)); - scene.overlay().showControls(new InputWindowElement(tunnelTop, Pointing.DOWN).rightClick(), 80); + scene.overlay().showControls(tunnelTop, Pointing.DOWN, 80).rightClick(); scene.idle(7); scene.overlay().showCenteredScrollInput(util.grid().at(2, 2, 3), Direction.UP, 120); scene.overlay().showText(120) @@ -378,8 +375,7 @@ public class TunnelScenes { 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); + scene.overlay().showControls(modeVec, Pointing.RIGHT, 140).showing(AllIcons.I_TUNNEL_SPLIT); ElementLink blockage2 = null; @@ -405,8 +401,7 @@ public class TunnelScenes { } if (i == 4) { - scene.overlay().showControls( - new InputWindowElement(modeVec, Pointing.RIGHT).showing(AllIcons.I_TUNNEL_FORCED_SPLIT), 140); + scene.overlay().showControls(modeVec, Pointing.RIGHT, 140).showing(AllIcons.I_TUNNEL_FORCED_SPLIT); scene.world().modifyBlockEntity(util.grid().at(1, 2, 3), tunnelClass, be -> be.getBehaviour(ScrollOptionBehaviour.TYPE) .setValue(BrassTunnelBlockEntity.SelectionMode.FORCED_SPLIT.ordinal())); @@ -429,8 +424,7 @@ public class TunnelScenes { scene.world().modifyBlockEntity(util.grid().at(1, 2, 3), tunnelClass, be -> be.getBehaviour(ScrollOptionBehaviour.TYPE) .setValue(BrassTunnelBlockEntity.SelectionMode.ROUND_ROBIN.ordinal())); - scene.overlay().showControls( - new InputWindowElement(modeVec, Pointing.RIGHT).showing(AllIcons.I_TUNNEL_ROUND_ROBIN), 140); + scene.overlay().showControls(modeVec, Pointing.RIGHT, 140).showing(AllIcons.I_TUNNEL_ROUND_ROBIN); scene.overlay().showText(80) .attachKeyFrame() .pointAt(tunnelTop) @@ -452,8 +446,7 @@ public class TunnelScenes { } if (i == 15) { - scene.overlay().showControls( - new InputWindowElement(modeVec, Pointing.RIGHT).showing(AllIcons.I_TUNNEL_FORCED_ROUND_ROBIN), 140); + scene.overlay().showControls(modeVec, Pointing.RIGHT, 140).showing(AllIcons.I_TUNNEL_FORCED_ROUND_ROBIN); scene.world().modifyBlockEntity(util.grid().at(1, 2, 3), tunnelClass, be -> be.getBehaviour(ScrollOptionBehaviour.TYPE) .setValue(BrassTunnelBlockEntity.SelectionMode.FORCED_ROUND_ROBIN.ordinal())); @@ -472,8 +465,7 @@ public class TunnelScenes { } if (i == 19) { - scene.overlay().showControls( - new InputWindowElement(modeVec, Pointing.RIGHT).showing(AllIcons.I_TUNNEL_PREFER_NEAREST), 140); + scene.overlay().showControls(modeVec, Pointing.RIGHT, 140).showing(AllIcons.I_TUNNEL_PREFER_NEAREST); scene.world().modifyBlockEntity(util.grid().at(1, 2, 3), tunnelClass, be -> be.getBehaviour(ScrollOptionBehaviour.TYPE) .setValue(BrassTunnelBlockEntity.SelectionMode.PREFER_NEAREST.ordinal())); @@ -501,8 +493,7 @@ public class TunnelScenes { } if (i == 26) { - scene.overlay().showControls( - new InputWindowElement(modeVec, Pointing.RIGHT).showing(AllIcons.I_TUNNEL_RANDOMIZE), 140); + scene.overlay().showControls(modeVec, Pointing.RIGHT, 140).showing(AllIcons.I_TUNNEL_RANDOMIZE); scene.world().modifyBlockEntity(util.grid().at(1, 2, 3), tunnelClass, be -> be.getBehaviour(ScrollOptionBehaviour.TYPE) .setValue(BrassTunnelBlockEntity.SelectionMode.RANDOMIZE.ordinal())); @@ -519,8 +510,7 @@ public class TunnelScenes { 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.overlay().showControls(modeVec, Pointing.RIGHT, 140).showing(AllIcons.I_TUNNEL_SYNCHRONIZE); scene.world().modifyBlockEntity(util.grid().at(1, 2, 3), tunnelClass, be -> be.getBehaviour(ScrollOptionBehaviour.TYPE) .setValue(BrassTunnelBlockEntity.SelectionMode.SYNCHRONIZE.ordinal())); diff --git a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/fluid/DrainScenes.java b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/fluid/DrainScenes.java index 41ba8927c..e12bc6c6a 100644 --- a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/fluid/DrainScenes.java +++ b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/fluid/DrainScenes.java @@ -5,12 +5,11 @@ import com.simibubi.create.foundation.blockEntity.behaviour.fluid.SmartFluidTank import com.simibubi.create.foundation.ponder.CreateSceneBuilder; import net.createmod.catnip.utility.Pointing; +import net.createmod.ponder.api.element.ElementLink; +import net.createmod.ponder.api.element.WorldSectionElement; import net.createmod.ponder.api.scene.SceneBuilder; import net.createmod.ponder.api.scene.SceneBuildingUtil; -import net.createmod.ponder.foundation.ElementLink; -import net.createmod.ponder.foundation.Selection; -import net.createmod.ponder.foundation.element.InputWindowElement; -import net.createmod.ponder.foundation.element.WorldSectionElement; +import net.createmod.ponder.api.scene.Selection; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.world.item.ItemStack; @@ -51,10 +50,8 @@ public class DrainScenes { scene.idle(50); ItemStack lavaBucket = new ItemStack(Items.LAVA_BUCKET); - scene.overlay().showControls( - new InputWindowElement(util.vector().blockSurface(drainPos.west(), Direction.UP), Pointing.DOWN).rightClick() - .withItem(lavaBucket), - 40); + scene.overlay().showControls(util.vector().blockSurface(drainPos.west(), Direction.UP), Pointing.DOWN, 40).rightClick() + .withItem(lavaBucket); scene.idle(7); scene.world().modifyBlockEntity(drainPos, ItemDrainBlockEntity.class, be -> { be.getBehaviour(SmartFluidTankBehaviour.TYPE) @@ -90,8 +87,7 @@ public class DrainScenes { .pointAt(util.vector().topOf(util.grid().at(2, 1, 2))); scene.idle(40); - scene.overlay() - .showControls(new InputWindowElement(util.vector().topOf(beltPos), Pointing.DOWN).withItem(lavaBucket), 20); + scene.overlay().showControls(util.vector().topOf(beltPos), Pointing.DOWN, 20).withItem(lavaBucket); scene.idle(7); scene.world().createItemOnBelt(beltPos, Direction.NORTH, lavaBucket); scene.idle(30); diff --git a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/fluid/FluidMovementActorScenes.java b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/fluid/FluidMovementActorScenes.java index 5b861c7a4..514add3b2 100644 --- a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/fluid/FluidMovementActorScenes.java +++ b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/fluid/FluidMovementActorScenes.java @@ -8,13 +8,12 @@ import com.simibubi.create.foundation.fluid.FluidHelper; import com.simibubi.create.foundation.ponder.CreateSceneBuilder; import net.createmod.catnip.utility.Pointing; +import net.createmod.ponder.api.PonderPalette; +import net.createmod.ponder.api.element.ElementLink; +import net.createmod.ponder.api.element.WorldSectionElement; import net.createmod.ponder.api.scene.SceneBuilder; import net.createmod.ponder.api.scene.SceneBuildingUtil; -import net.createmod.ponder.foundation.ElementLink; -import net.createmod.ponder.foundation.PonderPalette; -import net.createmod.ponder.foundation.Selection; -import net.createmod.ponder.foundation.element.InputWindowElement; -import net.createmod.ponder.foundation.element.WorldSectionElement; +import net.createmod.ponder.api.scene.Selection; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.world.item.ItemStack; @@ -88,7 +87,7 @@ public class FluidMovementActorScenes { BlockPos psi2 = psi.west(2); scene.world().showSection(util.select().position(psi2), Direction.DOWN); - scene.overlay().showSelectionWithText(util.select().position(psi.west()), 50) + scene.overlay().showOutlineWithText(util.select().position(psi.west()), 50) .colored(PonderPalette.RED) .placeNearTarget() .attachKeyFrame() @@ -117,7 +116,7 @@ public class FluidMovementActorScenes { 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) + scene.overlay().showOutlineWithText(util.select().position(psi2), 70) .placeNearTarget() .colored(PonderPalette.GREEN) .attachKeyFrame() @@ -142,9 +141,11 @@ public class FluidMovementActorScenes { 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.overlay().showControls(util.vector().blockSurface( + util.grid().at(5, 3, 2), Direction.WEST) + .add(0, 0.5, 0), Pointing.LEFT, 30) + .withItem(bucket); + scene.world().modifyBlockEntity(st, type, be -> be.getCapability(fhc) .ifPresent(ifh -> ifh.drain(1000, FluidAction.EXECUTE))); scene.world().modifyBlockEntity(ct1, type, be -> be.getCapability(fhc) diff --git a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/fluid/FluidTankScenes.java b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/fluid/FluidTankScenes.java index 90fad9128..4ce2556c4 100644 --- a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/fluid/FluidTankScenes.java +++ b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/fluid/FluidTankScenes.java @@ -17,14 +17,12 @@ import com.simibubi.create.foundation.ponder.CreateSceneBuilder; import net.createmod.catnip.utility.Pointing; import net.createmod.catnip.utility.VecHelper; +import net.createmod.ponder.api.PonderPalette; +import net.createmod.ponder.api.element.ElementLink; +import net.createmod.ponder.api.element.WorldSectionElement; import net.createmod.ponder.api.scene.SceneBuilder; import net.createmod.ponder.api.scene.SceneBuildingUtil; -import net.createmod.ponder.foundation.ElementLink; -import net.createmod.ponder.foundation.PonderPalette; -import net.createmod.ponder.foundation.Selection; -import net.createmod.ponder.foundation.element.InputWindowElement; -import net.createmod.ponder.foundation.element.WorldSectionElement; -import net.createmod.ponder.foundation.instruction.EmitParticlesInstruction.Emitter; +import net.createmod.ponder.api.scene.Selection; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.util.RandomSource; @@ -157,13 +155,11 @@ public class FluidTankScenes { scene.idle(20); ItemStack bucket = new ItemStack(Items.BUCKET, 1); - scene.overlay().showControls( - new InputWindowElement(util.vector().blockSurface(util.grid().at(2, 2, 2), Direction.NORTH), Pointing.RIGHT) + scene.overlay().showControls(util.vector().blockSurface(util.grid().at(2, 2, 2), Direction.NORTH), Pointing.RIGHT, 40) .showing(AllIcons.I_MTD_CLOSE) - .withItem(bucket), - 40); + .withItem(bucket); scene.idle(7); - scene.overlay().showSelectionWithText(util.select().fromTo(2, 1, 2, 2, 2, 2), 70) + scene.overlay().showOutlineWithText(util.select().fromTo(2, 1, 2, 2, 2, 2), 70) .text("However, in Survival Mode Fluids cannot be added or taken manually") .attachKeyFrame() .colored(PonderPalette.RED) @@ -209,7 +205,7 @@ public class FluidTankScenes { for (int i = 0; i < 10; i++) { scene.effects().emitParticles(util.vector().topOf(3, 1, 1) .add(0, 1 / 16f, 0), - Emitter.simple(FluidFX.getFluidParticle(content), + scene.effects().simpleParticleEmitter(FluidFX.getFluidParticle(content), VecHelper.offsetRandomly(Vec3.ZERO, random, .1f)), 1, 1); } @@ -332,11 +328,9 @@ public class FluidTankScenes { .pointAt(blockSurface); scene.idle(70); - scene.overlay().showControls( - new InputWindowElement(util.vector().blockSurface(util.grid().at(3, 3, 1), Direction.NORTH), Pointing.RIGHT) + scene.overlay().showControls(util.vector().blockSurface(util.grid().at(3, 3, 1), Direction.NORTH), Pointing.RIGHT, 60) .rightClick() - .withItem(AllItems.WRENCH.asStack()), - 60); + .withItem(AllItems.WRENCH.asStack()); scene.idle(7); scene.world().modifyBlocks(full2, s -> s.setValue(FluidTankBlock.SHAPE, FluidTankBlock.Shape.PLAIN), false); scene.idle(30); @@ -375,11 +369,9 @@ public class FluidTankScenes { 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) + scene.overlay().showControls(util.vector().blockSurface(util.grid().at(2, 2, 2), Direction.NORTH), Pointing.RIGHT, 40) .rightClick() - .withItem(bucket), - 40); + .withItem(bucket); scene.idle(7); scene.world().modifyBlockEntity(cTankPos, CreativeFluidTankBlockEntity.class, be -> ((CreativeSmartFluidTank) be.getTankInventory()) diff --git a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/fluid/HosePulleyScenes.java b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/fluid/HosePulleyScenes.java index b84a9bc3e..6974cb832 100644 --- a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/fluid/HosePulleyScenes.java +++ b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/fluid/HosePulleyScenes.java @@ -10,12 +10,12 @@ import com.simibubi.create.content.fluids.pump.PumpBlock; import com.simibubi.create.content.fluids.tank.FluidTankBlockEntity; import com.simibubi.create.foundation.ponder.CreateSceneBuilder; +import net.createmod.ponder.api.PonderPalette; +import net.createmod.ponder.api.element.ElementLink; +import net.createmod.ponder.api.element.WorldSectionElement; import net.createmod.ponder.api.scene.SceneBuilder; import net.createmod.ponder.api.scene.SceneBuildingUtil; -import net.createmod.ponder.foundation.ElementLink; -import net.createmod.ponder.foundation.PonderPalette; -import net.createmod.ponder.foundation.Selection; -import net.createmod.ponder.foundation.element.WorldSectionElement; +import net.createmod.ponder.api.scene.Selection; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.world.level.block.Blocks; @@ -204,7 +204,7 @@ public class HosePulleyScenes { scene.world().showSectionAndMerge(crank, Direction.EAST, hoselink); scene.idle(20); - scene.overlay().showSelectionWithText(util.select().position(hosePos.below()), 50) + scene.overlay().showOutlineWithText(util.select().position(hosePos.below()), 50) .text("While fully retracted, the Hose Pulley cannot operate") .placeNearTarget() .colored(PonderPalette.RED) @@ -352,7 +352,7 @@ public class HosePulleyScenes { scene.idle(30); Selection pulleyPos = util.select().position(1, 3, 2); - scene.overlay().showSelectionWithText(pulleyPos, 60) + scene.overlay().showOutlineWithText(pulleyPos, 60) .text("It will provide/dispose fluids without affecting the source") .attachKeyFrame() .colored(PonderPalette.BLUE) diff --git a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/fluid/PipeScenes.java b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/fluid/PipeScenes.java index aefb138ba..bf0adbb02 100644 --- a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/fluid/PipeScenes.java +++ b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/fluid/PipeScenes.java @@ -18,13 +18,12 @@ import com.simibubi.create.foundation.fluid.FluidHelper; import com.simibubi.create.foundation.ponder.CreateSceneBuilder; import net.createmod.catnip.utility.Pointing; +import net.createmod.ponder.api.PonderPalette; +import net.createmod.ponder.api.element.ElementLink; +import net.createmod.ponder.api.element.WorldSectionElement; import net.createmod.ponder.api.scene.SceneBuilder; import net.createmod.ponder.api.scene.SceneBuildingUtil; -import net.createmod.ponder.foundation.ElementLink; -import net.createmod.ponder.foundation.PonderPalette; -import net.createmod.ponder.foundation.Selection; -import net.createmod.ponder.foundation.element.InputWindowElement; -import net.createmod.ponder.foundation.element.WorldSectionElement; +import net.createmod.ponder.api.scene.Selection; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.core.Direction.Axis; @@ -94,8 +93,8 @@ public class PipeScenes { scene.idle(60); - scene.overlay().showControls(new InputWindowElement(util.vector().centerOf(2, 1, 1), Pointing.DOWN).rightClick() - .withItem(AllItems.WRENCH.asStack()), 40); + scene.overlay().showControls(util.vector().centerOf(2, 1, 1), Pointing.DOWN, 40).rightClick() + .withItem(AllItems.WRENCH.asStack()); scene.idle(7); scene.world().restoreBlocks(util.select().position(2, 1, 1)); scene.overlay().showText(70) @@ -105,8 +104,8 @@ public class PipeScenes { .text("Using a wrench, a straight pipe segment can be given a window"); scene.idle(40); - scene.overlay().showControls(new InputWindowElement(util.vector().centerOf(1, 1, 2), Pointing.DOWN).rightClick() - .withItem(AllItems.WRENCH.asStack()), 10); + scene.overlay().showControls(util.vector().centerOf(1, 1, 2), Pointing.DOWN, 10).rightClick() + .withItem(AllItems.WRENCH.asStack()); scene.idle(7); scene.world().restoreBlocks(util.select().position(1, 1, 2)); scene.idle(40); @@ -151,7 +150,7 @@ public class PipeScenes { .placeNearTarget() .text("Powered by Mechanical Pumps, the Pipes can transport Fluids"); scene.idle(85); - scene.overlay().showSelectionWithText(tank, 40) + scene.overlay().showOutlineWithText(tank, 40) .colored(PonderPalette.RED) .placeNearTarget() .text("No fluid is being extracted at first"); @@ -323,8 +322,8 @@ public class PipeScenes { .setValue(FluidPipeBlock.WEST, true); ItemStack casingItem = AllBlocks.COPPER_CASING.asStack(); - scene.overlay().showControls(new InputWindowElement(util.vector().topOf(3, 1, 1), Pointing.DOWN).rightClick() - .withItem(casingItem), 60); + scene.overlay().showControls(util.vector().topOf(3, 1, 1), Pointing.DOWN, 60).rightClick() + .withItem(casingItem); scene.idle(7); scene.world().setBlock(util.grid().at(3, 1, 1), copperEncased, true); scene.idle(10); @@ -527,7 +526,7 @@ public class PipeScenes { .pointAt(filterVec); scene.idle(60); - scene.overlay().showSelectionWithText(util.select().position(basinPos), 80) + scene.overlay().showOutlineWithText(util.select().position(basinPos), 80) .placeNearTarget() .colored(PonderPalette.GREEN) .text("When placed directly at the source, they can specify the type of fluid to extract") @@ -540,8 +539,8 @@ public class PipeScenes { .getFluidType() .getBucket(chocolate); ItemStack milkBucket = new ItemStack(Items.MILK_BUCKET); - scene.overlay().showControls(new InputWindowElement(filterVec, Pointing.DOWN).rightClick() - .withItem(bucket), 80); + scene.overlay().showControls(filterVec, Pointing.DOWN, 80).rightClick() + .withItem(bucket); scene.idle(7); scene.world().setFilterData(util.select().position(3, 1, 1), SmartFluidPipeBlockEntity.class, bucket); scene.idle(10); @@ -589,14 +588,14 @@ public class PipeScenes { .pointAt(filterVec.add(-1, 0, 2)); scene.idle(90); - scene.overlay().showControls(new InputWindowElement(filterVec.add(-1, 0, 3), Pointing.DOWN).rightClick() - .withItem(milkBucket), 30); + scene.overlay().showControls(filterVec.add(-1, 0, 3), Pointing.DOWN, 30).rightClick() + .withItem(milkBucket); scene.idle(7); scene.world().setFilterData(util.select().position(2, 1, 4), SmartFluidPipeBlockEntity.class, milkBucket); scene.idle(30); - scene.overlay().showControls(new InputWindowElement(filterVec.add(-1, 0, 2), Pointing.DOWN).rightClick() - .withItem(bucket), 30); + scene.overlay().showControls(filterVec.add(-1, 0, 2), Pointing.DOWN, 30).rightClick() + .withItem(bucket); scene.idle(7); scene.world().setFilterData(util.select().position(2, 1, 3), SmartFluidPipeBlockEntity.class, bucket); scene.idle(30); diff --git a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/fluid/PumpScenes.java b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/fluid/PumpScenes.java index e9e0494c3..90328d26b 100644 --- a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/fluid/PumpScenes.java +++ b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/fluid/PumpScenes.java @@ -10,13 +10,12 @@ import com.simibubi.create.content.kinetics.simpleRelays.CogWheelBlock; import com.simibubi.create.foundation.ponder.CreateSceneBuilder; import net.createmod.catnip.utility.Pointing; +import net.createmod.ponder.api.PonderPalette; +import net.createmod.ponder.api.element.ElementLink; +import net.createmod.ponder.api.element.WorldSectionElement; import net.createmod.ponder.api.scene.SceneBuilder; import net.createmod.ponder.api.scene.SceneBuildingUtil; -import net.createmod.ponder.foundation.ElementLink; -import net.createmod.ponder.foundation.PonderPalette; -import net.createmod.ponder.foundation.Selection; -import net.createmod.ponder.foundation.element.InputWindowElement; -import net.createmod.ponder.foundation.element.WorldSectionElement; +import net.createmod.ponder.api.scene.Selection; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.core.Direction.Axis; @@ -139,8 +138,8 @@ public class PumpScenes { scene.overlay().chaseBoundingBoxOutline(PonderPalette.RED, in, new AABB(leverPos.below()), 30); scene.idle(45); - scene.overlay().showControls(new InputWindowElement(util.vector().topOf(pumpPos), Pointing.DOWN).rightClick() - .withItem(AllItems.WRENCH.asStack()), 40); + scene.overlay().showControls(util.vector().topOf(pumpPos), Pointing.DOWN, 40).rightClick() + .withItem(AllItems.WRENCH.asStack()); scene.idle(7); scene.world().modifyBlock(pumpPos, s -> s.setValue(PumpBlock.FACING, Direction.EAST), true); scene.overlay().showText(70) @@ -291,7 +290,7 @@ public class PumpScenes { scene.world().setKineticSpeed(largeCog, 8); scene.idle(20); - scene.overlay().showSelectionWithText(util.select().fromTo(2, 1, 1, 2, 1, 3), 60) + scene.overlay().showOutlineWithText(util.select().fromTo(2, 1, 1, 2, 1, 3), 60) .attachKeyFrame() .colored(PonderPalette.GREEN) .pointAt(util.vector().topOf(pumpPos)) @@ -300,9 +299,8 @@ public class PumpScenes { scene.idle(70); scene.idle(30); - scene.overlay() - .showControls(new InputWindowElement(util.vector().topOf(pumpPos.north()), Pointing.DOWN).rightClick() - .withItem(AllItems.WRENCH.asStack()), 30); + scene.overlay().showControls(util.vector().topOf(pumpPos.north()), Pointing.DOWN, 30).rightClick() + .withItem(AllItems.WRENCH.asStack()); scene.idle(7); scene.world().modifyBlock(pumpPos.north(), s -> s.setValue(PumpBlock.FACING, Direction.WEST), true); scene.idle(30); diff --git a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/fluid/SpoutScenes.java b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/fluid/SpoutScenes.java index 27bedac72..4cd6047e6 100644 --- a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/fluid/SpoutScenes.java +++ b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/fluid/SpoutScenes.java @@ -11,14 +11,12 @@ import com.simibubi.create.foundation.ponder.element.BeltItemElement; import net.createmod.catnip.utility.Pointing; import net.createmod.catnip.utility.VecHelper; +import net.createmod.ponder.api.PonderPalette; +import net.createmod.ponder.api.element.ElementLink; +import net.createmod.ponder.api.element.WorldSectionElement; import net.createmod.ponder.api.scene.SceneBuilder; import net.createmod.ponder.api.scene.SceneBuildingUtil; -import net.createmod.ponder.foundation.ElementLink; -import net.createmod.ponder.foundation.PonderPalette; -import net.createmod.ponder.foundation.Selection; -import net.createmod.ponder.foundation.element.InputWindowElement; -import net.createmod.ponder.foundation.element.WorldSectionElement; -import net.createmod.ponder.foundation.instruction.EmitParticlesInstruction.Emitter; +import net.createmod.ponder.api.scene.Selection; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.core.particles.ParticleOptions; @@ -77,13 +75,11 @@ public class SpoutScenes { ItemStack bucket = AllFluids.HONEY.get() .getFluidType() .getBucket(honey); - scene.overlay().showControls( - new InputWindowElement(util.vector().blockSurface(util.grid().at(2, 3, 2), Direction.NORTH), Pointing.RIGHT) + scene.overlay().showControls(util.vector().blockSurface(util.grid().at(2, 3, 2), Direction.NORTH), Pointing.RIGHT, 40) .showing(AllIcons.I_MTD_CLOSE) - .withItem(bucket), - 40); + .withItem(bucket); scene.idle(7); - scene.overlay().showSelectionWithText(util.select().position(2, 3, 2), 50) + scene.overlay().showOutlineWithText(util.select().position(2, 3, 2), 50) .pointAt(util.vector().blockSurface(util.grid().at(2, 3, 2), Direction.WEST)) .attachKeyFrame() .colored(PonderPalette.RED) @@ -106,7 +102,7 @@ public class SpoutScenes { ItemStack bottle = new ItemStack(Items.GLASS_BOTTLE); scene.world().createItemOnBeltLike(depotPos, Direction.NORTH, bottle); Vec3 depotCenter = util.vector().centerOf(depotPos.south()); - scene.overlay().showControls(new InputWindowElement(depotCenter, Pointing.UP).withItem(bottle), 30); + scene.overlay().showControls(depotCenter, Pointing.UP, 30).withItem(bottle); scene.idle(10); scene.idle(20); @@ -119,10 +115,10 @@ public class SpoutScenes { for (int i = 0; i < 10; i++) { scene.effects().emitParticles(util.vector().topOf(depotPos.south()) .add(0, 1 / 16f, 0), - Emitter.simple(fluidParticle, VecHelper.offsetRandomly(Vec3.ZERO, random, .1f)), 1, 1); + scene.effects().simpleParticleEmitter(fluidParticle, VecHelper.offsetRandomly(Vec3.ZERO, random, .1f)), 1, 1); } scene.idle(10); - scene.overlay().showControls(new InputWindowElement(depotCenter, Pointing.UP).withItem(potion), 50); + scene.overlay().showControls(depotCenter, Pointing.UP, 50).withItem(potion); scene.idle(60); scene.world().hideIndependentSection(depot, Direction.NORTH); @@ -156,7 +152,7 @@ public class SpoutScenes { for (int i = 0; i < 10; i++) { scene.effects().emitParticles(util.vector().topOf(depotPos.south()) .add(0, 1 / 16f, 0), - Emitter.simple(fluidParticle, VecHelper.offsetRandomly(Vec3.ZERO, random, .1f)), 1, 1); + scene.effects().simpleParticleEmitter(fluidParticle, VecHelper.offsetRandomly(Vec3.ZERO, random, .1f)), 1, 1); } scene.world().removeItemsFromBelt(spoutPos.below(2)); ingot = scene.world().createItemOnBelt(spoutPos.below(2), Direction.UP, potion); @@ -170,7 +166,7 @@ public class SpoutScenes { for (int i = 0; i < 10; i++) { scene.effects().emitParticles(util.vector().topOf(depotPos.south()) .add(0, 1 / 16f, 0), - Emitter.simple(fluidParticle, VecHelper.offsetRandomly(Vec3.ZERO, random, .1f)), 1, 1); + scene.effects().simpleParticleEmitter(fluidParticle, VecHelper.offsetRandomly(Vec3.ZERO, random, .1f)), 1, 1); } scene.world().removeItemsFromBelt(spoutPos.below(2)); ingot2 = scene.world().createItemOnBelt(spoutPos.below(2), Direction.UP, potion); diff --git a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/trains/TrackObserverScenes.java b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/trains/TrackObserverScenes.java index 967cf04eb..c5c9f5613 100644 --- a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/trains/TrackObserverScenes.java +++ b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/trains/TrackObserverScenes.java @@ -5,14 +5,14 @@ import com.simibubi.create.content.trains.observer.TrackObserverBlockEntity; import com.simibubi.create.foundation.ponder.CreateSceneBuilder; import net.createmod.catnip.utility.Pointing; +import net.createmod.ponder.api.PonderPalette; +import net.createmod.ponder.api.element.ElementLink; +import net.createmod.ponder.api.element.ParrotElement; +import net.createmod.ponder.api.element.ParrotPose; +import net.createmod.ponder.api.element.WorldSectionElement; import net.createmod.ponder.api.scene.SceneBuilder; import net.createmod.ponder.api.scene.SceneBuildingUtil; -import net.createmod.ponder.foundation.ElementLink; -import net.createmod.ponder.foundation.PonderPalette; -import net.createmod.ponder.foundation.Selection; -import net.createmod.ponder.foundation.element.InputWindowElement; -import net.createmod.ponder.foundation.element.ParrotElement; -import net.createmod.ponder.foundation.element.WorldSectionElement; +import net.createmod.ponder.api.scene.Selection; import net.minecraft.core.Direction; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; @@ -50,8 +50,8 @@ public class TrackObserverScenes { Vec3 target = util.vector().topOf(5, 0, 7); AABB bb = new AABB(target, target).move(0, 2 / 16f, 0); - scene.overlay().showControls(new InputWindowElement(target, Pointing.DOWN).rightClick() - .withItem(AllBlocks.TRACK_OBSERVER.asStack()), 40); + scene.overlay().showControls(target, Pointing.DOWN, 40).rightClick() + .withItem(AllBlocks.TRACK_OBSERVER.asStack()); scene.idle(6); scene.overlay().chaseBoundingBoxOutline(PonderPalette.GREEN, bb, bb, 1); scene.overlay().chaseBoundingBoxOutline(PonderPalette.GREEN, bb, bb.inflate(.45f, 1 / 16f, .45f), 60); @@ -83,7 +83,7 @@ public class TrackObserverScenes { scene.world().moveSection(trainInstance1, util.vector().of(-16, 0, 0), 80); scene.world().animateBogey(util.grid().at(5, 2, 7), 16, 80); ElementLink birb = - scene.special().createBirb(util.vector().centerOf(12, 3, 7), ParrotElement.FacePointOfInterestPose::new); + scene.special().createBirb(util.vector().centerOf(12, 3, 7), ParrotPose.FacePointOfInterestPose::new); scene.special().moveParrot(birb, util.vector().of(-16, 0, 0), 80); scene.idle(10); @@ -118,7 +118,7 @@ public class TrackObserverScenes { scene.idle(40); ItemStack waterBucket = new ItemStack(Items.WATER_BUCKET); - scene.overlay().showControls(new InputWindowElement(target, Pointing.DOWN).withItem(waterBucket), 30); + scene.overlay().showControls(target, Pointing.DOWN, 30).withItem(waterBucket); scene.idle(6); scene.world().setFilterData(observer, TrackObserverBlockEntity.class, waterBucket); scene.idle(50); @@ -127,7 +127,7 @@ public class TrackObserverScenes { scene.world().moveSection(trainInstance1, util.vector().of(6, 0, 0), 0); scene.world().moveSection(trainInstance1, util.vector().of(-16, 0, 0), 80); scene.world().animateBogey(util.grid().at(5, 2, 7), 16, 80); - birb = scene.special().createBirb(util.vector().centerOf(12, 3, 7), ParrotElement.FacePointOfInterestPose::new); + birb = scene.special().createBirb(util.vector().centerOf(12, 3, 7), ParrotPose.FacePointOfInterestPose::new); scene.special().moveParrot(birb, util.vector().of(-16, 0, 0), 80); scene.idle(10); @@ -147,7 +147,7 @@ public class TrackObserverScenes { scene.world().moveSection(trainInstance1, util.vector().of(6, 0, 0), 0); scene.world().moveSection(trainInstance1, util.vector().of(-16, 0, 0), 80); scene.world().animateBogey(util.grid().at(5, 2, 7), 16, 80); - birb = scene.special().createBirb(util.vector().centerOf(12, 3, 7), ParrotElement.FacePointOfInterestPose::new); + birb = scene.special().createBirb(util.vector().centerOf(12, 3, 7), ParrotPose.FacePointOfInterestPose::new); scene.special().moveParrot(birb, util.vector().of(-16, 0, 0), 80); scene.idle(10); diff --git a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/trains/TrackScenes.java b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/trains/TrackScenes.java index 25c5a1243..a862eb35d 100644 --- a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/trains/TrackScenes.java +++ b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/trains/TrackScenes.java @@ -7,14 +7,14 @@ import com.simibubi.create.content.processing.burner.BlazeBurnerBlock; import com.simibubi.create.foundation.ponder.CreateSceneBuilder; import net.createmod.catnip.utility.Pointing; +import net.createmod.ponder.api.PonderPalette; +import net.createmod.ponder.api.element.ElementLink; +import net.createmod.ponder.api.element.ParrotElement; +import net.createmod.ponder.api.element.ParrotPose; +import net.createmod.ponder.api.element.WorldSectionElement; import net.createmod.ponder.api.scene.SceneBuilder; import net.createmod.ponder.api.scene.SceneBuildingUtil; -import net.createmod.ponder.foundation.ElementLink; -import net.createmod.ponder.foundation.PonderPalette; -import net.createmod.ponder.foundation.Selection; -import net.createmod.ponder.foundation.element.InputWindowElement; -import net.createmod.ponder.foundation.element.ParrotElement; -import net.createmod.ponder.foundation.element.WorldSectionElement; +import net.createmod.ponder.api.scene.Selection; import net.minecraft.core.Direction; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.block.Blocks; @@ -62,16 +62,21 @@ public class TrackScenes { scene.idle(30); ItemStack trackStack = AllBlocks.TRACK.asStack(); - scene.overlay().showControls(new InputWindowElement(startTrack, Pointing.DOWN).rightClick() - .withItem(trackStack), 40); + + scene.overlay().showControls(startTrack, Pointing.DOWN, 40) + .rightClick() + .withItem(trackStack); + + scene.overlay().showControls(startTrack, Pointing.DOWN, 40).rightClick() + .withItem(trackStack); scene.idle(6); AABB bb = new AABB(util.grid().at(3, 1, 5)).contract(0, .75f, 0) .inflate(0, 0, .85f); scene.overlay().chaseBoundingBoxOutline(PonderPalette.GREEN, startTrack, bb, 32); scene.idle(45); - scene.overlay().showControls(new InputWindowElement(startTrack.add(9, 0, 0), Pointing.DOWN).rightClick() - .withItem(trackStack), 40); + scene.overlay().showControls(startTrack.add(9, 0, 0), Pointing.DOWN, 40).rightClick() + .withItem(trackStack); scene.idle(6); scene.overlay().showText(40) .pointAt(util.vector().topOf(12, 0, 5)) @@ -93,11 +98,11 @@ public class TrackScenes { scene.idle(10); scene.addKeyframe(); - scene.overlay().showControls(new InputWindowElement(util.vector().topOf(8, 0, 2), Pointing.DOWN).rightClick() - .withItem(trackStack), 15); + scene.overlay().showControls(util.vector().topOf(8, 0, 2), Pointing.DOWN, 15).rightClick() + .withItem(trackStack); scene.idle(15); - scene.overlay().showControls(new InputWindowElement(util.vector().topOf(2, 0, 8), Pointing.DOWN).rightClick() - .withItem(trackStack), 15); + scene.overlay().showControls(util.vector().topOf(2, 0, 8), Pointing.DOWN, 15).rightClick() + .withItem(trackStack); scene.idle(7); scene.world().showSection(util.select().position(2, 1, 8), Direction.DOWN); scene.idle(25); @@ -111,11 +116,11 @@ public class TrackScenes { scene.world().showSection(util.select().position(12, 1, 2), Direction.SOUTH); scene.idle(10); - scene.overlay().showControls(new InputWindowElement(util.vector().topOf(12, 0, 2), Pointing.DOWN).rightClick() - .withItem(trackStack), 10); + scene.overlay().showControls(util.vector().topOf(12, 0, 2), Pointing.DOWN, 10).rightClick() + .withItem(trackStack); scene.idle(15); - scene.overlay().showControls(new InputWindowElement(util.vector().topOf(2, 0, 12), Pointing.DOWN).rightClick() - .withItem(trackStack), 10); + scene.overlay().showControls(util.vector().topOf(2, 0, 12), Pointing.DOWN, 10).rightClick() + .withItem(trackStack); scene.idle(7); scene.world().showSection(util.select().fromTo(12, 1, 3, 12, 1, 5), Direction.DOWN); scene.idle(3); @@ -148,13 +153,13 @@ public class TrackScenes { scene.world().showSection(util.select().position(12, 1, 2), Direction.SOUTH); scene.idle(20); - scene.overlay().showControls(new InputWindowElement(util.vector().topOf(12, 0, 2), Pointing.DOWN).rightClick() - .withItem(trackStack), 10); + scene.overlay().showControls(util.vector().topOf(12, 0, 2), Pointing.DOWN, 10).rightClick() + .withItem(trackStack); scene.idle(10); - scene.overlay().showControls(new InputWindowElement(util.vector().topOf(2, 0, 12), Pointing.DOWN).rightClick() + scene.overlay().showControls(util.vector().topOf(2, 0, 12), Pointing.DOWN, 60).rightClick() .withItem(trackStack) - .whileCTRL(), 60); + .whileCTRL(); scene.idle(10); scene.overlay().showText(60) @@ -192,19 +197,15 @@ public class TrackScenes { scene.world().showSectionAndMerge(util.select().fromTo(2, 6, 10, 2, 11, 12), Direction.DOWN, slopeStart); scene.idle(20); - scene.overlay() - .showControls(new InputWindowElement(util.vector().topOf(12, 3, 11), Pointing.LEFT).withItem(trackStack), 30); + scene.overlay().showControls(util.vector().topOf(12, 3, 11), Pointing.LEFT, 30).withItem(trackStack); scene.idle(4); ItemStack smoothStone = new ItemStack(Blocks.SMOOTH_STONE); - scene.overlay().showControls( - new InputWindowElement(util.vector().topOf(12, 3, 11), Pointing.RIGHT).withItem(smoothStone), 26); + scene.overlay().showControls(util.vector().topOf(12, 3, 11), Pointing.RIGHT, 26).withItem(smoothStone); scene.idle(30); - scene.overlay() - .showControls(new InputWindowElement(util.vector().topOf(2, 6, 11), Pointing.LEFT).withItem(trackStack), 30); + scene.overlay().showControls(util.vector().topOf(2, 6, 11), Pointing.LEFT, 30).withItem(trackStack); scene.idle(4); - scene.overlay().showControls( - new InputWindowElement(util.vector().topOf(2, 6, 11), Pointing.RIGHT).withItem(smoothStone), 26); + scene.overlay().showControls(util.vector().topOf(2, 6, 11), Pointing.RIGHT, 26).withItem(smoothStone); scene.idle(10); scene.world().showSectionAndMerge(util.select().position(2, 12, 11), Direction.DOWN, slopeStart); @@ -219,19 +220,15 @@ public class TrackScenes { .text("Materials in the off-hand will be paved under tracks automatically"); scene.idle(80); - scene.overlay() - .showControls(new InputWindowElement(util.vector().topOf(12, 2, 7), Pointing.LEFT).withItem(trackStack), 30); + scene.overlay().showControls(util.vector().topOf(12, 2, 7), Pointing.LEFT, 30).withItem(trackStack); scene.idle(4); smoothStone = new ItemStack(Blocks.SMOOTH_STONE_SLAB); - scene.overlay().showControls( - new InputWindowElement(util.vector().topOf(12, 2, 7), Pointing.RIGHT).withItem(smoothStone), 26); + scene.overlay().showControls(util.vector().topOf(12, 2, 7), Pointing.RIGHT, 26).withItem(smoothStone); scene.idle(30); - scene.overlay() - .showControls(new InputWindowElement(util.vector().topOf(2, 4, 7), Pointing.LEFT).withItem(trackStack), 30); + scene.overlay().showControls(util.vector().topOf(2, 4, 7), Pointing.LEFT, 30).withItem(trackStack); scene.idle(4); - scene.overlay() - .showControls(new InputWindowElement(util.vector().topOf(2, 4, 7), Pointing.RIGHT).withItem(smoothStone), 26); + scene.overlay().showControls(util.vector().topOf(2, 4, 7), Pointing.RIGHT, 26).withItem(smoothStone); scene.idle(10); scene.world().showSectionAndMerge(util.select().position(2, 10, 7), Direction.DOWN, slopeStart); @@ -239,19 +236,15 @@ public class TrackScenes { scene.world().showSectionAndMerge(util.select().fromTo(11, 7, 6, 3, 11, 8), Direction.UP, slopeStart); scene.idle(20); - scene.overlay() - .showControls(new InputWindowElement(util.vector().topOf(12, 1, 3), Pointing.LEFT).withItem(trackStack), 30); + scene.overlay().showControls(util.vector().topOf(12, 1, 3), Pointing.LEFT, 30).withItem(trackStack); scene.idle(4); smoothStone = AllBlocks.METAL_GIRDER.asStack(); - scene.overlay().showControls( - new InputWindowElement(util.vector().topOf(12, 1, 3), Pointing.RIGHT).withItem(smoothStone), 26); + scene.overlay().showControls(util.vector().topOf(12, 1, 3), Pointing.RIGHT, 26).withItem(smoothStone); scene.idle(30); - scene.overlay() - .showControls(new InputWindowElement(util.vector().topOf(2, 2, 3), Pointing.LEFT).withItem(trackStack), 30); + scene.overlay().showControls(util.vector().topOf(2, 2, 3), Pointing.LEFT, 30).withItem(trackStack); scene.idle(4); - scene.overlay() - .showControls(new InputWindowElement(util.vector().topOf(2, 2, 3), Pointing.RIGHT).withItem(smoothStone), 26); + scene.overlay().showControls(util.vector().topOf(2, 2, 3), Pointing.RIGHT, 26).withItem(smoothStone); scene.idle(10); scene.world().showSectionAndMerge(util.select().position(2, 8, 3), Direction.DOWN, slopeStart); @@ -299,7 +292,7 @@ public class TrackScenes { scene.world().showIndependentSection(util.select().fromTo(5, 2, 4, 3, 3, 5), Direction.DOWN); ElementLink birb = - scene.special().createBirb(util.vector().centerOf(4, 3, 2), ParrotElement.FacePointOfInterestPose::new); + scene.special().createBirb(util.vector().centerOf(4, 3, 2), ParrotPose.FacePointOfInterestPose::new); scene.special().conductorBirb(birb, true); scene.special().movePointOfInterest(util.grid().at(4, 4, 10)); @@ -379,7 +372,7 @@ public class TrackScenes { scene.idle(5); scene.world().showSectionAndMerge(vStation, Direction.DOWN, stationElement); ElementLink birb = - scene.special().createBirb(util.vector().centerOf(2, 2, 7), ParrotElement.FacePointOfInterestPose::new); + scene.special().createBirb(util.vector().centerOf(2, 2, 7), ParrotPose.FacePointOfInterestPose::new); scene.special().movePointOfInterest(util.grid().at(4, 3, 4)); scene.idle(5); ElementLink trainElement = scene.world().showIndependentSection(train, Direction.DOWN); @@ -446,7 +439,7 @@ public class TrackScenes { .add(dStation), null); ElementLink dPlatformElement = scene.world().showIndependentSection(dPlatform, null); - birb = scene.special().createBirb(util.vector().centerOf(-2, 2, 7), ParrotElement.FacePointOfInterestPose::new); + birb = scene.special().createBirb(util.vector().centerOf(-2, 2, 7), ParrotPose.FacePointOfInterestPose::new); scene.world().moveSection(dPlatformElement, util.vector().of(-8, -2, 0), 0); scene.world().moveSection(stationElement, util.vector().of(-8, 0, 0), 0); scene.world().moveSection(stationElement, util.vector().of(8, 0, 0), 80); diff --git a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/trains/TrainScenes.java b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/trains/TrainScenes.java index 5ab10aa48..efeff69d6 100644 --- a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/trains/TrainScenes.java +++ b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/trains/TrainScenes.java @@ -6,14 +6,14 @@ import com.simibubi.create.content.trains.station.StationBlock; import com.simibubi.create.foundation.ponder.CreateSceneBuilder; import net.createmod.catnip.utility.Pointing; +import net.createmod.ponder.api.PonderPalette; +import net.createmod.ponder.api.element.ElementLink; +import net.createmod.ponder.api.element.ParrotElement; +import net.createmod.ponder.api.element.ParrotPose; +import net.createmod.ponder.api.element.WorldSectionElement; import net.createmod.ponder.api.scene.SceneBuilder; import net.createmod.ponder.api.scene.SceneBuildingUtil; -import net.createmod.ponder.foundation.ElementLink; -import net.createmod.ponder.foundation.PonderPalette; -import net.createmod.ponder.foundation.Selection; -import net.createmod.ponder.foundation.element.InputWindowElement; -import net.createmod.ponder.foundation.element.ParrotElement; -import net.createmod.ponder.foundation.element.WorldSectionElement; +import net.createmod.ponder.api.scene.Selection; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.world.item.ItemStack; @@ -67,8 +67,7 @@ public class TrainScenes { scene.world().toggleControls(initialControlsPos); scene.idle(20); - scene.overlay().showControls( - new InputWindowElement(util.vector().topOf(initialControlsPos), Pointing.DOWN).rightClick(), 70); + scene.overlay().showControls(util.vector().topOf(initialControlsPos), Pointing.DOWN, 70).rightClick(); scene.idle(20); scene.overlay().showText(60) @@ -93,8 +92,7 @@ public class TrainScenes { scene.world().animateBogey(util.grid().at(3, 2, 4), 4f, 30); scene.idle(40); - scene.overlay() - .showControls(new InputWindowElement(util.vector().topOf(initialControlsPos), Pointing.DOWN).scroll(), 70); + scene.overlay().showControls(util.vector().topOf(initialControlsPos), Pointing.DOWN, 70).scroll(); scene.idle(20); scene.overlay().showText(90) @@ -199,8 +197,8 @@ public class TrainScenes { scene.idle(80); Vec3 target = util.vector().topOf(util.grid().at(4, 0, 2)); - scene.overlay().showControls(new InputWindowElement(target, Pointing.RIGHT).rightClick() - .withItem(AllItems.SCHEDULE.asStack()), 80); + scene.overlay().showControls(target, Pointing.RIGHT, 80).rightClick() + .withItem(AllItems.SCHEDULE.asStack()); scene.overlay().showText(80) .pointAt(target) .placeNearTarget() @@ -209,9 +207,8 @@ public class TrainScenes { .text("Right-click with the item in hand to open its Interface"); scene.idle(100); - scene.overlay() - .showControls(new InputWindowElement(util.vector().topOf(util.grid().at(3, 3, 4)), Pointing.DOWN).rightClick() - .withItem(AllItems.SCHEDULE.asStack()), 80); + scene.overlay().showControls(util.vector().topOf(util.grid().at(3, 3, 4)), Pointing.DOWN, 80).rightClick() + .withItem(AllItems.SCHEDULE.asStack()); scene.idle(6); scene.world().conductorBlaze(util.grid().at(3, 3, 4), true); scene.overlay().showText(70) @@ -232,7 +229,7 @@ public class TrainScenes { scene.world().moveSection(trainElement2, util.vector().of(0, 0, -3), 0); scene.idle(10); Vec3 birbVec = util.vector().topOf(util.grid().at(3, 0, 7)); - ElementLink birb = scene.special().createBirb(birbVec, ParrotElement.FacePointOfInterestPose::new); + ElementLink birb = scene.special().createBirb(birbVec, ParrotPose.FacePointOfInterestPose::new); scene.world().animateTrainStation(stationPos, true); scene.overlay().showText(110) @@ -242,12 +239,12 @@ public class TrainScenes { .text("Any mob or blaze burner sitting in front of Train Controls is an eligible conductor"); scene.idle(80); - scene.overlay().showControls(new InputWindowElement(util.vector().centerOf(util.grid().at(3, 1, 7)), Pointing.DOWN) - .withItem(new ItemStack(Items.LEAD)), 30); + scene.overlay().showControls(util.vector().centerOf(util.grid().at(3, 1, 7)), Pointing.DOWN, 30) + .withItem(new ItemStack(Items.LEAD)); scene.idle(40); target = util.vector().centerOf(util.grid().at(3, 3, 4)); - scene.overlay().showControls(new InputWindowElement(target.add(0.5, 0, 0), Pointing.RIGHT).rightClick() - .withItem(new ItemStack(Items.LEAD)), 30); + scene.overlay().showControls(target.add(0.5, 0, 0), Pointing.RIGHT, 30).rightClick() + .withItem(new ItemStack(Items.LEAD)); scene.idle(6); scene.special().moveParrot(birb, target.subtract(birbVec), 5); scene.effects().indicateSuccess(util.grid().at(3, 3, 4)); @@ -261,8 +258,8 @@ public class TrainScenes { .text("Creatures on a lead can be given their seat more conveniently"); scene.idle(80); - scene.overlay().showControls(new InputWindowElement(util.vector().topOf(util.grid().at(3, 3, 4)), Pointing.DOWN) - .withItem(AllItems.SCHEDULE.asStack()), 15); + scene.overlay().showControls(util.vector().topOf(util.grid().at(3, 3, 4)), Pointing.DOWN, 15) + .withItem(AllItems.SCHEDULE.asStack()); scene.idle(6); scene.special().conductorBirb(birb, true); scene.special().movePointOfInterest(util.grid().at(16, 4, 4)); @@ -273,8 +270,7 @@ public class TrainScenes { scene.special().moveParrot(birb, util.vector().of(3, 0, 0), 30); scene.idle(40); - scene.overlay().showControls( - new InputWindowElement(util.vector().topOf(util.grid().at(6, 3, 4)), Pointing.DOWN).rightClick(), 70); + scene.overlay().showControls(util.vector().topOf(util.grid().at(6, 3, 4)), Pointing.DOWN, 70).rightClick(); scene.idle(6); scene.special().conductorBirb(birb, false); scene.special().movePointOfInterest(util.grid().at(3, 4, 1)); diff --git a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/trains/TrainSignalScenes.java b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/trains/TrainSignalScenes.java index 9adbb8e66..1a6f94cea 100644 --- a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/trains/TrainSignalScenes.java +++ b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/trains/TrainSignalScenes.java @@ -7,14 +7,14 @@ import com.simibubi.create.content.trains.signal.SignalBlockEntity.SignalState; import com.simibubi.create.foundation.ponder.CreateSceneBuilder; import net.createmod.catnip.utility.Pointing; +import net.createmod.ponder.api.PonderPalette; +import net.createmod.ponder.api.element.ElementLink; +import net.createmod.ponder.api.element.ParrotElement; +import net.createmod.ponder.api.element.ParrotPose; +import net.createmod.ponder.api.element.WorldSectionElement; import net.createmod.ponder.api.scene.SceneBuilder; import net.createmod.ponder.api.scene.SceneBuildingUtil; -import net.createmod.ponder.foundation.ElementLink; -import net.createmod.ponder.foundation.PonderPalette; -import net.createmod.ponder.foundation.Selection; -import net.createmod.ponder.foundation.element.InputWindowElement; -import net.createmod.ponder.foundation.element.ParrotElement; -import net.createmod.ponder.foundation.element.WorldSectionElement; +import net.createmod.ponder.api.scene.Selection; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.world.phys.AABB; @@ -57,8 +57,8 @@ public class TrainSignalScenes { AABB bb = new AABB(marker, marker); AABB bb3 = bb.move(3, 0, 0); - scene.overlay().showControls(new InputWindowElement(marker, Pointing.DOWN).rightClick() - .withItem(AllBlocks.TRACK_SIGNAL.asStack()), 40); + scene.overlay().showControls(marker, Pointing.DOWN, 40).rightClick() + .withItem(AllBlocks.TRACK_SIGNAL.asStack()); scene.idle(6); scene.overlay().chaseBoundingBoxOutline(PonderPalette.GREEN, bb, bb.move(0, -1 / 16f, 0), 1); scene.overlay().chaseBoundingBoxOutline(PonderPalette.GREEN, bb, bb.move(0, -1 / 16f, 0) @@ -87,7 +87,7 @@ public class TrainSignalScenes { ElementLink trainElement = scene.world().showIndependentSection(train, Direction.DOWN); Vec3 birbVec = util.vector().centerOf(util.grid().at(2, 3, 6)); - ElementLink birb = scene.special().createBirb(birbVec, ParrotElement.FacePointOfInterestPose::new); + ElementLink birb = scene.special().createBirb(birbVec, ParrotPose.FacePointOfInterestPose::new); scene.idle(10); scene.world().showSection(station, Direction.DOWN); @@ -102,8 +102,7 @@ public class TrainSignalScenes { .text("Scheduled Trains will never cross signals in the opposite direction"); scene.idle(90); - scene.overlay().showControls( - new InputWindowElement(birbVec.add(0, 0.5, 0), Pointing.DOWN).withItem(AllItems.SCHEDULE.asStack()), 40); + scene.overlay().showControls(birbVec.add(0, 0.5, 0), Pointing.DOWN, 40).withItem(AllItems.SCHEDULE.asStack()); scene.idle(6); scene.special().movePointOfInterest(util.grid().at(19, 4, 6)); @@ -124,8 +123,8 @@ public class TrainSignalScenes { scene.special().movePointOfInterest(util.grid().at(5, 1, 4)); scene.idle(20); - scene.overlay().showControls(new InputWindowElement(marker, Pointing.DOWN).rightClick() - .withItem(AllBlocks.TRACK_SIGNAL.asStack()), 40); + scene.overlay().showControls(marker, Pointing.DOWN, 40).rightClick() + .withItem(AllBlocks.TRACK_SIGNAL.asStack()); scene.idle(6); scene.overlay().chaseBoundingBoxOutline(PonderPalette.GREEN, bb, bb.move(0, -1 / 16f, 0), 1); scene.overlay().chaseBoundingBoxOutline(PonderPalette.GREEN, bb, bb.move(0, -1 / 16f, 0) @@ -145,8 +144,7 @@ public class TrainSignalScenes { scene.idle(90); scene.world().hideIndependentSection(signalElement, null); - scene.overlay().showControls( - new InputWindowElement(birbVec.add(0, 0.5, 0), Pointing.DOWN).withItem(AllItems.SCHEDULE.asStack()), 40); + scene.overlay().showControls(birbVec.add(0, 0.5, 0), Pointing.DOWN, 40).withItem(AllItems.SCHEDULE.asStack()); scene.idle(6); scene.special().movePointOfInterest(util.grid().at(19, 4, 6)); @@ -288,7 +286,7 @@ public class TrainSignalScenes { ElementLink trainElement = scene.world().showIndependentSection(train1, null); ElementLink birb1 = - scene.special().createBirb(util.vector().centerOf(18, 3, 7), ParrotElement.FacePointOfInterestPose::new); + scene.special().createBirb(util.vector().centerOf(18, 3, 7), ParrotPose.FacePointOfInterestPose::new); scene.world().moveSection(trainElement, util.vector().of(4, 0, 0), 0); scene.world().moveSection(trainElement, util.vector().of(-9, 0, 0), 45); scene.world().animateBogey(util.grid().at(13, 2, 7), 9f, 45); @@ -313,7 +311,7 @@ public class TrainSignalScenes { ElementLink trainElement2 = scene.world().showIndependentSection(train3, null); ElementLink birb2 = - scene.special().createBirb(util.vector().centerOf(18, 3, 7), ParrotElement.FacePointOfInterestPose::new); + scene.special().createBirb(util.vector().centerOf(18, 3, 7), ParrotPose.FacePointOfInterestPose::new); scene.world().moveSection(trainElement2, util.vector().of(4, 0, 6), 0); scene.world().moveSection(trainElement2, util.vector().of(-4.5, 0, 0), 35); scene.world().animateBogey(util.grid().at(13, 2, 1), 4.5f, 35); @@ -340,10 +338,8 @@ public class TrainSignalScenes { scene.world().changeSignalState(s3Pos, SignalState.GREEN); scene.idle(20); - scene.overlay().showControls( - new InputWindowElement(util.vector().blockSurface(s1Pos, Direction.EAST), Pointing.RIGHT).rightClick() - .withItem(AllItems.WRENCH.asStack()), - 80); + scene.overlay().showControls(util.vector().blockSurface(s1Pos, Direction.EAST), Pointing.RIGHT, 80).rightClick() + .withItem(AllItems.WRENCH.asStack()); scene.idle(6); scene.world().cycleBlockProperty(s1Pos, SignalBlock.TYPE); scene.idle(15); @@ -387,7 +383,7 @@ public class TrainSignalScenes { trainElement = scene.world().showIndependentSection(train1, Direction.DOWN); scene.world().moveSection(trainElement, util.vector().of(-10.5, 0, 0), 0); birb1 = scene.special().createBirb(util.vector().centerOf(3, 3, 7) - .add(.5, 0, 0), ParrotElement.DancePose::new); + .add(.5, 0, 0), ParrotPose.DancePose::new); scene.idle(10); scene.world().changeSignalState(s2Pos, SignalState.RED); scene.effects().indicateRedstone(s2Pos.above()); @@ -403,7 +399,7 @@ public class TrainSignalScenes { scene.idle(10); trainElement2 = scene.world().showIndependentSection(train3, null); - birb2 = scene.special().createBirb(util.vector().centerOf(18, 3, 7), ParrotElement.FacePointOfInterestPose::new); + birb2 = scene.special().createBirb(util.vector().centerOf(18, 3, 7), ParrotPose.FacePointOfInterestPose::new); scene.world().moveSection(trainElement2, util.vector().of(4, 0, 6), 0); scene.world().moveSection(trainElement2, util.vector().of(-4.5, 0, 0), 35); @@ -449,7 +445,7 @@ public class TrainSignalScenes { scene.world().moveSection(trainElement3a, util.vector().of(-20, 0, 20), 40); scene.world().animateBogey(util.grid().at(13, 2, 4), -20f, 40); ElementLink birb3 = - scene.special().createBirb(util.vector().of(18, 3.5, -2), ParrotElement.FacePointOfInterestPose::new); + scene.special().createBirb(util.vector().of(18, 3.5, -2), ParrotPose.FacePointOfInterestPose::new); scene.special().moveParrot(birb3, util.vector().of(-20, 0, 20), 40); scene.idle(5); @@ -546,7 +542,7 @@ public class TrainSignalScenes { scene.world().toggleControls(util.grid().at(6, 3, 5)); scene.world().showSection(train, Direction.DOWN); - scene.special().createBirb(util.vector().centerOf(util.grid().at(6, 3, 4)), ParrotElement.DancePose::new); + scene.special().createBirb(util.vector().centerOf(util.grid().at(6, 3, 4)), ParrotPose.DancePose::new); scene.idle(10); scene.world().toggleRedstonePower(comparator); scene.effects().indicateRedstone(signalPos); diff --git a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/trains/TrainStationScenes.java b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/trains/TrainStationScenes.java index b6b771310..5aff486fe 100644 --- a/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/trains/TrainStationScenes.java +++ b/src/main/java/com/simibubi/create/infrastructure/ponder/scenes/trains/TrainStationScenes.java @@ -6,14 +6,14 @@ import com.simibubi.create.content.trains.station.StationBlock; import com.simibubi.create.foundation.ponder.CreateSceneBuilder; import net.createmod.catnip.utility.Pointing; +import net.createmod.ponder.api.PonderPalette; +import net.createmod.ponder.api.element.ElementLink; +import net.createmod.ponder.api.element.ParrotElement; +import net.createmod.ponder.api.element.ParrotPose; +import net.createmod.ponder.api.element.WorldSectionElement; import net.createmod.ponder.api.scene.SceneBuilder; import net.createmod.ponder.api.scene.SceneBuildingUtil; -import net.createmod.ponder.foundation.ElementLink; -import net.createmod.ponder.foundation.PonderPalette; -import net.createmod.ponder.foundation.Selection; -import net.createmod.ponder.foundation.element.InputWindowElement; -import net.createmod.ponder.foundation.element.ParrotElement; -import net.createmod.ponder.foundation.element.WorldSectionElement; +import net.createmod.ponder.api.scene.Selection; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.world.item.ItemStack; @@ -61,8 +61,8 @@ public class TrainStationScenes { AABB bb = new AABB(util.vector().topOf(11, 0, 6), util.vector().topOf(11, 0, 6)).move(0, 2 / 16f, 0); - scene.overlay().showControls(new InputWindowElement(marker, Pointing.DOWN).rightClick() - .withItem(AllBlocks.TRACK_STATION.asStack()), 40); + scene.overlay().showControls(marker, Pointing.DOWN, 40).rightClick() + .withItem(AllBlocks.TRACK_STATION.asStack()); scene.idle(6); scene.overlay().chaseBoundingBoxOutline(PonderPalette.GREEN, bb, bb, 1); scene.overlay().chaseBoundingBoxOutline(PonderPalette.GREEN, bb, bb.inflate(.45f, 1 / 16f, .45f), 100); @@ -88,7 +88,7 @@ public class TrainStationScenes { .text("Stations are the Waypoints of your Track Network"); scene.idle(90); - scene.overlay().showControls(new InputWindowElement(stationTop, Pointing.DOWN).rightClick(), 50); + scene.overlay().showControls(stationTop, Pointing.DOWN, 50).rightClick(); scene.idle(16); scene.overlay().showText(70) .pointAt(stationTop) @@ -101,8 +101,7 @@ public class TrainStationScenes { scene.effects().indicateSuccess(stationPos); scene.idle(20); - scene.overlay().showControls(new InputWindowElement(marker, Pointing.DOWN).withItem(new ItemStack(Items.BARRIER)), - 60); + scene.overlay().showControls(marker, Pointing.DOWN, 60).withItem(new ItemStack(Items.BARRIER)); scene.idle(6); scene.overlay().chaseBoundingBoxOutline(PonderPalette.RED, bb, bb, 1); scene.overlay().chaseBoundingBoxOutline(PonderPalette.RED, bb, bb.inflate(.45f, 1 / 16f, .45f), 80); @@ -115,8 +114,8 @@ public class TrainStationScenes { scene.idle(85); ItemStack casing = AllBlocks.RAILWAY_CASING.asStack(); - scene.overlay().showControls(new InputWindowElement(util.vector().topOf(11, 0, 6), Pointing.RIGHT).rightClick() - .withItem(casing), 80); + scene.overlay().showControls(util.vector().topOf(11, 0, 6), Pointing.RIGHT, 80).rightClick() + .withItem(casing); scene.idle(6); scene.world().restoreBlocks(util.select().position(10, 2, 6)); ElementLink trainElement1 = @@ -130,15 +129,15 @@ public class TrainStationScenes { .text("Create new bogeys by using Train Casing on Tracks"); scene.idle(55); - scene.overlay().showControls(new InputWindowElement(util.vector().topOf(4, 0, 6), Pointing.RIGHT).rightClick() - .withItem(casing), 15); + scene.overlay().showControls(util.vector().topOf(4, 0, 6), Pointing.RIGHT, 15).rightClick() + .withItem(casing); scene.idle(6); scene.world().setBlock(util.grid().at(3, 2, 6), AllBlocks.SMALL_BOGEY.getDefaultState(), false); ElementLink trainElement2 = scene.world().showIndependentSection(util.select().position(3, 2, 6), Direction.DOWN); scene.idle(20); - scene.overlay().showControls(new InputWindowElement(util.vector().topOf(7, 0, 6), Pointing.RIGHT).rightClick() - .withItem(casing), 15); + scene.overlay().showControls(util.vector().topOf(7, 0, 6), Pointing.RIGHT, 15).rightClick() + .withItem(casing); scene.idle(6); scene.world().setBlock(util.grid().at(6, 2, 6), AllBlocks.SMALL_BOGEY.getDefaultState(), false); scene.world().showSectionAndMerge(util.select().position(6, 2, 6), Direction.DOWN, trainElement2); @@ -152,11 +151,11 @@ public class TrainStationScenes { .text("Click the track again to cycle between bogey designs"); scene.idle(35); - scene.overlay().showControls(new InputWindowElement(util.vector().topOf(4, 0, 6), Pointing.RIGHT).rightClick(), 15); + scene.overlay().showControls(util.vector().topOf(4, 0, 6), Pointing.RIGHT, 15).rightClick(); scene.idle(6); scene.world().restoreBlocks(util.select().position(3, 2, 6)); scene.idle(20); - scene.overlay().showControls(new InputWindowElement(util.vector().topOf(7, 0, 6), Pointing.RIGHT).rightClick(), 15); + scene.overlay().showControls(util.vector().topOf(7, 0, 6), Pointing.RIGHT, 15).rightClick(); scene.idle(6); scene.world().restoreBlocks(util.select().position(6, 2, 6)); scene.idle(30); @@ -200,15 +199,15 @@ public class TrainStationScenes { scene.overlay().chaseBoundingBoxOutline(PonderPalette.GREEN, glue1, glue1.inflate(1.25, 0, .25) .expandTowards(0, 1, 0), 60); scene.idle(15); - scene.overlay().showControls(new InputWindowElement(util.vector().topOf(util.grid().at(4, 2, 6)), Pointing.UP) - .withItem(AllItems.SUPER_GLUE.asStack()), 40); + scene.overlay().showControls(util.vector().topOf(util.grid().at(4, 2, 6)), Pointing.UP, 40) + .withItem(AllItems.SUPER_GLUE.asStack()); scene.idle(5); - scene.overlay().showControls(new InputWindowElement(util.vector().topOf(util.grid().at(10, 2, 6)), Pointing.UP) - .withItem(AllItems.SUPER_GLUE.asStack()), 40); + scene.overlay().showControls(util.vector().topOf(util.grid().at(10, 2, 6)), Pointing.UP, 40) + .withItem(AllItems.SUPER_GLUE.asStack()); scene.idle(55); - scene.overlay().showControls(new InputWindowElement(util.vector().topOf(util.grid().at(5, 3, 5)), Pointing.DOWN) - .withItem(new ItemStack(Items.CHARCOAL)), 40); + scene.overlay().showControls(util.vector().topOf(util.grid().at(5, 3, 5)), Pointing.DOWN, 40) + .withItem(new ItemStack(Items.CHARCOAL)); scene.idle(10); scene.overlay().showText(90) .pointAt(util.vector().blockSurface(util.grid().at(5, 3, 5), Direction.WEST)) @@ -217,7 +216,7 @@ public class TrainStationScenes { .colored(PonderPalette.BLUE) .text("Assembled Trains will move faster if they can find fuel in assembled chests or barrels"); scene.idle(100); - scene.overlay().showSelectionWithText(util.select().fromTo(4, 3, 6, 5, 4, 7), 60) + scene.overlay().showOutlineWithText(util.select().fromTo(4, 3, 6, 5, 4, 7), 60) .pointAt(util.vector().blockSurface(util.grid().at(5, 4, 6), Direction.UP)) .colored(PonderPalette.RED) .placeNearTarget() @@ -243,7 +242,7 @@ public class TrainStationScenes { .text("An optional second one allows departure from Stations in both directions"); scene.idle(75); - scene.overlay().showControls(new InputWindowElement(stationTop, Pointing.DOWN).rightClick(), 50); + scene.overlay().showControls(stationTop, Pointing.DOWN, 50).rightClick(); scene.idle(16); scene.overlay().showText(60) .pointAt(stationTop) @@ -260,7 +259,7 @@ public class TrainStationScenes { scene.idle(20); ElementLink birb = - scene.special().createBirb(util.vector().centerOf(10, 3, 6), ParrotElement.FacePointOfInterestPose::new); + scene.special().createBirb(util.vector().centerOf(10, 3, 6), ParrotPose.FacePointOfInterestPose::new); scene.idle(15); scene.special().movePointOfInterest(util.grid().at(18, 3, 6)); scene.idle(15); @@ -288,8 +287,8 @@ public class TrainStationScenes { .text("Trains can be disassembled back into blocks at stations only"); scene.idle(85); - scene.overlay().showControls(new InputWindowElement(stationTop, Pointing.DOWN).rightClick() - .withItem(new ItemStack(Items.FILLED_MAP)), 75); + scene.overlay().showControls(stationTop, Pointing.DOWN, 75).rightClick() + .withItem(new ItemStack(Items.FILLED_MAP)); scene.idle(15); scene.overlay().showText(70) .pointAt(stationTop) @@ -311,8 +310,8 @@ public class TrainStationScenes { scene.idle(15); Vec3 target = util.vector().topOf(util.grid().at(5, 3, 6)); - scene.overlay().showControls(new InputWindowElement(target, Pointing.DOWN).rightClick() - .withItem(AllItems.WRENCH.asStack()), 75); + scene.overlay().showControls(target, Pointing.DOWN, 75).rightClick() + .withItem(AllItems.WRENCH.asStack()); scene.idle(15); scene.overlay().showText(70) @@ -323,9 +322,8 @@ public class TrainStationScenes { .text("Assembled Trains can be relocated to nearby Tracks using the Wrench"); scene.idle(60); - scene.overlay() - .showControls(new InputWindowElement(util.vector().topOf(util.grid().at(6, 0, 2)), Pointing.DOWN).rightClick() - .withItem(AllItems.WRENCH.asStack()), 15); + scene.overlay().showControls(util.vector().topOf(util.grid().at(6, 0, 2)), Pointing.DOWN, 15).rightClick() + .withItem(AllItems.WRENCH.asStack()); scene.idle(15); scene.world().moveSection(trainElement3, util.vector().of(0, 0, -4), 5); @@ -361,7 +359,7 @@ public class TrainStationScenes { ElementLink trainElement = scene.world().showIndependentSection(train, Direction.DOWN); scene.world().moveSection(trainElement, util.vector().of(-4, 0, 0), 0); Vec3 target = util.vector().centerOf(2, 3, 6); - ElementLink birb = scene.special().createBirb(target, ParrotElement.FacePointOfInterestPose::new); + ElementLink birb = scene.special().createBirb(target, ParrotPose.FacePointOfInterestPose::new); scene.idle(10); scene.overlay().showText(90) @@ -370,8 +368,7 @@ public class TrainStationScenes { .attachKeyFrame() .text("Schedules can be used to provide drivers with a destination"); scene.idle(70); - scene.overlay().showControls( - new InputWindowElement(target.add(0, 0.5, 0), Pointing.DOWN).withItem(AllItems.SCHEDULE.asStack()), 40); + scene.overlay().showControls(target.add(0, 0.5, 0), Pointing.DOWN, 40).withItem(AllItems.SCHEDULE.asStack()); scene.idle(6); scene.special().movePointOfInterest(util.grid().at(9, 4, 6)); @@ -431,8 +428,7 @@ public class TrainStationScenes { .attachKeyFrame() .text("Mind that a Station can only be approached from the indicated direction"); scene.idle(70); - scene.overlay().showControls( - new InputWindowElement(target.add(0, 0.5, 0), Pointing.DOWN).withItem(AllItems.SCHEDULE.asStack()), 40); + scene.overlay().showControls(target.add(0, 0.5, 0), Pointing.DOWN, 40).withItem(AllItems.SCHEDULE.asStack()); scene.idle(6); scene.overlay().chaseBoundingBoxOutline(PonderPalette.OUTPUT, bb, bb, 1); @@ -474,7 +470,7 @@ public class TrainStationScenes { trainElement = scene.world().showIndependentSection(train, Direction.DOWN); scene.world().moveSection(trainElement, util.vector().of(-4, 0, 0), 0); target = util.vector().centerOf(2, 3, 6); - birb = scene.special().createBirb(target, ParrotElement.FacePointOfInterestPose::new); + birb = scene.special().createBirb(target, ParrotPose.FacePointOfInterestPose::new); scene.idle(10); scene.world().moveSection(trainElement, util.vector().of(4, 0, 0), 20); scene.world().animateBogey(util.grid().at(7, 2, 6), -4f, 20); @@ -485,9 +481,7 @@ public class TrainStationScenes { scene.idle(10); scene.world().animateTrainStation(stationPos, true); scene.idle(10); - scene.overlay().showControls( - new InputWindowElement(util.vector().topOf(stationPos), Pointing.DOWN).withItem(AllItems.SCHEDULE.asStack()), - 20); + scene.overlay().showControls(util.vector().topOf(stationPos), Pointing.DOWN, 20).withItem(AllItems.SCHEDULE.asStack()); scene.idle(30); scene.effects().indicateSuccess(stationPos); scene.idle(10);