some few changes again

This commit is contained in:
mangorifo
2023-03-29 14:50:28 +08:00
parent 539cbe9104
commit 4a5fb14339
4 changed files with 9 additions and 22 deletions
+4 -6
View File
@@ -7,7 +7,7 @@ import cf.sobrooms.commands.SetLoggingModeCommand;
import cf.sobrooms.events.enchantment.EnchantItem;
import cf.sobrooms.events.enchantment.PrepareItemEnchant;
import cf.sobrooms.events.player.*;
import cf.sobrooms.events.server.ServerStart;
import cf.sobrooms.events.server.ServerLoad;
import cf.sobrooms.events.weather.LightningStrike;
import cf.sobrooms.events.weather.ThunderChange;
import cf.sobrooms.events.weather.WeatherChange;
@@ -15,7 +15,6 @@ import cf.sobrooms.events.world.WorldInit;
import cf.sobrooms.events.world.WorldLoad;
import cf.sobrooms.events.world.WorldSave;
import cf.sobrooms.events.world.WorldUnload;
import com.google.gson.Gson;
import com.google.gson.JsonElement;
import com.google.gson.JsonParser;
import org.bukkit.Bukkit;
@@ -28,11 +27,10 @@ public class Main extends JavaPlugin {
public static File isLoggingConfig;
public static File notifyWebhookConfig;
public static File pubMessageWebhookConfig;
public static String serverAddress = "mc-srv2-singapore.rrryfoo.cf";
private static boolean webhooksAreValidUrls;
public static void main(String... args) {
System.out.printf("Initializing using server address: %s...%n", serverAddress);
System.out.printf("Initializing using server address: %s...%n", ServerUtils.address);
}
@Override
@@ -77,11 +75,11 @@ public class Main extends JavaPlugin {
}
// register events
ServerStart serverStart = new ServerStart();
getServer().getPluginManager().registerEvents(serverStart, this);
if (getLoggingConfig().equals("true") && webhooksAreValidUrls)
registerEvents();
if (webhooksAreValidUrls) {
ServerLoad serverStart = new ServerLoad();
getServer().getPluginManager().registerEvents(serverStart, this);
PlayerJoin playerJoin = new PlayerJoin();
PlayerQuit playerQuit = new PlayerQuit();
getServer().getPluginManager().registerEvents(playerJoin, this);