mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-01 02:46:41 +00:00
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:
@ -95,6 +95,7 @@ import com.sk89q.worldedit.internal.expression.Expression;
|
||||
import com.sk89q.worldedit.internal.expression.ExpressionException;
|
||||
import com.sk89q.worldedit.internal.expression.ExpressionTimeoutException;
|
||||
import com.sk89q.worldedit.internal.expression.LocalSlot.Variable;
|
||||
import com.sk89q.worldedit.internal.util.LogManagerCompat;
|
||||
import com.sk89q.worldedit.math.BlockVector2;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.MathUtils;
|
||||
@ -134,10 +135,9 @@ 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.registry.LegacyMapper;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
@ -170,7 +170,7 @@ import static com.sk89q.worldedit.regions.Regions.minimumBlockY;
|
||||
@SuppressWarnings({"FieldCanBeLocal"})
|
||||
public class EditSession extends PassthroughExtent implements AutoCloseable {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(EditSession.class);
|
||||
private static final Logger LOGGER = LogManagerCompat.getLogger();
|
||||
|
||||
/**
|
||||
* Used by {@link EditSession#setBlock(BlockVector3, BlockStateHolder, Stage)} to
|
||||
@ -2555,7 +2555,7 @@ public class EditSession extends PassthroughExtent implements AutoCloseable {
|
||||
timedOut[0] = timedOut[0] + 1;
|
||||
return null;
|
||||
} catch (Exception e) {
|
||||
log.warn("Failed to create shape", e);
|
||||
LOGGER.warn("Failed to create shape", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@ -3091,7 +3091,7 @@ public class EditSession extends PassthroughExtent implements AutoCloseable {
|
||||
timedOut.getAndIncrement();
|
||||
return null;
|
||||
} catch (Exception e) {
|
||||
log.warn("Failed to create shape", e);
|
||||
LOGGER.warn("Failed to create shape", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -24,6 +24,7 @@ import com.sk89q.worldedit.extension.input.InputParseException;
|
||||
import com.sk89q.worldedit.extent.NullExtent;
|
||||
import com.sk89q.worldedit.function.mask.BlockMask;
|
||||
import com.sk89q.worldedit.function.mask.BlockMaskBuilder;
|
||||
import com.sk89q.worldedit.internal.util.LogManagerCompat;
|
||||
import com.sk89q.worldedit.util.formatting.component.TextUtils;
|
||||
import com.sk89q.worldedit.util.io.file.ArchiveNioSupports;
|
||||
import com.sk89q.worldedit.util.logging.LogFormat;
|
||||
@ -33,8 +34,7 @@ import com.sk89q.worldedit.world.registry.LegacyMapper;
|
||||
import com.sk89q.worldedit.world.snapshot.SnapshotRepository;
|
||||
import com.sk89q.worldedit.world.snapshot.experimental.SnapshotDatabase;
|
||||
import com.sk89q.worldedit.world.snapshot.experimental.fs.FileSystemSnapshotDatabase;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@ -51,7 +51,7 @@ import java.util.Set;
|
||||
*/
|
||||
public abstract class LocalConfiguration {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(LocalConfiguration.class);
|
||||
private static final Logger LOGGER = LogManagerCompat.getLogger();
|
||||
|
||||
public boolean profile = false;
|
||||
public boolean traceUnflushedSessions = false;
|
||||
|
@ -46,6 +46,7 @@ import com.sk89q.worldedit.function.pattern.Pattern;
|
||||
import com.sk89q.worldedit.internal.SchematicsEventListener;
|
||||
import com.sk89q.worldedit.internal.expression.Expression;
|
||||
import com.sk89q.worldedit.internal.expression.invoke.ReturnException;
|
||||
import com.sk89q.worldedit.internal.util.LogManagerCompat;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.scripting.CraftScriptContext;
|
||||
import com.sk89q.worldedit.scripting.CraftScriptEngine;
|
||||
@ -71,8 +72,7 @@ import com.sk89q.worldedit.world.block.BlockType;
|
||||
import com.sk89q.worldedit.world.registry.BundledBlockData;
|
||||
import com.sk89q.worldedit.world.registry.BundledItemData;
|
||||
import com.sk89q.worldedit.world.registry.LegacyMapper;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import java.io.DataInputStream;
|
||||
import java.io.File;
|
||||
@ -109,7 +109,10 @@ import static com.sk89q.worldedit.event.platform.Interaction.OPEN;
|
||||
*/
|
||||
public final class WorldEdit {
|
||||
|
||||
public static final Logger logger = LoggerFactory.getLogger(WorldEdit.class);
|
||||
/**
|
||||
* This is for internal use only.
|
||||
*/
|
||||
public static final Logger logger = LogManagerCompat.getLogger();
|
||||
|
||||
private static final WorldEdit instance = new WorldEdit();
|
||||
private static String version;
|
||||
|
@ -45,6 +45,7 @@ import com.sk89q.worldedit.extent.clipboard.io.ClipboardFormats;
|
||||
import com.sk89q.worldedit.extent.clipboard.io.ClipboardReader;
|
||||
import com.sk89q.worldedit.extent.clipboard.io.ClipboardWriter;
|
||||
import com.sk89q.worldedit.function.operation.Operations;
|
||||
import com.sk89q.worldedit.internal.util.LogManagerCompat;
|
||||
import com.sk89q.worldedit.math.transform.Transform;
|
||||
import com.sk89q.worldedit.session.ClipboardHolder;
|
||||
import com.sk89q.worldedit.util.formatting.component.ErrorFormat;
|
||||
@ -58,14 +59,13 @@ import com.sk89q.worldedit.util.formatting.text.event.HoverEvent;
|
||||
import com.sk89q.worldedit.util.formatting.text.format.TextColor;
|
||||
import com.sk89q.worldedit.util.io.Closer;
|
||||
import com.sk89q.worldedit.util.io.file.FilenameException;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.enginehub.piston.annotation.Command;
|
||||
import org.enginehub.piston.annotation.CommandContainer;
|
||||
import org.enginehub.piston.annotation.param.Arg;
|
||||
import org.enginehub.piston.annotation.param.ArgFlag;
|
||||
import org.enginehub.piston.annotation.param.Switch;
|
||||
import org.enginehub.piston.exception.StopExecutionException;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.BufferedOutputStream;
|
||||
@ -102,7 +102,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||
@CommandContainer(superTypes = CommandPermissionsConditionGenerator.Registration.class)
|
||||
public class SchematicCommands {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(SchematicCommands.class);
|
||||
private static final Logger LOGGER = LogManagerCompat.getLogger();
|
||||
private final WorldEdit worldEdit;
|
||||
|
||||
/**
|
||||
@ -304,7 +304,7 @@ public class SchematicCommands {
|
||||
actor.printError("Unknown filename: " + filename);
|
||||
} catch (URISyntaxException | IOException e) {
|
||||
actor.printError("File could not be read or it does not exist: " + e.getMessage());
|
||||
log.warn("Failed to load a saved clipboard", e);
|
||||
LOGGER.warn("Failed to load a saved clipboard", e);
|
||||
} finally {
|
||||
if (in != null) {
|
||||
try {
|
||||
@ -701,7 +701,7 @@ public class SchematicCommands {
|
||||
ClipboardReader reader = closer.register(format.getReader(bis));
|
||||
|
||||
Clipboard clipboard = reader.read();
|
||||
log.info(actor.getName() + " loaded " + file.getCanonicalPath());
|
||||
LOGGER.info(actor.getName() + " loaded " + file.getCanonicalPath());
|
||||
return new ClipboardHolder(clipboard);
|
||||
}
|
||||
}
|
||||
@ -785,7 +785,7 @@ public class SchematicCommands {
|
||||
TextComponent noSlotsErr = TextComponent.of( //TODO - to be moved into captions/translatablecomponents
|
||||
String.format("You have " + numFiles + "/" + limit + " saved schematics. Delete some to save this one!",
|
||||
TextColor.RED));
|
||||
log.info(actor.getName() + " failed to save " + file.getCanonicalPath() + " - too many schematics!");
|
||||
LOGGER.info(actor.getName() + " failed to save " + file.getCanonicalPath() + " - too many schematics!");
|
||||
throw new WorldEditException(noSlotsErr) {
|
||||
};
|
||||
}
|
||||
@ -838,7 +838,7 @@ public class SchematicCommands {
|
||||
"You're about to be at " + String.format("%.1f", curKb) + "kb of schematics. ("
|
||||
+ String.format("%dkb", allocatedKb) + " available) Delete some first to save this one!",
|
||||
TextColor.RED);
|
||||
log.info(actor.getName() + " failed to save " + SCHEMATIC_NAME + " - not enough space!");
|
||||
LOGGER.info(actor.getName() + " failed to save " + SCHEMATIC_NAME + " - not enough space!");
|
||||
throw new WorldEditException(notEnoughKbErr) {
|
||||
};
|
||||
}
|
||||
@ -860,7 +860,7 @@ public class SchematicCommands {
|
||||
+ " schematic file slots left.", TextColor.GRAY);
|
||||
actor.print(slotsRemainingNotif);
|
||||
}
|
||||
log.info(actor.getName() + " saved " + file.getCanonicalPath());
|
||||
LOGGER.info(actor.getName() + " saved " + file.getCanonicalPath());
|
||||
} else {
|
||||
actor.printError(TranslatableComponent.of("fawe.cancel.worldedit.cancel.reason.manual"));
|
||||
}
|
||||
|
@ -26,16 +26,16 @@ import com.sk89q.worldedit.entity.Player;
|
||||
import com.sk89q.worldedit.extension.platform.Actor;
|
||||
import com.sk89q.worldedit.extension.platform.Platform;
|
||||
import com.sk89q.worldedit.extension.platform.permission.ActorSelectorLimits;
|
||||
import com.sk89q.worldedit.internal.util.LogManagerCompat;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.regions.RegionSelector;
|
||||
import com.sk89q.worldedit.util.Location;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
public enum SelectionWand implements DoubleActionBlockTool {
|
||||
INSTANCE;
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(SelectionWand.class);
|
||||
private static final Logger LOGGER = LogManagerCompat.getLogger();
|
||||
|
||||
@Override
|
||||
public boolean actSecondary(Platform server, LocalConfiguration config, Player player, LocalSession session, Location clicked) {
|
||||
@ -43,7 +43,7 @@ public enum SelectionWand implements DoubleActionBlockTool {
|
||||
BlockVector3 blockPoint = clicked.toVector().toBlockPoint();
|
||||
if (selector.selectPrimary(blockPoint, ActorSelectorLimits.forActor(player))) {
|
||||
if (Settings.IMP.EXPERIMENTAL.OTHER) {
|
||||
logger.info("actSecondary Hit and about to explain with explainPrimarySelection");
|
||||
LOGGER.info("actSecondary Hit and about to explain with explainPrimarySelection");
|
||||
}
|
||||
selector.explainPrimarySelection(player, session, blockPoint);
|
||||
}
|
||||
@ -57,7 +57,7 @@ public enum SelectionWand implements DoubleActionBlockTool {
|
||||
|
||||
if (selector.selectSecondary(blockPoint, ActorSelectorLimits.forActor(player))) {
|
||||
if (Settings.IMP.EXPERIMENTAL.OTHER) {
|
||||
logger.info("actPrimary Hit and about to explain with explainSecondarySelection");
|
||||
LOGGER.info("actPrimary Hit and about to explain with explainSecondarySelection");
|
||||
}
|
||||
selector.explainSecondarySelection(player, session, blockPoint);
|
||||
}
|
||||
|
@ -25,17 +25,17 @@ import com.google.common.util.concurrent.ListenableFuture;
|
||||
import com.google.common.util.concurrent.ListeningExecutorService;
|
||||
import com.sk89q.worldedit.extension.platform.Actor;
|
||||
import com.sk89q.worldedit.internal.command.exception.ExceptionConverter;
|
||||
import com.sk89q.worldedit.internal.util.LogManagerCompat;
|
||||
import com.sk89q.worldedit.util.formatting.component.ErrorFormat;
|
||||
import com.sk89q.worldedit.util.formatting.text.Component;
|
||||
import com.sk89q.worldedit.util.formatting.text.TextComponent;
|
||||
import com.sk89q.worldedit.util.formatting.text.format.TextColor;
|
||||
import com.sk89q.worldedit.util.task.FutureForwardingTask;
|
||||
import com.sk89q.worldedit.util.task.Supervisor;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.enginehub.piston.exception.CommandException;
|
||||
import org.enginehub.piston.exception.CommandExecutionException;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.function.Consumer;
|
||||
@ -45,7 +45,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
public final class AsyncCommandBuilder<T> {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(AsyncCommandBuilder.class);
|
||||
private static final Logger LOGGER = LogManagerCompat.getLogger();
|
||||
|
||||
private final Callable<T> callable;
|
||||
private final Actor sender;
|
||||
@ -174,7 +174,7 @@ public final class AsyncCommandBuilder<T> {
|
||||
}
|
||||
} catch (Throwable unknown) {
|
||||
sender.printError(failure.append(TextComponent.of(": Unknown error. Please see console.")));
|
||||
logger.error("Uncaught exception occurred in task: " + description, orig);
|
||||
LOGGER.error("Uncaught exception occurred in task: " + description, orig);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
|
@ -20,8 +20,6 @@ import org.enginehub.piston.inject.InjectAnnotation;
|
||||
import org.enginehub.piston.inject.InjectedValueAccess;
|
||||
import org.enginehub.piston.inject.Key;
|
||||
import org.enginehub.piston.inject.MemoizingValueAccess;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
@ -160,7 +158,6 @@ public @interface Confirm {
|
||||
final MemoizingValueAccess memoizingValueAccess;
|
||||
if (!(context instanceof MemoizingValueAccess)) {
|
||||
if (!context.getClass().getSimpleName().contains("AutoValue_CommandParametersImpl")) {
|
||||
LoggerFactory.getLogger(Confirm.class).warn("InjectedValueAccess " + context.getClass().getName() + " given to Confirm");
|
||||
return true;
|
||||
}
|
||||
memoizingValueAccess = (MemoizingValueAccess) Reflect.injectedValues.get(context);
|
||||
|
@ -121,6 +121,7 @@ import com.sk89q.worldedit.internal.command.ConfirmHandler;
|
||||
import com.sk89q.worldedit.internal.command.MethodInjector;
|
||||
import com.sk89q.worldedit.internal.command.exception.ExceptionConverter;
|
||||
import com.sk89q.worldedit.internal.command.exception.WorldEditExceptionConverter;
|
||||
import com.sk89q.worldedit.internal.util.LogManagerCompat;
|
||||
import com.sk89q.worldedit.internal.util.Substring;
|
||||
import com.sk89q.worldedit.regions.Region;
|
||||
import com.sk89q.worldedit.session.SessionKey;
|
||||
@ -133,6 +134,7 @@ import com.sk89q.worldedit.util.formatting.text.format.TextColor;
|
||||
import com.sk89q.worldedit.util.logging.DynamicStreamHandler;
|
||||
import com.sk89q.worldedit.util.logging.LogFormat;
|
||||
import com.sk89q.worldedit.world.World;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.enginehub.piston.Command;
|
||||
import org.enginehub.piston.CommandManager;
|
||||
import org.enginehub.piston.converter.ArgumentConverter;
|
||||
@ -155,8 +157,6 @@ import org.enginehub.piston.suggestion.Suggestion;
|
||||
import org.enginehub.piston.util.HelpGenerator;
|
||||
import org.enginehub.piston.util.ValueProvider;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@ -185,7 +185,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||
public final class PlatformCommandManager {
|
||||
|
||||
public static final Pattern COMMAND_CLEAN_PATTERN = Pattern.compile("^[/]+");
|
||||
private static final Logger log = LoggerFactory.getLogger(PlatformCommandManager.class);
|
||||
private static final Logger LOGGER = LogManagerCompat.getLogger();
|
||||
private static final java.util.logging.Logger COMMAND_LOG =
|
||||
java.util.logging.Logger.getLogger("com.sk89q.worldedit.CommandLog");
|
||||
|
||||
@ -567,7 +567,7 @@ public final class PlatformCommandManager {
|
||||
}
|
||||
|
||||
void registerCommandsWith(Platform platform) {
|
||||
log.info("Registering commands with " + platform.getClass().getCanonicalName());
|
||||
LOGGER.info("Registering commands with " + platform.getClass().getCanonicalName());
|
||||
|
||||
|
||||
LocalConfiguration config = platform.getConfiguration();
|
||||
@ -582,12 +582,12 @@ public final class PlatformCommandManager {
|
||||
File file = new File(config.getWorkingDirectory(), path);
|
||||
COMMAND_LOG.setLevel(Level.ALL);
|
||||
|
||||
log.info("Logging WorldEdit commands to " + file.getAbsolutePath());
|
||||
LOGGER.info("Logging WorldEdit commands to " + file.getAbsolutePath());
|
||||
|
||||
try {
|
||||
dynamicHandler.setHandler(new FileHandler(file.getAbsolutePath(), true));
|
||||
} catch (IOException e) {
|
||||
log.warn("Could not use command log file " + path + ": " + e.getMessage());
|
||||
LOGGER.warn("Could not use command log file " + path + ": " + e.getMessage());
|
||||
}
|
||||
|
||||
dynamicHandler.setFormatter(new LogFormat(config.logFormat));
|
||||
@ -828,7 +828,7 @@ public final class PlatformCommandManager {
|
||||
private void handleUnknownException(Actor actor, Throwable t) {
|
||||
actor.printError(TranslatableComponent.of("worldedit.command.error.report"));
|
||||
actor.print(TextComponent.of(t.getClass().getName() + ": " + t.getMessage()));
|
||||
log.error("An unexpected error while handling a WorldEdit command", t);
|
||||
LOGGER.error("An unexpected error while handling a WorldEdit command", t);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
@ -848,7 +848,7 @@ public final class PlatformCommandManager {
|
||||
suggestions = commandManager.getSuggestions(access, argStrings);
|
||||
} catch (Throwable t) { // catch errors which are *not* command exceptions generated by parsers/suggesters
|
||||
if (!(t instanceof CommandException)) {
|
||||
log.debug("Unexpected error occurred while generating suggestions for input: " + arguments, t);
|
||||
LOGGER.debug("Unexpected error occurred while generating suggestions for input: " + arguments, t);
|
||||
return;
|
||||
}
|
||||
throw t;
|
||||
|
@ -41,6 +41,7 @@ import com.sk89q.worldedit.event.platform.Interaction;
|
||||
import com.sk89q.worldedit.event.platform.PlatformInitializeEvent;
|
||||
import com.sk89q.worldedit.event.platform.PlatformReadyEvent;
|
||||
import com.sk89q.worldedit.event.platform.PlayerInputEvent;
|
||||
import com.sk89q.worldedit.internal.util.LogManagerCompat;
|
||||
import com.sk89q.worldedit.math.Vector3;
|
||||
import com.sk89q.worldedit.session.request.Request;
|
||||
import com.sk89q.worldedit.util.Location;
|
||||
@ -48,8 +49,7 @@ import com.sk89q.worldedit.util.SideEffect;
|
||||
import com.sk89q.worldedit.util.eventbus.Subscribe;
|
||||
import com.sk89q.worldedit.util.formatting.text.TranslatableComponent;
|
||||
import com.sk89q.worldedit.world.World;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
@ -71,7 +71,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||
*/
|
||||
public class PlatformManager {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(PlatformManager.class);
|
||||
private static final Logger LOGGER = LogManagerCompat.getLogger();
|
||||
|
||||
private final WorldEdit worldEdit;
|
||||
private final PlatformCommandManager platformCommandManager;
|
||||
@ -104,7 +104,7 @@ public class PlatformManager {
|
||||
public synchronized void register(Platform platform) {
|
||||
checkNotNull(platform);
|
||||
|
||||
logger.info("Got request to register " + platform.getClass() + " with WorldEdit [" + super.toString() + "]");
|
||||
LOGGER.info("Got request to register " + platform.getClass() + " with WorldEdit [" + super.toString() + "]");
|
||||
|
||||
// Just add the platform to the list of platforms: we'll pick favorites
|
||||
// once all the platforms have been loaded
|
||||
@ -113,7 +113,7 @@ public class PlatformManager {
|
||||
// Make sure that versions are in sync
|
||||
if (firstSeenVersion != null) {
|
||||
if (!firstSeenVersion.equals(platform.getVersion())) {
|
||||
logger.warn("Multiple ports of WorldEdit are installed but they report different versions ({} and {}). "
|
||||
LOGGER.warn("Multiple ports of WorldEdit are installed but they report different versions ({} and {}). "
|
||||
+ "If these two versions are truly different, then you may run into unexpected crashes and errors.", firstSeenVersion, platform.getVersion());
|
||||
}
|
||||
} else {
|
||||
@ -135,7 +135,7 @@ public class PlatformManager {
|
||||
boolean removed = platforms.remove(platform);
|
||||
|
||||
if (removed) {
|
||||
logger.info("Unregistering " + platform.getClass().getCanonicalName() + " from WorldEdit");
|
||||
LOGGER.info("Unregistering " + platform.getClass().getCanonicalName() + " from WorldEdit");
|
||||
|
||||
boolean choosePreferred = false;
|
||||
|
||||
@ -349,7 +349,7 @@ public class PlatformManager {
|
||||
VirtualWorld virtual = session.getVirtualWorld();
|
||||
if (virtual != null) {
|
||||
if (Settings.IMP.EXPERIMENTAL.OTHER) {
|
||||
logger.info("virtualWorld was not null in handlePlayerInput()");
|
||||
LOGGER.info("virtualWorld was not null in handlePlayerInput()");
|
||||
}
|
||||
|
||||
virtual.handleBlockInteract(player, vector.toBlockPoint(), event);
|
||||
@ -423,7 +423,7 @@ public class PlatformManager {
|
||||
VirtualWorld virtual = session.getVirtualWorld();
|
||||
if (virtual != null) {
|
||||
if (Settings.IMP.EXPERIMENTAL.OTHER) {
|
||||
logger.info("virtualWorld was not null in handlePlayerInput()");
|
||||
LOGGER.info("virtualWorld was not null in handlePlayerInput()");
|
||||
}
|
||||
virtual.handlePlayerInput(player, event);
|
||||
if (event.isCancelled()) {
|
||||
|
@ -2,8 +2,10 @@ package com.sk89q.worldedit.extension.platform.binding;
|
||||
|
||||
import com.boydti.fawe.util.StringMan;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.internal.util.LogManagerCompat;
|
||||
import com.sk89q.worldedit.util.formatting.text.Component;
|
||||
import com.sk89q.worldedit.util.formatting.text.TextComponent;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.enginehub.piston.CommandManager;
|
||||
import org.enginehub.piston.converter.ArgumentConverter;
|
||||
import org.enginehub.piston.converter.ConversionResult;
|
||||
@ -20,10 +22,10 @@ import java.lang.reflect.Method;
|
||||
import java.util.Optional;
|
||||
import java.util.function.Function;
|
||||
|
||||
import static org.slf4j.LoggerFactory.getLogger;
|
||||
|
||||
public class Bindings {
|
||||
|
||||
private static final Logger LOGGER = LogManagerCompat.getLogger();
|
||||
|
||||
private final WorldEdit worldEdit;
|
||||
|
||||
public Bindings(WorldEdit worldEdit) {
|
||||
@ -57,7 +59,7 @@ public class Bindings {
|
||||
Annotation annotation = annotations[0] == binding ? annotations[1] : annotations[0];
|
||||
key = Key.of(ret, annotation);
|
||||
} else {
|
||||
getLogger(Bindings.class).debug("Cannot annotate: " + method + " with " + StringMan.getString(annotations));
|
||||
LOGGER.debug("Cannot annotate: " + method + " with " + StringMan.getString(annotations));
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -32,6 +32,7 @@ import com.sk89q.worldedit.entity.Entity;
|
||||
import com.sk89q.worldedit.extent.buffer.ForgetfulExtentBuffer;
|
||||
import com.sk89q.worldedit.function.operation.Operation;
|
||||
import com.sk89q.worldedit.function.operation.OperationQueue;
|
||||
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;
|
||||
@ -39,23 +40,22 @@ import com.sk89q.worldedit.world.biome.BiomeType;
|
||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.jetbrains.annotations.Range;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
import static org.slf4j.LoggerFactory.getLogger;
|
||||
import static org.apache.logging.log4j.LogManager.getLogger;
|
||||
|
||||
/**
|
||||
* A base class for {@link Extent}s that merely passes extents onto another.
|
||||
*/
|
||||
public class AbstractDelegateExtent implements Extent {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(AbstractDelegateExtent.class);
|
||||
private static final Logger LOGGER = LogManagerCompat.getLogger();
|
||||
|
||||
//Not safe for public usage
|
||||
public Extent extent;
|
||||
@ -298,11 +298,11 @@ public class AbstractDelegateExtent implements Extent {
|
||||
@Override
|
||||
public Extent addProcessor(IBatchProcessor processor) {
|
||||
if (Settings.IMP.EXPERIMENTAL.OTHER) {
|
||||
logger.info("addProcessor Info: \t " + processor.getClass().getName());
|
||||
logger.info("The following is not an error or a crash:");
|
||||
LOGGER.info("addProcessor Info: \t " + processor.getClass().getName());
|
||||
LOGGER.info("The following is not an error or a crash:");
|
||||
StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
|
||||
for (StackTraceElement stackTraceElement : stackTrace) {
|
||||
logger.info(stackTraceElement.toString());
|
||||
LOGGER.info(stackTraceElement.toString());
|
||||
}
|
||||
|
||||
}
|
||||
@ -316,11 +316,11 @@ public class AbstractDelegateExtent implements Extent {
|
||||
@Override
|
||||
public Extent addPostProcessor(IBatchProcessor processor) {
|
||||
if (Settings.IMP.EXPERIMENTAL.OTHER) {
|
||||
logger.info("addPostProcessor Info: \t " + processor.getClass().getName());
|
||||
logger.info("The following is not an error or a crash:");
|
||||
LOGGER.info("addPostProcessor Info: \t " + processor.getClass().getName());
|
||||
LOGGER.info("The following is not an error or a crash:");
|
||||
StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
|
||||
for (StackTraceElement stackTraceElement : stackTrace) {
|
||||
logger.info(stackTraceElement.toString());
|
||||
LOGGER.info(stackTraceElement.toString());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -40,6 +40,7 @@ import com.sk89q.worldedit.extension.platform.Capability;
|
||||
import com.sk89q.worldedit.extent.clipboard.BlockArrayClipboard;
|
||||
import com.sk89q.worldedit.extent.clipboard.Clipboard;
|
||||
import com.sk89q.worldedit.internal.Constants;
|
||||
import com.sk89q.worldedit.internal.util.LogManagerCompat;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.util.Location;
|
||||
import com.sk89q.worldedit.world.DataFixer;
|
||||
@ -52,8 +53,7 @@ import com.sk89q.worldedit.world.entity.EntityType;
|
||||
import com.sk89q.worldedit.world.entity.EntityTypes;
|
||||
import net.jpountz.lz4.LZ4BlockInputStream;
|
||||
import net.jpountz.lz4.LZ4BlockOutputStream;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
@ -71,7 +71,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||
*/
|
||||
public class FastSchematicReader extends NBTSchematicReader {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(FastSchematicReader.class);
|
||||
private static final Logger LOGGER = LogManagerCompat.getLogger();
|
||||
private final NBTInputStream inputStream;
|
||||
private DataFixer fixer;
|
||||
private int dataVersion = -1;
|
||||
@ -183,7 +183,7 @@ public class FastSchematicReader extends NBTSchematicReader {
|
||||
try {
|
||||
state = BlockState.get(palettePart);
|
||||
} catch (InputParseException ignored) {
|
||||
log.warn("Invalid BlockState in palette: " + palettePart + ". Block will be replaced with air.");
|
||||
LOGGER.warn("Invalid BlockState in palette: " + palettePart + ". Block will be replaced with air.");
|
||||
state = BlockTypes.AIR.getDefaultState();
|
||||
}
|
||||
int index = (int) entry.getValue();
|
||||
@ -395,14 +395,14 @@ public class FastSchematicReader extends NBTSchematicReader {
|
||||
for (Entity e : clipboard.getEntities()) {
|
||||
clipboard.removeEntity(e);
|
||||
}
|
||||
log.error("Detected schematic entity outside clipboard region. FAWE will not load entities. "
|
||||
LOGGER.error("Detected schematic entity outside clipboard region. FAWE will not load entities. "
|
||||
+ "Please try loading the schematic with the format \"legacyentity\"");
|
||||
break;
|
||||
}
|
||||
}
|
||||
clipboard.createEntity(loc.setPosition(loc.subtract(min.toVector3())), state);
|
||||
} else {
|
||||
log.debug("Invalid entity: " + id);
|
||||
LOGGER.debug("Invalid entity: " + id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -42,6 +42,7 @@ import com.sk89q.worldedit.extent.clipboard.io.legacycompat.NoteBlockCompatibili
|
||||
import com.sk89q.worldedit.extent.clipboard.io.legacycompat.Pre13HangingCompatibilityHandler;
|
||||
import com.sk89q.worldedit.extent.clipboard.io.legacycompat.SignCompatibilityHandler;
|
||||
import com.sk89q.worldedit.extent.clipboard.io.legacycompat.SkullBlockCompatibilityHandler;
|
||||
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;
|
||||
@ -52,8 +53,7 @@ import com.sk89q.worldedit.world.entity.EntityType;
|
||||
import com.sk89q.worldedit.world.entity.EntityTypes;
|
||||
import com.sk89q.worldedit.world.registry.LegacyMapper;
|
||||
import com.sk89q.worldedit.world.storage.NBTConversions;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
@ -71,7 +71,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||
*/
|
||||
public class MCEditSchematicReader extends NBTSchematicReader {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MCEditSchematicReader.class);
|
||||
private static final Logger LOGGER = LogManagerCompat.getLogger();
|
||||
private final NBTInputStream inputStream;
|
||||
private final DataFixer fixer;
|
||||
private static final ImmutableList<NBTCompatibilityHandler> COMPATIBILITY_HANDLERS
|
||||
@ -253,7 +253,7 @@ public class MCEditSchematicReader extends NBTSchematicReader {
|
||||
byte data = blockData[index];
|
||||
int combined = block << 8 | data;
|
||||
if (unknownBlocks.add(combined)) {
|
||||
log.warn("Unknown block when loading schematic: "
|
||||
LOGGER.warn("Unknown block when loading schematic: "
|
||||
+ block + ":" + data + ". This is most likely a bad schematic.");
|
||||
}
|
||||
}
|
||||
@ -289,7 +289,7 @@ public class MCEditSchematicReader extends NBTSchematicReader {
|
||||
BaseEntity state = new BaseEntity(entityType, compound);
|
||||
clipboard.createEntity(location, state);
|
||||
} else {
|
||||
log.warn("Unknown entity when pasting schematic: " + id.toLowerCase(Locale.ROOT));
|
||||
LOGGER.warn("Unknown entity when pasting schematic: " + id.toLowerCase(Locale.ROOT));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -40,6 +40,7 @@ import com.sk89q.worldedit.extension.platform.Platform;
|
||||
import com.sk89q.worldedit.extent.clipboard.BlockArrayClipboard;
|
||||
import com.sk89q.worldedit.extent.clipboard.Clipboard;
|
||||
import com.sk89q.worldedit.internal.Constants;
|
||||
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;
|
||||
@ -52,8 +53,7 @@ import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
import com.sk89q.worldedit.world.entity.EntityType;
|
||||
import com.sk89q.worldedit.world.entity.EntityTypes;
|
||||
import com.sk89q.worldedit.world.storage.NBTConversions;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
@ -70,7 +70,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||
*/
|
||||
public class SpongeSchematicReader extends NBTSchematicReader {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(SpongeSchematicReader.class);
|
||||
private static final Logger LOGGER = LogManagerCompat.getLogger();
|
||||
private final NBTInputStream inputStream;
|
||||
private DataFixer fixer = null;
|
||||
private int schematicVersion = -1;
|
||||
@ -102,21 +102,21 @@ public class SpongeSchematicReader extends NBTSchematicReader {
|
||||
} else if (schematicVersion == 2) {
|
||||
dataVersion = requireTag(schematic, "DataVersion", IntTag.class).getValue();
|
||||
if (dataVersion < 0) {
|
||||
log.warn("Schematic has an unknown data version ({}). Data may be incompatible.",
|
||||
LOGGER.warn("Schematic has an unknown data version ({}). Data may be incompatible.",
|
||||
dataVersion);
|
||||
// Do not DFU unknown data
|
||||
dataVersion = liveDataVersion;
|
||||
}
|
||||
if (dataVersion > liveDataVersion) {
|
||||
log.warn("Schematic was made in a newer Minecraft version ({} > {}). Data may be incompatible.",
|
||||
LOGGER.warn("Schematic was made in a newer Minecraft version ({} > {}). Data may be incompatible.",
|
||||
dataVersion, liveDataVersion);
|
||||
} else if (dataVersion < liveDataVersion) {
|
||||
fixer = platform.getDataFixer();
|
||||
if (fixer != null) {
|
||||
log.debug("Schematic was made in an older Minecraft version ({} < {}), will attempt DFU.",
|
||||
LOGGER.debug("Schematic was made in an older Minecraft version ({} < {}), will attempt DFU.",
|
||||
dataVersion, liveDataVersion);
|
||||
} else {
|
||||
log.info("Schematic was made in an older Minecraft version ({} < {}), but DFU is not available. Data may be incompatible.",
|
||||
LOGGER.info("Schematic was made in an older Minecraft version ({} < {}), but DFU is not available. Data may be incompatible.",
|
||||
dataVersion, liveDataVersion);
|
||||
}
|
||||
}
|
||||
@ -217,7 +217,7 @@ public class SpongeSchematicReader extends NBTSchematicReader {
|
||||
try {
|
||||
state = WorldEdit.getInstance().getBlockFactory().parseFromInput(palettePart, parserContext).toImmutableState();
|
||||
} catch (InputParseException e) {
|
||||
log.warn("Invalid BlockState in palette: " + palettePart + ". Block will be replaced with air.");
|
||||
LOGGER.warn("Invalid BlockState in palette: " + palettePart + ". Block will be replaced with air.");
|
||||
state = BlockTypes.AIR.getDefaultState();
|
||||
}
|
||||
palette.put(id, state);
|
||||
@ -327,7 +327,7 @@ public class SpongeSchematicReader extends NBTSchematicReader {
|
||||
}
|
||||
BiomeType biome = BiomeTypes.get(key);
|
||||
if (biome == null) {
|
||||
log.warn("Unknown biome type :" + key
|
||||
LOGGER.warn("Unknown biome type :" + key
|
||||
+ " in palette. Are you missing a mod or using a schematic made in a newer version of Minecraft?");
|
||||
}
|
||||
Tag idTag = palettePart.getValue();
|
||||
@ -396,7 +396,7 @@ public class SpongeSchematicReader extends NBTSchematicReader {
|
||||
BaseEntity state = new BaseEntity(entityType, entityTag);
|
||||
clipboard.createEntity(location, state);
|
||||
} else {
|
||||
log.warn("Unknown entity when pasting schematic: " + id);
|
||||
LOGGER.warn("Unknown entity when pasting schematic: " + id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -27,6 +27,7 @@ import com.sk89q.jnbt.Tag;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.extent.Extent;
|
||||
import com.sk89q.worldedit.internal.helper.MCDirections;
|
||||
import com.sk89q.worldedit.internal.util.LogManagerCompat;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.math.Vector3;
|
||||
import com.sk89q.worldedit.math.transform.AffineTransform;
|
||||
@ -43,6 +44,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 org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@ -73,7 +75,6 @@ import static com.sk89q.worldedit.util.Direction.UP;
|
||||
import static com.sk89q.worldedit.util.Direction.WEST;
|
||||
import static com.sk89q.worldedit.util.Direction.findClosest;
|
||||
import static com.sk89q.worldedit.util.Direction.values;
|
||||
import static org.slf4j.LoggerFactory.getLogger;
|
||||
|
||||
/**
|
||||
* Transforms blocks themselves (but not their position) according to a
|
||||
@ -81,6 +82,8 @@ import static org.slf4j.LoggerFactory.getLogger;
|
||||
*/
|
||||
public class BlockTransformExtent extends ResettableExtent {
|
||||
|
||||
private static final Logger LOGGER = LogManagerCompat.getLogger();
|
||||
|
||||
private static final Set<PropertyKey> directional = PropertyKeySet.of(
|
||||
PropertyKey.HALF,
|
||||
PropertyKey.ROTATION,
|
||||
@ -174,7 +177,7 @@ public class BlockTransformExtent extends ResettableExtent {
|
||||
case 2:
|
||||
return adapt(combine(EAST, WEST), combine(SOUTH, NORTH));
|
||||
default:
|
||||
getLogger(BlockTransformExtent.class).error("Invalid {} {}", property.getName(), property.getValues());
|
||||
LOGGER.error("Invalid {} {}", property.getName(), property.getValues());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@ -207,7 +210,7 @@ public class BlockTransformExtent extends ResettableExtent {
|
||||
result.add(notIndex(combine(NORTHEAST, NORTHWEST, SOUTHWEST, SOUTHEAST), property.getIndexFor("inner_left"), property.getIndexFor("inner_right")));
|
||||
continue;
|
||||
default:
|
||||
getLogger(BlockTransformExtent.class).warn("Unknown direction {}", value);
|
||||
LOGGER.warn("Unknown direction {}", value);
|
||||
result.add(0L);
|
||||
}
|
||||
}
|
||||
@ -247,7 +250,7 @@ public class BlockTransformExtent extends ResettableExtent {
|
||||
directions.add(combine(NORTHEAST));
|
||||
break;
|
||||
default:
|
||||
getLogger(BlockTransformExtent.class).warn("Unknown direction {}", value);
|
||||
LOGGER.warn("Unknown direction {}", value);
|
||||
directions.add(0L);
|
||||
}
|
||||
}
|
||||
|
@ -19,7 +19,9 @@
|
||||
|
||||
package com.sk89q.worldedit.function.mask;
|
||||
|
||||
import com.sk89q.worldedit.internal.util.LogManagerCompat;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import java.util.AbstractMap;
|
||||
import java.util.ArrayList;
|
||||
@ -37,7 +39,6 @@ import java.util.stream.Collectors;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
import static org.slf4j.LoggerFactory.getLogger;
|
||||
|
||||
/**
|
||||
* Combines several masks and requires that all masks return true
|
||||
@ -46,6 +47,8 @@ import static org.slf4j.LoggerFactory.getLogger;
|
||||
*/
|
||||
public class MaskIntersection extends AbstractMask {
|
||||
|
||||
private static final Logger LOGGER = LogManagerCompat.getLogger();
|
||||
|
||||
protected final Set<Mask> masks;
|
||||
protected Mask[] masksArray;
|
||||
protected boolean defaultReturn;
|
||||
@ -160,9 +163,9 @@ public class MaskIntersection extends AbstractMask {
|
||||
while (combineMasks(pairingFunction(), failedCombines) && --maxIteration > 0);
|
||||
|
||||
if (maxIteration == 0) {
|
||||
getLogger(MaskIntersection.class).error("Failed optimize MaskIntersection");
|
||||
LOGGER.error("Failed optimize MaskIntersection");
|
||||
for (Mask mask : masks) {
|
||||
getLogger(MaskIntersection.class).error(mask.getClass() + " / " + mask);
|
||||
LOGGER.error(mask.getClass() + " / " + mask);
|
||||
}
|
||||
}
|
||||
// Return result
|
||||
|
@ -20,9 +20,9 @@
|
||||
package com.sk89q.worldedit.internal;
|
||||
|
||||
import com.sk89q.worldedit.event.platform.ConfigurationLoadEvent;
|
||||
import com.sk89q.worldedit.internal.util.LogManagerCompat;
|
||||
import com.sk89q.worldedit.util.eventbus.Subscribe;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.FileAlreadyExistsException;
|
||||
@ -31,7 +31,7 @@ import java.nio.file.Path;
|
||||
|
||||
public class SchematicsEventListener {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(SchematicsEventListener.class);
|
||||
private static final Logger LOGGER = LogManagerCompat.getLogger();
|
||||
|
||||
@Subscribe
|
||||
public void onConfigLoad(ConfigurationLoadEvent event) {
|
||||
|
@ -27,9 +27,9 @@ import com.google.gson.TypeAdapter;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.google.gson.stream.JsonReader;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import com.sk89q.worldedit.internal.util.LogManagerCompat;
|
||||
import com.sk89q.worldedit.math.BlockVector2;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.IOException;
|
||||
@ -52,7 +52,7 @@ import java.util.stream.Stream;
|
||||
public final class ChunkDeleter {
|
||||
|
||||
public static final String DELCHUNKS_FILE_NAME = "delete_chunks.json";
|
||||
private static final Logger logger = LoggerFactory.getLogger(ChunkDeleter.class);
|
||||
private static final Logger LOGGER = LogManagerCompat.getLogger();;
|
||||
|
||||
private static final Comparator<BlockVector2> chunkSorter = Comparator.comparing(
|
||||
pos -> (pos.getBlockX() & 31) + (pos.getBlockZ() & 31) * 32
|
||||
@ -80,13 +80,13 @@ public final class ChunkDeleter {
|
||||
try {
|
||||
chunkDeleter = createFromFile(chunkFile);
|
||||
} catch (JsonSyntaxException | IOException e) {
|
||||
logger.error("Could not parse chunk deletion file. Invalid file?", e);
|
||||
LOGGER.error("Could not parse chunk deletion file. Invalid file?", e);
|
||||
return;
|
||||
}
|
||||
logger.info("Found chunk deletions. Proceeding with deletion...");
|
||||
LOGGER.info("Found chunk deletions. Proceeding with deletion...");
|
||||
long start = System.currentTimeMillis();
|
||||
if (chunkDeleter.runDeleter()) {
|
||||
logger.info("Successfully deleted {} matching chunks (out of {}, taking {} ms).",
|
||||
LOGGER.info("Successfully deleted {} matching chunks (out of {}, taking {} ms).",
|
||||
chunkDeleter.getDeletedChunkCount(), chunkDeleter.getDeletionsRequested(),
|
||||
System.currentTimeMillis() - start);
|
||||
if (deleteOnSuccess) {
|
||||
@ -96,12 +96,12 @@ public final class ChunkDeleter {
|
||||
} catch (IOException ignored) {
|
||||
}
|
||||
if (!deletedFile) {
|
||||
logger.warn("Chunk deletion file could not be cleaned up. This may have unintended consequences"
|
||||
LOGGER.warn("Chunk deletion file could not be cleaned up. This may have unintended consequences"
|
||||
+ " on next startup, or if /delchunks is used again.");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
logger.error("Error occurred while deleting chunks. "
|
||||
LOGGER.error("Error occurred while deleting chunks. "
|
||||
+ "If world errors occur, stop the server and restore the *.bak backup files.");
|
||||
}
|
||||
}
|
||||
@ -131,7 +131,7 @@ public final class ChunkDeleter {
|
||||
|
||||
private boolean runBatch(ChunkDeletionInfo.ChunkBatch chunkBatch) {
|
||||
int chunkCount = chunkBatch.getChunkCount();
|
||||
logger.debug("Processing deletion batch with {} chunks.", chunkCount);
|
||||
LOGGER.debug("Processing deletion batch with {} chunks.", chunkCount);
|
||||
final Map<Path, Stream<BlockVector2>> regionToChunkList = groupChunks(chunkBatch);
|
||||
BiPredicate<RegionAccess, BlockVector2> predicate = createPredicates(chunkBatch.deletionPredicates);
|
||||
shouldPreload = chunkBatch.chunks == null;
|
||||
@ -147,7 +147,7 @@ public final class ChunkDeleter {
|
||||
try {
|
||||
backupRegion(regionPath);
|
||||
} catch (IOException e) {
|
||||
logger.warn("Error backing up region file: " + regionPath + ". Aborting the process.", e);
|
||||
LOGGER.warn("Error backing up region file: " + regionPath + ". Aborting the process.", e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -263,15 +263,15 @@ public final class ChunkDeleter {
|
||||
region.deleteChunk(chunk);
|
||||
totalChunksDeleted++;
|
||||
if (debugRate != 0 && totalChunksDeleted % debugRate == 0) {
|
||||
logger.debug("Deleted {} chunks so far.", totalChunksDeleted);
|
||||
LOGGER.debug("Deleted {} chunks so far.", totalChunksDeleted);
|
||||
}
|
||||
} else {
|
||||
logger.debug("Chunk did not match predicates: " + chunk);
|
||||
LOGGER.debug("Chunk did not match predicates: " + chunk);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
} catch (IOException e) {
|
||||
logger.warn("Error deleting chunks from region: " + regionFile + ". Aborting the process.", e);
|
||||
LOGGER.warn("Error deleting chunks from region: " + regionFile + ". Aborting the process.", e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,44 @@
|
||||
/*
|
||||
* WorldEdit, a Minecraft world manipulation toolkit
|
||||
* Copyright (C) sk89q <http://www.sk89q.com>
|
||||
* Copyright (C) WorldEdit team and contributors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.sk89q.worldedit.internal.util;
|
||||
|
||||
import com.google.common.base.Throwables;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class LogManagerCompat {
|
||||
|
||||
public static Logger getLogger() {
|
||||
return LogManager.getLogger(getCallerCallerClassName());
|
||||
}
|
||||
|
||||
private static String getCallerCallerClassName() {
|
||||
List<StackTraceElement> lazyStack = Throwables.lazyStackTrace(new Throwable());
|
||||
// 0 - this method
|
||||
// 1 - caller
|
||||
// 2 - caller caller
|
||||
return lazyStack.get(2).getClassName();
|
||||
}
|
||||
|
||||
private LogManagerCompat() {
|
||||
}
|
||||
}
|
@ -21,9 +21,9 @@
|
||||
|
||||
package com.sk89q.worldedit.math.interpolation;
|
||||
|
||||
import com.sk89q.worldedit.internal.util.LogManagerCompat;
|
||||
import com.sk89q.worldedit.math.Vector3;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map.Entry;
|
||||
@ -39,7 +39,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||
*/
|
||||
public class ReparametrisingInterpolation implements Interpolation {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(ReparametrisingInterpolation.class);
|
||||
private static final Logger LOGGER = LogManagerCompat.getLogger();
|
||||
|
||||
private final Interpolation baseInterpolation;
|
||||
private double totalArcLength;
|
||||
@ -108,7 +108,7 @@ public class ReparametrisingInterpolation implements Interpolation {
|
||||
|
||||
Entry<Double, Double> ceilingEntry = cache.ceilingEntry(arc);
|
||||
if (ceilingEntry == null) {
|
||||
log.warn("Error in arcToParameter: no ceiling entry for " + arc + " found!");
|
||||
LOGGER.warn("Error in arcToParameter: no ceiling entry for " + arc + " found!");
|
||||
return 0;
|
||||
}
|
||||
final double rightArc = ceilingEntry.getKey();
|
||||
|
@ -20,16 +20,12 @@
|
||||
package com.sk89q.worldedit.scripting;
|
||||
|
||||
import org.mozilla.javascript.ClassShutter;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Hides Minecraft's obfuscated & de-obfuscated names from scripts.
|
||||
*/
|
||||
class MinecraftHidingClassShutter implements ClassShutter {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(MinecraftHidingClassShutter.class);
|
||||
|
||||
@Override
|
||||
public boolean visibleToScripts(String fullClassName) {
|
||||
if (!fullClassName.contains(".")) {
|
||||
|
@ -31,6 +31,7 @@ import com.sk89q.worldedit.command.tool.Tool;
|
||||
import com.sk89q.worldedit.entity.Player;
|
||||
import com.sk89q.worldedit.event.platform.ConfigurationLoadEvent;
|
||||
import com.sk89q.worldedit.extension.platform.Locatable;
|
||||
import com.sk89q.worldedit.internal.util.LogManagerCompat;
|
||||
import com.sk89q.worldedit.session.request.Request;
|
||||
import com.sk89q.worldedit.session.storage.JsonFileSessionStore;
|
||||
import com.sk89q.worldedit.session.storage.SessionStore;
|
||||
@ -40,8 +41,7 @@ import com.sk89q.worldedit.util.eventbus.Subscribe;
|
||||
import com.sk89q.worldedit.world.gamemode.GameModes;
|
||||
import com.sk89q.worldedit.world.item.ItemType;
|
||||
import com.sk89q.worldedit.world.item.ItemTypes;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@ -69,7 +69,7 @@ public class SessionManager {
|
||||
private static final int FLUSH_PERIOD = 1000 * 30;
|
||||
private static final ListeningExecutorService executorService = MoreExecutors.listeningDecorator(
|
||||
EvenMoreExecutors.newBoundedCachedThreadPool(0, 1, 5, "WorldEdit Session Saver - %s"));
|
||||
private static final Logger log = LoggerFactory.getLogger(SessionManager.class);
|
||||
private static final Logger LOGGER = LogManagerCompat.getLogger();
|
||||
private static boolean warnedInvalidTool;
|
||||
|
||||
private final Timer timer = new Timer("WorldEdit Session Manager");
|
||||
@ -157,7 +157,7 @@ public class SessionManager {
|
||||
session = store.load(getKey(sessionKey));
|
||||
session.postLoad();
|
||||
} catch (IOException e) {
|
||||
log.warn("Failed to load saved session", e);
|
||||
LOGGER.warn("Failed to load saved session", e);
|
||||
session = new LocalSession();
|
||||
}
|
||||
Request.request().setSession(session);
|
||||
@ -252,7 +252,7 @@ public class SessionManager {
|
||||
try {
|
||||
store.save(getKey(key), entry.getValue());
|
||||
} catch (IOException e) {
|
||||
log.warn("Failed to write session for UUID " + getKey(key), e);
|
||||
LOGGER.warn("Failed to write session for UUID " + getKey(key), e);
|
||||
exception = e;
|
||||
}
|
||||
}
|
||||
|
@ -24,10 +24,10 @@ import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.JsonIOException;
|
||||
import com.google.gson.JsonParseException;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
import com.sk89q.worldedit.internal.util.LogManagerCompat;
|
||||
import com.sk89q.worldedit.util.gson.GsonUtil;
|
||||
import com.sk89q.worldedit.util.io.Closer;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.BufferedWriter;
|
||||
@ -47,7 +47,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||
*/
|
||||
public class JsonFileSessionStore implements SessionStore {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(JsonFileSessionStore.class);
|
||||
private static final Logger LOGGER = LogManagerCompat.getLogger();
|
||||
private final Gson gson;
|
||||
private final File dir;
|
||||
|
||||
@ -61,7 +61,7 @@ public class JsonFileSessionStore implements SessionStore {
|
||||
|
||||
if (!dir.isDirectory()) {
|
||||
if (!dir.mkdirs()) {
|
||||
log.warn("Failed to create directory '" + dir.getPath() + "' for sessions");
|
||||
LOGGER.warn("Failed to create directory '" + dir.getPath() + "' for sessions");
|
||||
}
|
||||
}
|
||||
|
||||
@ -90,9 +90,9 @@ public class JsonFileSessionStore implements SessionStore {
|
||||
BufferedReader br = closer.register(new BufferedReader(fr));
|
||||
LocalSession session = gson.fromJson(br, LocalSession.class);
|
||||
if (session == null) {
|
||||
log.warn("Loaded a null session from {}, creating new session", file);
|
||||
LOGGER.warn("Loaded a null session from {}, creating new session", file);
|
||||
if (!file.delete()) {
|
||||
log.warn("Failed to delete corrupted session {}", file);
|
||||
LOGGER.warn("Failed to delete corrupted session {}", file);
|
||||
}
|
||||
session = new LocalSession();
|
||||
}
|
||||
@ -120,7 +120,7 @@ public class JsonFileSessionStore implements SessionStore {
|
||||
|
||||
if (finalFile.exists()) {
|
||||
if (!finalFile.delete()) {
|
||||
log.warn("Failed to delete " + finalFile.getPath() + " so the .tmp file can replace it");
|
||||
LOGGER.warn("Failed to delete " + finalFile.getPath() + " so the .tmp file can replace it");
|
||||
}
|
||||
}
|
||||
|
||||
@ -129,7 +129,7 @@ public class JsonFileSessionStore implements SessionStore {
|
||||
}
|
||||
|
||||
if (!tempFile.renameTo(finalFile)) {
|
||||
log.warn("Failed to rename temporary session file to " + finalFile.getPath());
|
||||
LOGGER.warn("Failed to rename temporary session file to " + finalFile.getPath());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -24,10 +24,10 @@ package com.sk89q.worldedit.util;
|
||||
import com.sk89q.util.StringUtil;
|
||||
import com.sk89q.worldedit.LocalConfiguration;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
import com.sk89q.worldedit.internal.util.LogManagerCompat;
|
||||
import com.sk89q.worldedit.util.report.Unreported;
|
||||
import com.sk89q.worldedit.world.registry.LegacyMapper;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
@ -49,7 +49,7 @@ import java.util.Set;
|
||||
*/
|
||||
public class PropertiesConfiguration extends LocalConfiguration {
|
||||
|
||||
@Unreported private static final Logger log = LoggerFactory.getLogger(PropertiesConfiguration.class);
|
||||
@Unreported private static final Logger LOGGER = LogManagerCompat.getLogger();
|
||||
|
||||
@Unreported protected Properties properties;
|
||||
@Unreported protected File path;
|
||||
@ -82,7 +82,7 @@ public class PropertiesConfiguration extends LocalConfiguration {
|
||||
properties.load(stream);
|
||||
} catch (FileNotFoundException ignored) {
|
||||
} catch (IOException e) {
|
||||
log.warn("Failed to read configuration", e);
|
||||
LOGGER.warn("Failed to read configuration", e);
|
||||
}
|
||||
|
||||
loadExtra();
|
||||
@ -147,7 +147,7 @@ public class PropertiesConfiguration extends LocalConfiguration {
|
||||
try (OutputStream output = new FileOutputStream(path)) {
|
||||
properties.store(output, "Don't put comments; they get removed");
|
||||
} catch (IOException e) {
|
||||
log.warn("Failed to write configuration", e);
|
||||
LOGGER.warn("Failed to write configuration", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -25,7 +25,7 @@ import com.sk89q.worldedit.LocalConfiguration;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
import com.sk89q.worldedit.session.SessionManager;
|
||||
import com.sk89q.worldedit.util.report.Unreported;
|
||||
import org.slf4j.Logger;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashSet;
|
||||
|
@ -22,8 +22,8 @@ package com.sk89q.worldedit.util.eventbus;
|
||||
import com.google.common.collect.HashMultimap;
|
||||
import com.google.common.collect.Multimap;
|
||||
import com.google.common.collect.SetMultimap;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import com.sk89q.worldedit.internal.util.LogManagerCompat;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.ArrayList;
|
||||
@ -47,7 +47,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||
*/
|
||||
public final class EventBus {
|
||||
|
||||
private final Logger logger = LoggerFactory.getLogger(EventBus.class);
|
||||
private static final Logger LOGGER = LogManagerCompat.getLogger();
|
||||
|
||||
private final ReadWriteLock lock = new ReentrantReadWriteLock();
|
||||
|
||||
@ -192,7 +192,7 @@ public final class EventBus {
|
||||
try {
|
||||
handler.handleEvent(event);
|
||||
} catch (InvocationTargetException e) {
|
||||
logger.error("Could not dispatch event: " + event + " to handler " + handler, e);
|
||||
LOGGER.error("Could not dispatch event: " + event + " to handler " + handler, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -21,8 +21,8 @@ package com.sk89q.worldedit.util.io;
|
||||
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
import com.google.common.base.Throwables;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import com.sk89q.worldedit.internal.util.LogManagerCompat;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.io.IOException;
|
||||
@ -35,7 +35,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
public final class Closer implements Closeable {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(Closer.class);
|
||||
private static final Logger LOGGER = LogManagerCompat.getLogger();
|
||||
|
||||
/**
|
||||
* The suppressor implementation to use for the current Java version.
|
||||
@ -239,7 +239,7 @@ public final class Closer implements Closeable {
|
||||
@Override
|
||||
public void suppress(Object closeable, Throwable thrown, Throwable suppressed) {
|
||||
// log to the same place as Closeables
|
||||
logger.warn("Suppressing exception thrown when closing " + closeable, suppressed);
|
||||
LOGGER.warn("Suppressing exception thrown when closing " + closeable, suppressed);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -35,11 +35,6 @@ public class ArchiveNioSupports {
|
||||
|
||||
static {
|
||||
ImmutableList.Builder<ArchiveNioSupport> builder = ImmutableList.builder();
|
||||
try {
|
||||
builder.add(TrueVfsArchiveNioSupport.getInstance());
|
||||
} catch (NoClassDefFoundError ignored) {
|
||||
// No TrueVFS available. That's OK.
|
||||
}
|
||||
SUPPORTS = builder.add(ZipArchiveNioSupport.getInstance())
|
||||
.addAll(ServiceLoader.load(ArchiveNioSupport.class))
|
||||
.build();
|
||||
|
@ -1,73 +0,0 @@
|
||||
/*
|
||||
* WorldEdit, a Minecraft world manipulation toolkit
|
||||
* Copyright (C) sk89q <http://www.sk89q.com>
|
||||
* Copyright (C) WorldEdit team and contributors
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.sk89q.worldedit.util.io.file;
|
||||
|
||||
import com.google.common.base.Splitter;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import net.java.truevfs.access.TArchiveDetector;
|
||||
import net.java.truevfs.access.TFileSystem;
|
||||
import net.java.truevfs.access.TPath;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Path;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
|
||||
public final class TrueVfsArchiveNioSupport implements ArchiveNioSupport {
|
||||
|
||||
private static final TrueVfsArchiveNioSupport INSTANCE = new TrueVfsArchiveNioSupport();
|
||||
|
||||
public static TrueVfsArchiveNioSupport getInstance() {
|
||||
return INSTANCE;
|
||||
}
|
||||
|
||||
private static final Set<String> ALLOWED_EXTENSIONS = ImmutableSet.copyOf(
|
||||
Splitter.on('|').split(TArchiveDetector.ALL.getExtensions())
|
||||
);
|
||||
|
||||
private TrueVfsArchiveNioSupport() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<ArchiveDir> tryOpenAsDir(Path archive) throws IOException {
|
||||
String fileName = archive.getFileName().toString();
|
||||
int dot = fileName.indexOf('.');
|
||||
if (dot < 0 || dot >= fileName.length() || !ALLOWED_EXTENSIONS
|
||||
.contains(fileName.substring(dot + 1))) {
|
||||
return Optional.empty();
|
||||
}
|
||||
TFileSystem fileSystem = new TPath(archive).getFileSystem();
|
||||
TPath root = fileSystem.getPath("/");
|
||||
Path realRoot = ArchiveNioSupports.skipRootSameName(
|
||||
root, fileName.substring(0, dot)
|
||||
);
|
||||
return Optional.of(new ArchiveDir() {
|
||||
@Override
|
||||
public Path getPath() {
|
||||
return realRoot;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() throws IOException {
|
||||
fileSystem.close();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
@ -19,8 +19,8 @@
|
||||
|
||||
package com.sk89q.worldedit.util.report;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import com.sk89q.worldedit.internal.util.LogManagerCompat;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Modifier;
|
||||
@ -29,7 +29,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
public class ShallowObjectReport extends DataReport {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(ShallowObjectReport.class);
|
||||
private static final Logger LOGGER = LogManagerCompat.getLogger();
|
||||
|
||||
public ShallowObjectReport(String title, Object object) {
|
||||
super(title);
|
||||
@ -53,7 +53,7 @@ public class ShallowObjectReport extends DataReport {
|
||||
Object value = field.get(object);
|
||||
append(field.getName(), String.valueOf(value));
|
||||
} catch (IllegalAccessException e) {
|
||||
log.warn("Failed to get value of '" + field.getName() + "' on " + type);
|
||||
LOGGER.warn("Failed to get value of '" + field.getName() + "' on " + type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -25,8 +25,6 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static org.slf4j.LoggerFactory.getLogger;
|
||||
|
||||
public class BlockTypesCache {
|
||||
/*
|
||||
-----------------------------------------------------
|
||||
|
@ -28,11 +28,11 @@ import com.google.gson.reflect.TypeToken;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.extension.platform.Capability;
|
||||
import com.sk89q.worldedit.internal.Constants;
|
||||
import com.sk89q.worldedit.internal.util.LogManagerCompat;
|
||||
import com.sk89q.worldedit.math.Vector3;
|
||||
import com.sk89q.worldedit.util.gson.VectorAdapter;
|
||||
import com.sk89q.worldedit.util.io.ResourceLoader;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
@ -55,7 +55,7 @@ import javax.annotation.Nullable;
|
||||
*/
|
||||
public final class BundledBlockData {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(BundledBlockData.class);
|
||||
private static final Logger LOGGER = LogManagerCompat.getLogger();
|
||||
private static BundledBlockData INSTANCE;
|
||||
private final ResourceLoader resourceLoader;
|
||||
|
||||
@ -70,7 +70,7 @@ public final class BundledBlockData {
|
||||
try {
|
||||
loadFromResource();
|
||||
} catch (Throwable e) {
|
||||
log.warn("Failed to load the built-in block registry", e);
|
||||
LOGGER.warn("Failed to load the built-in block registry", e);
|
||||
}
|
||||
}
|
||||
|
||||
@ -107,7 +107,7 @@ public final class BundledBlockData {
|
||||
if (url == null) {
|
||||
throw new IOException("Could not find blocks.json");
|
||||
}
|
||||
log.debug("Using {} for bundled block data.", url);
|
||||
LOGGER.debug("Using {} for bundled block data.", url);
|
||||
String data = Resources.toString(url, Charset.defaultCharset());
|
||||
List<BlockEntry> entries = gson.fromJson(data, new TypeToken<List<BlockEntry>>() {}.getType());
|
||||
|
||||
|
@ -26,11 +26,11 @@ import com.google.gson.reflect.TypeToken;
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.extension.platform.Capability;
|
||||
import com.sk89q.worldedit.internal.Constants;
|
||||
import com.sk89q.worldedit.internal.util.LogManagerCompat;
|
||||
import com.sk89q.worldedit.math.Vector3;
|
||||
import com.sk89q.worldedit.util.gson.VectorAdapter;
|
||||
import com.sk89q.worldedit.util.io.ResourceLoader;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
@ -53,7 +53,7 @@ import javax.annotation.Nullable;
|
||||
*/
|
||||
public final class BundledItemData {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(BundledItemData.class);
|
||||
private static final Logger LOGGER = LogManagerCompat.getLogger();
|
||||
private static BundledItemData INSTANCE;
|
||||
private final ResourceLoader resourceLoader;
|
||||
|
||||
@ -68,7 +68,7 @@ public final class BundledItemData {
|
||||
try {
|
||||
loadFromResource();
|
||||
} catch (Throwable e) {
|
||||
log.warn("Failed to load the built-in item registry", e);
|
||||
LOGGER.warn("Failed to load the built-in item registry", e);
|
||||
}
|
||||
}
|
||||
|
||||
@ -94,7 +94,7 @@ public final class BundledItemData {
|
||||
if (url == null) {
|
||||
throw new IOException("Could not find items.json");
|
||||
}
|
||||
log.debug("Using {} for bundled item data.", url);
|
||||
LOGGER.debug("Using {} for bundled item data.", url);
|
||||
String data = Resources.toString(url, Charset.defaultCharset());
|
||||
List<ItemEntry> entries = gson.fromJson(data, new TypeToken<List<ItemEntry>>() {}.getType());
|
||||
|
||||
|
@ -33,6 +33,7 @@ import com.sk89q.worldedit.extension.input.InputParseException;
|
||||
import com.sk89q.worldedit.extension.input.ParserContext;
|
||||
import com.sk89q.worldedit.extension.platform.Capability;
|
||||
import com.sk89q.worldedit.internal.Constants;
|
||||
import com.sk89q.worldedit.internal.util.LogManagerCompat;
|
||||
import com.sk89q.worldedit.math.Vector3;
|
||||
import com.sk89q.worldedit.registry.state.PropertyKey;
|
||||
import com.sk89q.worldedit.util.gson.VectorAdapter;
|
||||
@ -44,8 +45,7 @@ import com.sk89q.worldedit.world.block.BlockType;
|
||||
import com.sk89q.worldedit.world.item.ItemType;
|
||||
import com.sk89q.worldedit.world.item.ItemTypes;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectArrayMap;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
@ -56,7 +56,7 @@ import javax.annotation.Nullable;
|
||||
|
||||
public final class LegacyMapper {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(LegacyMapper.class);
|
||||
private static final Logger LOGGER = LogManagerCompat.getLogger();
|
||||
private static LegacyMapper INSTANCE;
|
||||
private final ResourceLoader resourceLoader;
|
||||
|
||||
@ -79,7 +79,7 @@ public final class LegacyMapper {
|
||||
try {
|
||||
loadFromResource();
|
||||
} catch (Throwable e) {
|
||||
log.warn("Failed to load the built-in legacy id registry", e);
|
||||
LOGGER.warn("Failed to load the built-in legacy id registry", e);
|
||||
}
|
||||
}
|
||||
|
||||
@ -140,7 +140,7 @@ public final class LegacyMapper {
|
||||
|
||||
// if it's still null, both fixer and default failed
|
||||
if (state == null) {
|
||||
log.debug("Unknown block: " + value);
|
||||
LOGGER.debug("Unknown block: " + value);
|
||||
} else {
|
||||
// it's not null so one of them succeeded, now use it
|
||||
blockToStringMap.put(state, id);
|
||||
@ -174,7 +174,7 @@ public final class LegacyMapper {
|
||||
type = ItemTypes.get(value);
|
||||
}
|
||||
if (type == null) {
|
||||
log.debug("Unknown item: " + value);
|
||||
LOGGER.debug("Unknown item: " + value);
|
||||
} else {
|
||||
try {
|
||||
itemMap.put(getCombinedId(id), type);
|
||||
|
@ -21,6 +21,7 @@
|
||||
|
||||
package com.sk89q.worldedit.world.snapshot;
|
||||
|
||||
import com.sk89q.worldedit.internal.util.LogManagerCompat;
|
||||
import com.sk89q.worldedit.world.DataException;
|
||||
import com.sk89q.worldedit.world.storage.ChunkStore;
|
||||
import com.sk89q.worldedit.world.storage.FileLegacyChunkStore;
|
||||
@ -29,8 +30,7 @@ import com.sk89q.worldedit.world.storage.TrueZipLegacyChunkStore;
|
||||
import com.sk89q.worldedit.world.storage.TrueZipMcRegionChunkStore;
|
||||
import com.sk89q.worldedit.world.storage.ZippedLegacyChunkStore;
|
||||
import com.sk89q.worldedit.world.storage.ZippedMcRegionChunkStore;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@ -43,7 +43,7 @@ import java.util.zip.ZipFile;
|
||||
*/
|
||||
public class Snapshot implements Comparable<Snapshot> {
|
||||
|
||||
protected static Logger logger = LoggerFactory.getLogger(Snapshot.class);
|
||||
private static final Logger LOGGER = LogManagerCompat.getLogger();
|
||||
|
||||
protected File file;
|
||||
protected String name;
|
||||
@ -70,7 +70,7 @@ public class Snapshot implements Comparable<Snapshot> {
|
||||
public ChunkStore getChunkStore() throws IOException, DataException {
|
||||
ChunkStore chunkStore = internalGetChunkStore();
|
||||
|
||||
logger.info("WorldEdit: Using " + chunkStore.getClass().getCanonicalName()
|
||||
LOGGER.info("WorldEdit: Using " + chunkStore.getClass().getCanonicalName()
|
||||
+ " for loading snapshot '" + file.getAbsolutePath() + "'");
|
||||
|
||||
return chunkStore;
|
||||
@ -156,7 +156,7 @@ public class Snapshot implements Comparable<Snapshot> {
|
||||
}
|
||||
} catch (IOException ex) {
|
||||
// Skip the file, but print an error
|
||||
logger.info("Could not load snapshot: "
|
||||
LOGGER.info("Could not load snapshot: "
|
||||
+ file.getPath());
|
||||
} catch (DataException ex) {
|
||||
// No truezip, so tar file not supported.
|
||||
|
Reference in New Issue
Block a user