mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-27 01:05:38 +00:00
baddev
This commit is contained in:
parent
299b31a75b
commit
b73d1df350
@ -44,6 +44,8 @@ import org.bukkit.entity.Player;
|
|||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
import org.bukkit.event.entity.PlayerDeathEvent;
|
import org.bukkit.event.entity.PlayerDeathEvent;
|
||||||
|
import org.bukkit.event.player.PlayerJoinEvent;
|
||||||
|
import org.bukkit.event.player.PlayerQuitEvent;
|
||||||
|
|
||||||
public class Discord extends FreedomService
|
public class Discord extends FreedomService
|
||||||
{
|
{
|
||||||
@ -272,6 +274,18 @@ public class Discord extends FreedomService
|
|||||||
startBot();
|
startBot();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler(priority = EventPriority.MONITOR)
|
||||||
|
public void onPlayerJoin(PlayerJoinEvent event)
|
||||||
|
{
|
||||||
|
messageChatChannel("**" + deformat(event.getPlayer().getName()) + " joined the server" + "**");
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler(priority = EventPriority.MONITOR)
|
||||||
|
public void onPlayerLeave(PlayerQuitEvent event)
|
||||||
|
{
|
||||||
|
messageChatChannel("**" + deformat(event.getPlayer().getName()) + " left the server" + "**");
|
||||||
|
}
|
||||||
|
|
||||||
public void messageChatChannel(String message)
|
public void messageChatChannel(String message)
|
||||||
{
|
{
|
||||||
String chat_channel_id = ConfigEntry.DISCORD_CHAT_CHANNEL_ID.getString();
|
String chat_channel_id = ConfigEntry.DISCORD_CHAT_CHANNEL_ID.getString();
|
||||||
@ -378,7 +392,7 @@ public class Discord extends FreedomService
|
|||||||
Guild server = bot.getGuildById(ConfigEntry.DISCORD_SERVER_ID.getString());
|
Guild server = bot.getGuildById(ConfigEntry.DISCORD_SERVER_ID.getString());
|
||||||
if (server == null)
|
if (server == null)
|
||||||
{
|
{
|
||||||
FLog.severe("The discord server ID specified is invalid, or the bot is not on the server.");
|
FLog.severe("The Discord server ID specified is invalid, or the bot is not on the server.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,7 +35,6 @@ public class SQLite extends FreedomService
|
|||||||
|
|
||||||
public void connect()
|
public void connect()
|
||||||
{
|
{
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
connection = DriverManager.getConnection("jdbc:sqlite:" + plugin.getDataFolder() + "/" + FILE_NAME);
|
connection = DriverManager.getConnection("jdbc:sqlite:" + plugin.getDataFolder() + "/" + FILE_NAME);
|
||||||
|
Loading…
Reference in New Issue
Block a user