-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed Configuration implementation and added /atlas reload argument.
- Loading branch information
1 parent
87226d1
commit 5620b51
Showing
18 changed files
with
177 additions
and
160 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+2.45 KB
API/out/production/Atlas/cc/funkemunky/api/commands/CommandMessages.class
Binary file not shown.
Binary file modified
BIN
+1.72 KB
(120%)
API/out/production/Atlas/cc/funkemunky/api/commands/FunkeCommand.class
Binary file not shown.
Binary file modified
BIN
-131 Bytes
(88%)
API/out/production/Atlas/cc/funkemunky/api/commands/impl/AtlasCommand.class
Binary file not shown.
Binary file added
BIN
+1.33 KB
API/out/production/Atlas/cc/funkemunky/api/commands/impl/args/ReloadArgument.class
Binary file not shown.
Binary file modified
BIN
+12 Bytes
(100%)
API/out/production/Atlas/cc/funkemunky/api/commands/impl/args/UpdateArgument.class
Binary file not shown.
Binary file modified
BIN
+246 Bytes
(110%)
API/out/production/Atlas/cc/funkemunky/api/updater/Updater.class
Binary file not shown.
Binary file added
BIN
+1.67 KB
API/out/production/Atlas/cc/funkemunky/api/updater/UpdaterListener.class
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
updater: | ||
autoDownload: false | ||
checkForUpdates: true | ||
notifyWhenUpdate: true | ||
notifyOnJoin: true | ||
metrics: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
name: Atlas | ||
main: cc.funkemunky.api.Atlas | ||
version: 1.0.3 | ||
version: 1.0.4 | ||
author: funkemunky | ||
commands: | ||
atlas: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
API/src/cc/funkemunky/api/commands/impl/args/ReloadArgument.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package cc.funkemunky.api.commands.impl.args; | ||
|
||
import cc.funkemunky.api.Atlas; | ||
import cc.funkemunky.api.commands.FunkeArgument; | ||
import cc.funkemunky.api.utils.Color; | ||
import org.bukkit.command.Command; | ||
import org.bukkit.command.CommandSender; | ||
|
||
public class ReloadArgument extends FunkeArgument { | ||
public ReloadArgument() { | ||
super("reload", "reload", "reload the configuration.", "atlas.reload"); | ||
} | ||
|
||
@Override | ||
public void onArgument(CommandSender sender, Command cmd, String[] args) { | ||
Atlas.getInstance().reloadConfig(); | ||
sender.sendMessage(Color.Green + "Successfully reloaded the Atlas configuration file!"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package cc.funkemunky.api.updater; | ||
|
||
|
||
import cc.funkemunky.api.Atlas; | ||
import cc.funkemunky.api.utils.Color; | ||
import org.bukkit.event.EventHandler; | ||
import org.bukkit.event.Listener; | ||
import org.bukkit.event.player.PlayerJoinEvent; | ||
|
||
public class UpdaterListener implements Listener { | ||
|
||
@EventHandler | ||
public void onEvent(PlayerJoinEvent event) { | ||
if(event.getPlayer().hasPermission("api.admin") | ||
&& Atlas.getInstance().getConfig().getBoolean("updater.notifyOnJoin") && Atlas.getInstance().getUpdater().needsToUpdate()) { | ||
event.getPlayer().sendMessage(Color.translate("&8[&a&lAtlas&8] &7A new version of Atlas has been released (&f" + Atlas.getInstance().getUpdater().getVersion() + "&7)!")); | ||
} | ||
} | ||
} |