Skip to content

Commit

Permalink
Use proper Addon settings getters.
Browse files Browse the repository at this point in the history
  • Loading branch information
BONNe committed Jan 10, 2019
1 parent b8e0ca4 commit 6c0ac96
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public ResetListener(ChallengesAddon addon) {

@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
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());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public ChallengeResult build() {
// Run commands
runCommands(challenge.getRewardCommands());
user.sendMessage("challenges.you-completed", "[challenge]", challenge.getFriendlyName());
if (addon.getConfig().getBoolean("broadcastmessages", false)) {
if (addon.getChallengesSettings().isBroadcastMessages()) {
for (Player p : addon.getServer().getOnlinePlayers()) {
User.getInstance(p).sendMessage("challenges.name-has-completed",
"[name]", user.getName(), "[challenge]", challenge.getFriendlyName());
Expand Down Expand Up @@ -166,7 +166,7 @@ public TryToComplete(ChallengesAddon addon, User user, ChallengesManager manager
// Run commands
runCommands(challenge.getRewardCommands());
user.sendMessage("challenges.you-completed", "[challenge]", challenge.getFriendlyName());
if (addon.getConfig().getBoolean("broadcastmessages", false)) {
if (addon.getChallengesSettings().isBroadcastMessages()) {
for (Player p : addon.getServer().getOnlinePlayers()) {
User.getInstance(p).sendMessage("challenges.name-has-completed",
"[name]", user.getName(), "[challenge]", challenge.getFriendlyName());
Expand Down

0 comments on commit 6c0ac96

Please sign in to comment.