Skip to content

Commit

Permalink
More work on salepoint ponder
Browse files Browse the repository at this point in the history
  • Loading branch information
IThundxr committed Oct 30, 2024
1 parent e1e44fe commit cf42efe
Showing 1 changed file with 43 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,21 @@

package dev.ithundxr.createnumismatics.ponder;

import com.simibubi.create.foundation.ponder.ElementLink;
import com.simibubi.create.foundation.ponder.SceneBuilder;
import com.simibubi.create.foundation.ponder.SceneBuildingUtil;
import com.simibubi.create.foundation.ponder.Selection;
import com.simibubi.create.foundation.ponder.element.EntityElement;
import com.simibubi.create.foundation.ponder.element.WorldSectionElement;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;

public class SalepointScenes {
private static final ItemStack ingotStack = new ItemStack(Items.IRON_INGOT, 64);

public static void item(SceneBuilder scene, SceneBuildingUtil util) {
scene.title("salepoint_item", "Using Salepoints");
scene.configureBasePlate(1, 0, 12);
Expand All @@ -49,8 +55,8 @@ public static void item(SceneBuilder scene, SceneBuildingUtil util) {
Selection smallCog = util.select.position(12, 1, 3);
Selection largeCog = util.select.position(13, 0, 3);

Selection train1 = util.select.fromTo(12, 2, 4, 8, 3, 7);
Selection train2 = util.select.fromTo(7, 2, 4, 4, 3, 7);
Selection train1 = util.select.fromTo(12, 2, 5, 8, 3, 7);
Selection train2 = util.select.fromTo(7, 2, 5, 4, 3, 7);
Selection train2a = util.select.fromTo(7, 2, 7, 4, 3, 10);

// Show tracks
Expand All @@ -77,11 +83,41 @@ public static void item(SceneBuilder scene, SceneBuildingUtil util) {
scene.idle(10);
scene.world.showSection(station, Direction.DOWN);
scene.idle(10);

ItemStack stack = new ItemStack(Items.IRON_INGOT, 64);
for (int i = 0; i < 10; i++) {
scene.world.createItemOnBelt(beltStart, Direction.DOWN, stack);
scene.idle(10);

for (int i = 0; i < 6; i++) {
ElementLink<EntityElement> item = scene.world.createItemEntity(
util.vector.centerOf(beltStart.above(3)),
util.vector.of(0, 0, 0),
ingotStack
);
scene.idle(13);
scene.world.modifyEntity(item, Entity::discard);

scene.world.createItemOnBelt(beltStart, Direction.DOWN, ingotStack);
scene.idle(5);
}

scene.overlay.showText(70)
.attachKeyFrame()
.text("""
The Salepoint is a way to buy and sell items and fluid in bulk.
Normally, stationary interfaces will automatically connect to any assembled interface that attaches to it.
""")
.pointAt(portableInterface.getCenter())
.placeNearTarget();
scene.idle(80);

scene.addKeyframe();
scene.idle(10);

ElementLink<WorldSectionElement> trainElement1 = scene.world.showIndependentSection(train1, Direction.EAST);
scene.world.moveSection(trainElement1, util.vector.of(-14, 0, 0), 0);

scene.idle(30);

ElementLink<WorldSectionElement> trainElement2 = scene.world.showIndependentSection(train2, Direction.EAST);
scene.world.moveSection(trainElement2, util.vector.of(-14, 0, 0), 0);

//scene.world.moveSection(trainElement1, util.vector.of(20, 0, -8), 0);
}
}

0 comments on commit cf42efe

Please sign in to comment.