Close the object-placement couplings of the tooling audit

PlacementRun carries the placement's display name and its JSON, from which the
host reads the settings other modules declare at the placement level.
FeatureRegistry.registerPlacementType lets the module that owns placements
declare the type and its JSON names for the placement level. RunningWorld and
PlacementTerrain keep a typed PlacementRecord (object id, placement id,
optional structure id) instead of a text. Loot gives the seed a container is
shuffled with, the ProtectedFloor service says whether the lowest layer belongs
to the terrain module, and EntitySpec holds the spawn reason, rising out of the
ground, panda genes and applying to a provided mob.
This commit is contained in:
piexel committed 2026-10-28 04:02:32 +01:00
1 parent 0347e106c3
commit a9e3cbaa93
18 files changed
+355 -50

No files matched your search

@@ -8,6 +8,7 @@ import com.volmit.world.PackWorld;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.OptionalLong;
/**
* The loot a module gives containers and mobs. The host asks in two steps so that it, and plugins listening to it, can
@@ -27,6 +28,16 @@ public interface Loot {
/** The items the pack's table {@code table} gives at {@code site}; empty for a table this module does not know. */
List<ItemDrop> items(PackWorld world, Site site, ResourceId table);
/**
* The seed the host shuffles the slots of the container at {@code site} with after it filled it, so that the same
* container always ends up with its items in the same slots. Empty to leave the order to the host's other providers;
* the host uses the first seed it gets, in module id order, and keeps the items in the order of the tables when no
* provider gives one.
*/
default OptionalLong shuffleSeed(PackWorld world, Site site) {
return OptionalLong.empty();
}
/**
* Where loot is given.
*
@@ -0,0 +1,18 @@
package com.volmit.service;
import com.volmit.world.PackWorld;
/**
* Whether the lowest layer of the world, the blocks at height 0, belongs to the module that shapes the terrain, such as
* a bedrock floor it writes itself. When it does, the host discards the blocks that placements and other stages write
* there, so that nothing replaces the floor. A pack has one provider, since two modules could not both own the floor.
* Without a provider the host protects nothing.
*/
@Service(Providers.ONE)
public interface ProtectedFloor {
/**
* Whether the host discards blocks written at height 0 of {@code world}. The answer depends on the world and its
* settings only: the host asks once when it starts the world and keeps it while the world runs.
*/
boolean protectsFloor(PackWorld world);
}