3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-11-17 00:20:09 +01:00

mark folia todos

Dieser Commit ist enthalten in:
SirYwell 2024-01-27 16:34:31 +01:00
Ursprung ac83bb500e
Commit 4608c8e485
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
18 geänderte Dateien mit 25 neuen und 35 gelöschten Zeilen

Datei anzeigen

@ -242,13 +242,7 @@ public final class PaperweightFaweAdapter extends FaweAdapter<net.minecraft.nbt.
int y = location.getBlockY();
int z = location.getBlockZ();
final ServerLevel handle = getServerLevel(location.getWorld());
LevelChunk chunk;
if (Fawe.isTickThread()) {
// TODO check if is owned by this thread, else synchronize
chunk = handle.getChunk(x >> 4, z >> 4);
} else {
chunk = TaskManager.taskManager().syncAt(() -> handle.getChunk(x >> 4, z >> 4), BukkitAdapter.adapt(location));
}
LevelChunk chunk = handle.getChunk(x >> 4, z >> 4);
final BlockPos blockPos = new BlockPos(x, y, z);
final net.minecraft.world.level.block.state.BlockState blockData = chunk.getBlockState(blockPos);
BlockState state = adapt(blockData);

Datei anzeigen

@ -57,7 +57,6 @@ public class PaperweightFaweWorldNativeAccess implements WorldNativeAccess<Level
this.level = level;
// Use the actual tick as minecraft-defined so we don't try to force blocks into the world when the server's already lagging.
// - With the caveat that we don't want to have too many cached changed (1024) so we'd flush those at 1024 anyway.
// TODO
this.lastTick = new AtomicInteger();
if (!FoliaSupport.isFolia()) {
this.lastTick.set(Bukkit.getCurrentTick());
@ -66,7 +65,7 @@ public class PaperweightFaweWorldNativeAccess implements WorldNativeAccess<Level
cachedChange -> new IntPair(cachedChange.blockPos.getX() >> 4, cachedChange.blockPos.getZ() >> 4),
HashSet::new,
(chunk, changes) -> {
// TODO only send chunks based on ticks? Need to make sure everything actually flushed in the end
// TODO (folia) only send chunks based on ticks? Need to make sure everything actually flushed in the end
/*boolean nextTick = true;
if (!FoliaSupport.isFolia()) {
int currentTick = MinecraftServer.currentTick;

Datei anzeigen

@ -65,7 +65,7 @@ public class PaperweightFaweWorldNativeAccess implements WorldNativeAccess<Level
cachedChange -> new IntPair(cachedChange.blockPos.getX() >> 4, cachedChange.blockPos.getZ() >> 4),
HashSet::new,
(chunk, changes) -> {
// TODO only send chunks based on ticks? Need to make sure everything actually flushed in the end
// TODO (folia) only send chunks based on ticks? Need to make sure everything actually flushed in the end
/*boolean nextTick = true;
if (!FoliaSupport.isFolia()) {
int currentTick = MinecraftServer.currentTick;

Datei anzeigen

@ -65,7 +65,7 @@ public class PaperweightFaweWorldNativeAccess implements WorldNativeAccess<Level
cachedChange -> new IntPair(cachedChange.blockPos.getX() >> 4, cachedChange.blockPos.getZ() >> 4),
HashSet::new,
(chunk, changes) -> {
// TODO only send chunks based on ticks? Need to make sure everything actually flushed in the end
// TODO (folia) only send chunks based on ticks? Need to make sure everything actually flushed in the end
/*boolean nextTick = true;
if (!FoliaSupport.isFolia()) {
int currentTick = MinecraftServer.currentTick;

Datei anzeigen

@ -93,7 +93,7 @@ public class FaweBukkit implements IFawe, Listener {
//PlotSquared support is limited to Spigot/Paper as of 02/20/2020
TaskManager.taskManager().taskGlobal(this::setupPlotSquared);
// TODO moved out of task below??
// TODO (folia) moved out of task below??
Bukkit.getPluginManager().registerEvents(FaweBukkit.this, FaweBukkit.this.plugin);
// Registered delayed Event Listeners
/*TaskManager.taskManager().task(() -> {

Datei anzeigen

@ -76,7 +76,7 @@ public class FaweDelegateRegionManager {
e.printStackTrace();
} finally {
if (whenDone != null) {
// TODO
// TODO (folia)
// TaskManager.taskManager().task(whenDone, new com.sk89q.worldedit.util.Location(world, ));
}
}
@ -204,7 +204,7 @@ public class FaweDelegateRegionManager {
RelightMode.valueOf(com.fastasyncworldedit.core.configuration.Settings.settings().LIGHTING.MODE)
);
if (whenDone != null) {
// TODO
// TODO (folia)
// TaskManager.taskManager().task(whenDone);
}
}
@ -274,7 +274,7 @@ public class FaweDelegateRegionManager {
RelightMode.valueOf(com.fastasyncworldedit.core.configuration.Settings.settings().LIGHTING.MODE)
);
if (whenDone != null) {
// TODO
// TODO (folia)
// TaskManager.taskManager().task(whenDone);
}
}
@ -304,7 +304,7 @@ public class FaweDelegateRegionManager {
e.printStackTrace();
}
if (whenDone != null) {
// TODO
// TODO (folia)
// TaskManager.taskManager().task(whenDone);
}
}
@ -358,7 +358,7 @@ public class FaweDelegateRegionManager {
}
}
if (whenDone != null) {
// TODO
// TODO (folia)
// TaskManager.taskManager().task(whenDone);
}
});
@ -383,7 +383,7 @@ public class FaweDelegateRegionManager {
editSession.flushQueue();
}
if (whenDone != null) {
// TODO
// TODO (folia)
// TaskManager.taskManager().task(whenDone);
}
}

Datei anzeigen

@ -68,8 +68,6 @@ public class BukkitTaskManager extends TaskManager {
}
}
// TODO
@Override
public <T> T syncAt(final Supplier<T> supplier, final World world, final int chunkX, final int chunkZ) {
return sync(supplier);
@ -90,7 +88,7 @@ public class BukkitTaskManager extends TaskManager {
return supplier.get();
}
try {
// TODO
// TODO (folia)
return Fawe.instance().getQueueHandler().sync(supplier).get();
} catch (InterruptedException | ExecutionException e) {
throw new RuntimeException(e);

Datei anzeigen

@ -37,7 +37,7 @@ public class FoliaTaskManager extends TaskManager {
@Override
public int repeatAsync(@NotNull final Runnable runnable, final int interval) {
// TODO return some kind of own ScheduledTask instead of int
// TODO (folia) return some kind of own ScheduledTask instead of int
Bukkit.getAsyncScheduler().runAtFixedRate(
WorldEditPlugin.getInstance(),
asConsumer(runnable),
@ -147,7 +147,6 @@ public class FoliaTaskManager extends TaskManager {
@Override
public <T> T syncGlobal(final Supplier<T> supplier) {
// TODO avoid deadlocks (Bukkit.isGlobalTickThread not available at time of writing)
if (isGlobalTickThread()) {
return supplier.get();
}

Datei anzeigen

@ -254,7 +254,7 @@ public class BukkitPlayer extends AbstractPlayerActor {
player.sendMessage("Teleportation failed");
}
});
return true; // TODO this might not be correct
return true; // TODO (folia) this might not be correct
}
return TaskManager.taskManager().syncWith(() -> teleport.get().join(), this);
//FAWE end

Datei anzeigen

@ -147,7 +147,7 @@ public class BukkitWorld extends AbstractWorld {
public List<com.sk89q.worldedit.entity.Entity> getEntities(Region region) {
World world = getWorld();
List<Entity> ents = List.of(); // TODO TaskManager.taskManager().sync(world::getEntities);
List<Entity> ents = List.of(); // TODO (folia) TaskManager.taskManager().sync(world::getEntities);
List<com.sk89q.worldedit.entity.Entity> entities = new ArrayList<>();
for (Entity ent : ents) {
if (region.contains(BukkitAdapter.asBlockVector(ent.getLocation()))) {

Datei anzeigen

@ -138,7 +138,7 @@ public class Fawe {
}, 1);
if (!FoliaSupport.isFolia()) {
// TODO TaskManager.taskManager().repeat(timer, 1);
// TODO (folia) TaskManager.taskManager().repeat(timer, 1);
}
clipboardExecutor = new KeyQueuedExecutorService<>(new ThreadPoolExecutor(

Datei anzeigen

@ -26,7 +26,7 @@ public class LazyBaseEntity extends BaseEntity {
if (Fawe.isMainThread()) {
setNbt(tmp.get());
} else {
// TODO folia
// TODO (folia)
// setNbt(TaskManager.taskManager().sync(tmp));
}
}

Datei anzeigen

@ -91,7 +91,7 @@ public abstract class QueueHandler implements Trimable, Runnable {
private long allocate = 50;
protected QueueHandler() {
// TODO make main thread independent
// TODO (folia) make main thread independent
// TaskManager.taskManager().repeat(this, 1);
}

Datei anzeigen

@ -92,7 +92,7 @@ public class DefaultProgressTracker implements BiConsumer<DefaultProgressTracker
}
private void done() {
// TODO
// TODO (folia)
// TaskManager.taskManager().task(this::doneTask);
}
@ -100,7 +100,7 @@ public class DefaultProgressTracker implements BiConsumer<DefaultProgressTracker
private void send() {
// Run on main thread
// TODO
// TODO (folia)
// TaskManager.taskManager().task(this::sendTask);
}

Datei anzeigen

@ -701,7 +701,7 @@ public class UtilityCommands {
//FAWE start - run this sync
int finalRadius = radius;
int killed;
// TODO location context might be somewhere else actually
// TODO (folia) location context might be somewhere else actually
if (actor instanceof Player player) {
killed = TaskManager.taskManager().syncWith(
() -> killMatchingEntities(finalRadius, actor, flags::createFunction),
@ -742,7 +742,7 @@ public class UtilityCommands {
//FAWE start - run this sync
int removed = 0;
// TODO location context might be somewhere else actually
// TODO (folia) location context might be somewhere else actually
// removed = TaskManager.taskManager().sync(() -> killMatchingEntities(radius, actor, remover::createFunction));
//FAWE end
actor.print(Caption.of("worldedit.remove.removed", TextComponent.of(removed)));

Datei anzeigen

@ -108,7 +108,7 @@ public abstract class AbstractNonPlayerActor implements Actor {
if (async) {
asyncNotifyQueue.run(wrapped);
} else {
// TODO folia
// TODO (folia)
// TaskManager.taskManager().taskNow(wrapped, false);
}
return true;

Datei anzeigen

@ -676,7 +676,7 @@ public abstract class AbstractPlayerActor implements Actor, Player, Cloneable {
if (async) {
asyncNotifyQueue.run(wrapped);
} else {
// TODO folia
// TODO (folia)
// TaskManager.taskManager().taskNow(wrapped, false);
}
return true;

Datei anzeigen

@ -690,7 +690,7 @@ public final class PlatformCommandManager {
if (actor instanceof Player player) {
TaskManager.taskManager().task(() -> handleCommandOnCurrentThread(event), player.getLocation());
} else {
// TODO folia
// TODO (folia)
}
return;
} else {