mirror of
https://github.com/BentoBoxWorld/Challenges.git
synced 2024-11-24 11:36:53 +01:00
Merge pull request #67 from BONNe/patch-3
Fix logic issue in Other Type challenge
This commit is contained in:
commit
1fa5e65a57
@ -764,22 +764,38 @@ public class TryToComplete
|
||||
*/
|
||||
private ChallengeResult checkOthers()
|
||||
{
|
||||
if (!this.addon.isEconomyProvided() ||
|
||||
this.challenge.getRequiredMoney() <= 0 ||
|
||||
if (!this.addon.isLevelProvided() &&
|
||||
this.challenge.getRequiredIslandLevel() != 0)
|
||||
{
|
||||
this.user.sendMessage("challenges.missing-addon");
|
||||
}
|
||||
else if (!this.addon.isEconomyProvided() &&
|
||||
this.challenge.getRequiredMoney() != 0)
|
||||
{
|
||||
this.user.sendMessage("challenges.missing-addon");
|
||||
}
|
||||
else if (this.addon.isEconomyProvided() && this.challenge.getRequiredMoney() < 0)
|
||||
{
|
||||
this.user.sendMessage("challenges.incorrect");
|
||||
}
|
||||
else if (this.addon.isEconomyProvided() &&
|
||||
!this.addon.getEconomyProvider().has(this.user, this.challenge.getRequiredMoney()))
|
||||
{
|
||||
this.user.sendMessage("challenges.not-enough-money",
|
||||
"[money]",
|
||||
Integer.toString(this.challenge.getRequiredMoney()));
|
||||
}
|
||||
else if (this.challenge.getRequiredExperience() <= 0 ||
|
||||
this.user.getPlayer().getTotalExperience() < this.challenge.getRequiredExperience())
|
||||
else if (this.challenge.getRequiredExperience() < 0)
|
||||
{
|
||||
this.user.sendMessage("challenges.incorrect");
|
||||
}
|
||||
else if (this.user.getPlayer().getTotalExperience() < this.challenge.getRequiredExperience())
|
||||
{
|
||||
this.user.sendMessage("challenges.not-enough-exp",
|
||||
"[xp]",
|
||||
Integer.toString(this.challenge.getRequiredExperience()));
|
||||
}
|
||||
else if (!this.addon.isLevelProvided() ||
|
||||
else if (this.addon.isLevelProvided() &&
|
||||
this.addon.getLevelAddon().getIslandLevel(this.world, this.user.getUniqueId()) < this.challenge.getRequiredIslandLevel())
|
||||
{
|
||||
this.user.sendMessage("challenges.error.island-level",
|
||||
|
@ -218,3 +218,5 @@ challenges:
|
||||
you-completed: You completed the [challenge] challenge!
|
||||
you-completed-level: Congratulations, you complete [level]!
|
||||
you-repeated: You repeated the [challenge] challenge!
|
||||
missing-addon: It is not possible to complete challenge. Plugin or addon is missing.
|
||||
incorrect: Current challenge is corupted.
|
||||
|
Loading…
Reference in New Issue
Block a user