Re-add missing default spawn lists in features (#8285)

Fixes #8265
Fixes #8301
This commit is contained in:
sciwhiz12 authored and GitHub committed 2021-12-27 16:23:43 +00:00
1 parent 0320c185b5
commit 7259887176
6 files changed
+67 -10

No files matched your search

@@ -98,8 +98,14 @@ public class StructureSpawnManager
StructureFeature<?> structure = entry.getKey();
StructureSpawnInfo spawnInfo = entry.getValue();
//Note: We check if the structure has spawns for a type first before looking at the world as it should be a cheaper check
if (spawnInfo.spawns.containsKey(classification) && structureManager.getStructureAt(pos, structure).isValid())
return spawnInfo.spawns.get(classification);
if (spawnInfo.spawns.containsKey(classification))
{
boolean valid = spawnInfo.insideOnly
? structureManager.getStructureWithPieceAt(pos, structure).isValid()
: structureManager.getStructureAt(pos, structure).isValid();
if (valid)
return spawnInfo.spawns.get(classification);
}
}
return null;
}