Update Upstream

609c7b8 Scrapped Logging Framework 4 Java

Closes #997
Closes #998
Closes #999
Closes #1000
Closes #1001
Closes #1002
This commit is contained in:
NotMyFault
2021-03-29 15:29:16 +02:00
parent 2dc89f735d
commit b96cea75b8
118 changed files with 700 additions and 743 deletions

View File

@ -14,8 +14,8 @@ import com.boydti.fawe.util.TextureUtil;
import com.boydti.fawe.util.WEManager;
import com.github.luben.zstd.util.Native;
import com.sk89q.worldedit.WorldEdit;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.sk89q.worldedit.internal.util.LogManagerCompat;
import org.apache.logging.log4j.Logger;
import java.io.BufferedReader;
import java.io.File;
@ -73,7 +73,7 @@ import javax.management.NotificationEmitter;
*/
public class Fawe {
private static final Logger log = LoggerFactory.getLogger(Fawe.class);
private static final Logger LOGGER = LogManagerCompat.getLogger();
private static Fawe instance;
@ -250,7 +250,7 @@ public class Fawe {
try {
Settings.IMP.reload(file);
} catch (Throwable e) {
log.error("Failed to load config.", e);
LOGGER.error("Failed to load config.", e);
}
}
@ -272,14 +272,14 @@ public class Fawe {
if (Settings.IMP.CLIPBOARD.COMPRESSION_LEVEL > 6 || Settings.IMP.HISTORY.COMPRESSION_LEVEL > 6) {
Settings.IMP.CLIPBOARD.COMPRESSION_LEVEL = Math.min(6, Settings.IMP.CLIPBOARD.COMPRESSION_LEVEL);
Settings.IMP.HISTORY.COMPRESSION_LEVEL = Math.min(6, Settings.IMP.HISTORY.COMPRESSION_LEVEL);
log.error("ZSTD Compression Binding Not Found.\n"
LOGGER.error("ZSTD Compression Binding Not Found.\n"
+ "FAWE will still work but compression won't work as well.\n", e);
}
}
try {
net.jpountz.util.Native.load();
} catch (Throwable e) {
log.error("LZ4 Compression Binding Not Found.\n"
LOGGER.error("LZ4 Compression Binding Not Found.\n"
+ "FAWE will still work but compression will be slower.\n", e);
}
}
@ -288,7 +288,7 @@ public class Fawe {
boolean x86OS = System.getProperty("sun.arch.data.model").contains("32");
boolean x86JVM = System.getProperty("os.arch").contains("32");
if (x86OS != x86JVM) {
log.info("You are running 32-bit Java on a 64-bit machine. Please upgrade to 64-bit Java.");
LOGGER.info("You are running 32-bit Java on a 64-bit machine. Please upgrade to 64-bit Java.");
}
}
@ -322,7 +322,7 @@ public class Fawe {
}
}
} catch (Throwable ignored) {
log.error("FAWE encountered an error trying to listen to JVM memory.\n"
LOGGER.error("FAWE encountered an error trying to listen to JVM memory.\n"
+ "Please change your Java security settings or disable this message by"
+ "changing 'max-memory-percent' in the config files to '-1'.");
}

View File

@ -30,10 +30,12 @@ import com.sk89q.jnbt.LongTag;
import com.sk89q.jnbt.ShortTag;
import com.sk89q.jnbt.StringTag;
import com.sk89q.jnbt.Tag;
import com.sk89q.worldedit.internal.util.LogManagerCompat;
import com.sk89q.worldedit.math.MutableBlockVector3;
import com.sk89q.worldedit.math.MutableVector3;
import com.sk89q.worldedit.util.formatting.text.TranslatableComponent;
import com.sk89q.worldedit.world.block.BlockTypesCache;
import org.apache.logging.log4j.Logger;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
@ -56,12 +58,13 @@ import java.util.function.Function;
import java.util.function.Supplier;
import static com.google.common.base.Preconditions.checkNotNull;
import static org.slf4j.LoggerFactory.getLogger;
public enum FaweCache implements Trimable {
IMP
; // singleton
private static final Logger LOGGER = LogManagerCompat.getLogger();
public final int BLOCKS_PER_LAYER = 4096;
public final int CHUNK_LAYERS = 16;
public final int WORLD_HEIGHT = CHUNK_LAYERS << 4;
@ -503,7 +506,7 @@ public enum FaweCache implements Trimable {
} else if (value instanceof Boolean) {
return asTag((byte) ((boolean) value ? 1 : 0));
}
getLogger(FaweCache.class).error("Invalid nbt: {}", value);
LOGGER.error("Invalid nbt: {}", value);
return null;
}

View File

@ -14,7 +14,7 @@ import java.util.Set;
import java.util.concurrent.Future;
import java.util.function.Function;
import static org.slf4j.LoggerFactory.getLogger;
import static org.apache.logging.log4j.LogManager.getLogger;
public interface IBatchProcessor {

View File

@ -3,15 +3,15 @@ package com.boydti.fawe.beta.implementation.blocks;
import com.boydti.fawe.Fawe;
import com.boydti.fawe.beta.IBlocks;
import com.boydti.fawe.beta.IChunkSet;
import com.sk89q.worldedit.internal.util.LogManagerCompat;
import com.sk89q.worldedit.world.block.BlockState;
import com.sk89q.worldedit.world.block.BlockTypesCache;
import org.apache.logging.log4j.Logger;
import org.jetbrains.annotations.Range;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public abstract class CharBlocks implements IBlocks {
public static final Logger logger = LoggerFactory.getLogger(CharBlocks.class);
private static final Logger LOGGER = LogManagerCompat.getLogger();
protected static final Section FULL = new Section() {
@Override
@ -139,9 +139,9 @@ public abstract class CharBlocks implements IBlocks {
try {
set(layer, index, value);
} catch (ArrayIndexOutOfBoundsException exception) {
logger.error("Tried setting block at coordinates (" + x + "," + y + "," + z + ")");
LOGGER.error("Tried setting block at coordinates (" + x + "," + y + "," + z + ")");
assert Fawe.imp() != null;
logger.error("Layer variable was = {}", layer, exception);
LOGGER.error("Layer variable was = {}", layer, exception);
}
}

View File

@ -10,6 +10,7 @@ import com.boydti.fawe.object.RunnableVal;
import com.boydti.fawe.object.collection.BlockVectorSet;
import com.boydti.fawe.util.MathMan;
import com.boydti.fawe.util.TaskManager;
import com.sk89q.worldedit.internal.util.LogManagerCompat;
import com.sk89q.worldedit.math.MutableBlockVector3;
import com.sk89q.worldedit.registry.state.BooleanProperty;
import com.sk89q.worldedit.registry.state.DirectionalProperty;
@ -20,8 +21,7 @@ import com.sk89q.worldedit.world.block.BlockState;
import com.sk89q.worldedit.world.block.BlockTypes;
import com.sk89q.worldedit.world.registry.BlockMaterial;
import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.logging.log4j.Logger;
import java.util.ArrayDeque;
import java.util.ArrayList;
@ -41,7 +41,7 @@ import java.util.stream.Collectors;
public class NMSRelighter implements Relighter {
private static final Logger log = LoggerFactory.getLogger(NMSRelighter.class);
private static final Logger LOGGER = LogManagerCompat.getLogger();
private static final int DISPATCH_SIZE = 64;
private static final DirectionalProperty stairDirection;
private static final EnumProperty stairHalf;
@ -1028,8 +1028,8 @@ public class NMSRelighter implements Relighter {
heightMapList.get(HeightMapType.MOTION_BLOCKING)[j] = y + 1;
}
} catch (Exception ignored) {
log.debug("Error calculating waterlogged state for BlockState: " + state.getBlockType().getId() + ". States:");
log.debug(states.entrySet().stream().map(e -> e.getKey() + "=" + e.getValue())
LOGGER.debug("Error calculating waterlogged state for BlockState: " + state.getBlockType().getId() + ". States:");
LOGGER.debug(states.entrySet().stream().map(e -> e.getKey() + "=" + e.getValue())
.collect(Collectors.joining(", ", "{", "}")));
}
try {
@ -1039,8 +1039,8 @@ public class NMSRelighter implements Relighter {
heightMapList.get(HeightMapType.MOTION_BLOCKING_NO_LEAVES)[j] = y + 1;
}
} catch (Exception ignored) {
log.debug("Error calculating waterlogged state for BlockState: " + state.getBlockType().getId() + ". States:");
log.debug(states.entrySet().stream().map(e -> e.getKey() + "=" + e.getValue())
LOGGER.debug("Error calculating waterlogged state for BlockState: " + state.getBlockType().getId() + ". States:");
LOGGER.debug(states.entrySet().stream().map(e -> e.getKey() + "=" + e.getValue())
.collect(Collectors.joining(", ", "{", "}")));
}
}

View File

@ -10,8 +10,6 @@ import com.boydti.fawe.util.StringMan;
import com.google.common.cache.LoadingCache;
import com.sk89q.worldedit.extent.Extent;
import org.jetbrains.annotations.Nullable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.ArrayList;
import java.util.Arrays;
@ -28,8 +26,6 @@ import java.util.function.Supplier;
public class MultiBatchProcessor implements IBatchProcessor {
private static final Logger log = LoggerFactory.getLogger(MultiBatchProcessor.class);
private IBatchProcessor[] processors;
private final LoadingCache<Class<?>, Map<Long, Filter>> classToThreadIdToFilter =
FaweCache.IMP.createCache((Supplier<Map<Long, Filter>>) ConcurrentHashMap::new);

View File

@ -21,9 +21,9 @@ import com.boydti.fawe.util.MathMan;
import com.boydti.fawe.util.MemUtil;
import com.google.common.util.concurrent.Futures;
import com.sk89q.worldedit.extent.Extent;
import com.sk89q.worldedit.internal.util.LogManagerCompat;
import it.unimi.dsi.fastutil.longs.Long2ObjectLinkedOpenHashMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.logging.log4j.Logger;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.ExecutionException;
@ -38,8 +38,7 @@ import java.util.concurrent.locks.ReentrantLock;
*/
public class SingleThreadQueueExtent extends ExtentBatchProcessorHolder implements IQueueExtent<IQueueChunk> {
// Don't bother with the full classpath.
private static final Logger log = LoggerFactory.getLogger("SingleThreadQueueExtent");
private static final Logger LOGGER = LogManagerCompat.getLogger();
// Pool discarded chunks for reuse (can safely be cleared by another thread)
// private static final ConcurrentLinkedQueue<IChunk> CHUNK_POOL = new ConcurrentLinkedQueue<>();
@ -302,10 +301,10 @@ public class SingleThreadQueueExtent extends ExtentBatchProcessorHolder implemen
future = (Future) future.get();
}
} catch (FaweException messageOnly) {
log.warn(messageOnly.getMessage());
LOGGER.warn(messageOnly.getMessage());
} catch (ExecutionException e) {
if (e.getCause() instanceof FaweException) {
log.warn(e.getCause().getClass().getCanonicalName() + ": " + e.getCause().getMessage());
LOGGER.warn(e.getCause().getClass().getCanonicalName() + ": " + e.getCause().getMessage());
} else {
e.printStackTrace();
}
@ -321,10 +320,10 @@ public class SingleThreadQueueExtent extends ExtentBatchProcessorHolder implemen
first = (Future) first.get();
}
} catch (FaweException messageOnly) {
log.warn(messageOnly.getMessage());
LOGGER.warn(messageOnly.getMessage());
} catch (ExecutionException e) {
if (e.getCause() instanceof FaweException) {
log.warn(e.getCause().getClass().getCanonicalName() + ": " + e.getCause().getMessage());
LOGGER.warn(e.getCause().getClass().getCanonicalName() + ": " + e.getCause().getMessage());
} else {
e.printStackTrace();
}
@ -340,14 +339,14 @@ public class SingleThreadQueueExtent extends ExtentBatchProcessorHolder implemen
try {
next = (Future) next.get();
} catch (FaweException messageOnly) {
log.warn(messageOnly.getMessage());
LOGGER.warn(messageOnly.getMessage());
} catch (ExecutionException e) {
if (e.getCause() instanceof FaweException) {
log.warn(e.getCause().getClass().getCanonicalName() + ": " + e.getCause().getMessage());
LOGGER.warn(e.getCause().getClass().getCanonicalName() + ": " + e.getCause().getMessage());
} else {
e.printStackTrace();
}
log.error("Please report this error on our issue tracker");
LOGGER.error("Please report this error on our issue tracker: https://github.com/IntellectualSites/FastAsyncWorldEdit/issues");
e.getCause().printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();

View File

@ -3,8 +3,8 @@ package com.boydti.fawe.config;
import com.boydti.fawe.configuration.MemorySection;
import com.boydti.fawe.configuration.file.YamlConfiguration;
import com.boydti.fawe.util.StringMan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.sk89q.worldedit.internal.util.LogManagerCompat;
import org.apache.logging.log4j.Logger;
import java.io.ByteArrayOutputStream;
import java.io.File;
@ -26,7 +26,7 @@ import java.util.Map;
public class Config {
private final Logger log = LoggerFactory.getLogger(Config.class);
private static final Logger LOGGER = LogManagerCompat.getLogger();
public Config() {
save(new PrintWriter(new ByteArrayOutputStream(0)), getClass(), this, 0);
@ -48,7 +48,7 @@ public class Config {
}
}
}
log.debug("Failed to get config option: " + key);
LOGGER.debug("Failed to get config option: " + key);
return null;
}
@ -79,7 +79,7 @@ public class Config {
}
}
}
log.debug("Failed to set config option: " + key + ": " + value + " | " + instance + " | " + root.getSimpleName() + ".yml");
LOGGER.debug("Failed to set config option: " + key + ": " + value + " | " + instance + " | " + root.getSimpleName() + ".yml");
}
public boolean load(File file) {
@ -333,7 +333,7 @@ public class Config {
setAccessible(field);
return field;
} catch (Throwable ignored) {
log.debug("Invalid config field: " + StringMan.join(split, ".") + " for " + toNodeName(instance.getClass().getSimpleName()));
LOGGER.debug("Invalid config field: " + StringMan.join(split, ".") + " for " + toNodeName(instance.getClass().getSimpleName()));
return null;
}
}

View File

@ -3,7 +3,9 @@ package com.boydti.fawe.configuration.file;
import com.boydti.fawe.configuration.Configuration;
import com.boydti.fawe.configuration.ConfigurationSection;
import com.boydti.fawe.configuration.InvalidConfigurationException;
import com.sk89q.worldedit.internal.util.LogManagerCompat;
import com.sk89q.worldedit.util.YAMLConfiguration;
import org.apache.logging.log4j.Logger;
import org.yaml.snakeyaml.DumperOptions;
import org.yaml.snakeyaml.Yaml;
import org.yaml.snakeyaml.error.YAMLException;
@ -16,13 +18,13 @@ import java.nio.file.Files;
import java.nio.file.StandardCopyOption;
import java.util.Map;
import static org.slf4j.LoggerFactory.getLogger;
/**
* An implementation of {@link com.boydti.fawe.configuration.Configuration} which saves all files in Yaml.
* Note that this implementation is not synchronized.
*/
public class YamlConfiguration extends FileConfiguration {
private static final Logger LOGGER = LogManagerCompat.getLogger();
protected static final String COMMENT_PREFIX = "# ";
protected static final String BLANK_CONFIG = "{}\n";
private final DumperOptions yamlOptions = new DumperOptions();
@ -64,8 +66,7 @@ public class YamlConfiguration extends FileConfiguration {
dest = new File(file.getAbsolutePath() + "_broken_" + i++);
}
Files.copy(file.toPath(), dest.toPath(), StandardCopyOption.REPLACE_EXISTING);
getLogger(YamlConfiguration.class).error("Could not read: {}\n"
+ "Renamed to: {}", file, dest.getName(), ex);
LOGGER.error("Could not read {}\n" + "Renamed to {}", file, dest.getAbsolutePath(), ex);
} catch (final IOException e) {
e.printStackTrace();
}
@ -97,7 +98,7 @@ public class YamlConfiguration extends FileConfiguration {
try {
config.load(reader);
} catch (final IOException | InvalidConfigurationException ex) {
getLogger(YAMLConfiguration.class).error("Cannot load configuration from stream", ex);
LOGGER.error("Cannot load configuration from stream", ex);
}
return config;

View File

@ -1,7 +1,8 @@
package com.boydti.fawe.configuration.serialization;
import com.boydti.fawe.configuration.Configuration;
import org.slf4j.LoggerFactory;
import com.sk89q.worldedit.internal.util.LogManagerCompat;
import org.apache.logging.log4j.Logger;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
@ -14,6 +15,8 @@ import java.util.Map;
*/
public class ConfigurationSerialization {
private static final Logger LOGGER = LogManagerCompat.getLogger();
public static final String SERIALIZED_TYPE_KEY = "==";
private static final Map<String, Class<? extends ConfigurationSerializable>> aliases =
new HashMap<>();
@ -196,15 +199,14 @@ public class ConfigurationSerialization {
ConfigurationSerializable result = (ConfigurationSerializable) method.invoke(null, args);
if (result == null) {
LoggerFactory.getLogger(ConfigurationSerialization.class).error(
"Could not call method '" + method.toString() + "' of " + this.clazz + " for deserialization: method returned null");
LOGGER.error("Could not call method '" + method.toString() + "' of " + this.clazz + " for deserialization: method returned null");
} else {
return result;
}
} catch (Throwable ex) {
LoggerFactory.getLogger(ConfigurationSerialization.class).error("Could not call method '" + method.toString() + "' of " + this.clazz
+ " for deserialization",
ex instanceof InvocationTargetException ? ex.getCause() : ex);
LOGGER.error("Could not call method '" + method.toString() + "' of " + this.clazz
+ " for deserialization",
ex instanceof InvocationTargetException ? ex.getCause() : ex);
}
return null;
@ -214,9 +216,9 @@ public class ConfigurationSerialization {
try {
return ctor.newInstance(args);
} catch (Throwable ex) {
LoggerFactory.getLogger(ConfigurationSerialization.class).error("Could not call constructor '" + ctor.toString() + "' of " + this.clazz
+ " for deserialization",
ex instanceof InvocationTargetException ? ex.getCause() : ex);
LOGGER.error("Could not call constructor '" + ctor.toString() + "' of " + this.clazz
+ " for deserialization",
ex instanceof InvocationTargetException ? ex.getCause() : ex);
}
return null;

View File

@ -1,16 +1,15 @@
package com.boydti.fawe.database;
import com.boydti.fawe.config.Config;
import com.sk89q.worldedit.internal.util.LogManagerCompat;
import com.sk89q.worldedit.world.World;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.logging.log4j.Logger;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
public class DBHandler {
private final Logger log = LoggerFactory.getLogger(Config.class);
private static final Logger LOGGER = LogManagerCompat.getLogger();
public static final DBHandler IMP = new DBHandler();
@ -26,7 +25,7 @@ public class DBHandler {
databases.put(world, database);
return database;
} catch (Throwable e) {
log.error("No JDBC driver found!", e);
LOGGER.error("No JDBC driver found!", e);
return null;
}
}

View File

@ -6,13 +6,13 @@ import com.boydti.fawe.logging.rollback.RollbackOptimizedHistory;
import com.boydti.fawe.object.collection.YieldIterable;
import com.boydti.fawe.object.task.AsyncNotifyQueue;
import com.boydti.fawe.util.MainUtil;
import com.sk89q.worldedit.internal.util.LogManagerCompat;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.regions.CuboidRegion;
import com.sk89q.worldedit.world.World;
import org.apache.logging.log4j.Logger;
import org.intellij.lang.annotations.Language;
import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.File;
import java.io.IOException;
@ -32,7 +32,7 @@ import java.util.stream.IntStream;
public class RollbackDatabase extends AsyncNotifyQueue {
private static final Logger log = LoggerFactory.getLogger(RollbackDatabase.class);
private static final Logger LOGGER = LogManagerCompat.getLogger();
private final String prefix;
private final File dbLocation;
@ -309,7 +309,7 @@ public class RollbackDatabase extends AsyncNotifyQueue {
dbLocation.createNewFile();
} catch (IOException e) {
e.printStackTrace();
log.debug("Unable to create the database!");
LOGGER.error("Unable to create the database!");
}
}
Class.forName("org.sqlite.JDBC");

View File

@ -17,6 +17,7 @@ import com.sk89q.jnbt.ListTag;
import com.sk89q.jnbt.NBTConstants;
import com.sk89q.jnbt.NBTInputStream;
import com.sk89q.jnbt.NBTOutputStream;
import com.sk89q.worldedit.internal.util.LogManagerCompat;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.regions.Region;
import com.sk89q.worldedit.registry.state.Property;
@ -30,6 +31,7 @@ import com.sk89q.worldedit.world.block.BlockType;
import com.sk89q.worldedit.world.block.BlockTypes;
import com.sk89q.worldedit.world.block.BlockTypesCache;
import it.unimi.dsi.fastutil.io.FastByteArrayOutputStream;
import org.apache.logging.log4j.Logger;
import java.io.IOException;
import java.util.ArrayList;
@ -44,9 +46,10 @@ import java.util.UUID;
import java.util.concurrent.Future;
import javax.annotation.Nullable;
import static org.slf4j.LoggerFactory.getLogger;
public class MCAChunk implements IChunk {
private static final Logger LOGGER = LogManagerCompat.getLogger();
public final boolean[] hasSections = new boolean[16];
public boolean hasBiomes = false;
@ -310,7 +313,7 @@ public class MCAChunk implements IChunk {
Object value = state.getState(property);
String valueStr = value.toString();
if (Character.isUpperCase(valueStr.charAt(0))) {
getLogger(MCAChunk.class).warn("Invalid uppercase value {}", value);
LOGGER.warn("Invalid uppercase value {}", value);
valueStr = valueStr.toLowerCase(Locale.ROOT);
}
out.writeNamedTag(key, valueStr);

View File

@ -12,11 +12,13 @@ import com.boydti.fawe.util.MathMan;
import com.sk89q.jnbt.CompoundTag;
import com.sk89q.jnbt.NBTInputStream;
import com.sk89q.worldedit.WorldEditException;
import com.sk89q.worldedit.internal.util.LogManagerCompat;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.world.World;
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
import it.unimi.dsi.fastutil.io.FastByteArrayOutputStream;
import org.apache.logging.log4j.Logger;
import java.io.BufferedInputStream;
import java.io.File;
@ -38,8 +40,6 @@ import java.util.zip.Deflater;
import java.util.zip.Inflater;
import java.util.zip.InflaterInputStream;
import static org.slf4j.LoggerFactory.getLogger;
/**
* Chunk format: http://minecraft.gamepedia.com/Chunk_format#Entity_format
* e.g., `.Level.Entities.#` (Starts with a . as the root tag is unnamed)
@ -47,6 +47,8 @@ import static org.slf4j.LoggerFactory.getLogger;
*/
public class MCAFile extends ExtentBatchProcessorHolder implements Trimable, IChunkExtent {
private static final Logger LOGGER = LogManagerCompat.getLogger();
private static Field fieldBuf2;
static {
@ -294,7 +296,7 @@ public class MCAFile extends ExtentBatchProcessorHolder implements Trimable, ICh
if (offset < offsets.length) {
offsets[offset] = i;
} else {
getLogger(MCAFile.class).debug("Ignoring invalid offset " + offset);
LOGGER.debug("Ignoring invalid offset " + offset);
}
}
}

View File

@ -2,13 +2,16 @@ package com.boydti.fawe.jnbt.streamer;
import com.sk89q.jnbt.NBTConstants;
import com.sk89q.jnbt.NBTInputStream;
import com.sk89q.worldedit.internal.util.LogManagerCompat;
import org.apache.logging.log4j.Logger;
import java.io.DataInputStream;
import java.io.IOException;
import static org.slf4j.LoggerFactory.getLogger;
public class StreamDelegate {
private static final Logger LOGGER = LogManagerCompat.getLogger();
private static final byte[][] ZERO_KEYS = new byte[0][];
private static final StreamDelegate[] ZERO_VALUES = new StreamDelegate[0];
@ -41,7 +44,7 @@ public class StreamDelegate {
private StreamDelegate add(String name, StreamDelegate scope) {
if (valueReader != null) {
getLogger(StreamDelegate.class).warn("Scope {} | {} may not run, as the stream is only read once, and a value reader is already set", name, scope);
LOGGER.warn("Scope {} | {} may not run, as the stream is only read once, and a value reader is already set", name, scope);
}
byte[] bytes = name.getBytes(NBTConstants.CHARSET);
int maxSize = bytes.length;
@ -169,7 +172,7 @@ public class StreamDelegate {
public StreamDelegate withValue(ValueReader valueReader) {
if (keys.length != 0) {
getLogger(StreamDelegate.class).warn("Reader {} may not run, as the stream is only read once, and a value reader is already set", valueReader);
LOGGER.warn("Reader {} may not run, as the stream is only read once, and a value reader is already set", valueReader);
}
this.valueReader = valueReader;
return this;

View File

@ -4,17 +4,20 @@ import com.boydti.fawe.database.DBHandler;
import com.boydti.fawe.database.RollbackDatabase;
import com.boydti.fawe.object.changeset.DiskStorageHistory;
import com.boydti.fawe.object.changeset.SimpleChangeSetSummary;
import com.sk89q.worldedit.internal.util.LogManagerCompat;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.regions.CuboidRegion;
import com.sk89q.worldedit.world.World;
import org.apache.logging.log4j.Logger;
import java.io.IOException;
import java.io.OutputStream;
import java.util.UUID;
import static org.slf4j.LoggerFactory.getLogger;
public class RollbackOptimizedHistory extends DiskStorageHistory {
private static final Logger LOGGER = LogManagerCompat.getLogger();
private long time;
private int minX;
@ -47,7 +50,7 @@ public class RollbackOptimizedHistory extends DiskStorageHistory {
this.blockSize = (int) size;
this.command = command;
this.closed = true;
getLogger(RollbackOptimizedHistory.class).debug("Size {}", size);
LOGGER.debug("Size: {}", size);
}
public long getTime() {

View File

@ -14,6 +14,7 @@ import com.sk89q.worldedit.command.tool.BrushTool;
import com.sk89q.worldedit.entity.Player;
import com.sk89q.worldedit.extension.platform.Actor;
import com.sk89q.worldedit.extension.platform.Platform;
import com.sk89q.worldedit.internal.util.LogManagerCompat;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.math.Vector3;
import com.sk89q.worldedit.util.Location;
@ -24,16 +25,17 @@ import com.sk89q.worldedit.util.formatting.text.event.HoverEvent;
import com.sk89q.worldedit.util.formatting.text.format.TextColor;
import com.sk89q.worldedit.world.World;
import com.sk89q.worldedit.world.block.BlockState;
import org.apache.logging.log4j.Logger;
import java.io.IOException;
import java.util.Iterator;
import java.util.UUID;
import java.util.function.Supplier;
import static org.slf4j.LoggerFactory.getLogger;
public class InspectBrush extends BrushTool {
private static final Logger LOGGER = LogManagerCompat.getLogger();
/**
* Construct the tool.
*/
@ -64,13 +66,13 @@ public class InspectBrush extends BrushTool {
public boolean perform(final Player player, LocalSession session, boolean rightClick) {
if (!player.hasPermission("worldedit.tool.inspect")) {
player.print(Caption.of("", "worldedit.tool.inspect"));
getLogger(InspectBrush.class).debug("No tool control");
LOGGER.debug("No tool control");
return false;
}
if (!Settings.IMP.HISTORY.USE_DATABASE) {
player.print(Caption.of("fawe.error.setting.disable",
"history.use-database (Import with /history import )"));
getLogger(InspectBrush.class).debug("No db");
LOGGER.debug("No db");
return false;
}
try {
@ -113,7 +115,7 @@ public class InspectBrush extends BrushTool {
} catch (IOException e) {
throw new RuntimeException(e);
} catch (Throwable e) {
getLogger(InspectBrush.class).error("E throw", e);
LOGGER.error("E throw", e);
}
return true;
}

View File

@ -37,6 +37,7 @@ import com.sk89q.worldedit.extent.clipboard.Clipboard;
import com.sk89q.worldedit.function.mask.Mask;
import com.sk89q.worldedit.function.operation.Operation;
import com.sk89q.worldedit.function.pattern.Pattern;
import com.sk89q.worldedit.internal.util.LogManagerCompat;
import com.sk89q.worldedit.math.BlockVector2;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.math.MutableBlockVector3;
@ -60,6 +61,7 @@ import com.sk89q.worldedit.world.block.BlockStateHolder;
import com.sk89q.worldedit.world.block.BlockType;
import com.sk89q.worldedit.world.block.BlockTypes;
import com.sk89q.worldedit.world.block.BlockTypesCache;
import org.apache.logging.log4j.Logger;
import java.awt.image.BufferedImage;
import java.io.File;
@ -75,10 +77,10 @@ import java.util.concurrent.ThreadLocalRandom;
import java.util.function.Supplier;
import javax.annotation.Nullable;
import static org.slf4j.LoggerFactory.getLogger;
public class HeightMapMCAGenerator extends MCAWriter implements StreamChange, Drawable, VirtualWorld {
private static final Logger LOGGER = LogManagerCompat.getLogger();
private final MutableBlockVector3 mutable = new MutableBlockVector3();
private final DifferentialBlockBuffer blocks;
@ -2128,7 +2130,7 @@ public class HeightMapMCAGenerator extends MCAWriter implements StreamChange, Dr
@Override
public IChunkGet get(int x, int z) {
getLogger(HeightMapMCAGenerator.class).debug("Should not be using buffering with HMMG");
LOGGER.debug("Should not be using buffering with HMMG");
return new FallbackChunkGet(this, x, z);
}
}

View File

@ -5,14 +5,18 @@ import com.boydti.fawe.util.ExtentTraverser;
import com.sk89q.worldedit.WorldEditException;
import com.sk89q.worldedit.history.UndoContext;
import com.sk89q.worldedit.history.change.Change;
import com.sk89q.worldedit.internal.util.LogManagerCompat;
import org.apache.logging.log4j.Logger;
import java.io.File;
import java.io.IOException;
import static com.google.common.base.Preconditions.checkNotNull;
import static org.slf4j.LoggerFactory.getLogger;
public class CFIChange implements Change {
private static final Logger LOGGER = LogManagerCompat.getLogger();
private final File file;
public CFIChange(File file) {
@ -25,7 +29,7 @@ public class CFIChange implements Change {
if (found != null) {
return found.get();
}
getLogger(CFIChange.class).debug("FAWE does not support: " + context.getExtent() + " for " + getClass() + " (bug Empire92)");
LOGGER.debug("FAWE does not support: " + context.getExtent() + " for " + getClass() + " (bug Empire92)");
return null;
}

View File

@ -10,18 +10,20 @@ import com.sk89q.worldedit.entity.BaseEntity;
import com.sk89q.worldedit.extent.Extent;
import com.sk89q.worldedit.history.UndoContext;
import com.sk89q.worldedit.history.change.Change;
import com.sk89q.worldedit.internal.util.LogManagerCompat;
import com.sk89q.worldedit.util.Location;
import com.sk89q.worldedit.world.entity.EntityType;
import com.sk89q.worldedit.world.entity.EntityTypes;
import org.apache.logging.log4j.Logger;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import static org.slf4j.LoggerFactory.getLogger;
public class MutableEntityChange implements Change {
private static final Logger LOGGER = LogManagerCompat.getLogger();
public CompoundTag tag;
public boolean create;
@ -59,7 +61,7 @@ public class MutableEntityChange implements Change {
most = ((LongTag) map.get("PersistentIDMSB")).getValue();
least = ((LongTag) map.get("PersistentIDLSB")).getValue();
} else {
getLogger(MutableEntityChange.class).debug("Skipping entity without uuid.");
LOGGER.debug("Skipping entity without uuid.");
return;
}
List<DoubleTag> pos = (List<DoubleTag>) map.get("Pos").getValue();
@ -74,7 +76,7 @@ public class MutableEntityChange implements Change {
Map<String, Tag> map = tag.getValue();
Tag posTag = map.get("Pos");
if (posTag == null) {
getLogger(MutableEntityChange.class).debug("Missing pos tag: " + tag);
LOGGER.debug("Missing pos tag: " + tag);
return;
}
List<DoubleTag> pos = (List<DoubleTag>) posTag.getValue();

View File

@ -38,7 +38,7 @@ import java.util.UUID;
import java.util.concurrent.Future;
import java.util.concurrent.atomic.AtomicInteger;
import static org.slf4j.LoggerFactory.getLogger;
import static org.apache.logging.log4j.LogManager.getLogger;
public abstract class AbstractChangeSet implements ChangeSet, IBatchProcessor {

View File

@ -11,6 +11,7 @@ import com.sk89q.jnbt.Tag;
import com.sk89q.worldedit.entity.BaseEntity;
import com.sk89q.worldedit.entity.Entity;
import com.sk89q.worldedit.extent.clipboard.BlockArrayClipboard;
import com.sk89q.worldedit.internal.util.LogManagerCompat;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.regions.CuboidRegion;
import com.sk89q.worldedit.regions.Region;
@ -21,8 +22,7 @@ import com.sk89q.worldedit.world.block.BaseBlock;
import com.sk89q.worldedit.world.block.BlockState;
import com.sk89q.worldedit.world.block.BlockStateHolder;
import com.sk89q.worldedit.world.block.BlockTypes;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.logging.log4j.Logger;
import javax.annotation.Nullable;
import java.io.Closeable;
@ -53,7 +53,7 @@ import java.util.stream.Collectors;
*/
public class DiskOptimizedClipboard extends LinearClipboard implements Closeable {
private static final Logger log = LoggerFactory.getLogger(DiskOptimizedClipboard.class);
private static final Logger LOGGER = LogManagerCompat.getLogger();
private static final int HEADER_SIZE = 14;
@ -80,7 +80,7 @@ public class DiskOptimizedClipboard extends LinearClipboard implements Closeable
if (HEADER_SIZE + ((long) getVolume() << 1) >= Integer.MAX_VALUE) {
throw new IllegalArgumentException("Dimensions too large for this clipboard format. Use //lazycopy for large selections.");
} else if (HEADER_SIZE + ((long) getVolume() << 1) + (long) ((getHeight() >> 2) + 1) * ((getLength() >> 2) + 1) * ((getWidth() >> 2) + 1) >= Integer.MAX_VALUE) {
log.error("Dimensions are too large for biomes to be stored in a DiskOptimizedClipboard");
LOGGER.error("Dimensions are too large for biomes to be stored in a DiskOptimizedClipboard");
canHaveBiomes = false;
}
nbtMap = new HashMap<>();

View File

@ -15,6 +15,7 @@ import com.sk89q.worldedit.extent.clipboard.BlockArrayClipboard;
import com.sk89q.worldedit.extent.clipboard.Clipboard;
import com.sk89q.worldedit.extent.clipboard.io.ClipboardReader;
import com.sk89q.worldedit.extent.clipboard.io.ClipboardWriter;
import com.sk89q.worldedit.internal.util.LogManagerCompat;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.math.MutableBlockVector3;
import com.sk89q.worldedit.regions.CuboidRegion;
@ -29,6 +30,7 @@ import com.sk89q.worldedit.world.block.BlockTypes;
import com.sk89q.worldedit.world.entity.EntityTypes;
import com.sk89q.worldedit.world.storage.NBTConversions;
import it.unimi.dsi.fastutil.ints.Int2ObjectArrayMap;
import org.apache.logging.log4j.Logger;
import org.jetbrains.annotations.NotNull;
import java.io.IOException;
@ -39,9 +41,10 @@ import java.util.List;
import java.util.Map;
import java.util.UUID;
import static org.slf4j.LoggerFactory.getLogger;
public class MinecraftStructure implements ClipboardReader, ClipboardWriter {
private static final Logger LOGGER = LogManagerCompat.getLogger();
private static final int WARN_SIZE = 32;
private NBTInputStream inputStream;
@ -160,7 +163,7 @@ public class MinecraftStructure implements ClipboardReader, ClipboardWriter {
int height = region.getHeight();
int length = region.getLength();
if (width > WARN_SIZE || height > WARN_SIZE || length > WARN_SIZE) {
getLogger(MinecraftStructure.class).debug("A structure longer than 32 is unsupported by minecraft (but probably still works)");
LOGGER.info("A structure longer than 32 is unsupported by minecraft (but probably still works)");
}
Map<String, Object> structure = FaweCache.IMP.asMap("version", 1, "author", owner);
// ignored: version / owner

View File

@ -36,14 +36,14 @@ import com.sk89q.worldedit.event.extent.EditSessionEvent;
import com.sk89q.worldedit.extent.AbstractDelegateExtent;
import com.sk89q.worldedit.extent.Extent;
import com.sk89q.worldedit.extent.inventory.BlockBag;
import com.sk89q.worldedit.internal.util.LogManagerCompat;
import com.sk89q.worldedit.regions.Region;
import com.sk89q.worldedit.util.Identifiable;
import com.sk89q.worldedit.util.eventbus.EventBus;
import com.sk89q.worldedit.util.formatting.text.TranslatableComponent;
import com.sk89q.worldedit.world.World;
import org.apache.logging.log4j.Logger;
import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Locale;
import java.util.UUID;
@ -53,7 +53,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
public class EditSessionBuilder {
private static final Logger logger = LoggerFactory.getLogger(AbstractDelegateExtent.class);
private static final Logger LOGGER = LogManagerCompat.getLogger();
@NotNull
private World world;
@ -246,11 +246,11 @@ public class EditSessionBuilder {
event.getActor().printDebug(" - To allow this plugin add it to the FAWE `allowed-plugins` list");
event.getActor().printDebug(" - To hide this message set `debug` to false in the FAWE config.yml");
} else {
logger.debug("Potentially unsafe extent blocked: " + toReturn.getClass().getName());
logger.debug(" - For area restrictions, it is recommended to use the FaweAPI");
logger.debug(" - For block logging, it is recommended to use BlocksHub");
logger.debug(" - To allow this plugin add it to the FAWE `allowed-plugins` list");
logger.debug(" - To hide this message set `debug` to false in the FAWE config.yml");
LOGGER.debug("Potentially unsafe extent blocked: " + toReturn.getClass().getName());
LOGGER.debug(" - For area restrictions, it is recommended to use the FaweAPI");
LOGGER.debug(" - For block logging, it is recommended to use BlocksHub");
LOGGER.debug(" - To allow this plugin add it to the FAWE `allowed-plugins` list");
LOGGER.debug(" - To hide this message set `debug` to false in the FAWE config.yml");
}
}
}

View File

@ -21,6 +21,7 @@ import com.sk89q.worldedit.entity.Entity;
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.internal.util.LogManagerCompat;
import com.sk89q.worldedit.util.Location;
import com.sk89q.worldedit.util.formatting.text.Component;
import com.sk89q.worldedit.util.formatting.text.TranslatableComponent;
@ -32,6 +33,7 @@ import net.jpountz.lz4.LZ4Factory;
import net.jpountz.lz4.LZ4FastDecompressor;
import net.jpountz.lz4.LZ4InputStream;
import net.jpountz.lz4.LZ4Utils;
import org.apache.logging.log4j.Logger;
import org.jetbrains.annotations.NotNull;
import javax.annotation.Nonnull;
@ -89,10 +91,10 @@ import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
import static java.lang.System.arraycopy;
import static org.slf4j.LoggerFactory.getLogger;
public class MainUtil {
private static final Logger LOGGER = LogManagerCompat.getLogger();
public static List<String> filter(String prefix, List<String> suggestions) {
if (prefix.isEmpty()) {
return suggestions;
@ -438,7 +440,7 @@ public class MainUtil {
content = scanner.next().trim();
}
if (!content.startsWith("<")) {
getLogger(MainUtil.class).debug(content);
LOGGER.debug(content);
}
if (responseCode == 200) {
return url;
@ -638,7 +640,7 @@ public class MainUtil {
return newFile;
}
} catch (IOException e) {
getLogger(MainUtil.class).debug("Could not save " + resource, e);
LOGGER.debug("Could not save " + resource, e);
}
return null;
}
@ -880,7 +882,7 @@ public class MainUtil {
pool.submit(file::delete);
Component msg = TranslatableComponent.of("worldedit.schematic.delete.deleted");
if (printDebug) {
getLogger(MainUtil.class).debug(msg.toString());
LOGGER.debug(msg.toString());
}
}
});

View File

@ -4,6 +4,8 @@ import com.boydti.fawe.Fawe;
import com.boydti.fawe.beta.implementation.queue.QueueHandler;
import com.boydti.fawe.config.Settings;
import com.boydti.fawe.object.RunnableVal;
import com.sk89q.worldedit.internal.util.LogManagerCompat;
import org.apache.logging.log4j.Logger;
import org.jetbrains.annotations.NotNull;
import java.util.Collection;
@ -15,10 +17,10 @@ import java.util.concurrent.atomic.AtomicBoolean;
import java.util.function.Supplier;
import javax.annotation.Nullable;
import static org.slf4j.LoggerFactory.getLogger;
public abstract class TaskManager {
private static final Logger LOGGER = LogManagerCompat.getLogger();
public static TaskManager IMP;
private final ForkJoinPool pool = new ForkJoinPool();
@ -257,7 +259,7 @@ public abstract class TaskManager {
running.wait(timeout);
if (running.get() && System.currentTimeMillis() - start > Settings.IMP.QUEUE.DISCARD_AFTER_MS) {
new RuntimeException("FAWE is taking a long time to execute a task (might just be a symptom): ").printStackTrace();
getLogger(TaskManager.class).debug("For full debug information use: /fawe threads");
LOGGER.info("For full debug information use: /fawe threads");
}
}
}

View File

@ -9,6 +9,7 @@ import com.google.gson.reflect.TypeToken;
import com.google.gson.stream.JsonReader;
import com.sk89q.worldedit.extent.clipboard.Clipboard;
import com.sk89q.worldedit.function.mask.Mask;
import com.sk89q.worldedit.internal.util.LogManagerCompat;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.util.PropertiesConfiguration;
import com.sk89q.worldedit.util.report.Unreported;
@ -20,8 +21,7 @@ import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
import it.unimi.dsi.fastutil.ints.IntArraySet;
import it.unimi.dsi.fastutil.longs.LongArrayList;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.logging.log4j.Logger;
import java.awt.image.BufferedImage;
import java.io.BufferedInputStream;
@ -51,12 +51,12 @@ import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
import javax.imageio.ImageIO;
import static org.slf4j.LoggerFactory.getLogger;
import static org.apache.logging.log4j.LogManager.getLogger;
// TODO FIXME
public class TextureUtil implements TextureHolder {
private static final Logger log = LoggerFactory.getLogger(TextureUtil.class);
private static final Logger LOGGER = LogManagerCompat.getLogger();
private static final int[] FACTORS = new int[766];
@ -355,7 +355,7 @@ public class TextureUtil implements TextureHolder {
this.folder = folder;
if (!folder.exists()) {
try {
log.info("Downloading asset jar from Mojang, please wait...");
LOGGER.info("Downloading asset jar from Mojang, please wait...");
new File(Fawe.imp().getDirectory() + "/" + Settings.IMP.PATHS.TEXTURES + "/" + "/.minecraft/versions/").mkdirs();
try (BufferedInputStream in = new BufferedInputStream(new URL("https://launcher.mojang.com/v1/objects/37fd3c903861eeff3bc24b71eed48f828b5269c8/client.jar").openStream());
FileOutputStream fileOutputStream = new FileOutputStream(Fawe.imp().getDirectory() + "/" + Settings.IMP.PATHS.TEXTURES + "/" + "/.minecraft/versions/1.16.5.jar")) {
@ -364,14 +364,14 @@ public class TextureUtil implements TextureHolder {
while ((bytesRead = in.read(dataBuffer, 0, 1024)) != -1) {
fileOutputStream.write(dataBuffer, 0, bytesRead);
}
log.info("Asset jar down has been downloaded successfully.");
LOGGER.info("Asset jar down has been downloaded successfully.");
} catch (IOException e) {
log.error("Could not download version jar. Please do so manually by creating a `FastAsyncWorldEdit/textures` folder with `.minecraft/versions` jar in it.");
log.error("If the file exists, please make sure the server has read access to the directory.");
LOGGER.error("Could not download version jar. Please do so manually by creating a `FastAsyncWorldEdit/textures` folder with `.minecraft/versions` jar in it.");
LOGGER.error("If the file exists, please make sure the server has read access to the directory.");
}
} catch (AccessControlException e) {
log.error("Could not download asset jar. It's likely your file permission are setup improperly and do not allow fetching data from the Mojang servers.");
log.error("Please create the following folder manually: `FastAsyncWorldEdit/textures` with `.minecraft/versions` jar in it.");
LOGGER.error("Could not download asset jar. It's likely your file permission are setup improperly and do not allow fetching data from the Mojang servers.");
LOGGER.error("Please create the following folder manually: `FastAsyncWorldEdit/textures` with `.minecraft/versions` jar in it.");
}
}
@ -643,8 +643,8 @@ public class TextureUtil implements TextureHolder {
fileOutputStream.write(dataBuffer, 0, bytesRead);
}
} catch (IOException e) {
log.error("Could not download version jar. Please do so manually by creating a `FastAsyncWorldEdit/textures` folder with `.minecraft/versions` jar or mods in it.");
log.error("If the file exists, please make sure the server has read access to the directory.");
LOGGER.error("Could not download version jar. Please do so manually by creating a `FastAsyncWorldEdit/textures` folder with `.minecraft/versions` jar or mods in it.");
LOGGER.error("If the file exists, please make sure the server has read access to the directory.");
}
} else {
for (File file : files) {

View File

@ -1,5 +1,8 @@
package com.boydti.fawe.util;
import com.sk89q.worldedit.internal.util.LogManagerCompat;
import org.apache.logging.log4j.Logger;
import java.io.DataInputStream;
import java.io.IOException;
import java.net.URL;
@ -7,8 +10,6 @@ import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Base64;
import static org.slf4j.LoggerFactory.getLogger;
/** An internal FAWE class not meant for public use. **/
public enum ThirdPartyManager {
@ -22,6 +23,8 @@ public enum ThirdPartyManager {
;
private static final Logger LOGGER = LogManagerCompat.getLogger();
public final String url;
public final int fileSize;
public final String digest;
@ -54,12 +57,12 @@ public enum ThirdPartyManager {
String jarDigest = Base64.getEncoder().encodeToString(jarDigestBytes);
if (this.digest.equals(jarDigest)) {
getLogger(ThirdPartyManager.class).debug("++++ HASH CHECK ++++");
getLogger(ThirdPartyManager.class).debug(this.url);
getLogger(ThirdPartyManager.class).debug(this.digest);
LOGGER.debug("++++ HASH CHECK ++++");
LOGGER.debug(this.url);
LOGGER.debug(this.digest);
return jarBytes;
} else {
getLogger(ThirdPartyManager.class).debug(jarDigest + " | " + url);
LOGGER.debug(jarDigest + " | " + url);
throw new IllegalStateException("The downloaded jar does not match the hash");
}
} catch (NoSuchAlgorithmException e) {

View File

@ -10,12 +10,12 @@ import com.sk89q.worldedit.WorldEditException;
import com.sk89q.worldedit.entity.Player;
import com.sk89q.worldedit.extent.AbstractDelegateExtent;
import com.sk89q.worldedit.extent.Extent;
import com.sk89q.worldedit.internal.util.LogManagerCompat;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.regions.Region;
import com.sk89q.worldedit.util.Location;
import com.sk89q.worldedit.util.formatting.text.TextComponent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.logging.log4j.Logger;
import java.util.ArrayDeque;
import java.util.HashSet;
@ -24,14 +24,14 @@ import java.util.Set;
public class WEManager {
private static final Logger log = LoggerFactory.getLogger(WEManager.class);
private static final Logger LOGGER = LogManagerCompat.getLogger();
public static final WEManager IMP = new WEManager();
public final ArrayDeque<FaweMaskManager> managers = new ArrayDeque<>();
public void cancelEditSafe(AbstractDelegateExtent parent, FaweException reason) throws FaweException {
log.warn("CancelEditSafe was hit. Please ignore this message.");
LOGGER.warn("CancelEditSafe was hit. Please ignore this message.");
Extent currentExtent = parent.getExtent();
if (!(currentExtent instanceof NullExtent)) {
parent.extent = new NullExtent(parent.extent, reason);
@ -123,10 +123,10 @@ public class WEManager {
player.printError(TextComponent.of("Missing permission " + "fawe." + manager.getKey()));
}
}
log.debug("Region info for " + player.getName());
log.debug("There are " + backupRegions.size() + " backupRegions being added to Regions. Regions has " + regions.size() + " before backupRegions are added");
LOGGER.debug("Region info for " + player.getName());
LOGGER.debug("There are " + backupRegions.size() + " backupRegions being added to Regions. Regions has " + regions.size() + " before backupRegions are added");
regions.addAll(backupRegions);
log.debug("Finished adding regions for " + player.getName());
LOGGER.debug("Finished adding regions for " + player.getName());
if (!masks.isEmpty()) {
player.setMeta("lastMask", masks);
} else {