mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-01 02:46:41 +00:00
Major command changes that don't work yet.
This commit is contained in:
@ -25,7 +25,7 @@ public final class BrushCache {
|
||||
return item.hasNbtData() ? item.getNbtData() : null;
|
||||
}
|
||||
|
||||
private static final Object getKey(BaseItem item) {
|
||||
private static Object getKey(BaseItem item) {
|
||||
return item.getNativeItem();
|
||||
}
|
||||
|
||||
|
@ -21,7 +21,7 @@ package com.boydti.fawe.util;
|
||||
|
||||
import com.boydti.fawe.command.AnvilCommands;
|
||||
import com.boydti.fawe.command.CFICommands;
|
||||
import com.sk89q.minecraft.util.commands.Command;
|
||||
import org.enginehub.piston.annotation.Command;
|
||||
import com.sk89q.minecraft.util.commands.CommandPermissions;
|
||||
import com.sk89q.minecraft.util.commands.NestedCommand;
|
||||
import com.sk89q.worldedit.command.BiomeCommands;
|
||||
|
@ -4,21 +4,27 @@ import com.boydti.fawe.Fawe;
|
||||
import com.boydti.fawe.FaweAPI;
|
||||
import com.boydti.fawe.config.Settings;
|
||||
import com.boydti.fawe.logging.rollback.RollbackOptimizedHistory;
|
||||
import com.boydti.fawe.object.*;
|
||||
import com.boydti.fawe.object.FaweLimit;
|
||||
import com.boydti.fawe.object.FawePlayer;
|
||||
import com.boydti.fawe.object.FaweQueue;
|
||||
import com.boydti.fawe.object.NullChangeSet;
|
||||
import com.boydti.fawe.object.RegionWrapper;
|
||||
import com.boydti.fawe.object.changeset.DiskStorageHistory;
|
||||
import com.boydti.fawe.object.changeset.FaweChangeSet;
|
||||
import com.boydti.fawe.object.changeset.MemoryOptimizedHistory;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.event.extent.EditSessionEvent;
|
||||
import com.sk89q.worldedit.extent.inventory.BlockBag;
|
||||
import com.sk89q.worldedit.regions.Region;
|
||||
import com.sk89q.worldedit.util.eventbus.EventBus;
|
||||
import com.sk89q.worldedit.world.World;
|
||||
import java.util.UUID;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
import java.util.UUID;
|
||||
|
||||
public class EditSessionBuilder {
|
||||
private World world;
|
||||
@ -102,8 +108,8 @@ public class EditSessionBuilder {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param disk If it should be stored on disk
|
||||
* @param uuid The uuid to store it under (if on disk)
|
||||
* @param disk If it should be stored on disk
|
||||
* @param uuid The uuid to store it under (if on disk)
|
||||
* @param compression Compression level (0-9)
|
||||
* @return
|
||||
*/
|
||||
@ -180,17 +186,15 @@ public class EditSessionBuilder {
|
||||
return this;
|
||||
}
|
||||
|
||||
public EditSessionBuilder eventBus(@Nullable EventBus eventBus) {
|
||||
this.eventBus = eventBus;
|
||||
return this;
|
||||
}
|
||||
|
||||
public EditSessionBuilder event(@Nullable EditSessionEvent event) {
|
||||
this.event = event;
|
||||
return this;
|
||||
}
|
||||
|
||||
public EditSession build() {
|
||||
return new EditSession(worldName, world, queue, player, limit, changeSet, allowedRegions, autoQueue, fastmode, checkMemory, combineStages, blockBag, eventBus, event);
|
||||
if (eventBus == null) {
|
||||
eventBus = WorldEdit.getInstance().getEventBus();
|
||||
}
|
||||
return new EditSession(worldName, world, queue, player, limit, changeSet, allowedRegions, autoQueue, fastmode, checkMemory, combineStages, blockBag, eventBus, event);
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,7 @@
|
||||
package com.boydti.fawe.util;
|
||||
|
||||
import static java.lang.System.arraycopy;
|
||||
|
||||
import com.boydti.fawe.Fawe;
|
||||
import com.boydti.fawe.config.BBC;
|
||||
import com.boydti.fawe.config.Settings;
|
||||
@ -12,7 +14,6 @@ import com.boydti.fawe.object.RunnableVal2;
|
||||
import com.boydti.fawe.object.changeset.CPUOptimizedChangeSet;
|
||||
import com.boydti.fawe.object.changeset.FaweStreamChangeSet;
|
||||
import com.boydti.fawe.object.io.AbstractDelegateOutputStream;
|
||||
|
||||
import com.github.luben.zstd.ZstdInputStream;
|
||||
import com.github.luben.zstd.ZstdOutputStream;
|
||||
import com.sk89q.jnbt.CompoundTag;
|
||||
@ -27,20 +28,19 @@ import com.sk89q.worldedit.extent.clipboard.io.ClipboardFormat;
|
||||
import com.sk89q.worldedit.extent.clipboard.io.ClipboardFormats;
|
||||
import com.sk89q.worldedit.history.changeset.ChangeSet;
|
||||
import com.sk89q.worldedit.util.Location;
|
||||
import static java.lang.System.arraycopy;
|
||||
import net.jpountz.lz4.LZ4BlockInputStream;
|
||||
import net.jpountz.lz4.LZ4BlockOutputStream;
|
||||
import net.jpountz.lz4.LZ4Compressor;
|
||||
import net.jpountz.lz4.LZ4Factory;
|
||||
import net.jpountz.lz4.LZ4FastDecompressor;
|
||||
import net.jpountz.lz4.LZ4InputStream;
|
||||
import net.jpountz.lz4.LZ4Utils;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import javax.imageio.ImageIO;
|
||||
import java.awt.*;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.*;
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.io.PrintWriter;
|
||||
import java.lang.reflect.Array;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.MalformedURLException;
|
||||
@ -77,6 +77,15 @@ import java.util.zip.GZIPInputStream;
|
||||
import java.util.zip.Inflater;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipInputStream;
|
||||
import javax.annotation.Nullable;
|
||||
import javax.imageio.ImageIO;
|
||||
import net.jpountz.lz4.LZ4BlockInputStream;
|
||||
import net.jpountz.lz4.LZ4BlockOutputStream;
|
||||
import net.jpountz.lz4.LZ4Compressor;
|
||||
import net.jpountz.lz4.LZ4Factory;
|
||||
import net.jpountz.lz4.LZ4FastDecompressor;
|
||||
import net.jpountz.lz4.LZ4InputStream;
|
||||
import net.jpountz.lz4.LZ4Utils;
|
||||
|
||||
public class MainUtil {
|
||||
/*
|
||||
@ -853,33 +862,4 @@ public class MainUtil {
|
||||
}
|
||||
}
|
||||
|
||||
public static void warnDeprecated(Class... alternatives) {
|
||||
StackTraceElement[] stacktrace = new RuntimeException().getStackTrace();
|
||||
if (stacktrace.length > 1) {
|
||||
for (int i = 1; i < stacktrace.length; i++) {
|
||||
StackTraceElement stack = stacktrace[i];
|
||||
String s = stack.toString();
|
||||
if (s.startsWith("com.sk89q")) {
|
||||
continue;
|
||||
}
|
||||
try {
|
||||
StackTraceElement creatorElement = stacktrace[1];
|
||||
String className = creatorElement.getClassName();
|
||||
Class clazz = Class.forName(className);
|
||||
String creator = clazz.getSimpleName();
|
||||
String packageName = clazz.getPackage().getName();
|
||||
|
||||
StackTraceElement deprecatedElement = stack;
|
||||
String myName = Class.forName(deprecatedElement.getClassName()).getSimpleName();
|
||||
Fawe.debug("@" + creator + " used by " + myName + "." + deprecatedElement.getMethodName() + "():" + deprecatedElement.getLineNumber() + " is deprecated.");
|
||||
Fawe.debug(" - Alternatives: " + StringMan.getString(alternatives));
|
||||
} catch (Throwable throwable) {
|
||||
throwable.printStackTrace();
|
||||
} finally {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -171,16 +171,7 @@ public class SetQueue {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (pool.getQueuedSubmissionCount() != 0 || pool.getRunningThreadCount() != 0 || pool.getQueuedTaskCount() != 0) {
|
||||
// if (Fawe.get().isJava8())
|
||||
{
|
||||
pool.awaitQuiescence(Long.MAX_VALUE, TimeUnit.MILLISECONDS);
|
||||
}
|
||||
// else {
|
||||
// pool.shutdown();
|
||||
// pool.awaitTermination(Long.MAX_VALUE, TimeUnit.MILLISECONDS);
|
||||
// pool = new ForkJoinPool();
|
||||
// completer = new ExecutorCompletionService(pool);
|
||||
// }
|
||||
pool.awaitQuiescence(Long.MAX_VALUE, TimeUnit.MILLISECONDS);
|
||||
}
|
||||
queue.endSet(parallel);
|
||||
} catch (Throwable e) {
|
||||
|
@ -3,8 +3,9 @@ package com.boydti.fawe.util.chat;
|
||||
import com.boydti.fawe.Fawe;
|
||||
import com.boydti.fawe.config.BBC;
|
||||
import com.boydti.fawe.object.FawePlayer;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
|
||||
import com.sk89q.worldedit.extension.platform.Actor;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class Message {
|
||||
@ -75,7 +76,7 @@ public class Message {
|
||||
}
|
||||
|
||||
public Message command(String command) {
|
||||
Fawe.get().getChatManager().command(this, (WorldEdit.getInstance().getConfiguration().noDoubleSlash ? "" : "/") + command);
|
||||
Fawe.get().getChatManager().command(this, ("/") + command);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,7 @@ import com.boydti.fawe.util.MainUtil;
|
||||
import com.boydti.fawe.util.StringMan;
|
||||
import com.sk89q.minecraft.util.commands.CommandLocals;
|
||||
import com.sk89q.minecraft.util.commands.Link;
|
||||
import com.sk89q.worldedit.extension.platform.CommandManager;
|
||||
import com.sk89q.worldedit.extension.platform.PlatformCommandManager;
|
||||
import com.sk89q.worldedit.util.command.CommandCallable;
|
||||
import com.sk89q.worldedit.util.command.CommandMapping;
|
||||
import com.sk89q.worldedit.util.command.Description;
|
||||
@ -57,7 +57,7 @@ public class UsageMessage extends Message {
|
||||
String prefix = !commandString.isEmpty() ? commandString + " " : "";
|
||||
|
||||
List<CommandMapping> list = new ArrayList<>(dispatcher.getCommands());
|
||||
list.sort(new PrimaryAliasComparator(CommandManager.COMMAND_CLEAN_PATTERN));
|
||||
list.sort(new PrimaryAliasComparator(PlatformCommandManager.COMMAND_CLEAN_PATTERN));
|
||||
|
||||
for (CommandMapping mapping : list) {
|
||||
boolean perm = locals == null || mapping.getCallable().testPermission(locals);
|
||||
|
Reference in New Issue
Block a user