Skip to content

Added a way to disable updates. #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public void onEnable() {
getConfig().options().copyDefaults(true);
saveConfig();

CLUpdate clUpdate = new CLUpdate(this);
boolean enableUpdates = getConfig().getBoolean("updates");

Server server = getServer();
ConsoleCommandSender console = server.getConsoleSender();
Expand All @@ -37,7 +37,10 @@ public void onEnable() {
}

console.sendMessage(ChatColor.AQUA + getDescription().getName() + " V" + getDescription().getVersion() + " has been enabled!");
Bukkit.getPluginManager().registerEvents(clUpdate, this);
if(enableUpdates) {
CLUpdate clUpdate = new CLUpdate(this);
Bukkit.getPluginManager().registerEvents(clUpdate, this);
}
}

public static void sendActionBar(Player player, String message) {
Expand Down Expand Up @@ -127,4 +130,4 @@ public static void sendActionBarToAllPlayers(String message, int duration) {
sendActionBar(p, message, duration);
}
}
}
}
1 change: 1 addition & 0 deletions src/main/resources/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
updates: true