mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-06-27 19:24:43 +02:00
Fixes #3027
- Ditch slf4j in favor of log4j. slf4j is (unfortunately) very much unmaintained at this time and future versions of MC (1.17+) will use log4j version 2.14.1 onwards over some ancient sfl4j version. - Using log4j reduces our jar size as well, because we don't need to bridge it as the game provides it natively.
This commit is contained in:
@ -98,8 +98,8 @@ import org.bukkit.entity.WaterMob;
|
||||
import org.checkerframework.checker.index.qual.NonNegative;
|
||||
import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
@ -117,7 +117,7 @@ public class BukkitUtil extends WorldUtil {
|
||||
public static final BukkitAudiences BUKKIT_AUDIENCES = BukkitAudiences.create(BukkitPlatform.getPlugin(BukkitPlatform.class));
|
||||
public static final LegacyComponentSerializer LEGACY_COMPONENT_SERIALIZER = LegacyComponentSerializer.legacySection();
|
||||
public static final MiniMessage MINI_MESSAGE = MiniMessage.builder().build();
|
||||
private static final Logger logger = LoggerFactory.getLogger("P2/" + BukkitUtil.class.getSimpleName());
|
||||
private static final Logger LOGGER = LogManager.getLogger("PlotSquared/" + BukkitUtil.class.getSimpleName());
|
||||
private final Collection<BlockType> tileEntityTypes = new HashSet<>();
|
||||
|
||||
/**
|
||||
@ -388,7 +388,7 @@ public class BukkitUtil extends WorldUtil {
|
||||
) {
|
||||
final World world = getWorld(worldName);
|
||||
if (world == null) {
|
||||
logger.warn("An error occurred while setting the biome because the world was null", new RuntimeException());
|
||||
LOGGER.warn("An error occurred while setting the biome because the world was null", new RuntimeException());
|
||||
return;
|
||||
}
|
||||
final Biome biome = BukkitAdapter.adapt(biomeType);
|
||||
@ -487,7 +487,7 @@ public class BukkitUtil extends WorldUtil {
|
||||
allowedInterfaces.add(Firework.class);
|
||||
}
|
||||
case "player" -> allowedInterfaces.add(Player.class);
|
||||
default -> logger.error("Unknown entity category requested: {}", category);
|
||||
default -> LOGGER.error("Unknown entity category requested: {}", category);
|
||||
}
|
||||
final Set<com.sk89q.worldedit.world.entity.EntityType> types = new HashSet<>();
|
||||
outer:
|
||||
|
@ -37,8 +37,8 @@ import org.bukkit.Chunk;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
@ -47,7 +47,7 @@ import java.util.Set;
|
||||
|
||||
public class ContentMap {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger("P2/" + ContentMap.class.getSimpleName());
|
||||
private static final Logger LOGGER = LogManager.getLogger("PlotSquared/" + ContentMap.class.getSimpleName());
|
||||
|
||||
final Set<EntityWrapper> entities;
|
||||
final Map<PlotLoc, BaseBlock[]> allBlocks;
|
||||
@ -128,7 +128,7 @@ public class ContentMap {
|
||||
try {
|
||||
entity.spawn(world, xOffset, zOffset);
|
||||
} catch (Exception e) {
|
||||
logger.error("Failed to restore entity", e);
|
||||
LOGGER.error("Failed to restore entity", e);
|
||||
}
|
||||
}
|
||||
this.entities.clear();
|
||||
|
@ -36,8 +36,8 @@ import org.bukkit.Bukkit;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.bukkit.scheduler.BukkitTask;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import javax.net.ssl.HttpsURLConnection;
|
||||
import java.io.IOException;
|
||||
@ -46,7 +46,7 @@ import java.net.URL;
|
||||
|
||||
public class UpdateUtility implements Listener {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger("P2/" + UpdateUtility.class.getSimpleName());
|
||||
private static final Logger LOGGER = LogManager.getLogger("PlotSquared/" + UpdateUtility.class.getSimpleName());
|
||||
|
||||
public static PlotVersion internalVersion;
|
||||
public static String spigotVersion;
|
||||
@ -73,23 +73,23 @@ public class UpdateUtility implements Listener {
|
||||
.getAsJsonObject();
|
||||
spigotVersion = result.get("current_version").getAsString();
|
||||
} catch (IOException e) {
|
||||
logger.error("Unable to check for updates. Error: {}", e.getMessage());
|
||||
LOGGER.error("Unable to check for updates. Error: {}", e.getMessage());
|
||||
return;
|
||||
}
|
||||
|
||||
if (internalVersion.isLaterVersion(spigotVersion)) {
|
||||
logger.info("There appears to be a PlotSquared update available!");
|
||||
logger.info("You are running version {}, the latest version is {}",
|
||||
LOGGER.info("There appears to be a PlotSquared update available!");
|
||||
LOGGER.info("You are running version {}, the latest version is {}",
|
||||
internalVersion.versionString(), spigotVersion
|
||||
);
|
||||
logger.info("https://www.spigotmc.org/resources/77506/updates");
|
||||
LOGGER.info("https://www.spigotmc.org/resources/77506/updates");
|
||||
hasUpdate = true;
|
||||
if (Settings.UpdateChecker.NOTIFY_ONCE) {
|
||||
cancelTask();
|
||||
}
|
||||
} else if (notify) {
|
||||
notify = false;
|
||||
logger.info("Congratulations! You are running the latest PlotSquared version");
|
||||
LOGGER.info("Congratulations! You are running the latest PlotSquared version");
|
||||
}
|
||||
}, 0L, Settings.UpdateChecker.POLL_RATE * 60 * 20);
|
||||
}
|
||||
|
Reference in New Issue
Block a user