Skip to content

Commit

Permalink
System updates fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
zS0bye committed Dec 1, 2022
1 parent a7456f5 commit 40556be
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 14 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>it.zS0bye</groupId>
<artifactId>BetterSecurity</artifactId>
<version>1.3.1</version>
<version>1.3.2</version>
<packaging>jar</packaging>

<name>BetterSecurity</name>
Expand All @@ -18,7 +18,7 @@
</properties>

<build>
<finalName>BetterSecurity-v1.3.1</finalName>
<finalName>BetterSecurity-v1.3.2</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ public void registerListeners() {
this.getServer().getPluginManager().registerEvents(new CmdsOnlyPlayersListener(this), this);
this.getServer().getPluginManager().registerEvents(new PermissionPreventionListener(this), this);
this.getServer().getPluginManager().registerEvents(new PortBypassPreventionListener(this), this);
this.getServer().getPluginManager().registerEvents(new UpdaterListener(this), this);

Config.BLOCK_CUSTOM_COMMANDS.getConfigurationSection().forEach(command ->
this.getServer().getPluginManager().registerEvents(new BlockCustomCmdsListener(this, command), this));
Expand All @@ -149,8 +148,11 @@ private void loadUpdater() {
final UpdateType updateType = UpdateType.valueOf(Config.SETTINGS_CHECK_UPDATE_TYPE.getString());
final VandalUpdater vandalUpdater = new VandalUpdater(resourceId, updateType);
vandalUpdater.setUpdateMessage(Lang.UPDATE_NOTIFICATION.getCustomString());
Bukkit.getScheduler().runTaskTimerAsynchronously(this, () -> this.updateMsg = vandalUpdater.message(this.getLogger(), this.getName(),
this.getDescription().getVersion(), this.getServer().getUpdateFolderFile(), this.getDataFolder()), 20L, 30 * 60 * 20L);
Bukkit.getScheduler().runTaskTimerAsynchronously(this, () -> {
this.updateMsg = vandalUpdater.message(this.getLogger(), this.getName(),
this.getDescription().getVersion(), this.getServer().getUpdateFolderFile(), this.getDataFolder());
this.getServer().getPluginManager().registerEvents(new UpdaterListener(this), this);
}, 20L, 30 * 60 * 20L);
}

public void registerProtocols() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ private void loadListeners() {
this.getProxy().getPluginManager().registerListener(this, new PluginMessageListener(this));
this.getProxy().getPluginManager().registerListener(this, new BlockTabCompleteListener());
this.getProxy().getPluginManager().registerListener(this, new WaterTabCompleteListener(this));
this.getProxy().getPluginManager().registerListener(this, new UpdaterListener(this));

this.getLogger().info(ConsoleUtils.YELLOW + "┃ Events registered successfully!" + ConsoleUtils.RESET);
}
Expand All @@ -103,8 +102,11 @@ private void loadUpdater() {
final String resourceId = "105608";
final VandalUpdater vandalUpdater = new VandalUpdater(resourceId, UpdateType.NORMAL);
vandalUpdater.setUpdateMessage(Lang.UPDATE_NOTIFICATION.getCustomString());
this.getProxy().getScheduler().schedule(this, () -> this.updateMsg = vandalUpdater.message(this.getLogger(), this.getDescription().getName(),
this.getDescription().getVersion(), null, null), 20L, 30 * 60, TimeUnit.SECONDS);
this.getProxy().getScheduler().schedule(this, () -> {
this.updateMsg = vandalUpdater.message(this.getLogger(), this.getDescription().getName(),
this.getDescription().getVersion(), null, null);
this.getProxy().getPluginManager().registerListener(this, new UpdaterListener(this));
}, 20L, 30 * 60, TimeUnit.SECONDS);
}


Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/configs/bukkit/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# ░ ░ ░ ░ ░ ░ ░ ░ ░░ ░ ░ ░ ░ ░ ░
# ░ ░ ░ ░
#
# Version: 1.3.1 | Bukkit Version
# Version: 1.3.2 | Bukkit Version
# Configuration
#
# Wiki: https://zs0bye.gitbook.io/bettersecurity/plugins/bettersecurity
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/configs/bukkit/languages/en_US.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# ░ ░ ░ ░ ░ ░ ░ ░ ░░ ░ ░ ░ ░ ░ ░
# ░ ░ ░ ░
#
# Version: 1.3.1 | Bukkit Version
# Version: 1.3.2 | Bukkit Version
# Messages - en_US [English]
#
# Wiki: https://zs0bye.gitbook.io/bettersecurity/plugins/bettersecurity
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/configs/bukkit/languages/it_IT.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# ░ ░ ░ ░ ░ ░ ░ ░ ░░ ░ ░ ░ ░ ░ ░
# ░ ░ ░ ░
#
# Version: 1.3.1 | Bukkit Version
# Version: 1.3.2 | Bukkit Version
# Messages - it_IT [Italiano]
#
# Wiki: https://zs0bye.gitbook.io/bettersecurity/plugins/bettersecurity
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/configs/bungee/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# ░ ░ ░ ░ ░ ░ ░ ░ ░░ ░ ░ ░ ░ ░ ░
# ░ ░ ░ ░
#
# Version: 1.3.1 | BungeeCord Version
# Version: 1.3.2 | BungeeCord Version
# Configuration
#
# Wiki: https://zs0bye.gitbook.io/bettersecurity/plugins/bettersecurity
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/configs/bungee/languages/en_US.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# ░ ░ ░ ░ ░ ░ ░ ░ ░░ ░ ░ ░ ░ ░ ░
# ░ ░ ░ ░
#
# Version: 1.3.1 | BungeeCord Version
# Version: 1.3.2 | BungeeCord Version
# Messages - en_US [English]
#
# Wiki: https://zs0bye.gitbook.io/bettersecurity/plugins/bettersecurity
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/configs/bungee/languages/it_IT.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# ░ ░ ░ ░ ░ ░ ░ ░ ░░ ░ ░ ░ ░ ░ ░
# ░ ░ ░ ░
#
# Version: 1.3.1 | BungeeCord Version
# Version: 1.3.2 | BungeeCord Version
# Messages - it_IT [Italiano]
#
# Wiki: https://zs0bye.gitbook.io/bettersecurity/plugins/bettersecurity
Expand Down

0 comments on commit 40556be

Please sign in to comment.