geforkt von Mirrors/Paper
[Bleeding] Ignore Block Physics in Chunk population. Fixes BUKKIT-4923
Suppressing physics updates during Chunk population prevents infinite recursion due to custom Block Populators editing border blocks on chunks.
Dieser Commit ist enthalten in:
Ursprung
c7b4514ad3
Commit
0aa187f151
@ -237,9 +237,14 @@ public class ChunkProviderServer implements IChunkProvider {
|
|||||||
|
|
||||||
org.bukkit.World world = this.world.getWorld();
|
org.bukkit.World world = this.world.getWorld();
|
||||||
if (world != null) {
|
if (world != null) {
|
||||||
|
this.world.populating = true;
|
||||||
|
try {
|
||||||
for (org.bukkit.generator.BlockPopulator populator : world.getPopulators()) {
|
for (org.bukkit.generator.BlockPopulator populator : world.getPopulators()) {
|
||||||
populator.populate(world, random, chunk.bukkitChunk);
|
populator.populate(world, random, chunk.bukkitChunk);
|
||||||
}
|
}
|
||||||
|
} finally {
|
||||||
|
this.world.populating = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
BlockSand.instaFall = false;
|
BlockSand.instaFall = false;
|
||||||
this.world.getServer().getPluginManager().callEvent(new org.bukkit.event.world.ChunkPopulateEvent(chunk.bukkitChunk));
|
this.world.getServer().getPluginManager().callEvent(new org.bukkit.event.world.ChunkPopulateEvent(chunk.bukkitChunk));
|
||||||
|
@ -70,6 +70,7 @@ public abstract class World implements IBlockAccess {
|
|||||||
public boolean callingPlaceEvent = false;
|
public boolean callingPlaceEvent = false;
|
||||||
public long ticksPerAnimalSpawns;
|
public long ticksPerAnimalSpawns;
|
||||||
public long ticksPerMonsterSpawns;
|
public long ticksPerMonsterSpawns;
|
||||||
|
public boolean populating;
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
private ArrayList M;
|
private ArrayList M;
|
||||||
private boolean N;
|
private boolean N;
|
||||||
@ -398,6 +399,11 @@ public abstract class World implements IBlockAccess {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void update(int i, int j, int k, Block block) {
|
public void update(int i, int j, int k, Block block) {
|
||||||
|
// CraftBukkit start
|
||||||
|
if (this.populating) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// CraftBukkit end
|
||||||
this.applyPhysics(i, j, k, block);
|
this.applyPhysics(i, j, k, block);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren