mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-11-28 08:44:50 +00:00
Place and locate structures through the api instead of the engine
Structure placement, its locator, the cave anchor resolver and the native start planner now take the pack world and its running world, and StructurePlacing writes through the mantle stage context and the placement graph. Terrain carving draws its noise from the pack's noise factory. The api gains clearBlock/clearAttached on PlacementTerrain, RunningWorld.carvedAt and VanillaStructureContext.world; modules get the host's seed purposes through their world view.
This commit is contained in:
1 parent
5ab99210b2
commit
3d209b393c
47 files changed
+1957
-1127
No files matched your search
@@ -17,7 +17,7 @@
|
||||
*/
|
||||
package art.arcane.iris.builtin.structure;
|
||||
|
||||
import com.volmit.generation.InvocationContext;
|
||||
import com.volmit.stage.MantleStageContext;
|
||||
import com.volmit.resource.ResourceId;
|
||||
|
||||
import java.util.List;
|
||||
@@ -31,7 +31,7 @@ import java.util.Optional;
|
||||
*/
|
||||
public interface StructureHost {
|
||||
/** Places the structures that start in the chunk whose mantle the mantle invocation {@code context} generates. */
|
||||
void placeChunk(InvocationContext context);
|
||||
void placeChunk(MantleStageContext context);
|
||||
|
||||
/** How far, in blocks along X and Z, a structure may write beyond the chunk it starts in. */
|
||||
int reach();
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package art.arcane.iris.builtin.structure;
|
||||
|
||||
import com.volmit.resource.ResourceId;
|
||||
|
||||
/** The seed purposes of structure placement, for {@link com.volmit.world.PackWorld#seed(ResourceId)}. */
|
||||
public final class StructureSeeds {
|
||||
/**
|
||||
* The seed placements start from: where structures start, their anchors and their pieces. Iris keeps the seed it has
|
||||
* always used for it, so the structures of existing worlds stay where they are.
|
||||
*/
|
||||
public static final ResourceId PLACEMENT = ResourceId.parse("iris:structure/placement");
|
||||
|
||||
private StructureSeeds() {
|
||||
}
|
||||
}
|
||||
@@ -90,6 +90,16 @@ public abstract class ForwardingTerrain implements PlacementTerrain {
|
||||
delegate.recordPlacement(x, y, z, placement);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearBlock(int x, int y, int z) {
|
||||
delegate.clearBlock(x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearAttached(int x, int y, int z) {
|
||||
delegate.clearAttached(x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<PlacementRecord> placementAt(int x, int y, int z) {
|
||||
return delegate.placementAt(x, y, z);
|
||||
|
||||
Reference in new issue
Block a user