Skip to content

Commit

Permalink
Fix reload bug
Browse files Browse the repository at this point in the history
  • Loading branch information
TenkyuChimata committed Dec 27, 2023
1 parent 8b28c1c commit 7cbbc29
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/main/java/jp/wolfx/mceew/MCEEW.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ public final class MCEEW extends JavaPlugin {
private static String cwa_alert_sound_type;
private static double cwa_alert_sound_volume;
private static double cwa_alert_sound_pitch;
private static String jmaEqlist_md5;
private static String cencEqlist_md5;
private static String jmaEqlist_md5 = null;
private static String cencEqlist_md5 = null;
private static JsonObject jmaEqlistData = null;
private static JsonObject cencEqlistData = null;
private static final ArrayList<String> jmaEqlist_info = new ArrayList<>();
Expand Down Expand Up @@ -171,13 +171,13 @@ private void cancelScheduler() {

private void mceewScheduler(boolean updaterBoolean) {
if (!folia) {
Bukkit.getScheduler().runTaskAsynchronously(this, () -> wsClient(true));
Bukkit.getScheduler().runTaskAsynchronously(this, () -> wsClient(updaterBoolean));
if (updaterBoolean) {
Bukkit.getScheduler().runTaskAsynchronously(this, this::updater);
}
} else {
Plugin plugin = this;
Bukkit.getAsyncScheduler().runNow(plugin, task1 -> wsClient(true));
Bukkit.getAsyncScheduler().runNow(plugin, task1 -> wsClient(updaterBoolean));
if (updaterBoolean) {
Bukkit.getAsyncScheduler().runNow(plugin, task2 -> updater());
}
Expand Down Expand Up @@ -734,8 +734,6 @@ private void loadEew(Boolean first) {
this.cancelScheduler();
this.saveDefaultConfig();
this.reloadConfig();
jmaEqlist_md5 = null;
cencEqlist_md5 = null;
jpEewBoolean = this.getConfig().getBoolean("enable_jp");
scEewBoolean = this.getConfig().getBoolean("enable_sc");
cwaEewBoolean = this.getConfig().getBoolean("enable_cwa");
Expand Down

0 comments on commit 7cbbc29

Please sign in to comment.