Use proper Addon settings getters.

This commit is contained in:
BONNe1704 2019-01-10 11:40:23 +02:00
parent b8e0ca4331
commit 6c0ac96251
2 changed files with 3 additions and 3 deletions

View File

@ -26,7 +26,7 @@ public class ResetListener implements Listener {
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true) @EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
public void onIslandReset(IslandEvent e) { public void onIslandReset(IslandEvent e) {
if (e.getReason().equals(Reason.CREATED) || (addon.getConfig().getBoolean("resetchallenges") && e.getReason().equals(Reason.RESETTED))) { if (e.getReason().equals(Reason.CREATED) || (addon.getChallengesSettings().isResetChallenges() && e.getReason().equals(Reason.RESETTED))) {
addon.getChallengesManager().resetAllChallenges(e.getOwner(), e.getLocation().getWorld()); addon.getChallengesManager().resetAllChallenges(e.getOwner(), e.getLocation().getWorld());
} }
} }

View File

@ -101,7 +101,7 @@ public class TryToComplete {
// Run commands // Run commands
runCommands(challenge.getRewardCommands()); runCommands(challenge.getRewardCommands());
user.sendMessage("challenges.you-completed", "[challenge]", challenge.getFriendlyName()); user.sendMessage("challenges.you-completed", "[challenge]", challenge.getFriendlyName());
if (addon.getConfig().getBoolean("broadcastmessages", false)) { if (addon.getChallengesSettings().isBroadcastMessages()) {
for (Player p : addon.getServer().getOnlinePlayers()) { for (Player p : addon.getServer().getOnlinePlayers()) {
User.getInstance(p).sendMessage("challenges.name-has-completed", User.getInstance(p).sendMessage("challenges.name-has-completed",
"[name]", user.getName(), "[challenge]", challenge.getFriendlyName()); "[name]", user.getName(), "[challenge]", challenge.getFriendlyName());
@ -166,7 +166,7 @@ public class TryToComplete {
// Run commands // Run commands
runCommands(challenge.getRewardCommands()); runCommands(challenge.getRewardCommands());
user.sendMessage("challenges.you-completed", "[challenge]", challenge.getFriendlyName()); user.sendMessage("challenges.you-completed", "[challenge]", challenge.getFriendlyName());
if (addon.getConfig().getBoolean("broadcastmessages", false)) { if (addon.getChallengesSettings().isBroadcastMessages()) {
for (Player p : addon.getServer().getOnlinePlayers()) { for (Player p : addon.getServer().getOnlinePlayers()) {
User.getInstance(p).sendMessage("challenges.name-has-completed", User.getInstance(p).sendMessage("challenges.name-has-completed",
"[name]", user.getName(), "[challenge]", challenge.getFriendlyName()); "[name]", user.getName(), "[challenge]", challenge.getFriendlyName());