some few changes again
This commit is contained in:
@@ -5,7 +5,6 @@ import cf.sobrooms.Main;
|
||||
import cf.sobrooms.ServerUtils;
|
||||
import cf.sobrooms.Utils;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.server.ServerLoadEvent;
|
||||
@@ -16,14 +15,16 @@ import java.util.Date;
|
||||
|
||||
import cf.sobrooms.DiscordWebhook.EmbedObject;
|
||||
|
||||
public class ServerStart implements Listener {
|
||||
import static cf.sobrooms.ServerUtils.address;
|
||||
|
||||
public class ServerLoad implements Listener {
|
||||
public static int timesCalled = 0;
|
||||
@EventHandler
|
||||
public void onServerStart(ServerLoadEvent event) {
|
||||
Bukkit.getConsoleSender().sendMessage("Triggered ServerLoad event.");
|
||||
if (timesCalled < 1) {
|
||||
Bukkit.getConsoleSender().sendMessage("Checking if server is up on " + ServerUtils.address + " with port " + ServerUtils.port + "...");
|
||||
if (ServerUtils.serverIsUp(Main.serverAddress, 25565)) {
|
||||
if (ServerUtils.serverIsUp(address, 25565)) {
|
||||
System.out.println(ServerUtils.webhook_messages);
|
||||
System.out.println(ServerUtils.webhook_notify);
|
||||
DiscordWebhook notify = new DiscordWebhook(Main.getNotifyWebhook());
|
||||
|
||||
Reference in New Issue
Block a user