diff --git a/README.md b/README.md index 3c3ad9e5f..3bc9a7759 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,16 @@ chunk it reaches and every restart fits it the same way. Object place modes are stilt, `VacuumProfile`, `PlaceTrait`s) that the placement stages ask; the pack JSON keeps the mode names. `iris:objects` also provides `SaplingGrowth` (`TreeGrowing`: the tree a sapling grows into, as placed blocks, and which objects are trees) and says which biomes and regions place an object (`ObjectLocating`, for the object search). +`iris:objects` ships in the built-ins jar. It declares the settings `objects` (region, biome: the list of `ObjectPlacement`s), +`proceduralObjects` (region, biome), `treeSettings` (dimension), `requireObjectSurfaceSupport`, `objectSurfaceSupportBuffer`, +`upperDimensionObjects` and `upperObjectsForcePlace` (dimension), all written as they always were. `ObjectPlacement` describes +the same JSON as Iris's `IrisObjectPlacement` and keeps the JSON it was read from, because Iris's placement stages still read +a placement as their own class (`ObjectPlacements.host`). What a jar cannot do, Iris does through the facades `ObjectHost` and +`ObjectChunk` in `art.arcane.iris.builtin.objects`: loading and scaling the pack's objects, placing one with the placement +stages into the chunk's mantle (on the surface, in a cave inside the cave's bounds, or hung from the terrain above), reading the +carved space the cave carver planned, and the layout around a position. `ObjectPlacing` and its helpers (`ChunkObjectPlacing`, +`CaveAnchors`, `PlacementReach`) decide what to place and where. The procedural generators (`engine/object/procedural`) stay +compiled in, behind `ProceduralPlacement`, until they build `GeneratedObject`s instead of Iris objects. `iris:loot` owns the loot table resource kind (`LootResources`, folder `loot`), checks the tables and the references to them (`LootValidator`), and provides `Loot` (`LootGiving`: which tables a container draws from and the `ItemDrop`s a table gives) and `BlockDrops` (`BlockDropping`). `iris:spawn` owns spawners, entities and markers (`SpawnResources`, diff --git a/src/main/java/art/arcane/iris/builtin/package-info.java b/src/main/java/art/arcane/iris/builtin/package-info.java index 4e62e77b1..b609b5b97 100644 --- a/src/main/java/art/arcane/iris/builtin/package-info.java +++ b/src/main/java/art/arcane/iris/builtin/package-info.java @@ -29,7 +29,7 @@ *
* Besides those, it holds what the compiled-in built-ins and the built-ins jar must share, since each sees its own copy * of every other class: narrow facades only Iris's own built-ins use, interfaces Iris's worlds implement - * ({@link art.arcane.iris.builtin.IrisSeed}), and per-world state several of them use + * ({@link art.arcane.iris.builtin.IrisSeed}, {@link art.arcane.iris.builtin.objects.ObjectHost}), and per-world state several of them use * ({@link art.arcane.iris.builtin.terrain.LayerBlocks}). Keep them few: each is a promise. *
* Some built-in stages produce Iris's own types, such as the placement settings of {@code iris:prepare}. A
diff --git a/src/main/java/art/arcane/iris/engine/mantle/components/ChunkObjectPlacing.java b/src/main/java/art/arcane/iris/engine/mantle/components/ChunkObjectPlacing.java
index 677f0aba4..eb8338d9e 100644
--- a/src/main/java/art/arcane/iris/engine/mantle/components/ChunkObjectPlacing.java
+++ b/src/main/java/art/arcane/iris/engine/mantle/components/ChunkObjectPlacing.java
@@ -461,7 +461,7 @@ final class ChunkObjectPlacing {
private void placeProceduralVariant(ProceduralPlacement placement, PlaceableObject variant, String scope, CaveProfile caveProfile,
CaveAnchors.Search search, CaveAnchors.Anchor anchor, int x, int z, int id) {
String goldenTag = golden ? scope + "/" + placement.name() : null;
- PlacementTags tags = tags(variant, id, "procedural", placement.tree(), placement, false);
+ PlacementTags tags = tags(variant, id, "procedural", placement.tree(), false);
int resultY;
String commit = "n/a";
if (anchor != null) {
@@ -556,11 +556,10 @@ final class ChunkObjectPlacing {
}
private PlacementTags tags(PlaceableObject object, int id, String context, boolean treePlacement, PlacementSource placement) {
- return tags(object, id, context, treePlacement, placement, placement.isDolphinTarget() && placement.underwater());
+ return tags(object, id, context, treePlacement, placement.isDolphinTarget() && placement.underwater());
}
- private PlacementTags tags(PlaceableObject object, int id, String context, boolean treePlacement, PlacementSource placement,
- boolean buriedTreasure) {
+ private PlacementTags tags(PlaceableObject object, int id, String context, boolean treePlacement, boolean buriedTreasure) {
return new PlacementTags(placementMarker(object, id, context), treePlacement, buriedTreasure);
}
@@ -608,15 +607,15 @@ final class ChunkObjectPlacing {
}
private void logCaveDiagnostics(Column column) {
- CarvedCount carved = new CarvedCount();
+ int carvedBlocks = 0;
int maxY = Math.min(worldHeight - 1, column.surfaceY() - DIAGNOSTIC_SURFACE_MARGIN);
for (int y = 1; y < maxY; y++) {
if (chunk.carved().isCarved(centerX, y, centerZ)) {
- carved.blocks++;
+ carvedBlocks++;
}
}
log.debug("Cave object diag: chunk=" + chunkX + "," + chunkZ + " surfaceBiome=" + column.surface() + " caveBiome=" + column.cave()
- + " surfaceY=" + column.surfaceY() + " maxAnchorY=" + maxY + " carvedAtCenter=" + carved.blocks
+ + " surfaceY=" + column.surfaceY() + " maxAnchorY=" + maxY + " carvedAtCenter=" + carvedBlocks
+ " biomeCarvingObjects=" + carvingObjects(column.objects().cave()).size()
+ " regionCarvingObjects=" + carvingObjects(column.objects().region()).size()
+ " sameBiome=" + column.cave().equals(column.surface()));
@@ -649,10 +648,6 @@ final class ChunkObjectPlacing {
private record ColumnProfiles(CaveProfile surface, CaveProfile cave, CaveProfile region) {
}
- private static final class CarvedCount {
- private int blocks;
- }
-
/** What placing the objects of a chunk came to. */
private static final class Tally {
private final java.util.Map