Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-10-03 20:21:05 +02:00
Improve scheduling for chunk data of regen
Dieser Commit ist enthalten in:
Ursprung
7bca6ef57c
Commit
9ac3bccbde
@ -61,6 +61,7 @@ import net.minecraft.world.level.chunk.PalettedContainerRO;
|
|||||||
import net.minecraft.world.level.levelgen.Heightmap;
|
import net.minecraft.world.level.levelgen.Heightmap;
|
||||||
import net.minecraft.world.level.lighting.LevelLightEngine;
|
import net.minecraft.world.level.lighting.LevelLightEngine;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.craftbukkit.v1_19_R3.CraftWorld;
|
import org.bukkit.craftbukkit.v1_19_R3.CraftWorld;
|
||||||
import org.bukkit.craftbukkit.v1_19_R3.block.CraftBlock;
|
import org.bukkit.craftbukkit.v1_19_R3.block.CraftBlock;
|
||||||
@ -771,19 +772,10 @@ public class PaperweightGetBlocks extends CharGetBlocks implements BukkitGetBloc
|
|||||||
final int y = blockHash.getY();
|
final int y = blockHash.getY();
|
||||||
final int z = blockHash.getZ() + bz;
|
final int z = blockHash.getZ() + bz;
|
||||||
final BlockPos pos = new BlockPos(x, y, z);
|
final BlockPos pos = new BlockPos(x, y, z);
|
||||||
|
BlockEntity tileEntity = nmsWorld.getBlockEntity(pos);
|
||||||
synchronized (nmsWorld) {
|
|
||||||
|
|
||||||
BlockEntity tileEntity = TaskManager.taskManager().syncAt(
|
|
||||||
() -> nmsWorld.getBlockEntity(pos),
|
|
||||||
new Location(new BukkitWorld(getChunk().bukkitChunk.getWorld()), Vector3.at(x, y, z))
|
|
||||||
);
|
|
||||||
if (tileEntity == null || tileEntity.isRemoved()) {
|
if (tileEntity == null || tileEntity.isRemoved()) {
|
||||||
nmsWorld.removeBlockEntity(pos);
|
nmsWorld.removeBlockEntity(pos);
|
||||||
tileEntity = TaskManager.taskManager().syncAt(
|
tileEntity = nmsWorld.getBlockEntity(pos);
|
||||||
() -> nmsWorld.getBlockEntity(pos),
|
|
||||||
new Location(new BukkitWorld(getChunk().bukkitChunk.getWorld()), Vector3.at(x, y, z))
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
if (tileEntity != null) {
|
if (tileEntity != null) {
|
||||||
final net.minecraft.nbt.CompoundTag tag = (net.minecraft.nbt.CompoundTag) adapter.fromNative(
|
final net.minecraft.nbt.CompoundTag tag = (net.minecraft.nbt.CompoundTag) adapter.fromNative(
|
||||||
@ -794,7 +786,6 @@ public class PaperweightGetBlocks extends CharGetBlocks implements BukkitGetBloc
|
|||||||
tileEntity.load(tag);
|
tileEntity.load(tag);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -828,7 +819,9 @@ public class PaperweightGetBlocks extends CharGetBlocks implements BukkitGetBloc
|
|||||||
// Run the sync tasks
|
// Run the sync tasks
|
||||||
for (Runnable task : finalSyncTasks) {
|
for (Runnable task : finalSyncTasks) {
|
||||||
if (task != null) {
|
if (task != null) {
|
||||||
task.run();
|
Bukkit.getRegionScheduler().execute(WorldEditPlugin.getInstance(), nmsWorld.getWorld(), bx,
|
||||||
|
bz, task::run
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (callback == null) {
|
if (callback == null) {
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren