File Details
BlueprintNexus-1.4.1
- R
- Jun 1, 2026
- 63.10 KB
- 31
- Early Access
File Name
BlueprintNexus-1.4.1.jar
Supported Versions
- Early Access
### Bug Fix: PrefabSpawnerBlock (Trees & Sub-Prefabs) Disappearing in Survival Mode
#### 1. The Issue
* **The Symptom**: When placing custom prefabs/structures via the plugin, trees, foliage, and other sub-prefabs (defined via `PrefabSpawnerBlock` inside the editor) failed to spawn in Survival or Adventure mode, leaving empty spaces.
* **The Root Cause**:
1. Hytale's vanilla world generator only triggers and processes `PrefabSpawnerBlock` entities for structures it spawns *itself*. It completely ignores them for plugin-pasted structures, which leaves behind the technical dotted outline boxes in the world.
2. In our first attempt to hide these ugly technical outline blocks by converting them to `BlockType.EMPTY` (air) during the block-placement pass, Hytale immediately discarded the block's entity components. Because the `Holder<ChunkStore>` state was wiped out, the spawner could never trigger, and the sub-prefabs disappeared completely.
#### 2. The Solution (Implemented in v1.4.1)
* **Deferred Capture**: The technical blocks are safely hidden (replaced with air) in the first pass, but their exact ECS `Holder<ChunkStore>` configuration is securely captured and registered in the deferred spawner queue (`deferredSpawners`).
* **Manual Recursive Injection**: During the spawner flush phase in `executeBlockSpawnerIfPresent`, the plugin now checks if the spawner has a `PrefabSpawnerBlock` component:
1. It extracts the target prefab path, selection weights, and height adaptation settings (`fitHeightmap`).
2. It deterministically computes the random choice based on weights and the chunk generation seed.
3. It retrieves the current block's rotation index to align the sub-prefab perfectly with the parent structure.
4. It calculates the correct Y-coordinate by querying the `ChunkGenerator` heightmap if `fitHeightmap` is enabled.
5. It recursively generates the chosen sub-prefab directly into the chunk using `StructureEntry.pastePrefabRecursive` with a default-true block mask.