2.1.170 - papi fix

This commit is contained in:
nossr50 2021-01-05 15:25:39 -08:00
parent 0b8f4b4733
commit ba7b6826b4
19 changed files with 29 additions and 26 deletions

View File

@ -1,3 +1,6 @@
Version 2.1.170
Reverted a change that broke compatibility with the mcMMO papi ecloud thingy
Version 2.1.169
Fixed a few memory leaks involving arrows
Fixed mcMMO inappropriately assigning metadata to projectiles not fired from players

View File

@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.gmail.nossr50.mcMMO</groupId>
<artifactId>mcMMO</artifactId>
<version>2.1.169</version>
<version>2.1.170</version>
<name>mcMMO</name>
<url>https://github.com/mcMMO-Dev/mcMMO</url>
<scm>

View File

@ -46,6 +46,6 @@ public class AddlevelsCommand extends ExperienceCommand {
if(isSilent)
return;
player.sendMessage(LocaleLoader.getString("Commands.addlevels.AwardSkill.1", value, skill.getLocalizedName()));
player.sendMessage(LocaleLoader.getString("Commands.addlevels.AwardSkill.1", value, skill.getName()));
}
}

View File

@ -49,6 +49,6 @@ public class AddxpCommand extends ExperienceCommand {
if(isSilent)
return;
player.sendMessage(LocaleLoader.getString("Commands.addxp.AwardSkill", value, skill.getLocalizedName()));
player.sendMessage(LocaleLoader.getString("Commands.addxp.AwardSkill", value, skill.getName()));
}
}

View File

@ -159,7 +159,7 @@ public abstract class ExperienceCommand implements TabExecutor {
sender.sendMessage(LocaleLoader.getString("Commands.addlevels.AwardAll.2", playerName));
}
else {
sender.sendMessage(LocaleLoader.getString("Commands.addlevels.AwardSkill.2", skill.getLocalizedName(), playerName));
sender.sendMessage(LocaleLoader.getString("Commands.addlevels.AwardSkill.2", skill.getName(), playerName));
}
}

View File

@ -52,6 +52,6 @@ public class MmoeditCommand extends ExperienceCommand {
if(isSilent)
return;
player.sendMessage(LocaleLoader.getString("Commands.mmoedit.Modified.1", skill.getLocalizedName(), value));
player.sendMessage(LocaleLoader.getString("Commands.mmoedit.Modified.1", skill.getName(), value));
}
}

View File

@ -143,7 +143,7 @@ public class SkillresetCommand implements TabExecutor {
}
protected void handlePlayerMessageSkill(Player player, PrimarySkillType skill) {
player.sendMessage(LocaleLoader.getString("Commands.Reset.Single", skill.getLocalizedName()));
player.sendMessage(LocaleLoader.getString("Commands.Reset.Single", skill.getName()));
}
private boolean validateArguments(CommandSender sender, String skillName) {
@ -155,7 +155,7 @@ public class SkillresetCommand implements TabExecutor {
sender.sendMessage(LocaleLoader.getString("Commands.addlevels.AwardAll.2", playerName));
}
else {
sender.sendMessage(LocaleLoader.getString("Commands.addlevels.AwardSkill.2", skill.getLocalizedName(), playerName));
sender.sendMessage(LocaleLoader.getString("Commands.addlevels.AwardSkill.2", skill.getName(), playerName));
}
}

View File

@ -59,6 +59,6 @@ public class HardcoreCommand extends HardcoreModeCommand {
skill.setHardcoreStatLossEnabled(enable);
}
mcMMO.p.getServer().broadcastMessage(LocaleLoader.getString("Hardcore.Mode." + (enable ? "Enabled" : "Disabled"), LocaleLoader.getString("Hardcore.DeathStatLoss.Name"), (skill == null ? "all skills" : skill.getLocalizedName())));
mcMMO.p.getServer().broadcastMessage(LocaleLoader.getString("Hardcore.Mode." + (enable ? "Enabled" : "Disabled"), LocaleLoader.getString("Hardcore.DeathStatLoss.Name"), (skill == null ? "all skills" : skill.getName())));
}
}

View File

@ -45,7 +45,7 @@ public abstract class SkillCommand implements TabExecutor {
public SkillCommand(PrimarySkillType skill) {
this.skill = skill;
skillName = skill.getLocalizedName();
skillName = skill.getName();
skillGuideCommand = new SkillGuideCommand(skill);
}
@ -173,10 +173,10 @@ public abstract class SkillCommand implements TabExecutor {
{
if(i+1 < parentList.size())
{
parentMessage.append(LocaleLoader.getString("Effects.Child.ParentList", parentList.get(i).getLocalizedName(), mcMMOPlayer.getSkillLevel(parentList.get(i))));
parentMessage.append(LocaleLoader.getString("Effects.Child.ParentList", parentList.get(i).getName(), mcMMOPlayer.getSkillLevel(parentList.get(i))));
parentMessage.append(ChatColor.GRAY).append(", ");
} else {
parentMessage.append(LocaleLoader.getString("Effects.Child.ParentList", parentList.get(i).getLocalizedName(), mcMMOPlayer.getSkillLevel(parentList.get(i))));
parentMessage.append(LocaleLoader.getString("Effects.Child.ParentList", parentList.get(i).getName(), mcMMOPlayer.getSkillLevel(parentList.get(i))));
}
}

View File

@ -18,7 +18,7 @@ public class SkillGuideCommand implements CommandExecutor {
private final String invalidPage = LocaleLoader.getString("Guides.Page.Invalid");
public SkillGuideCommand(PrimarySkillType skill) {
header = LocaleLoader.getString("Guides.Header", skill.getLocalizedName());
header = LocaleLoader.getString("Guides.Header", skill.getName());
guide = getGuide(skill);
}

View File

@ -919,7 +919,7 @@ public final class FlatfileDatabaseManager implements DatabaseManager {
}
int cap = Config.getInstance().getLevelCap(skill);
if (Integer.parseInt(character[index]) > cap) {
mcMMO.p.getLogger().warning("Truncating " + skill.getLocalizedName() + " to configured max level for player " + character[USERNAME]);
mcMMO.p.getLogger().warning("Truncating " + skill.getName() + " to configured max level for player " + character[USERNAME]);
character[index] = cap + "";
updated = true;
}

View File

@ -192,7 +192,7 @@ public class McMMOPlayer implements Identified {
if(hasReachedPowerLevelCap()) {
NotificationManager.sendPlayerInformationChatOnly(player, "LevelCap.PowerLevel", String.valueOf(Config.getInstance().getPowerLevelCap()));
} else if(hasReachedLevelCap(primarySkillType)) {
NotificationManager.sendPlayerInformationChatOnly(player, "LevelCap.Skill", String.valueOf(Config.getInstance().getLevelCap(primarySkillType)), primarySkillType.getLocalizedName());
NotificationManager.sendPlayerInformationChatOnly(player, "LevelCap.Skill", String.valueOf(Config.getInstance().getLevelCap(primarySkillType)), primarySkillType.getName());
}
//Updates from Party sources
@ -827,7 +827,7 @@ public class McMMOPlayer implements Identified {
int diff = RankUtils.getSuperAbilityUnlockRequirement(skill.getAbility()) - getSkillLevel(skill);
//Inform the player they are not yet skilled enough
NotificationManager.sendPlayerInformation(player, NotificationType.ABILITY_COOLDOWN, "Skills.AbilityGateRequirementFail", String.valueOf(diff), skill.getLocalizedName());
NotificationManager.sendPlayerInformation(player, NotificationType.ABILITY_COOLDOWN, "Skills.AbilityGateRequirementFail", String.valueOf(diff), skill.getName());
return;
}
@ -983,7 +983,7 @@ public class McMMOPlayer implements Identified {
String allCDStr = aSuperAbilityCD + ", " + bSuperAbilityCD;
NotificationManager.sendPlayerInformation(player, NotificationType.TOOL, "Skills.TooTired.Extra",
primarySkillType.getLocalizedName(),
primarySkillType.getName(),
allCDStr);
}

View File

@ -99,7 +99,7 @@ public enum PrimarySkillType {
subSkillNames.add(subSkillType.getNiceNameNoSpaces(subSkillType));
}
names.add(skill.getLocalizedName());
names.add(skill.getName());
}
Collections.sort(names);
@ -234,7 +234,7 @@ public enum PrimarySkillType {
return null;
}
public String getLocalizedName() {
public String getName() {
return StringUtils.getCapitalized(LocaleLoader.getString(StringUtils.getCapitalized(this.toString()) + ".SkillName"));
}

View File

@ -937,7 +937,7 @@ public class PlayerListener implements Listener {
// Do these ACTUALLY have to be lower case to work properly?
for (PrimarySkillType skill : PrimarySkillType.values()) {
String skillName = skill.toString().toLowerCase(Locale.ENGLISH);
String localizedName = skill.getLocalizedName().toLowerCase(Locale.ENGLISH);
String localizedName = skill.getName().toLowerCase(Locale.ENGLISH);
if (lowerCaseCommand.equals(localizedName)) {
event.setMessage(message.replace(command, skillName));

View File

@ -53,7 +53,7 @@ public class McrankCommandDisplayTask extends BukkitRunnable {
// }
rank = skills.get(skill);
sender.sendMessage(LocaleLoader.getString("Commands.mcrank.Skill", skill.getLocalizedName(), (rank == null ? LocaleLoader.getString("Commands.mcrank.Unranked") : rank)));
sender.sendMessage(LocaleLoader.getString("Commands.mcrank.Skill", skill.getName(), (rank == null ? LocaleLoader.getString("Commands.mcrank.Unranked") : rank)));
}
rank = skills.get(null);

View File

@ -61,10 +61,10 @@ public class MctopCommandDisplayTask extends BukkitRunnable {
}
else {
if(sender instanceof Player) {
sender.sendMessage(LocaleLoader.getString("Commands.Skill.Leaderboard", skill.getLocalizedName()));
sender.sendMessage(LocaleLoader.getString("Commands.Skill.Leaderboard", skill.getName()));
}
else {
sender.sendMessage(ChatColor.stripColor(LocaleLoader.getString("Commands.Skill.Leaderboard", skill.getLocalizedName())));
sender.sendMessage(ChatColor.stripColor(LocaleLoader.getString("Commands.Skill.Leaderboard", skill.getName())));
}
}

View File

@ -37,7 +37,7 @@ public final class CommandRegistrationManager {
private static void registerSkillCommands() {
for (PrimarySkillType skill : PrimarySkillType.values()) {
String commandName = skill.toString().toLowerCase(Locale.ENGLISH);
String localizedName = skill.getLocalizedName().toLowerCase(Locale.ENGLISH);
String localizedName = skill.getName().toLowerCase(Locale.ENGLISH);
PluginCommand command;

View File

@ -149,7 +149,7 @@ public class ExperienceBarManager {
private void informPlayer(@NotNull ExperienceBarManager.@NotNull XPBarSettingTarget settingTarget, @Nullable PrimarySkillType skillType) {
//Inform player of setting change
if(settingTarget != XPBarSettingTarget.RESET) {
NotificationManager.sendPlayerInformationChatOnlyPrefixed(mcMMOPlayer.getPlayer(), "Commands.XPBar.SettingChanged", skillType.getLocalizedName(), settingTarget.toString());
NotificationManager.sendPlayerInformationChatOnlyPrefixed(mcMMOPlayer.getPlayer(), "Commands.XPBar.SettingChanged", skillType.getName(), settingTarget.toString());
} else {
NotificationManager.sendPlayerInformationChatOnlyPrefixed(mcMMOPlayer.getPlayer(), "Commands.XPBar.Reset");
}

View File

@ -93,7 +93,7 @@ public class ScoreboardManager {
int i = 0;
for (PrimarySkillType type : PrimarySkillType.values()) {
// Include child skills
skillLabelBuilder.put(type, getShortenedName(colors.get(i) + type.getLocalizedName(), false));
skillLabelBuilder.put(type, getShortenedName(colors.get(i) + type.getName(), false));
if (type.getAbility() != null) {
abilityLabelBuilder.put(type.getAbility(), getShortenedName(colors.get(i) + type.getAbility().getLocalizedName()));
@ -115,7 +115,7 @@ public class ScoreboardManager {
else {
for (PrimarySkillType type : PrimarySkillType.values()) {
// Include child skills
skillLabelBuilder.put(type, getShortenedName(ChatColor.GREEN + type.getLocalizedName()));
skillLabelBuilder.put(type, getShortenedName(ChatColor.GREEN + type.getName()));
if (type.getAbility() != null) {
abilityLabelBuilder.put(type.getAbility(), formatAbility(type.getAbility().getLocalizedName()));