diff options
Diffstat (limited to 'patches/server/0717-Fix-swamp-hut-cat-generation-deadlock.patch')
-rw-r--r-- | patches/server/0717-Fix-swamp-hut-cat-generation-deadlock.patch | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/patches/server/0717-Fix-swamp-hut-cat-generation-deadlock.patch b/patches/server/0717-Fix-swamp-hut-cat-generation-deadlock.patch index bac78b77ff..8a176245ca 100644 --- a/patches/server/0717-Fix-swamp-hut-cat-generation-deadlock.patch +++ b/patches/server/0717-Fix-swamp-hut-cat-generation-deadlock.patch @@ -23,10 +23,10 @@ index 534630b0161c8d869e49e7a59572193550be0671..7dfd2b17e82a80683af28779d0bd8f64 this.setPersistenceRequired(); } diff --git a/src/main/java/net/minecraft/world/level/StructureManager.java b/src/main/java/net/minecraft/world/level/StructureManager.java -index b33a015b834873f279bf33a64974ef440a37df79..b59581b92aed0bc1b09008c695b0b112c3e65743 100644 +index 09e0c6b6bddcba2f4a59838ac63cda3188f71e41..07eb481380e8fd4e492f36342ba633579c1b624e 100644 --- a/src/main/java/net/minecraft/world/level/StructureManager.java +++ b/src/main/java/net/minecraft/world/level/StructureManager.java -@@ -44,7 +44,12 @@ public class StructureManager { +@@ -46,7 +46,12 @@ public class StructureManager { } public List<StructureStart> startsForStructure(ChunkPos pos, Predicate<Structure> predicate) { @@ -37,10 +37,10 @@ index b33a015b834873f279bf33a64974ef440a37df79..b59581b92aed0bc1b09008c695b0b112 + public List<StructureStart> startsForStructure(ChunkPos pos, Predicate<Structure> predicate, @Nullable ServerLevelAccessor levelAccessor) { + Map<Structure, LongSet> map = (levelAccessor == null ? this.level : levelAccessor).getChunk(pos.x, pos.z, ChunkStatus.STRUCTURE_REFERENCES).getAllReferences(); + // Paper end - Fix swamp hut cat generation deadlock - ImmutableList.Builder<StructureStart> builder = ImmutableList.builder(); + Builder<StructureStart> builder = ImmutableList.builder(); - for(Map.Entry<Structure, LongSet> entry : map.entrySet()) { -@@ -108,13 +113,18 @@ public class StructureManager { + for (Entry<Structure, LongSet> entry : map.entrySet()) { +@@ -111,10 +116,15 @@ public class StructureManager { } public StructureStart getStructureWithPieceAt(BlockPos pos, TagKey<Structure> structureTag) { @@ -51,12 +51,9 @@ index b33a015b834873f279bf33a64974ef440a37df79..b59581b92aed0bc1b09008c695b0b112 + // Paper end - Fix swamp hut cat generation deadlock Registry<Structure> registry = this.registryAccess().registryOrThrow(Registries.STRUCTURE); - for(StructureStart structureStart : this.startsForStructure(new ChunkPos(pos), (structure) -> { - return registry.getHolder(registry.getId(structure)).map((reference) -> { - return reference.is(structureTag); - }).orElse(false); -- })) { -+ }, levelAccessor)) { // Paper - Fix swamp hut cat generation deadlock + for (StructureStart structureStart : this.startsForStructure( +- new ChunkPos(pos), structure -> registry.getHolder(registry.getId(structure)).map(reference -> reference.is(structureTag)).orElse(false) ++ new ChunkPos(pos), structure -> registry.getHolder(registry.getId(structure)).map(reference -> reference.is(structureTag)).orElse(false), levelAccessor // Paper - Fix swamp hut cat generation deadlock + )) { if (this.structureHasPieceAt(pos, structureStart)) { return structureStart; - } |