Enhance reload message

This commit is contained in:
N0tMyFaultOG 2021-01-21 10:19:07 +01:00
parent 1c4339ce1c
commit 67f9e54285
No known key found for this signature in database
GPG Key ID: 823348042DA95A81
2 changed files with 23 additions and 1 deletions

View File

@ -0,0 +1,18 @@
package com.boydti.fawe.bukkit.util;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class SaneSoftwareCheck {
private static final Logger log = LoggerFactory.getLogger(SaneSoftwareCheck.class);
public static Class<?> checkVersion() {
try {
Class.forName("org.yatopiamc.yatopia.server.YatopiaConfig");
} catch (ClassNotFoundException e) {
return null;
} log.warn("You are running a server fork that is known to be extremely dangerous and lead to data loss. It is strongly recommended you switch to a more stable, high-performing server software, like Paper.");
return null;
}
}

View File

@ -84,6 +84,7 @@ import java.util.Optional;
import java.util.logging.Level;
import static com.boydti.fawe.bukkit.util.JavaVersionCheck.checkJvm;
import static com.boydti.fawe.bukkit.util.SaneSoftwareCheck.checkVersion;
import static com.google.common.base.Preconditions.checkNotNull;
import static com.sk89q.worldedit.internal.anvil.ChunkDeleter.DELCHUNKS_FILE_NAME;
@ -162,7 +163,8 @@ public class WorldEditPlugin extends JavaPlugin { //implements TabCompleter
// register this so we can load world-dependent data right as the first world is loading
getServer().getPluginManager().registerEvents(new WorldInitListener(), this);
} else {
getLogger().warning("Server reload detected. This may cause various issues with WorldEdit and dependent plugins.");
getLogger().warning("Server reload detected. This may cause various issues with FastAsyncWorldEdit and dependent plugins.");
getLogger().warning("For more information, see https://matthewmiller.dev/blog/problem-with-reload/");
try {
setupPreWorldData();
// since worlds are loaded already, we can do this now
@ -176,6 +178,8 @@ public class WorldEditPlugin extends JavaPlugin { //implements TabCompleter
// Check whether the server runs on 11 or greater
checkJvm();
// Check if we are in a safe environment
checkVersion();
}
private void setupPreWorldData() {