Make Anti-Xray multithreaded (#3520)

Obfuscate multiple chunks at a time over the server thread pool.

Will speed up chunk processing when anti xray is enabled.

Co-authored-by: Aikar <aikar@aikar.co>
This commit is contained in:
stonar96
2020-06-09 10:12:20 +02:00
parent 2dc5846adf
commit 65154f7929
5 changed files with 49 additions and 42 deletions

View File

@@ -4015,7 +4015,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+
// Add env and gen to constructor
public WorldServer(MinecraftServer minecraftserver, Executor executor, WorldNBTStorage worldnbtstorage, WorldData worlddata, DimensionManager dimensionmanager, GameProfilerFiller gameprofilerfiller, WorldLoadListener worldloadlistener, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen) {
super(worlddata, dimensionmanager, (world, worldprovider) -> {
super(worlddata, dimensionmanager, executor, (world, worldprovider) -> { // Paper - pass executor down
@@ -0,0 +0,0 @@ public class WorldServer extends World {
this.mobSpawnerTrader = this.worldProvider.getDimensionManager().getType() == DimensionManager.OVERWORLD ? new MobSpawnerTrader(this) : null; // CraftBukkit - getType()