mirror of
https://github.com/BentoBoxWorld/Challenges.git
synced 2025-01-17 21:51:47 +01:00
Enable Level and Money editing, even when required addons or plugins are not provided.
This commit is contained in:
parent
a41859459f
commit
c05015716f
@ -824,9 +824,7 @@ public class EditChallengeGUI extends CommonGUI
|
|||||||
description.add(this.user.getTranslation("challenges.gui.descriptions.current-value",
|
description.add(this.user.getTranslation("challenges.gui.descriptions.current-value",
|
||||||
"[value]", Long.toString(this.challenge.getRequiredIslandLevel())));
|
"[value]", Long.toString(this.challenge.getRequiredIslandLevel())));
|
||||||
|
|
||||||
if (this.addon.isLevelProvided())
|
icon = new ItemStack(this.addon.isLevelProvided() ? Material.BEACON : Material.BARRIER);
|
||||||
{
|
|
||||||
icon = new ItemStack(Material.BEACON);
|
|
||||||
clickHandler = (panel, user, clickType, slot) -> {
|
clickHandler = (panel, user, clickType, slot) -> {
|
||||||
new NumberGUI(this.user, (int) this.challenge.getRequiredIslandLevel(), lineLength, (status, value) -> {
|
new NumberGUI(this.user, (int) this.challenge.getRequiredIslandLevel(), lineLength, (status, value) -> {
|
||||||
if (status)
|
if (status)
|
||||||
@ -839,12 +837,6 @@ public class EditChallengeGUI extends CommonGUI
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
icon = new ItemStack(Material.BARRIER);
|
|
||||||
clickHandler = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
glow = false;
|
glow = false;
|
||||||
break;
|
break;
|
||||||
@ -857,9 +849,7 @@ public class EditChallengeGUI extends CommonGUI
|
|||||||
description.add(this.user.getTranslation("challenges.gui.descriptions.current-value",
|
description.add(this.user.getTranslation("challenges.gui.descriptions.current-value",
|
||||||
"[value]", Long.toString(this.challenge.getRequiredIslandLevel())));
|
"[value]", Long.toString(this.challenge.getRequiredIslandLevel())));
|
||||||
|
|
||||||
if (this.addon.isEconomyProvided())
|
icon = new ItemStack(this.addon.isEconomyProvided() ? Material.GOLD_INGOT : Material.BARRIER);
|
||||||
{
|
|
||||||
icon = new ItemStack(Material.GOLD_INGOT);
|
|
||||||
clickHandler = (panel, user, clickType, slot) -> {
|
clickHandler = (panel, user, clickType, slot) -> {
|
||||||
new NumberGUI(this.user, this.challenge.getRequiredMoney(), 0, lineLength, (status, value) -> {
|
new NumberGUI(this.user, this.challenge.getRequiredMoney(), 0, lineLength, (status, value) -> {
|
||||||
if (status)
|
if (status)
|
||||||
@ -871,12 +861,6 @@ public class EditChallengeGUI extends CommonGUI
|
|||||||
});
|
});
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
icon = new ItemStack(Material.BARRIER);
|
|
||||||
clickHandler = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
glow = false;
|
glow = false;
|
||||||
break;
|
break;
|
||||||
@ -892,21 +876,13 @@ public class EditChallengeGUI extends CommonGUI
|
|||||||
this.user.getTranslation("challenges.gui.descriptions.enabled") :
|
this.user.getTranslation("challenges.gui.descriptions.enabled") :
|
||||||
this.user.getTranslation("challenges.gui.descriptions.disabled")));
|
this.user.getTranslation("challenges.gui.descriptions.disabled")));
|
||||||
|
|
||||||
if (this.addon.isEconomyProvided())
|
icon = new ItemStack(this.addon.isEconomyProvided() ? Material.LEVER : Material.BARRIER);
|
||||||
{
|
|
||||||
icon = new ItemStack(Material.LEVER);
|
|
||||||
clickHandler = (panel, user, clickType, slot) -> {
|
clickHandler = (panel, user, clickType, slot) -> {
|
||||||
this.challenge.setTakeMoney(!this.challenge.isTakeMoney());
|
this.challenge.setTakeMoney(!this.challenge.isTakeMoney());
|
||||||
|
|
||||||
this.build();
|
this.build();
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
icon = new ItemStack(Material.BARRIER);
|
|
||||||
clickHandler = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
glow = this.challenge.isTakeMoney();
|
glow = this.challenge.isTakeMoney();
|
||||||
break;
|
break;
|
||||||
@ -1009,9 +985,7 @@ public class EditChallengeGUI extends CommonGUI
|
|||||||
description.add(this.user.getTranslation("challenges.gui.descriptions.current-value",
|
description.add(this.user.getTranslation("challenges.gui.descriptions.current-value",
|
||||||
"[value]", Integer.toString(this.challenge.getRewardMoney())));
|
"[value]", Integer.toString(this.challenge.getRewardMoney())));
|
||||||
|
|
||||||
if (this.addon.isEconomyProvided())
|
icon = new ItemStack(this.addon.isEconomyProvided() ? Material.GOLD_INGOT : Material.BARRIER);
|
||||||
{
|
|
||||||
icon = new ItemStack(Material.GOLD_INGOT);
|
|
||||||
clickHandler = (panel, user, clickType, slot) -> {
|
clickHandler = (panel, user, clickType, slot) -> {
|
||||||
new NumberGUI(this.user, this.challenge.getRewardMoney(), 0, lineLength, (status, value) -> {
|
new NumberGUI(this.user, this.challenge.getRewardMoney(), 0, lineLength, (status, value) -> {
|
||||||
if (status)
|
if (status)
|
||||||
@ -1024,12 +998,7 @@ public class EditChallengeGUI extends CommonGUI
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
icon = new ItemStack(Material.BARRIER);
|
|
||||||
clickHandler = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
glow = false;
|
glow = false;
|
||||||
break;
|
break;
|
||||||
@ -1207,9 +1176,7 @@ public class EditChallengeGUI extends CommonGUI
|
|||||||
description.add(this.user.getTranslation("challenges.gui.descriptions.current-value",
|
description.add(this.user.getTranslation("challenges.gui.descriptions.current-value",
|
||||||
"[value]", Integer.toString(this.challenge.getRepeatMoneyReward())));
|
"[value]", Integer.toString(this.challenge.getRepeatMoneyReward())));
|
||||||
|
|
||||||
if (this.addon.isEconomyProvided())
|
icon = new ItemStack(this.addon.isEconomyProvided() ? Material.GOLD_NUGGET : Material.BARRIER);
|
||||||
{
|
|
||||||
icon = new ItemStack(Material.GOLD_NUGGET);
|
|
||||||
clickHandler = (panel, user, clickType, slot) -> {
|
clickHandler = (panel, user, clickType, slot) -> {
|
||||||
new NumberGUI(this.user,
|
new NumberGUI(this.user,
|
||||||
this.challenge.getRepeatMoneyReward(),
|
this.challenge.getRepeatMoneyReward(),
|
||||||
@ -1226,12 +1193,6 @@ public class EditChallengeGUI extends CommonGUI
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
icon = new ItemStack(Material.BARRIER);
|
|
||||||
clickHandler = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
glow = false;
|
glow = false;
|
||||||
break;
|
break;
|
||||||
|
@ -584,9 +584,7 @@ public class EditLevelGUI extends CommonGUI
|
|||||||
description.add(this.user.getTranslation("challenges.gui.descriptions.current-value",
|
description.add(this.user.getTranslation("challenges.gui.descriptions.current-value",
|
||||||
"[value]", Integer.toString(this.challengeLevel.getRewardMoney())));
|
"[value]", Integer.toString(this.challengeLevel.getRewardMoney())));
|
||||||
|
|
||||||
if (this.addon.isEconomyProvided())
|
icon = new ItemStack(this.addon.isEconomyProvided() ? Material.GOLD_INGOT : Material.BARRIER);
|
||||||
{
|
|
||||||
icon = new ItemStack(Material.GOLD_INGOT);
|
|
||||||
clickHandler = (panel, user, clickType, slot) -> {
|
clickHandler = (panel, user, clickType, slot) -> {
|
||||||
new NumberGUI(this.user, this.challengeLevel.getRewardMoney(), 0, lineLength, (status, value) -> {
|
new NumberGUI(this.user, this.challengeLevel.getRewardMoney(), 0, lineLength, (status, value) -> {
|
||||||
if (status)
|
if (status)
|
||||||
@ -599,12 +597,6 @@ public class EditLevelGUI extends CommonGUI
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
icon = new ItemStack(Material.BARRIER);
|
|
||||||
clickHandler = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
glow = false;
|
glow = false;
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user