Commits

md_5 authored 4cb32587ac1
SPIGOT-2255: Nether Structure generation ConcurrentModificationException
No tags

nms-patches/StructureGenerator.patch

Added
1 +--- a/net/minecraft/server/StructureGenerator.java
2 ++++ b/net/minecraft/server/StructureGenerator.java
3 +@@ -94,7 +94,7 @@
4 + return this.c(blockposition) != null;
5 + }
6 +
7 +- protected StructureStart c(BlockPosition blockposition) {
8 ++ protected synchronized StructureStart c(BlockPosition blockposition) { // CraftBukkit - synchronized
9 + Iterator iterator = this.c.values().iterator();
10 +
11 + while (iterator.hasNext()) {
12 +@@ -116,7 +116,7 @@
13 + return null;
14 + }
15 +
16 +- public boolean b(World world, BlockPosition blockposition) {
17 ++ public synchronized boolean b(World world, BlockPosition blockposition) { // CraftBukkit - synchronized
18 + this.a(world);
19 + Iterator iterator = this.c.values().iterator();
20 +
21 +@@ -133,7 +133,7 @@
22 + return true;
23 + }
24 +
25 +- public BlockPosition getNearestGeneratedFeature(World world, BlockPosition blockposition) {
26 ++ public synchronized BlockPosition getNearestGeneratedFeature(World world, BlockPosition blockposition) { // CraftBukkit - synchronized
27 + this.g = world;
28 + this.a(world);
29 + this.f.setSeed(world.getSeed());
30 +@@ -195,7 +195,7 @@
31 + return null;
32 + }
33 +
34 +- protected void a(World world) {
35 ++ protected synchronized void a(World world) { // CraftBukkit - synchronized
36 + if (this.a == null) {
37 + this.a = (PersistentStructure) world.a(PersistentStructure.class, this.a());
38 + if (this.a == null) {

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut