refactor + remove worldsave
This commit is contained in:
@@ -15,7 +15,6 @@ import cf.sobrooms.events.weather.ThunderChange;
|
||||
import cf.sobrooms.events.weather.WeatherChange;
|
||||
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.JsonElement;
|
||||
import com.google.gson.JsonParser;
|
||||
@@ -131,9 +130,8 @@ public class Main extends JavaPlugin {
|
||||
JsonParser jsonReader = new JsonParser();
|
||||
JsonElement MsgParse = jsonReader.parse(brfmsg.readLine());
|
||||
String lineMsg = MsgParse.getAsJsonObject().get("url_publicmsg").getAsString();
|
||||
// validate url being url
|
||||
// but this won't validate the url being an actual webhook
|
||||
// i can try but lazy :sob:
|
||||
|
||||
brfmsg.close();
|
||||
if (lineMsg.equals("default-ns")) {
|
||||
System.out.printf("Please set the public message webhook URL in %s and restart the server", webhookConfig.getAbsolutePath());
|
||||
webhooksAreValidUrls = false;
|
||||
@@ -156,9 +154,8 @@ public class Main extends JavaPlugin {
|
||||
JsonParser jsonReader = new JsonParser();
|
||||
JsonElement NtfyParse = jsonReader.parse(brfntfy.readLine());
|
||||
String lineNtfy = NtfyParse.getAsJsonObject().get("url_notify").getAsString();
|
||||
// validate url being url
|
||||
// but this won't validate the url being an actual webhook
|
||||
// i can try but lazy :sob:
|
||||
|
||||
brfntfy.close();
|
||||
if (lineNtfy.equals("default-ns")) {
|
||||
System.out.printf("Please set the webhook URL in %s and restart the server", webhookConfig.getAbsolutePath());
|
||||
webhooksAreValidUrls = false;
|
||||
@@ -186,7 +183,6 @@ public class Main extends JavaPlugin {
|
||||
else
|
||||
return "Content is not a boolean";
|
||||
}
|
||||
reader.close();
|
||||
} catch (IOException e) {
|
||||
System.out.println("An error occurred while reading the configuration file.");
|
||||
e.printStackTrace();
|
||||
@@ -207,7 +203,6 @@ public class Main extends JavaPlugin {
|
||||
WeatherChange weatherChange = new WeatherChange();
|
||||
WorldInit worldInit = new WorldInit();
|
||||
WorldLoad worldLoad = new WorldLoad();
|
||||
WorldSave worldSave = new WorldSave();
|
||||
WorldUnload worldUnload = new WorldUnload();
|
||||
VehicleEnter vehicleEnter = new VehicleEnter();
|
||||
VehicleExit vehicleExit = new VehicleExit();
|
||||
@@ -222,7 +217,6 @@ public class Main extends JavaPlugin {
|
||||
getServer().getPluginManager().registerEvents(weatherChange, this);
|
||||
getServer().getPluginManager().registerEvents(worldInit, this);
|
||||
getServer().getPluginManager().registerEvents(worldLoad, this);
|
||||
getServer().getPluginManager().registerEvents(worldSave, this);
|
||||
getServer().getPluginManager().registerEvents(worldUnload, this);
|
||||
getServer().getPluginManager().registerEvents(vehicleEnter, this);
|
||||
getServer().getPluginManager().registerEvents(vehicleExit, this);
|
||||
|
||||
Reference in New Issue
Block a user