Merge branch 'develop' into multiple-complete

This commit is contained in:
BONNe 2019-05-04 19:04:21 +03:00 committed by GitHub
commit 322be0a249
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 25 additions and 19 deletions

View File

@ -56,7 +56,7 @@
</activation> </activation>
<properties> <properties>
<!-- Override only if necessary --> <!-- Override only if necessary -->
<build.number>-#${env.BUILD_NUMBER}</build.number> <build.number>-#${env.BUILD_NUMBER}</build.number>
<!-- GIT_BRANCH --> <!-- GIT_BRANCH -->
</properties> </properties>
</profile> </profile>

View File

@ -1,6 +1,7 @@
package world.bentobox.challenges.panel.admin; package world.bentobox.challenges.panel.admin;
import org.bukkit.ChatColor;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.enchantments.Enchantment; import org.bukkit.enchantments.Enchantment;
@ -275,7 +276,7 @@ public class EditLevelGUI extends CommonGUI
private PanelItem createChallengeIcon(Challenge challenge) private PanelItem createChallengeIcon(Challenge challenge)
{ {
return new PanelItemBuilder(). return new PanelItemBuilder().
name(challenge.getFriendlyName()). name(ChatColor.translateAlternateColorCodes('&', challenge.getFriendlyName())).
description(GuiUtils.stringSplit( description(GuiUtils.stringSplit(
challenge.getDescription(), challenge.getDescription(),
this.addon.getChallengesSettings().getLoreLineLength())). this.addon.getChallengesSettings().getLoreLineLength())).

View File

@ -1,6 +1,7 @@
package world.bentobox.challenges.panel.admin; package world.bentobox.challenges.panel.admin;
import org.bukkit.ChatColor;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.World; import org.bukkit.World;
import java.util.List; import java.util.List;
@ -133,7 +134,7 @@ public class ListChallengesGUI extends CommonGUI
private PanelItem createChallengeIcon(Challenge challenge) private PanelItem createChallengeIcon(Challenge challenge)
{ {
PanelItemBuilder itemBuilder = new PanelItemBuilder(). PanelItemBuilder itemBuilder = new PanelItemBuilder().
name(challenge.getFriendlyName()). name(ChatColor.translateAlternateColorCodes('&', challenge.getFriendlyName())).
description(GuiUtils.stringSplit(this.generateChallengeDescription(challenge, this.user.getPlayer()), description(GuiUtils.stringSplit(this.generateChallengeDescription(challenge, this.user.getPlayer()),
this.addon.getChallengesSettings().getLoreLineLength())). this.addon.getChallengesSettings().getLoreLineLength())).
icon(challenge.getIcon()). icon(challenge.getIcon()).

View File

@ -1,6 +1,7 @@
package world.bentobox.challenges.panel.admin; package world.bentobox.challenges.panel.admin;
import org.bukkit.ChatColor;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.World; import org.bukkit.World;
import java.util.List; import java.util.List;
@ -133,7 +134,7 @@ public class ListLevelsGUI extends CommonGUI
private PanelItem createLevelIcon(ChallengeLevel challengeLevel) private PanelItem createLevelIcon(ChallengeLevel challengeLevel)
{ {
PanelItemBuilder itemBuilder = new PanelItemBuilder(). PanelItemBuilder itemBuilder = new PanelItemBuilder().
name(challengeLevel.getFriendlyName()). name(ChatColor.translateAlternateColorCodes('&', challengeLevel.getFriendlyName())).
description(GuiUtils.stringSplit( description(GuiUtils.stringSplit(
this.generateLevelDescription(challengeLevel, this.user.getPlayer()), this.generateLevelDescription(challengeLevel, this.user.getPlayer()),
this.addon.getChallengesSettings().getLoreLineLength())). this.addon.getChallengesSettings().getLoreLineLength())).

View File

@ -1,6 +1,7 @@
package world.bentobox.challenges.panel.user; package world.bentobox.challenges.panel.user;
import org.bukkit.ChatColor;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
@ -350,7 +351,9 @@ public class ChallengesGUI extends CommonGUI
{ {
return new PanelItemBuilder(). return new PanelItemBuilder().
icon(challenge.getIcon()). icon(challenge.getIcon()).
name(challenge.getFriendlyName().isEmpty() ? challenge.getUniqueId() : challenge.getFriendlyName()). name(challenge.getFriendlyName().isEmpty() ?
challenge.getUniqueId() :
ChatColor.translateAlternateColorCodes('&', challenge.getFriendlyName())).
description(GuiUtils.stringSplit(this.generateChallengeDescription(challenge, this.user.getPlayer()), description(GuiUtils.stringSplit(this.generateChallengeDescription(challenge, this.user.getPlayer()),
this.addon.getChallengesSettings().getLoreLineLength())). this.addon.getChallengesSettings().getLoreLineLength())).
clickHandler((panel, user1, clickType, slot) -> { clickHandler((panel, user1, clickType, slot) -> {
@ -474,7 +477,7 @@ public class ChallengesGUI extends CommonGUI
return new PanelItemBuilder(). return new PanelItemBuilder().
icon(icon). icon(icon).
name(name). name(ChatColor.translateAlternateColorCodes('&', name)).
description(description). description(description).
glow(glow). glow(glow).
clickHandler(clickHandler). clickHandler(clickHandler).

View File

@ -1,6 +1,7 @@
package world.bentobox.challenges.panel.util; package world.bentobox.challenges.panel.util;
import org.bukkit.ChatColor;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.event.inventory.ClickType; import org.bukkit.event.inventory.ClickType;
import java.util.*; import java.util.*;
@ -144,7 +145,7 @@ public class SelectChallengeGUI
return new PanelItemBuilder(). return new PanelItemBuilder().
name(challenge.getFriendlyName()). name(ChatColor.translateAlternateColorCodes('&', challenge.getFriendlyName())).
description(GuiUtils.stringSplit(description, this.lineLength)). description(GuiUtils.stringSplit(description, this.lineLength)).
icon(challenge.getIcon()). icon(challenge.getIcon()).
clickHandler((panel, user1, clickType, slot) -> { clickHandler((panel, user1, clickType, slot) -> {

View File

@ -4,9 +4,8 @@
package world.bentobox.challenges.tasks; package world.bentobox.challenges.tasks;
import org.bukkit.GameMode;
import org.bukkit.Material; import org.bukkit.*;
import org.bukkit.World;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import org.bukkit.block.BlockFace; import org.bukkit.block.BlockFace;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;
@ -1250,7 +1249,7 @@ public class TryToComplete
outputMessage = outputMessage.replace("[rewardText]", challenge.getRewardText()); outputMessage = outputMessage.replace("[rewardText]", challenge.getRewardText());
} }
return outputMessage; return ChatColor.translateAlternateColorCodes('&', outputMessage);
} }
@ -1270,7 +1269,7 @@ public class TryToComplete
outputMessage = outputMessage.replace("[rewardText]", level.getRewardText()); outputMessage = outputMessage.replace("[rewardText]", level.getRewardText());
} }
return outputMessage; return ChatColor.translateAlternateColorCodes('&', outputMessage);
} }

View File

@ -319,13 +319,13 @@ challenges:
admin: admin:
hit-things: 'Hit things to add them to the list of things required. Right click when done.' hit-things: 'Hit things to add them to the list of things required. Right click when done.'
you-added: 'You added one [thing] to the challenge' you-added: 'You added one [thing] to the challenge'
challenge-created: '[challenge] created!' challenge-created: '[challenge]&r created!'
you-completed-challenge: '&2You completed the [value] challenge!' you-completed-challenge: '&2You completed the [value] &r&2challenge!'
you-repeated-challenge: '&2You repeated the [value] challenge!' you-repeated-challenge: '&2You repeated the [value] &r&2challenge!'
you-repeated-challenge-multiple: '&2You repeated the [value] challenge [count] times!' you-repeated-challenge-multiple: '&2You repeated the [value] &r&2challenge [count] times!'
you-completed-level: '&2You completed the [value] level!' you-completed-level: '&2You completed the [value] &r&2level!'
name-has-completed-challenge: '&5[name] has completed the [value] challenge!' name-has-completed-challenge: '&5[name] has completed the [value] &r&5challenge!'
name-has-completed-level: '&5[name] has completed the [value] level!' name-has-completed-level: '&5[name] has completed the [value] &r&5level!'
import-levels: 'Start importing Levels' import-levels: 'Start importing Levels'
import-challenges: 'Start importing Challenges' import-challenges: 'Start importing Challenges'
no-levels: 'Warning: No levels defined in challenges.yml' no-levels: 'Warning: No levels defined in challenges.yml'