Skip to content

Commit

Permalink
1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
untodesu committed Apr 2, 2023
1 parent 1d271f3 commit 9067c2a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
17 changes: 8 additions & 9 deletions src/main/java/su/gprb/nrmc/motd/AnarMotd.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ public void reloadConfig()
super.reloadConfig();

FileConfiguration config = getConfig();
config.addDefault("motd.file", "config/motd.txt");
config.addDefault("motd.format", ChatColor.GOLD.toString());
config.addDefault("title.mode", "disabled");
config.addDefault("title.text", "A Minecraft Server");
config.addDefault("title.format", ChatColor.GRAY.toString() + ChatColor.BOLD + ChatColor.ITALIC);
config.options().copyDefaults(true);

try {
final String mformat = Objects.requireNonNull(config.getString("motd.format"));
Expand Down Expand Up @@ -83,19 +89,13 @@ public void reloadConfig()
}

saveConfig();

Bukkit.getLogger().info("AnarMOTD reloaded!");
}

@Override
public void onEnable()
{
FileConfiguration config = getConfig();
config.addDefault("motd.file", "config/motd.txt");
config.addDefault("motd.format", ChatColor.GOLD.toString());
config.addDefault("title.mode", "disabled");
config.addDefault("title.text", "A Minecraft Server");
config.addDefault("title.format", ChatColor.GRAY.toString() + ChatColor.BOLD + ChatColor.ITALIC);
config.options().copyDefaults(true);

// Register self as a command executor
Objects.requireNonNull(getCommand("motd")).setExecutor(this);

Expand All @@ -109,7 +109,6 @@ public void onEnable()
public boolean onCommand(CommandSender sender, Command command, String label, String[] args)
{
reloadConfig();
Bukkit.getLogger().info("AnarMOTD reloaded!");
return true;
}

Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
main: su.gprb.nrmc.motd.AnarMOTD
name: AnarMOTD
version: 1.0.0
main: su.gprb.nrmc.motd.AnarMotd
name: AnarMotd
version: 1.1.0
description: The simplest MOTD plugin out there
api-version: 1.19
load: STARTUP
Expand Down

0 comments on commit 9067c2a

Please sign in to comment.