Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-11-17 00:20:09 +01:00
tmp
Dieser Commit ist enthalten in:
Ursprung
0bee4a6bf2
Commit
ac83bb500e
@ -3,7 +3,6 @@ package com.fastasyncworldedit.bukkit;
|
||||
import com.fastasyncworldedit.bukkit.adapter.BukkitQueueHandler;
|
||||
import com.fastasyncworldedit.bukkit.adapter.NMSAdapter;
|
||||
import com.fastasyncworldedit.bukkit.listener.BrushListener;
|
||||
import com.fastasyncworldedit.bukkit.listener.ChunkListener9;
|
||||
import com.fastasyncworldedit.bukkit.listener.RenderListener;
|
||||
import com.fastasyncworldedit.bukkit.regions.GriefDefenderFeature;
|
||||
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.util.BukkitTaskManager;
|
||||
import com.fastasyncworldedit.bukkit.util.FoliaTaskManager;
|
||||
import com.fastasyncworldedit.core.util.FoliaSupport;
|
||||
import com.fastasyncworldedit.bukkit.util.ItemUtil;
|
||||
import com.fastasyncworldedit.bukkit.util.MinecraftVersion;
|
||||
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.Preloader;
|
||||
import com.fastasyncworldedit.core.regions.FaweMaskManager;
|
||||
import com.fastasyncworldedit.core.util.FoliaSupport;
|
||||
import com.fastasyncworldedit.core.util.TaskManager;
|
||||
import com.fastasyncworldedit.core.util.WEManager;
|
||||
import com.fastasyncworldedit.core.util.image.ImageViewer;
|
||||
@ -92,8 +91,7 @@ public class FaweBukkit implements IFawe, Listener {
|
||||
platformAdapter = new NMSAdapter();
|
||||
|
||||
//PlotSquared support is limited to Spigot/Paper as of 02/20/2020
|
||||
// TODO plotsquared support
|
||||
// TaskManager.taskManager().later(this::setupPlotSquared, 0);
|
||||
TaskManager.taskManager().taskGlobal(this::setupPlotSquared);
|
||||
|
||||
// TODO moved out of task below??
|
||||
Bukkit.getPluginManager().registerEvents(FaweBukkit.this, FaweBukkit.this.plugin);
|
||||
|
@ -389,9 +389,7 @@ public interface IBukkitAdapter {
|
||||
* @return list of {@link org.bukkit.entity.Entity}
|
||||
*/
|
||||
default List<org.bukkit.entity.Entity> getEntities(org.bukkit.World world) {
|
||||
// TODO
|
||||
// return TaskManager.taskManager().sync(world::getEntities);
|
||||
return List.of();
|
||||
return TaskManager.taskManager().syncGlobal(world::getEntities);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,7 +1,6 @@
|
||||
package com.fastasyncworldedit.core.entity;
|
||||
|
||||
import com.fastasyncworldedit.core.Fawe;
|
||||
import com.fastasyncworldedit.core.util.TaskManager;
|
||||
import com.sk89q.worldedit.entity.BaseEntity;
|
||||
import com.sk89q.worldedit.util.nbt.CompoundBinaryTag;
|
||||
import com.sk89q.worldedit.world.entity.EntityType;
|
||||
@ -27,7 +26,7 @@ public class LazyBaseEntity extends BaseEntity {
|
||||
if (Fawe.isMainThread()) {
|
||||
setNbt(tmp.get());
|
||||
} else {
|
||||
// TODO
|
||||
// TODO folia
|
||||
// setNbt(TaskManager.taskManager().sync(tmp));
|
||||
}
|
||||
}
|
||||
|
@ -914,13 +914,14 @@ public class NMSRelighter implements Relighter {
|
||||
queue.flush();
|
||||
finished.set(true);
|
||||
} else {
|
||||
TaskManager.taskManager().syncAt(new RunnableVal<>() {
|
||||
// fine to sync global, starlight is required for Folia
|
||||
TaskManager.taskManager().syncGlobal(new RunnableVal<>() {
|
||||
@Override
|
||||
public void run(Object value) {
|
||||
queue.flush();
|
||||
finished.set(true);
|
||||
}
|
||||
}, null); // TODO
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -951,8 +952,7 @@ public class NMSRelighter implements Relighter {
|
||||
if (Settings.settings().LIGHTING.ASYNC) {
|
||||
runnable.run();
|
||||
} else {
|
||||
// TODO
|
||||
// TaskManager.taskManager().sync(runnable);
|
||||
TaskManager.taskManager().syncGlobal(runnable);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3,7 +3,6 @@ package com.fastasyncworldedit.core.util.progress;
|
||||
import com.fastasyncworldedit.core.configuration.Caption;
|
||||
import com.fastasyncworldedit.core.configuration.Settings;
|
||||
import com.fastasyncworldedit.core.util.StringMan;
|
||||
import com.fastasyncworldedit.core.util.TaskManager;
|
||||
import com.sk89q.worldedit.entity.Player;
|
||||
import com.sk89q.worldedit.util.formatting.text.Component;
|
||||
import com.sk89q.worldedit.util.formatting.text.TextComponent;
|
||||
|
@ -3819,13 +3819,12 @@ public class EditSession extends PassthroughExtent implements AutoCloseable {
|
||||
}
|
||||
if (containsAny) {
|
||||
changes++;
|
||||
// TODO this seems to be broken?
|
||||
/* TaskManager.taskManager().sync(new RunnableVal<Object>() {
|
||||
TaskManager.taskManager().syncGlobal(new RunnableVal<Object>() {
|
||||
@Override
|
||||
public void run(Object value) {
|
||||
regenerateChunk(cx, cz, biome, seed);
|
||||
}
|
||||
});*/
|
||||
});
|
||||
}
|
||||
}
|
||||
if (changes != 0) {
|
||||
|
@ -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.ClipboardFormats;
|
||||
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.BoundedHeightMask;
|
||||
import com.sk89q.worldedit.function.mask.ExistingBlockMask;
|
||||
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.pattern.Pattern;
|
||||
import com.sk89q.worldedit.function.visitor.DownwardVisitor;
|
||||
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.VertHeight;
|
||||
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.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.Vector2;
|
||||
import com.sk89q.worldedit.math.Vector3;
|
||||
import com.sk89q.worldedit.regions.CuboidRegion;
|
||||
import com.sk89q.worldedit.regions.CylinderRegion;
|
||||
import com.sk89q.worldedit.regions.EllipsoidRegion;
|
||||
import com.sk89q.worldedit.regions.Region;
|
||||
import com.sk89q.worldedit.util.formatting.component.SubtleFormat;
|
||||
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 javax.imageio.ImageIO;
|
||||
import java.awt.RenderingHints;
|
||||
import java.awt.*;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@ -758,6 +749,17 @@ public class UtilityCommands {
|
||||
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,
|
||||
MaxChangedBlocksException {
|
||||
List<EntityVisitor> visitors = new ArrayList<>();
|
||||
|
@ -20,7 +20,6 @@
|
||||
package com.sk89q.worldedit.extension.platform;
|
||||
|
||||
import com.fastasyncworldedit.core.internal.exception.FaweException;
|
||||
import com.fastasyncworldedit.core.util.TaskManager;
|
||||
import com.fastasyncworldedit.core.util.task.AsyncNotifyKeyedQueue;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.internal.cui.CUIEvent;
|
||||
@ -109,7 +108,7 @@ public abstract class AbstractNonPlayerActor implements Actor {
|
||||
if (async) {
|
||||
asyncNotifyQueue.run(wrapped);
|
||||
} else {
|
||||
// TODO
|
||||
// TODO folia
|
||||
// TaskManager.taskManager().taskNow(wrapped, false);
|
||||
}
|
||||
return true;
|
||||
|
@ -23,7 +23,6 @@ import com.fastasyncworldedit.core.configuration.Caption;
|
||||
import com.fastasyncworldedit.core.internal.exception.FaweException;
|
||||
import com.fastasyncworldedit.core.math.MutableBlockVector3;
|
||||
import com.fastasyncworldedit.core.regions.FaweMaskManager;
|
||||
import com.fastasyncworldedit.core.util.TaskManager;
|
||||
import com.fastasyncworldedit.core.util.WEManager;
|
||||
import com.fastasyncworldedit.core.util.task.AsyncNotifyKeyedQueue;
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
@ -677,7 +676,7 @@ public abstract class AbstractPlayerActor implements Actor, Player, Cloneable {
|
||||
if (async) {
|
||||
asyncNotifyQueue.run(wrapped);
|
||||
} else {
|
||||
// TODO
|
||||
// TODO folia
|
||||
// TaskManager.taskManager().taskNow(wrapped, false);
|
||||
}
|
||||
return true;
|
||||
|
@ -690,7 +690,7 @@ public final class PlatformCommandManager {
|
||||
if (actor instanceof Player player) {
|
||||
TaskManager.taskManager().task(() -> handleCommandOnCurrentThread(event), player.getLocation());
|
||||
} else {
|
||||
// TODO
|
||||
// TODO folia
|
||||
}
|
||||
return;
|
||||
} else {
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren