Skip to content
This repository was archived by the owner on Nov 2, 2021. It is now read-only.

Commit

Permalink
Cleaned up config and added lang option
Browse files Browse the repository at this point in the history
Refreshened configuration file for update 3.0.
Added lang option for tip message.
Prepared for release 3.0.
  • Loading branch information
DarkPyves committed Jul 27, 2016
1 parent 66ae268 commit 5c669b1
Show file tree
Hide file tree
Showing 5 changed files with 113 additions and 65 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.hm.achievement</groupId>
<artifactId>AdvancedAchievements</artifactId>
<version>3.0-Beta</version>
<version>3.0</version>
<url>https://github.com/PyvesB/AdvancedAchievements</url>
<name>AdvancedAchievements</name>
<description>A Minecraft plugin that brings unique and challenging achievements on your server! Books, GUI, rankings, rewards, effects and more!</description>
Expand Down
15 changes: 10 additions & 5 deletions src/main/java/com/hm/achievement/AdvancedAchievements.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
* Spigot project page: spigotmc.org/resources/advanced-achievements.6239
*
* @since April 2015
* @version 3.0-Beta
* @version 3.0
* @author Pyves
*/
public class AdvancedAchievements extends JavaPlugin {
Expand Down Expand Up @@ -924,6 +924,11 @@ private void updateOldLanguage() {
updateDone = true;
}

if (!lang.getKeys(false).contains("aach-tip")) {
lang.set("aach-tip", "&lHINT&r &8You can &7&n&ohover&r &8or &7&n&oclick&r &8on the commands!");
updateDone = true;
}

if (updateDone) {
// Changes in the language file: save and do a fresh load.
try {
Expand Down Expand Up @@ -1068,18 +1073,17 @@ public boolean onCommand(CommandSender sender, Command cmd, String commandLabel,
if (!cmd.getName().equalsIgnoreCase("aach"))
return false;


if ((args.length == 1) && !args[0].equalsIgnoreCase("help")) {

if (args[0].equalsIgnoreCase("book") && sender.hasPermission("achievement.book")
&& sender instanceof Player) {

bookCommand.giveBook(((Player) sender));

} else if (args[0].equalsIgnoreCase("hcaa") && sender.hasPermission("achievement.easteregg")) {

displayEasterEgg(sender);

} else if (args[0].equalsIgnoreCase("reload")) {

if (sender.hasPermission("achievement.reload")) {
Expand Down Expand Up @@ -1200,6 +1204,7 @@ public boolean onCommand(CommandSender sender, Command cmd, String commandLabel,
}

/**
* Easter egg; run it and you'll see what all this mess is about!
*
* @param sender
*/
Expand Down
7 changes: 3 additions & 4 deletions src/main/java/com/hm/achievement/command/HelpCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public void getHelp(CommandSender sender) {
plugin.getPluginLang().getString("aach-command-check", "Check if NAME has ACH.")
.replace("ACH", "&oach&r&7").replace("NAME", "&oplayer&r&7")),
"/aach check ach name", plugin.getPluginLang().getString("aach-command-check-hover",
"Don't forget to add the colors defined in the config file."));
"Use the Name parameter specified in the config."));

if (sender.hasPermission("achievement.delete"))
sendJsonClickableHoverableMessage(sender,
Expand All @@ -124,9 +124,8 @@ public void getHelp(CommandSender sender) {
sender.sendMessage(plugin.getColor() + " ");

// Tip message.
sender.sendMessage(ChatColor.GRAY + "§lHINT§r" + ChatColor.DARK_GRAY + " You can " + ChatColor.GRAY
+ "§n§ohover§r" + ChatColor.DARK_GRAY + " or " + ChatColor.GRAY + "§n§oclick§r" + ChatColor.DARK_GRAY
+ " on the commands!");
sender.sendMessage(ChatColor.GRAY + ChatColor.translateAlternateColorCodes('&', plugin.getPluginLang()
.getString("aach-tip", "&lHINT&r &8You can &7&n&ohover&r &8or &7&n&oclick&r &8on the commands!")));
}

/**
Expand Down
Loading

0 comments on commit 5c669b1

Please sign in to comment.