Skip to content

Commit

Permalink
Minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
Chew committed Jul 29, 2020
1 parent e740fc3 commit 5a642b2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/main/java/me/puyttre/svl/Commands.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

public class Commands implements CommandExecutor {

private SimpleVoteListener plugin;
private final SimpleVoteListener plugin;

public Commands(SimpleVoteListener plugin) {
this.plugin = plugin;
Expand All @@ -21,7 +21,7 @@ public boolean onCommand(CommandSender sender, Command cmd, String label, String
if (cmd.getName().toLowerCase().equals("svl")) {
if (args.length > 0) {
if (args[0].equals("reload")) {
plugin.config = YamlConfiguration.loadConfiguration(new File(plugin.getDataFolder(), "SimpleVoteListener.yml"));
plugin.config = YamlConfiguration.loadConfiguration(new File(plugin.getDataFolder(), "config.yml"));
sender.sendMessage(ChatColor.GREEN + "[SVL] Config reloaded.");
} else {
sender.sendMessage(ChatColor.RED + "Unknown command.");
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/me/puyttre/svl/JoinEvent.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

public class JoinEvent implements Listener {

private SimpleVoteListener plugin;
private final SimpleVoteListener plugin;

public JoinEvent(SimpleVoteListener plugin) {
this.plugin = plugin;
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/me/puyttre/svl/SimpleVoteListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ public void onEnable() {

getCommand("svl").setExecutor(new Commands(this));

if (!new File(getDataFolder(), "SimpleVoteListener.yml").exists()) {
saveResource("SimpleVoteListener.yml", false);
if (!new File(getDataFolder(), "config.yml").exists()) {
saveResource("config.yml", false);
loadConfig();
messager.log("Config file not found. Generating a new one for you!");
} else {
Expand All @@ -42,14 +42,14 @@ public void onEnable() {

@Override
public void onDisable() {
messager.log("All Offline Players removed from list (Cause: plugin disabled)");
messager.log("Stopping all timed commands...");
getLogger().info("All Offline Players removed from list (Cause: plugin disabled)");
getLogger().info("Stopping all timed commands...");
timer.stopAll();
messager.log("SimpleVoteListener 2.4 successfully disabled.");
getLogger().info("SimpleVoteListener 3.0 successfully disabled.");
}

public void loadConfig() {
this.config = YamlConfiguration.loadConfiguration(new File(getDataFolder(), "SimpleVoteListener.yml"));
this.config = this.getConfig();
}

@EventHandler
Expand Down

0 comments on commit 5a642b2

Please sign in to comment.