mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-27 01:05:38 +00:00
i can't think but this may be right
This commit is contained in:
parent
1a28facc56
commit
9dbe30aaa7
@ -8,6 +8,7 @@ import me.totalfreedom.discord.command.HelpCommand;
|
||||
import me.totalfreedom.discord.command.ListCommand;
|
||||
import me.totalfreedom.discord.command.TPSCommand;
|
||||
import me.totalfreedom.discord.handling.CommandHandler;
|
||||
import me.totalfreedom.discord.react.ReactiveBukkitScheduler;
|
||||
import me.totalfreedom.discord.util.SnowflakeEntry;
|
||||
import me.totalfreedom.discord.util.TFM_Bridge;
|
||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||
@ -24,8 +25,6 @@ public class Bot
|
||||
private final GatewayDiscordClient client;
|
||||
private final TFM_Bridge tfm;
|
||||
private final HashMap<String, PlayerData> LINK_CODES = new HashMap<>();
|
||||
private Boolean enabled = false;
|
||||
|
||||
public Bot()
|
||||
{
|
||||
//Creates the gateway client and connects to the gateway
|
||||
@ -51,12 +50,6 @@ public class Bot
|
||||
.getDiscriminator();
|
||||
}
|
||||
|
||||
|
||||
private String poolIdentifier()
|
||||
{
|
||||
return "TFD4J";
|
||||
}
|
||||
|
||||
public TFM_Bridge getTFM()
|
||||
{
|
||||
return tfm;
|
||||
|
@ -8,21 +8,22 @@ import me.totalfreedom.discord.handling.CommandHandler;
|
||||
import me.totalfreedom.discord.listener.AdminChatListener;
|
||||
import me.totalfreedom.discord.listener.BukkitNative;
|
||||
import me.totalfreedom.discord.listener.MinecraftListener;
|
||||
import me.totalfreedom.discord.react.ReactiveBukkitScheduler;
|
||||
import me.totalfreedom.totalfreedommod.api.Context;
|
||||
import me.totalfreedom.totalfreedommod.api.TFD4JCommons;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class TFD4J extends JavaPlugin
|
||||
{
|
||||
private final Logger slf4j = getSLF4JLogger();
|
||||
private final Logger slf4j = this.getSLF4JLogger();
|
||||
private Bot bot;
|
||||
private MinecraftListener mc;
|
||||
private AdminChatListener ac;
|
||||
private TFD4JCommons tfd4jcommons;
|
||||
private BukkitNative bn;
|
||||
private CommandHandler ch;
|
||||
private ReactiveBukkitScheduler rbs;
|
||||
|
||||
@Override
|
||||
public void onEnable()
|
||||
@ -34,6 +35,8 @@ public class TFD4J extends JavaPlugin
|
||||
this.bot = new Bot();
|
||||
bot.initialize();
|
||||
|
||||
this.rbs = new ReactiveBukkitScheduler(this);
|
||||
|
||||
slf4j().info("Bot successfully initialized! Registering the Bukkit Native listener...");
|
||||
this.bn = new BukkitNative(this);
|
||||
|
||||
@ -52,6 +55,7 @@ public class TFD4J extends JavaPlugin
|
||||
this.ch.registerCommand(new TPSCommand());
|
||||
|
||||
this.getBot().getClient().on(ChatInputInteractionEvent.class, ch::handle)
|
||||
.subscribeOn(getReactiveBukkitScheduler())
|
||||
.subscribe();
|
||||
|
||||
slf4j().info("Commands successfully registered! Providing context to TFM...");
|
||||
@ -98,4 +102,9 @@ public class TFD4J extends JavaPlugin
|
||||
{
|
||||
return ac;
|
||||
}
|
||||
|
||||
public ReactiveBukkitScheduler getReactiveBukkitScheduler()
|
||||
{
|
||||
return rbs;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user