i can't think but this may be right

This commit is contained in:
Paul Reilly 2023-03-16 13:19:37 -05:00
parent 1a28facc56
commit 9dbe30aaa7
2 changed files with 12 additions and 10 deletions

View File

@ -8,6 +8,7 @@ import me.totalfreedom.discord.command.HelpCommand;
import me.totalfreedom.discord.command.ListCommand; import me.totalfreedom.discord.command.ListCommand;
import me.totalfreedom.discord.command.TPSCommand; import me.totalfreedom.discord.command.TPSCommand;
import me.totalfreedom.discord.handling.CommandHandler; import me.totalfreedom.discord.handling.CommandHandler;
import me.totalfreedom.discord.react.ReactiveBukkitScheduler;
import me.totalfreedom.discord.util.SnowflakeEntry; import me.totalfreedom.discord.util.SnowflakeEntry;
import me.totalfreedom.discord.util.TFM_Bridge; import me.totalfreedom.discord.util.TFM_Bridge;
import me.totalfreedom.totalfreedommod.config.ConfigEntry; import me.totalfreedom.totalfreedommod.config.ConfigEntry;
@ -24,8 +25,6 @@ public class Bot
private final GatewayDiscordClient client; private final GatewayDiscordClient client;
private final TFM_Bridge tfm; private final TFM_Bridge tfm;
private final HashMap<String, PlayerData> LINK_CODES = new HashMap<>(); private final HashMap<String, PlayerData> LINK_CODES = new HashMap<>();
private Boolean enabled = false;
public Bot() public Bot()
{ {
//Creates the gateway client and connects to the gateway //Creates the gateway client and connects to the gateway
@ -51,12 +50,6 @@ public class Bot
.getDiscriminator(); .getDiscriminator();
} }
private String poolIdentifier()
{
return "TFD4J";
}
public TFM_Bridge getTFM() public TFM_Bridge getTFM()
{ {
return tfm; return tfm;

View File

@ -8,21 +8,22 @@ import me.totalfreedom.discord.handling.CommandHandler;
import me.totalfreedom.discord.listener.AdminChatListener; import me.totalfreedom.discord.listener.AdminChatListener;
import me.totalfreedom.discord.listener.BukkitNative; import me.totalfreedom.discord.listener.BukkitNative;
import me.totalfreedom.discord.listener.MinecraftListener; import me.totalfreedom.discord.listener.MinecraftListener;
import me.totalfreedom.discord.react.ReactiveBukkitScheduler;
import me.totalfreedom.totalfreedommod.api.Context; import me.totalfreedom.totalfreedommod.api.Context;
import me.totalfreedom.totalfreedommod.api.TFD4JCommons; import me.totalfreedom.totalfreedommod.api.TFD4JCommons;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class TFD4J extends JavaPlugin public class TFD4J extends JavaPlugin
{ {
private final Logger slf4j = getSLF4JLogger(); private final Logger slf4j = this.getSLF4JLogger();
private Bot bot; private Bot bot;
private MinecraftListener mc; private MinecraftListener mc;
private AdminChatListener ac; private AdminChatListener ac;
private TFD4JCommons tfd4jcommons; private TFD4JCommons tfd4jcommons;
private BukkitNative bn; private BukkitNative bn;
private CommandHandler ch; private CommandHandler ch;
private ReactiveBukkitScheduler rbs;
@Override @Override
public void onEnable() public void onEnable()
@ -34,6 +35,8 @@ public class TFD4J extends JavaPlugin
this.bot = new Bot(); this.bot = new Bot();
bot.initialize(); bot.initialize();
this.rbs = new ReactiveBukkitScheduler(this);
slf4j().info("Bot successfully initialized! Registering the Bukkit Native listener..."); slf4j().info("Bot successfully initialized! Registering the Bukkit Native listener...");
this.bn = new BukkitNative(this); this.bn = new BukkitNative(this);
@ -52,6 +55,7 @@ public class TFD4J extends JavaPlugin
this.ch.registerCommand(new TPSCommand()); this.ch.registerCommand(new TPSCommand());
this.getBot().getClient().on(ChatInputInteractionEvent.class, ch::handle) this.getBot().getClient().on(ChatInputInteractionEvent.class, ch::handle)
.subscribeOn(getReactiveBukkitScheduler())
.subscribe(); .subscribe();
slf4j().info("Commands successfully registered! Providing context to TFM..."); slf4j().info("Commands successfully registered! Providing context to TFM...");
@ -98,4 +102,9 @@ public class TFD4J extends JavaPlugin
{ {
return ac; return ac;
} }
public ReactiveBukkitScheduler getReactiveBukkitScheduler()
{
return rbs;
}
} }