3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-11-17 00:20:09 +01:00
Dieser Commit ist enthalten in:
SirYwell 2024-01-06 19:04:16 +01:00
Ursprung 0bee4a6bf2
Commit ac83bb500e
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
10 geänderte Dateien mit 25 neuen und 32 gelöschten Zeilen

Datei anzeigen

@ -3,7 +3,6 @@ package com.fastasyncworldedit.bukkit;
import com.fastasyncworldedit.bukkit.adapter.BukkitQueueHandler; import com.fastasyncworldedit.bukkit.adapter.BukkitQueueHandler;
import com.fastasyncworldedit.bukkit.adapter.NMSAdapter; import com.fastasyncworldedit.bukkit.adapter.NMSAdapter;
import com.fastasyncworldedit.bukkit.listener.BrushListener; import com.fastasyncworldedit.bukkit.listener.BrushListener;
import com.fastasyncworldedit.bukkit.listener.ChunkListener9;
import com.fastasyncworldedit.bukkit.listener.RenderListener; import com.fastasyncworldedit.bukkit.listener.RenderListener;
import com.fastasyncworldedit.bukkit.regions.GriefDefenderFeature; import com.fastasyncworldedit.bukkit.regions.GriefDefenderFeature;
import com.fastasyncworldedit.bukkit.regions.GriefPreventionFeature; import com.fastasyncworldedit.bukkit.regions.GriefPreventionFeature;
@ -12,7 +11,6 @@ import com.fastasyncworldedit.bukkit.regions.TownyFeature;
import com.fastasyncworldedit.bukkit.regions.WorldGuardFeature; import com.fastasyncworldedit.bukkit.regions.WorldGuardFeature;
import com.fastasyncworldedit.bukkit.util.BukkitTaskManager; import com.fastasyncworldedit.bukkit.util.BukkitTaskManager;
import com.fastasyncworldedit.bukkit.util.FoliaTaskManager; import com.fastasyncworldedit.bukkit.util.FoliaTaskManager;
import com.fastasyncworldedit.core.util.FoliaSupport;
import com.fastasyncworldedit.bukkit.util.ItemUtil; import com.fastasyncworldedit.bukkit.util.ItemUtil;
import com.fastasyncworldedit.bukkit.util.MinecraftVersion; import com.fastasyncworldedit.bukkit.util.MinecraftVersion;
import com.fastasyncworldedit.bukkit.util.image.BukkitImageViewer; import com.fastasyncworldedit.bukkit.util.image.BukkitImageViewer;
@ -24,6 +22,7 @@ import com.fastasyncworldedit.core.queue.implementation.QueueHandler;
import com.fastasyncworldedit.core.queue.implementation.preloader.AsyncPreloader; import com.fastasyncworldedit.core.queue.implementation.preloader.AsyncPreloader;
import com.fastasyncworldedit.core.queue.implementation.preloader.Preloader; import com.fastasyncworldedit.core.queue.implementation.preloader.Preloader;
import com.fastasyncworldedit.core.regions.FaweMaskManager; import com.fastasyncworldedit.core.regions.FaweMaskManager;
import com.fastasyncworldedit.core.util.FoliaSupport;
import com.fastasyncworldedit.core.util.TaskManager; import com.fastasyncworldedit.core.util.TaskManager;
import com.fastasyncworldedit.core.util.WEManager; import com.fastasyncworldedit.core.util.WEManager;
import com.fastasyncworldedit.core.util.image.ImageViewer; import com.fastasyncworldedit.core.util.image.ImageViewer;
@ -92,8 +91,7 @@ public class FaweBukkit implements IFawe, Listener {
platformAdapter = new NMSAdapter(); platformAdapter = new NMSAdapter();
//PlotSquared support is limited to Spigot/Paper as of 02/20/2020 //PlotSquared support is limited to Spigot/Paper as of 02/20/2020
// TODO plotsquared support TaskManager.taskManager().taskGlobal(this::setupPlotSquared);
// TaskManager.taskManager().later(this::setupPlotSquared, 0);
// TODO moved out of task below?? // TODO moved out of task below??
Bukkit.getPluginManager().registerEvents(FaweBukkit.this, FaweBukkit.this.plugin); Bukkit.getPluginManager().registerEvents(FaweBukkit.this, FaweBukkit.this.plugin);

Datei anzeigen

@ -389,9 +389,7 @@ public interface IBukkitAdapter {
* @return list of {@link org.bukkit.entity.Entity} * @return list of {@link org.bukkit.entity.Entity}
*/ */
default List<org.bukkit.entity.Entity> getEntities(org.bukkit.World world) { default List<org.bukkit.entity.Entity> getEntities(org.bukkit.World world) {
// TODO return TaskManager.taskManager().syncGlobal(world::getEntities);
// return TaskManager.taskManager().sync(world::getEntities);
return List.of();
} }
} }

Datei anzeigen

@ -1,7 +1,6 @@
package com.fastasyncworldedit.core.entity; package com.fastasyncworldedit.core.entity;
import com.fastasyncworldedit.core.Fawe; import com.fastasyncworldedit.core.Fawe;
import com.fastasyncworldedit.core.util.TaskManager;
import com.sk89q.worldedit.entity.BaseEntity; import com.sk89q.worldedit.entity.BaseEntity;
import com.sk89q.worldedit.util.nbt.CompoundBinaryTag; import com.sk89q.worldedit.util.nbt.CompoundBinaryTag;
import com.sk89q.worldedit.world.entity.EntityType; import com.sk89q.worldedit.world.entity.EntityType;
@ -27,7 +26,7 @@ public class LazyBaseEntity extends BaseEntity {
if (Fawe.isMainThread()) { if (Fawe.isMainThread()) {
setNbt(tmp.get()); setNbt(tmp.get());
} else { } else {
// TODO // TODO folia
// setNbt(TaskManager.taskManager().sync(tmp)); // setNbt(TaskManager.taskManager().sync(tmp));
} }
} }

Datei anzeigen

@ -914,13 +914,14 @@ public class NMSRelighter implements Relighter {
queue.flush(); queue.flush();
finished.set(true); finished.set(true);
} else { } else {
TaskManager.taskManager().syncAt(new RunnableVal<>() { // fine to sync global, starlight is required for Folia
TaskManager.taskManager().syncGlobal(new RunnableVal<>() {
@Override @Override
public void run(Object value) { public void run(Object value) {
queue.flush(); queue.flush();
finished.set(true); finished.set(true);
} }
}, null); // TODO });
} }
} }
@ -951,8 +952,7 @@ public class NMSRelighter implements Relighter {
if (Settings.settings().LIGHTING.ASYNC) { if (Settings.settings().LIGHTING.ASYNC) {
runnable.run(); runnable.run();
} else { } else {
// TODO TaskManager.taskManager().syncGlobal(runnable);
// TaskManager.taskManager().sync(runnable);
} }
} }

Datei anzeigen

@ -3,7 +3,6 @@ package com.fastasyncworldedit.core.util.progress;
import com.fastasyncworldedit.core.configuration.Caption; import com.fastasyncworldedit.core.configuration.Caption;
import com.fastasyncworldedit.core.configuration.Settings; import com.fastasyncworldedit.core.configuration.Settings;
import com.fastasyncworldedit.core.util.StringMan; import com.fastasyncworldedit.core.util.StringMan;
import com.fastasyncworldedit.core.util.TaskManager;
import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.entity.Player;
import com.sk89q.worldedit.util.formatting.text.Component; import com.sk89q.worldedit.util.formatting.text.Component;
import com.sk89q.worldedit.util.formatting.text.TextComponent; import com.sk89q.worldedit.util.formatting.text.TextComponent;

Datei anzeigen

@ -3819,13 +3819,12 @@ public class EditSession extends PassthroughExtent implements AutoCloseable {
} }
if (containsAny) { if (containsAny) {
changes++; changes++;
// TODO this seems to be broken? TaskManager.taskManager().syncGlobal(new RunnableVal<Object>() {
/* TaskManager.taskManager().sync(new RunnableVal<Object>() {
@Override @Override
public void run(Object value) { public void run(Object value) {
regenerateChunk(cx, cz, biome, seed); regenerateChunk(cx, cz, biome, seed);
} }
});*/ });
} }
} }
if (changes != 0) { if (changes != 0) {

Datei anzeigen

@ -50,19 +50,12 @@ import com.sk89q.worldedit.extension.platform.Actor;
import com.sk89q.worldedit.extent.clipboard.io.ClipboardFormat; import com.sk89q.worldedit.extent.clipboard.io.ClipboardFormat;
import com.sk89q.worldedit.extent.clipboard.io.ClipboardFormats; import com.sk89q.worldedit.extent.clipboard.io.ClipboardFormats;
import com.sk89q.worldedit.function.EntityFunction; import com.sk89q.worldedit.function.EntityFunction;
import com.sk89q.worldedit.function.block.BlockReplace;
import com.sk89q.worldedit.function.mask.BlockTypeMask; import com.sk89q.worldedit.function.mask.BlockTypeMask;
import com.sk89q.worldedit.function.mask.BoundedHeightMask;
import com.sk89q.worldedit.function.mask.ExistingBlockMask; import com.sk89q.worldedit.function.mask.ExistingBlockMask;
import com.sk89q.worldedit.function.mask.Mask; import com.sk89q.worldedit.function.mask.Mask;
import com.sk89q.worldedit.function.mask.MaskIntersection;
import com.sk89q.worldedit.function.mask.Masks;
import com.sk89q.worldedit.function.mask.RegionMask;
import com.sk89q.worldedit.function.operation.Operations; import com.sk89q.worldedit.function.operation.Operations;
import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.function.pattern.Pattern;
import com.sk89q.worldedit.function.visitor.DownwardVisitor;
import com.sk89q.worldedit.function.visitor.EntityVisitor; import com.sk89q.worldedit.function.visitor.EntityVisitor;
import com.sk89q.worldedit.function.visitor.RecursiveVisitor;
import com.sk89q.worldedit.internal.annotation.Direction; import com.sk89q.worldedit.internal.annotation.Direction;
import com.sk89q.worldedit.internal.annotation.VertHeight; import com.sk89q.worldedit.internal.annotation.VertHeight;
import com.sk89q.worldedit.internal.expression.EvaluationException; import com.sk89q.worldedit.internal.expression.EvaluationException;
@ -70,10 +63,8 @@ import com.sk89q.worldedit.internal.expression.Expression;
import com.sk89q.worldedit.internal.expression.ExpressionException; import com.sk89q.worldedit.internal.expression.ExpressionException;
import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.math.Vector2; import com.sk89q.worldedit.math.Vector2;
import com.sk89q.worldedit.math.Vector3;
import com.sk89q.worldedit.regions.CuboidRegion; import com.sk89q.worldedit.regions.CuboidRegion;
import com.sk89q.worldedit.regions.CylinderRegion; import com.sk89q.worldedit.regions.CylinderRegion;
import com.sk89q.worldedit.regions.EllipsoidRegion;
import com.sk89q.worldedit.regions.Region; import com.sk89q.worldedit.regions.Region;
import com.sk89q.worldedit.util.formatting.component.SubtleFormat; import com.sk89q.worldedit.util.formatting.component.SubtleFormat;
import com.sk89q.worldedit.util.formatting.text.Component; import com.sk89q.worldedit.util.formatting.text.Component;
@ -89,7 +80,7 @@ import org.enginehub.piston.annotation.param.ArgFlag;
import org.enginehub.piston.annotation.param.Switch; import org.enginehub.piston.annotation.param.Switch;
import javax.imageio.ImageIO; import javax.imageio.ImageIO;
import java.awt.RenderingHints; import java.awt.*;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
@ -758,6 +749,17 @@ public class UtilityCommands {
return removed; return removed;
} }
private int killMatchingEntitiesSync(Integer radius, Actor actor, Supplier<EntityFunction> func) {
LocalSession session = we.getSessionManager().get(actor);
BlockVector3 center = session.getPlacementPosition(actor);
EditSession editSession = session.createEditSession(actor);
World world = editSession.getWorld();
return TaskManager.taskManager().syncAt(
() -> killMatchingEntities(radius, actor, func),
world, center.getBlockX() >> 4, center.getBlockZ() >> 4
);
}
private int killMatchingEntities(Integer radius, Actor actor, Supplier<EntityFunction> func) throws IncompleteRegionException, private int killMatchingEntities(Integer radius, Actor actor, Supplier<EntityFunction> func) throws IncompleteRegionException,
MaxChangedBlocksException { MaxChangedBlocksException {
List<EntityVisitor> visitors = new ArrayList<>(); List<EntityVisitor> visitors = new ArrayList<>();

Datei anzeigen

@ -20,7 +20,6 @@
package com.sk89q.worldedit.extension.platform; package com.sk89q.worldedit.extension.platform;
import com.fastasyncworldedit.core.internal.exception.FaweException; import com.fastasyncworldedit.core.internal.exception.FaweException;
import com.fastasyncworldedit.core.util.TaskManager;
import com.fastasyncworldedit.core.util.task.AsyncNotifyKeyedQueue; import com.fastasyncworldedit.core.util.task.AsyncNotifyKeyedQueue;
import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.WorldEditException;
import com.sk89q.worldedit.internal.cui.CUIEvent; import com.sk89q.worldedit.internal.cui.CUIEvent;
@ -109,7 +108,7 @@ public abstract class AbstractNonPlayerActor implements Actor {
if (async) { if (async) {
asyncNotifyQueue.run(wrapped); asyncNotifyQueue.run(wrapped);
} else { } else {
// TODO // TODO folia
// TaskManager.taskManager().taskNow(wrapped, false); // TaskManager.taskManager().taskNow(wrapped, false);
} }
return true; return true;

Datei anzeigen

@ -23,7 +23,6 @@ import com.fastasyncworldedit.core.configuration.Caption;
import com.fastasyncworldedit.core.internal.exception.FaweException; import com.fastasyncworldedit.core.internal.exception.FaweException;
import com.fastasyncworldedit.core.math.MutableBlockVector3; import com.fastasyncworldedit.core.math.MutableBlockVector3;
import com.fastasyncworldedit.core.regions.FaweMaskManager; import com.fastasyncworldedit.core.regions.FaweMaskManager;
import com.fastasyncworldedit.core.util.TaskManager;
import com.fastasyncworldedit.core.util.WEManager; import com.fastasyncworldedit.core.util.WEManager;
import com.fastasyncworldedit.core.util.task.AsyncNotifyKeyedQueue; import com.fastasyncworldedit.core.util.task.AsyncNotifyKeyedQueue;
import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.EditSession;
@ -677,7 +676,7 @@ public abstract class AbstractPlayerActor implements Actor, Player, Cloneable {
if (async) { if (async) {
asyncNotifyQueue.run(wrapped); asyncNotifyQueue.run(wrapped);
} else { } else {
// TODO // TODO folia
// TaskManager.taskManager().taskNow(wrapped, false); // TaskManager.taskManager().taskNow(wrapped, false);
} }
return true; return true;

Datei anzeigen

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