|
@@ -12,8 +12,6 @@ import com.gmail.nossr50.mcMMO;
|
|
|
import com.gmail.nossr50.util.Permissions;
|
|
|
import com.gmail.nossr50.util.skills.RankUtils;
|
|
|
import net.kyori.adventure.audience.Audience;
|
|
|
-import net.kyori.adventure.audience.MessageType;
|
|
|
-import net.kyori.adventure.identity.Identity;
|
|
|
import net.kyori.adventure.text.Component;
|
|
|
import net.kyori.adventure.text.TextComponent;
|
|
|
import net.kyori.adventure.text.event.ClickEvent;
|
|
@@ -35,41 +33,37 @@ public class TextComponentFactory {
|
|
|
|
|
|
/**
|
|
|
* Makes a text component using strings from a locale and supports passing an undefined number of variables to the LocaleLoader
|
|
|
+ *
|
|
|
* @param localeKey target locale string address
|
|
|
- * @param values vars to be passed to the locale loader
|
|
|
+ * @param values vars to be passed to the locale loader
|
|
|
* @return
|
|
|
*/
|
|
|
- public static TextComponent getNotificationMultipleValues(String localeKey, String... values)
|
|
|
- {
|
|
|
+ public static TextComponent getNotificationMultipleValues(String localeKey, String... values) {
|
|
|
String preColoredString = LocaleLoader.getString(localeKey, (Object[]) values);
|
|
|
return Component.text(preColoredString);
|
|
|
}
|
|
|
|
|
|
- public static Component getNotificationTextComponentFromLocale(String localeKey)
|
|
|
- {
|
|
|
+ public static Component getNotificationTextComponentFromLocale(String localeKey) {
|
|
|
return getNotificationTextComponent(LocaleLoader.getString(localeKey));
|
|
|
}
|
|
|
|
|
|
- public static Component getNotificationLevelUpTextComponent(PrimarySkillType skill, int levelsGained, int currentLevel)
|
|
|
- {
|
|
|
- return Component.text(LocaleLoader.getString("Overhaul.Levelup", LocaleLoader.getString("Overhaul.Name."+ StringUtils.getCapitalized(skill.toString())), levelsGained, currentLevel));
|
|
|
+ public static Component getNotificationLevelUpTextComponent(PrimarySkillType skill, int levelsGained, int currentLevel) {
|
|
|
+ return Component.text(LocaleLoader.getString("Overhaul.Levelup", LocaleLoader.getString("Overhaul.Name." + StringUtils.getCapitalized(skill.toString())), levelsGained, currentLevel));
|
|
|
}
|
|
|
|
|
|
- private static TextComponent getNotificationTextComponent(String text)
|
|
|
- {
|
|
|
+ private static TextComponent getNotificationTextComponent(String text) {
|
|
|
//textComponent.setColor(getNotificationColor(notificationType));
|
|
|
return Component.text(text);
|
|
|
}
|
|
|
|
|
|
- public static void sendPlayerSubSkillWikiLink(Player player, String subskillformatted)
|
|
|
- {
|
|
|
- if(!mcMMO.p.getGeneralConfig().getUrlLinksEnabled())
|
|
|
+ public static void sendPlayerSubSkillWikiLink(Player player, String subskillformatted) {
|
|
|
+ if (!mcMMO.p.getGeneralConfig().getUrlLinksEnabled())
|
|
|
return;
|
|
|
|
|
|
TextComponent.Builder wikiLinkComponent = Component.text().content(LocaleLoader.getString("Overhaul.mcMMO.MmoInfo.Wiki"));
|
|
|
wikiLinkComponent.decoration(TextDecoration.UNDERLINED, true);
|
|
|
|
|
|
- String wikiUrl = "https://wiki.mcmmo.org/"+subskillformatted;
|
|
|
+ String wikiUrl = "https://wiki.mcmmo.org/" + subskillformatted;
|
|
|
|
|
|
wikiLinkComponent.clickEvent(ClickEvent.openUrl(wikiUrl));
|
|
|
|
|
@@ -77,39 +71,40 @@ public class TextComponentFactory {
|
|
|
|
|
|
wikiLinkComponent.hoverEvent(HoverEvent.showText(componentBuilder.build()));
|
|
|
|
|
|
- mcMMO.getAudiences().player(player).sendMessage(Identity.nil(), wikiLinkComponent, MessageType.SYSTEM);
|
|
|
+ mcMMO.getAudiences().player(player).sendMessage(wikiLinkComponent);
|
|
|
}
|
|
|
|
|
|
public static void sendPlayerUrlHeader(Player player) {
|
|
|
TextComponent prefix = Component.text(LocaleLoader.getString("Overhaul.mcMMO.Url.Wrap.Prefix") + " ");
|
|
|
/*prefix.setColor(ChatColor.DARK_AQUA);*/
|
|
|
- TextComponent suffix = Component.text(" "+LocaleLoader.getString("Overhaul.mcMMO.Url.Wrap.Suffix"));
|
|
|
+ TextComponent suffix = Component.text(" " + LocaleLoader.getString("Overhaul.mcMMO.Url.Wrap.Suffix"));
|
|
|
/*suffix.setColor(ChatColor.DARK_AQUA);*/
|
|
|
|
|
|
TextComponent emptySpace = Component.space();
|
|
|
|
|
|
- mcMMO.getAudiences().player(player).sendMessage(Identity.nil(),TextComponent.ofChildren(
|
|
|
- prefix,
|
|
|
- getWebLinkTextComponent(McMMOWebLinks.WEBSITE),
|
|
|
- emptySpace,
|
|
|
- getWebLinkTextComponent(McMMOWebLinks.DISCORD),
|
|
|
- emptySpace,
|
|
|
- getWebLinkTextComponent(McMMOWebLinks.PATREON),
|
|
|
- emptySpace,
|
|
|
- getWebLinkTextComponent(McMMOWebLinks.WIKI),
|
|
|
- emptySpace,
|
|
|
- getWebLinkTextComponent(McMMOWebLinks.SPIGOT),
|
|
|
- emptySpace,
|
|
|
- getWebLinkTextComponent(McMMOWebLinks.HELP_TRANSLATE),
|
|
|
- suffix
|
|
|
- ), MessageType.SYSTEM);
|
|
|
+ // TODO: Update system msg API
|
|
|
+ mcMMO.getAudiences().player(player).sendMessage(Component.textOfChildren(
|
|
|
+ prefix,
|
|
|
+ getWebLinkTextComponent(McMMOWebLinks.WEBSITE),
|
|
|
+ emptySpace,
|
|
|
+ getWebLinkTextComponent(McMMOWebLinks.DISCORD),
|
|
|
+ emptySpace,
|
|
|
+ getWebLinkTextComponent(McMMOWebLinks.PATREON),
|
|
|
+ emptySpace,
|
|
|
+ getWebLinkTextComponent(McMMOWebLinks.WIKI),
|
|
|
+ emptySpace,
|
|
|
+ getWebLinkTextComponent(McMMOWebLinks.SPIGOT),
|
|
|
+ emptySpace,
|
|
|
+ getWebLinkTextComponent(McMMOWebLinks.HELP_TRANSLATE),
|
|
|
+ suffix
|
|
|
+ ));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* Sends a player a bunch of text components that represent a list of sub-skills
|
|
|
* Styling and formatting is applied before sending the messages
|
|
|
*
|
|
|
- * @param player target player
|
|
|
+ * @param player target player
|
|
|
* @param subSkillComponents the text components representing the sub-skills by name
|
|
|
*/
|
|
|
public static void sendPlayerSubSkillList(@NotNull Player player, @NotNull List<Component> subSkillComponents) {
|
|
@@ -129,17 +124,15 @@ public class TextComponentFactory {
|
|
|
}
|
|
|
|
|
|
//Send each group
|
|
|
- for(Component curLine : individualLinesToSend) {
|
|
|
- audience.sendMessage(Identity.nil(), curLine);
|
|
|
+ for (Component curLine : individualLinesToSend) {
|
|
|
+ audience.sendMessage(curLine);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private static Component getWebLinkTextComponent(McMMOWebLinks webLinks)
|
|
|
- {
|
|
|
+ private static Component getWebLinkTextComponent(McMMOWebLinks webLinks) {
|
|
|
TextComponent.Builder webTextComponent;
|
|
|
|
|
|
- switch(webLinks)
|
|
|
- {
|
|
|
+ switch (webLinks) {
|
|
|
case WEBSITE:
|
|
|
webTextComponent = Component.text().content(LocaleLoader.getString("JSON.Hover.AtSymbolURL"));
|
|
|
TextUtils.addChildWebComponent(webTextComponent, "Web");
|
|
@@ -180,12 +173,10 @@ public class TextComponentFactory {
|
|
|
return webTextComponent.build();
|
|
|
}
|
|
|
|
|
|
- private static Component getUrlHoverEvent(McMMOWebLinks webLinks)
|
|
|
- {
|
|
|
+ private static Component getUrlHoverEvent(McMMOWebLinks webLinks) {
|
|
|
TextComponent.Builder componentBuilder = Component.text().content(webLinks.getNiceTitle());
|
|
|
|
|
|
- switch(webLinks)
|
|
|
- {
|
|
|
+ switch (webLinks) {
|
|
|
case WEBSITE:
|
|
|
addUrlHeaderHover(webLinks, componentBuilder);
|
|
|
componentBuilder.append(Component.newline()).append(Component.newline());
|
|
@@ -223,7 +214,7 @@ public class TextComponentFactory {
|
|
|
componentBuilder.append(Component.text(webLinks.getLocaleDescription(), NamedTextColor.GREEN));
|
|
|
componentBuilder.append(Component.newline());
|
|
|
componentBuilder.append(Component.text("You can use this website to help translate mcMMO into your language!" +
|
|
|
- "\nIf you want to know more contact me in discord.", NamedTextColor.DARK_GRAY));
|
|
|
+ "\nIf you want to know more contact me in discord.", NamedTextColor.DARK_GRAY));
|
|
|
}
|
|
|
|
|
|
return componentBuilder.build();
|
|
@@ -234,13 +225,11 @@ public class TextComponentFactory {
|
|
|
componentBuilder.append(Component.text(webLinks.getUrl(), NamedTextColor.GRAY, TextDecoration.ITALIC));
|
|
|
}
|
|
|
|
|
|
- private static ClickEvent getUrlClickEvent(String url)
|
|
|
- {
|
|
|
+ private static ClickEvent getUrlClickEvent(String url) {
|
|
|
return ClickEvent.openUrl(url);
|
|
|
}
|
|
|
|
|
|
- private static Component getSubSkillTextComponent(Player player, SubSkillType subSkillType)
|
|
|
- {
|
|
|
+ private static Component getSubSkillTextComponent(Player player, SubSkillType subSkillType) {
|
|
|
//Get skill name
|
|
|
String skillName = subSkillType.getLocaleName();
|
|
|
|
|
@@ -257,8 +246,7 @@ public class TextComponentFactory {
|
|
|
return textComponent.build();
|
|
|
}
|
|
|
|
|
|
- private static TextComponent getSubSkillTextComponent(Player player, AbstractSubSkill abstractSubSkill)
|
|
|
- {
|
|
|
+ private static TextComponent getSubSkillTextComponent(Player player, AbstractSubSkill abstractSubSkill) {
|
|
|
//String key = abstractSubSkill.getConfigKeyName();
|
|
|
String skillName = abstractSubSkill.getNiceName();
|
|
|
|
|
@@ -297,46 +285,37 @@ public class TextComponentFactory {
|
|
|
return textComponent;
|
|
|
}
|
|
|
|
|
|
- private static Component getSubSkillHoverComponent(Player player, AbstractSubSkill abstractSubSkill)
|
|
|
- {
|
|
|
+ private static Component getSubSkillHoverComponent(Player player, AbstractSubSkill abstractSubSkill) {
|
|
|
return getSubSkillHoverEventJSON(abstractSubSkill, player);
|
|
|
}
|
|
|
|
|
|
- private static Component getSubSkillHoverComponent(Player player, SubSkillType subSkillType)
|
|
|
- {
|
|
|
+ private static Component getSubSkillHoverComponent(Player player, SubSkillType subSkillType) {
|
|
|
return getSubSkillHoverEventJSON(subSkillType, player);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* Used for the skill in the new skill system (Deriving from AbstractSubSkill)
|
|
|
+ *
|
|
|
* @param abstractSubSkill this subskill
|
|
|
- * @param player the player who owns this subskill
|
|
|
+ * @param player the player who owns this subskill
|
|
|
* @return the hover basecomponent object for this subskill
|
|
|
*/
|
|
|
- private static Component getSubSkillHoverEventJSON(AbstractSubSkill abstractSubSkill, Player player)
|
|
|
- {
|
|
|
+ private static Component getSubSkillHoverEventJSON(AbstractSubSkill abstractSubSkill, Player player) {
|
|
|
String skillName = abstractSubSkill.getNiceName();
|
|
|
|
|
|
/*
|
|
|
* Hover Event BaseComponent color table
|
|
|
*/
|
|
|
- TextColor ccSubSkillHeader = NamedTextColor.GOLD;
|
|
|
- TextColor ccRank = NamedTextColor.BLUE;
|
|
|
- TextColor ccCurRank = NamedTextColor.GREEN;
|
|
|
- TextColor ccPossessive = NamedTextColor.WHITE;
|
|
|
- //ChatColor ccDescriptionHeader = ChatColor.DARK_PURPLE;
|
|
|
- //ChatColor ccDescription = ChatColor.WHITE;
|
|
|
- TextColor ccLocked = NamedTextColor.DARK_GRAY;
|
|
|
- TextColor ccLevelRequirement = NamedTextColor.BLUE;
|
|
|
- TextColor ccLevelRequired = NamedTextColor.RED;
|
|
|
+ TextColor ccLocked = NamedTextColor.DARK_GRAY;
|
|
|
+ TextColor ccLevelRequirement = NamedTextColor.BLUE;
|
|
|
+ TextColor ccLevelRequired = NamedTextColor.RED;
|
|
|
|
|
|
SubSkillType subSkillType = abstractSubSkill.getSubSkillType();
|
|
|
|
|
|
//SubSkillType Name
|
|
|
TextComponent.Builder componentBuilder = setupSkillComponentNameStyle(player, skillName, subSkillType, RankUtils.hasUnlockedSubskill(player, abstractSubSkill));
|
|
|
|
|
|
- if(!RankUtils.hasUnlockedSubskill(player, abstractSubSkill))
|
|
|
- {
|
|
|
+ if (!RankUtils.hasUnlockedSubskill(player, abstractSubSkill)) {
|
|
|
//Skill is not unlocked yet
|
|
|
addLocked(abstractSubSkill, ccLocked, ccLevelRequirement, ccLevelRequired, componentBuilder);
|
|
|
} else {
|
|
@@ -346,12 +325,11 @@ public class TextComponentFactory {
|
|
|
int curRank = RankUtils.getRank(player, abstractSubSkill);
|
|
|
int nextRank = 0;
|
|
|
|
|
|
- if(curRank < abstractSubSkill.getNumRanks() && abstractSubSkill.getNumRanks() > 0)
|
|
|
- {
|
|
|
- nextRank = RankUtils.getRankUnlockLevel(abstractSubSkill, curRank+1);
|
|
|
+ if (curRank < abstractSubSkill.getNumRanks() && abstractSubSkill.getNumRanks() > 0) {
|
|
|
+ nextRank = RankUtils.getRankUnlockLevel(abstractSubSkill, curRank + 1);
|
|
|
}
|
|
|
|
|
|
- addRanked(ccRank, ccCurRank, ccPossessive, ccCurRank, componentBuilder, abstractSubSkill.getNumRanks(), RankUtils.getRank(player, abstractSubSkill), nextRank);
|
|
|
+ addRanked(componentBuilder, abstractSubSkill.getNumRanks(), RankUtils.getRank(player, abstractSubSkill), nextRank);
|
|
|
|
|
|
componentBuilder.append(Component.text(LocaleLoader.getString("JSON.DescriptionHeader")));
|
|
|
componentBuilder.append(Component.newline()).append(Component.text(abstractSubSkill.getDescription())).append(Component.newline());
|
|
@@ -386,17 +364,14 @@ public class TextComponentFactory {
|
|
|
return componentBuilder;
|
|
|
}
|
|
|
|
|
|
- private static void addRanked(TextColor ccRank, TextColor ccCurRank, TextColor ccPossessive, TextColor ccNumRanks, TextComponent.Builder componentBuilder, int numRanks, int rank, int nextRank) {
|
|
|
+ private static void addRanked(TextComponent.Builder componentBuilder, int numRanks, int rank, int nextRank) {
|
|
|
if (numRanks > 0) {
|
|
|
//Rank: x
|
|
|
componentBuilder.append(Component.text(LocaleLoader.getString("JSON.Hover.Rank", String.valueOf(rank)))).append(Component.newline());
|
|
|
|
|
|
//Next Rank: x
|
|
|
- if(nextRank > rank)
|
|
|
+ if (nextRank > rank)
|
|
|
componentBuilder.append(Component.text(LocaleLoader.getString("JSON.Hover.NextRank", String.valueOf(nextRank)))).append(Component.newline());
|
|
|
-
|
|
|
- /*componentBuilder.append(" " + LocaleLoader.getString("JSON.RankPossesive") + " ").color(ccPossessive);
|
|
|
- componentBuilder.append(String.valueOf(numRanks)).color(ccNumRanks);*/
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -418,47 +393,38 @@ public class TextComponentFactory {
|
|
|
componentBuilder.append(Component.text(LocaleLoader.getString("JSON.LevelRequirement") + ": ", ccLevelRequirement));
|
|
|
}
|
|
|
|
|
|
- @Deprecated
|
|
|
- private static Component getSubSkillHoverEventJSON(SubSkillType subSkillType, Player player)
|
|
|
- {
|
|
|
+ private static Component getSubSkillHoverEventJSON(SubSkillType subSkillType, Player player) {
|
|
|
String skillName = subSkillType.getLocaleName();
|
|
|
|
|
|
/*
|
|
|
* Hover Event BaseComponent color table
|
|
|
*/
|
|
|
- TextColor ccSubSkillHeader = NamedTextColor.GOLD;
|
|
|
- TextColor ccRank = NamedTextColor.BLUE;
|
|
|
- TextColor ccCurRank = NamedTextColor.GREEN;
|
|
|
- TextColor ccPossessive = NamedTextColor.WHITE;
|
|
|
- TextColor ccDescriptionHeader = NamedTextColor.DARK_PURPLE;
|
|
|
- TextColor ccDescription = NamedTextColor.DARK_GRAY;
|
|
|
- TextColor ccLocked = NamedTextColor.DARK_GRAY;
|
|
|
- TextColor ccLevelRequirement = NamedTextColor.BLUE;
|
|
|
- TextColor ccLevelRequired = NamedTextColor.RED;
|
|
|
+ TextColor ccDescriptionHeader = NamedTextColor.DARK_PURPLE;
|
|
|
+ TextColor ccDescription = NamedTextColor.DARK_GRAY;
|
|
|
+ TextColor ccLocked = NamedTextColor.DARK_GRAY;
|
|
|
+ TextColor ccLevelRequirement = NamedTextColor.BLUE;
|
|
|
+ TextColor ccLevelRequired = NamedTextColor.RED;
|
|
|
|
|
|
//SubSkillType Name
|
|
|
TextComponent.Builder componentBuilder = setupSkillComponentNameStyle(player, skillName, subSkillType, RankUtils.hasUnlockedSubskill(player, subSkillType));
|
|
|
|
|
|
- if(!RankUtils.hasUnlockedSubskill(player, subSkillType))
|
|
|
- {
|
|
|
+ if (!RankUtils.hasUnlockedSubskill(player, subSkillType)) {
|
|
|
//Skill is not unlocked yet
|
|
|
addLocked(subSkillType, ccLocked, ccLevelRequirement, ccLevelRequired, componentBuilder);
|
|
|
} else {
|
|
|
//addSubSkillTypeToHoverEventJSON(subSkillType, componentBuilder);
|
|
|
|
|
|
//RANK
|
|
|
- if(subSkillType.getNumRanks() > 0)
|
|
|
- {
|
|
|
+ if (subSkillType.getNumRanks() > 0) {
|
|
|
int curRank = RankUtils.getRank(player, subSkillType);
|
|
|
int nextRank = 0;
|
|
|
|
|
|
- if(curRank < subSkillType.getNumRanks())
|
|
|
- {
|
|
|
- nextRank = RankUtils.getRankUnlockLevel(subSkillType, curRank+1);
|
|
|
+ if (curRank < subSkillType.getNumRanks()) {
|
|
|
+ nextRank = RankUtils.getRankUnlockLevel(subSkillType, curRank + 1);
|
|
|
}
|
|
|
|
|
|
- addRanked(ccRank, ccCurRank, ccPossessive, ccCurRank, componentBuilder, subSkillType.getNumRanks(), RankUtils.getRank(player, subSkillType), nextRank);
|
|
|
-
|
|
|
+ addRanked(componentBuilder, subSkillType.getNumRanks(),
|
|
|
+ RankUtils.getRank(player, subSkillType), nextRank);
|
|
|
}
|
|
|
|
|
|
componentBuilder.append(Component.newline());
|
|
@@ -472,55 +438,52 @@ public class TextComponentFactory {
|
|
|
return componentBuilder.build();
|
|
|
}
|
|
|
|
|
|
- private static void addSubSkillTypeToHoverEventJSON(AbstractSubSkill abstractSubSkill, TextComponent.Builder componentBuilder)
|
|
|
- {
|
|
|
- if(abstractSubSkill.isSuperAbility())
|
|
|
- {
|
|
|
- componentBuilder.append(Component.text(LocaleLoader.getString("JSON.Type.SuperAbility"), NamedTextColor.LIGHT_PURPLE, TextDecoration.BOLD));
|
|
|
- } else if(abstractSubSkill.isActiveUse())
|
|
|
- {
|
|
|
- componentBuilder.append(Component.text(LocaleLoader.getString("JSON.Type.Active"), NamedTextColor.DARK_RED, TextDecoration.BOLD));
|
|
|
+ private static void addSubSkillTypeToHoverEventJSON(AbstractSubSkill abstractSubSkill,
|
|
|
+ TextComponent.Builder componentBuilder) {
|
|
|
+ if (abstractSubSkill.isSuperAbility()) {
|
|
|
+ componentBuilder.append(Component.text(LocaleLoader.getString("JSON.Type.SuperAbility"),
|
|
|
+ NamedTextColor.LIGHT_PURPLE, TextDecoration.BOLD));
|
|
|
+ } else if (abstractSubSkill.isActiveUse()) {
|
|
|
+ componentBuilder.append(Component.text(LocaleLoader.getString("JSON.Type.Active"),
|
|
|
+ NamedTextColor.DARK_RED, TextDecoration.BOLD));
|
|
|
} else {
|
|
|
- componentBuilder.append(Component.text(LocaleLoader.getString("JSON.Type.Passive"), NamedTextColor.GREEN, TextDecoration.BOLD));
|
|
|
+ componentBuilder.append(Component.text(LocaleLoader.getString("JSON.Type.Passive"),
|
|
|
+ NamedTextColor.GREEN, TextDecoration.BOLD));
|
|
|
}
|
|
|
|
|
|
componentBuilder.append(Component.newline());
|
|
|
}
|
|
|
|
|
|
- public static void getSubSkillTextComponents(Player player, List<Component> textComponents, PrimarySkillType parentSkill) {
|
|
|
- for(SubSkillType subSkillType : SubSkillType.values())
|
|
|
- {
|
|
|
- if(subSkillType.getParentSkill() == parentSkill)
|
|
|
- {
|
|
|
+ public static void getSubSkillTextComponents(Player player, List<Component> textComponents,
|
|
|
+ PrimarySkillType parentSkill) {
|
|
|
+ for (SubSkillType subSkillType : SubSkillType.values()) {
|
|
|
+ if (subSkillType.getParentSkill() == parentSkill) {
|
|
|
//TODO: Hacky rewrite later
|
|
|
//Only some versions of MC have this skill
|
|
|
- if(subSkillType == SubSkillType.FISHING_MASTER_ANGLER && mcMMO.getCompatibilityManager().getMasterAnglerCompatibilityLayer() == null)
|
|
|
+ if (subSkillType == SubSkillType.FISHING_MASTER_ANGLER
|
|
|
+ && mcMMO.getCompatibilityManager().getMasterAnglerCompatibilityLayer() == null)
|
|
|
continue;
|
|
|
|
|
|
- if(Permissions.isSubSkillEnabled(player, subSkillType))
|
|
|
- {
|
|
|
- if(!InteractionManager.hasSubSkill(subSkillType))
|
|
|
+ if (Permissions.isSubSkillEnabled(player, subSkillType)) {
|
|
|
+ if (!InteractionManager.hasSubSkill(subSkillType))
|
|
|
textComponents.add(TextComponentFactory.getSubSkillTextComponent(player, subSkillType));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/* NEW SKILL SYSTEM */
|
|
|
- for(AbstractSubSkill abstractSubSkill : InteractionManager.getSubSkillList())
|
|
|
- {
|
|
|
- if(abstractSubSkill.getPrimarySkill() == parentSkill)
|
|
|
- {
|
|
|
- if(Permissions.isSubSkillEnabled(player, abstractSubSkill))
|
|
|
+ for (AbstractSubSkill abstractSubSkill : InteractionManager.getSubSkillList()) {
|
|
|
+ if (abstractSubSkill.getPrimarySkill() == parentSkill) {
|
|
|
+ if (Permissions.isSubSkillEnabled(player, abstractSubSkill))
|
|
|
textComponents.add(TextComponentFactory.getSubSkillTextComponent(player, abstractSubSkill));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public static TextComponent getSubSkillUnlockedNotificationComponents(Player player, SubSkillType subSkillType)
|
|
|
- {
|
|
|
+ public static TextComponent getSubSkillUnlockedNotificationComponents(Player player, SubSkillType subSkillType) {
|
|
|
TextComponent.Builder unlockMessage = Component.text().content(LocaleLoader.getString("JSON.SkillUnlockMessage", subSkillType.getLocaleName(), RankUtils.getRank(player, subSkillType)));
|
|
|
unlockMessage.hoverEvent(HoverEvent.showText(getSubSkillHoverComponent(player, subSkillType)));
|
|
|
- unlockMessage.clickEvent(ClickEvent.runCommand("/"+subSkillType.getParentSkill().toString().toLowerCase(Locale.ENGLISH)));
|
|
|
+ unlockMessage.clickEvent(ClickEvent.runCommand("/" + subSkillType.getParentSkill().toString().toLowerCase(Locale.ENGLISH)));
|
|
|
return unlockMessage.build();
|
|
|
}
|
|
|
}
|