Fixed Flatlands generation & Discord bot not actually disabled (#215)

This commit is contained in:
CoolJWB
2020-07-02 11:08:57 +02:00
committed by GitHub
parent 19ed60d407
commit 556dfa7233
4 changed files with 125 additions and 1 deletions

View File

@ -1,10 +1,12 @@
package me.totalfreedom.totalfreedommod;
import com.sk89q.worldedit.bukkit.BukkitConfiguration;
import java.io.File;
import me.totalfreedom.totalfreedommod.config.YamlConfig;
import me.totalfreedom.totalfreedommod.util.FLog;
import me.totalfreedom.totalfreedommod.util.FUtil;
import org.bukkit.util.FileUtil;
import org.yaml.snakeyaml.Yaml;
public class BackupManager extends FreedomService
{

View File

@ -51,7 +51,7 @@ public class Discord extends FreedomService
{
public static HashMap<String, PlayerData> LINK_CODES = new HashMap<>();
public static HashMap<String, PlayerData> VERIFICATION_CODES = new HashMap<>();
public ScheduledThreadPoolExecutor RATELIMIT_EXECUTOR = new ScheduledThreadPoolExecutor(5, new CountingThreadFactory(this::poolIdentifier, "RateLimit"));
public ScheduledThreadPoolExecutor RATELIMIT_EXECUTOR;
public List<CompletableFuture<Message>> sentMessages = new ArrayList<>();
public static JDA bot = null;
@ -68,6 +68,7 @@ public class Discord extends FreedomService
}
if (bot != null)
{
RATELIMIT_EXECUTOR = new ScheduledThreadPoolExecutor(5, new CountingThreadFactory(this::poolIdentifier, "RateLimit")); // To avoid ClassNotFoundException as net.dv8tion.jda.internal.utils.concurrent.CountingThreadFactory doesn't exist.
for (Object object : bot.getRegisteredListeners())
{
bot.removeEventListener(object);