Fix NumberGUI item description issue.

There was missing lineLength parameter in most of NumberGui calls.
This commit is contained in:
BONNe1704 2019-02-14 10:46:56 +02:00
parent 68b0fa3b2e
commit 14660dd42c
5 changed files with 38 additions and 28 deletions

View File

@ -440,7 +440,7 @@ public class EditChallengeGUI extends CommonGUI
icon = new ItemStack(Material.DROPPER);
clickHandler = (panel, user, clickType, slot) -> {
new NumberGUI(this.user, this.challenge.getOrder(), -1, 54, (status, value) -> {
new NumberGUI(this.user, this.challenge.getOrder(), -1, 54, lineLength, (status, value) -> {
if (status)
{
this.challenge.setOrder(value);
@ -648,7 +648,7 @@ public class EditChallengeGUI extends CommonGUI
icon = new ItemStack(Material.COBBLESTONE_WALL);
clickHandler = (panel, user, clickType, slot) -> {
new NumberGUI(this.user, this.challenge.getSearchRadius(), 0, (status, value) -> {
new NumberGUI(this.user, this.challenge.getSearchRadius(), 0, lineLength, (status, value) -> {
if (status)
{
this.challenge.setSearchRadius(value);
@ -764,7 +764,7 @@ public class EditChallengeGUI extends CommonGUI
icon = new ItemStack(Material.EXPERIENCE_BOTTLE);
clickHandler = (panel, user, clickType, slot) -> {
new NumberGUI(this.user, this.challenge.getRequiredExperience(), 0, (status, value) -> {
new NumberGUI(this.user, this.challenge.getRequiredExperience(), 0, lineLength, (status, value) -> {
if (status)
{
this.challenge.setRequiredExperience(value);
@ -843,7 +843,7 @@ public class EditChallengeGUI extends CommonGUI
{
icon = new ItemStack(Material.GOLD_INGOT);
clickHandler = (panel, user, clickType, slot) -> {
new NumberGUI(this.user, this.challenge.getRequiredMoney(), 0, (status, value) -> {
new NumberGUI(this.user, this.challenge.getRequiredMoney(), 0, lineLength, (status, value) -> {
if (status)
{
this.challenge.setRequiredMoney(value);
@ -969,7 +969,7 @@ public class EditChallengeGUI extends CommonGUI
"[value]", Integer.toString(this.challenge.getRewardExperience())));
icon = new ItemStack(Material.EXPERIENCE_BOTTLE);
clickHandler = (panel, user, clickType, slot) -> {
new NumberGUI(this.user, this.challenge.getRewardExperience(), 0, (status, value) -> {
new NumberGUI(this.user, this.challenge.getRewardExperience(), 0, lineLength, (status, value) -> {
if (status)
{
this.challenge.setRewardExperience(value);
@ -995,7 +995,7 @@ public class EditChallengeGUI extends CommonGUI
{
icon = new ItemStack(Material.GOLD_INGOT);
clickHandler = (panel, user, clickType, slot) -> {
new NumberGUI(this.user, this.challenge.getRewardMoney(), 0, (status, value) -> {
new NumberGUI(this.user, this.challenge.getRewardMoney(), 0, lineLength, (status, value) -> {
if (status)
{
this.challenge.setRewardMoney(value);
@ -1076,7 +1076,7 @@ public class EditChallengeGUI extends CommonGUI
icon = new ItemStack(Material.COBBLESTONE_WALL);
clickHandler = (panel, user, clickType, slot) -> {
new NumberGUI(this.user, this.challenge.getMaxTimes(), 0, (status, value) -> {
new NumberGUI(this.user, this.challenge.getMaxTimes(), 0, lineLength, (status, value) -> {
if (status)
{
this.challenge.setMaxTimes(value);
@ -1167,7 +1167,7 @@ public class EditChallengeGUI extends CommonGUI
icon = new ItemStack(Material.GLASS_BOTTLE);
clickHandler = (panel, user, clickType, slot) -> {
new NumberGUI(this.user, this.challenge.getRepeatExperienceReward(), 0, (status, value) -> {
new NumberGUI(this.user, this.challenge.getRepeatExperienceReward(), 0, lineLength, (status, value) -> {
if (status)
{
this.challenge.setRepeatExperienceReward(value);
@ -1196,6 +1196,7 @@ public class EditChallengeGUI extends CommonGUI
new NumberGUI(this.user,
this.challenge.getRepeatMoneyReward(),
0,
lineLength,
(status, value) -> {
if (status)
{

View File

@ -388,7 +388,7 @@ public class EditLevelGUI extends CommonGUI
"[value]", Integer.toString(this.challengeLevel.getOrder())));
icon = new ItemStack(Material.DROPPER);
clickHandler = (panel, user, clickType, slot) -> {
new NumberGUI(this.user, this.challengeLevel.getOrder(), -1, 54, (status, value) -> {
new NumberGUI(this.user, this.challengeLevel.getOrder(), -1, 54, lineLength, (status, value) -> {
if (status)
{
this.challengeLevel.setOrder(value);
@ -412,7 +412,7 @@ public class EditLevelGUI extends CommonGUI
icon = new ItemStack(Material.REDSTONE_TORCH);
clickHandler = (panel, user, clickType, slot) -> {
new NumberGUI(this.user, this.challengeLevel.getWaiverAmount(), 0, (status, value) -> {
new NumberGUI(this.user, this.challengeLevel.getWaiverAmount(), 0, lineLength, (status, value) -> {
if (status)
{
this.challengeLevel.setWaiverAmount(value);
@ -500,7 +500,7 @@ public class EditLevelGUI extends CommonGUI
"[value]", Integer.toString(this.challengeLevel.getRewardExperience())));
icon = new ItemStack(Material.EXPERIENCE_BOTTLE);
clickHandler = (panel, user, clickType, slot) -> {
new NumberGUI(this.user, this.challengeLevel.getRewardExperience(), 0, (status, value) -> {
new NumberGUI(this.user, this.challengeLevel.getRewardExperience(), 0, lineLength, (status, value) -> {
if (status)
{
this.challengeLevel.setRewardExperience(value);
@ -526,7 +526,7 @@ public class EditLevelGUI extends CommonGUI
{
icon = new ItemStack(Material.GOLD_INGOT);
clickHandler = (panel, user, clickType, slot) -> {
new NumberGUI(this.user, this.challengeLevel.getRewardMoney(), 0, (status, value) -> {
new NumberGUI(this.user, this.challengeLevel.getRewardMoney(), 0, lineLength, (status, value) -> {
if (status)
{
this.challengeLevel.setRewardMoney(value);

View File

@ -241,6 +241,7 @@ public class EditSettingsGUI extends CommonGUI
new NumberGUI(this.user,
this.addon.getChallengesSettings().getLoreLineLength(),
0,
lineLength,
(status, value) -> {
if (status)
{

View File

@ -175,15 +175,19 @@ public class ManageBlocksGUI extends CommonGUI
}
else
{
new NumberGUI(this.user, this.materialMap.get(material), 1, (status, value) -> {
if (status)
{
// Update value only when something changes.
this.materialMap.put(material, value);
}
new NumberGUI(this.user,
this.materialMap.get(material),
1,
this.addon.getChallengesSettings().getLoreLineLength(),
(status, value) -> {
if (status)
{
// Update value only when something changes.
this.materialMap.put(material, value);
}
this.build();
});
this.build();
});
}
return true;
}).

View File

@ -189,15 +189,19 @@ public class ManageEntitiesGUI extends CommonGUI
}
else
{
new NumberGUI(this.user, this.requiredEntities.get(entity), 1, (status, value) -> {
if (status)
{
// Update value only when something changes.
this.requiredEntities.put(entity, value);
}
new NumberGUI(this.user,
this.requiredEntities.get(entity),
1,
this.addon.getChallengesSettings().getLoreLineLength(),
(status, value) -> {
if (status)
{
// Update value only when something changes.
this.requiredEntities.put(entity, value);
}
this.build();
});
this.build();
});
}
return true;
}).