Skip to content

Commit

Permalink
Change spacing from tab to space.
Browse files Browse the repository at this point in the history
  • Loading branch information
BONNe committed Dec 17, 2018
1 parent c2051d2 commit 3dd23ad
Showing 1 changed file with 47 additions and 47 deletions.
94 changes: 47 additions & 47 deletions src/main/java/bentobox/addon/challenges/panel/TryToComplete.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public ChallengeResult build() {

// Give money
this.addon.getPlugin().getVault().ifPresent(
vaultHook -> vaultHook.deposit(this.user, this.challenge.getRewardMoney()));
vaultHook -> vaultHook.deposit(this.user, this.challenge.getRewardMoney()));

// Give exp
user.getPlayer().giveExp(challenge.getRewardExp());
Expand All @@ -113,9 +113,9 @@ public ChallengeResult build() {
user.getInventory().addItem(reward).forEach((k,v) -> user.getWorld().dropItem(user.getLocation(), v));
}

// Give money
this.addon.getPlugin().getVault().ifPresent(
vaultHook -> vaultHook.deposit(this.user, this.challenge.getRepeatMoneyReward()));
// Give money
this.addon.getPlugin().getVault().ifPresent(
vaultHook -> vaultHook.deposit(this.user, this.challenge.getRepeatMoneyReward()));

// Give exp
user.getPlayer().giveExp(challenge.getRepeatExpReward());
Expand Down Expand Up @@ -157,9 +157,9 @@ public TryToComplete(ChallengesAddon addon, User user, ChallengesManager manager
user.getInventory().addItem(reward).forEach((k,v) -> user.getWorld().dropItem(user.getLocation(), v));
}

// Give money
this.addon.getPlugin().getVault().ifPresent(
vaultHook -> vaultHook.deposit(this.user, this.challenge.getRewardMoney()));
// Give money
this.addon.getPlugin().getVault().ifPresent(
vaultHook -> vaultHook.deposit(this.user, this.challenge.getRewardMoney()));

// Give exp
user.getPlayer().giveExp(challenge.getRewardExp());
Expand All @@ -179,8 +179,8 @@ public TryToComplete(ChallengesAddon addon, User user, ChallengesManager manager
}

// Give money
this.addon.getPlugin().getVault().ifPresent(
vaultHook -> vaultHook.deposit(this.user, this.challenge.getRepeatMoneyReward()));
this.addon.getPlugin().getVault().ifPresent(
vaultHook -> vaultHook.deposit(this.user, this.challenge.getRepeatMoneyReward()));

// Give exp
user.getPlayer().giveExp(challenge.getRepeatExpReward());
Expand Down Expand Up @@ -222,23 +222,23 @@ private ChallengeResult checkIfCanCompleteChallenge() {
}

// Check money
Optional<VaultHook> vaultHook = this.addon.getPlugin().getVault();
Optional<VaultHook> vaultHook = this.addon.getPlugin().getVault();

if (vaultHook.isPresent())
{
if (!vaultHook.get().has(this.user, this.challenge.getReqMoney()))
{
this.user.sendMessage("challenges.not-enough-money");
return new ChallengeResult();
}
}

// Check exp
if (this.user.getPlayer().getTotalExperience() < this.challenge.getReqExp())
{
this.user.sendMessage("challenges.not-enough-exp");
return new ChallengeResult();
}
{
if (!vaultHook.get().has(this.user, this.challenge.getReqMoney()))
{
this.user.sendMessage("challenges.not-enough-money");
return new ChallengeResult();
}
}

// Check exp
if (this.user.getPlayer().getTotalExperience() < this.challenge.getReqExp())
{
this.user.sendMessage("challenges.not-enough-exp");
return new ChallengeResult();
}

switch (challenge.getChallengeType()) {
case INVENTORY:
Expand Down Expand Up @@ -285,29 +285,29 @@ private ChallengeResult checkInventory() {
}

// process money removal
this.removeMoney();
this.removeMoney();

// Return the result
return new ChallengeResult().setMeetsRequirements().setRepeat(manager.isChallengeComplete(user, challenge.getUniqueId(), world));
}


/**
* This method withdraw user money, if challenge Required Money is larger then 0, and
* it is set to removal.
* This works only if vaultHook is enabled.
*/
/**
* This method withdraw user money, if challenge Required Money is larger then 0, and
* it is set to removal.
* This works only if vaultHook is enabled.
*/
private void removeMoney()
{
Optional<VaultHook> vaultHook = this.addon.getPlugin().getVault();

if (vaultHook.isPresent() &&
this.challenge.isTakeMoney() &&
this.challenge.getReqMoney() > 0)
{
vaultHook.get().withdraw(this.user, this.challenge.getReqMoney());
}
}
{
Optional<VaultHook> vaultHook = this.addon.getPlugin().getVault();

if (vaultHook.isPresent() &&
this.challenge.isTakeMoney() &&
this.challenge.getReqMoney() > 0)
{
vaultHook.get().withdraw(this.user, this.challenge.getReqMoney());
}
}


/**
Expand Down Expand Up @@ -347,9 +347,9 @@ private ChallengeResult checkLevel() {
long level = addon.getAddonByName("Level")
.map(l -> ((Level)l).getIslandLevel(world, user.getUniqueId())).orElse(0L);
if (level >= challenge.getReqIslandlevel()) {
// process money removal
this.removeMoney();
return new ChallengeResult().setMeetsRequirements();
// process money removal
this.removeMoney();
return new ChallengeResult().setMeetsRequirements();
} else {
user.sendMessage("challenges.error.island-level", TextVariables.NUMBER, String.valueOf(challenge.getReqIslandlevel()));
return new ChallengeResult();
Expand All @@ -370,10 +370,10 @@ private ChallengeResult checkSurrounding() {
}

if (result.meetsRequirements && this.challenge.isTakeMoney())
{
// process money removal
this.removeMoney();
}
{
// process money removal
this.removeMoney();
}

return result;
}
Expand Down

0 comments on commit 3dd23ad

Please sign in to comment.