Optimized our String/number conversions a bit. Also moved all

String-related util functions from Misc.java to StringUtils.java
This commit is contained in:
GJ
2013-02-13 11:45:48 -05:00
parent b1db0d037d
commit 2ad73e9b2c
26 changed files with 325 additions and 325 deletions

View File

@ -25,7 +25,7 @@ import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.skills.utilities.SkillTools;
import com.gmail.nossr50.skills.utilities.SkillType;
import com.gmail.nossr50.util.Misc;
import com.gmail.nossr50.util.StringUtils;
import com.gmail.nossr50.util.Users;
public class SpoutTools {
@ -147,8 +147,8 @@ public class SpoutTools {
}
String skillTypeString = skillType.toString();
String standardFileName = Misc.getCapitalized(skillTypeString)+".png";
String retroFileName = Misc.getCapitalized(skillTypeString)+"_r.png";
String standardFileName = StringUtils.getCapitalized(skillTypeString)+".png";
String retroFileName = StringUtils.getCapitalized(skillTypeString)+"_r.png";
writeFile(standardFileName, hudStandardDirectory);
writeFile(retroFileName, hudRetroDirectory);
@ -210,8 +210,8 @@ public class SpoutTools {
String skillTypeString = skillType.toString();
files.add(new File(hudStandardDirectory + Misc.getCapitalized(skillTypeString) + ".png"));
files.add(new File(hudRetroDirectory + Misc.getCapitalized(skillTypeString) + "_r.png"));
files.add(new File(hudStandardDirectory + StringUtils.getCapitalized(skillTypeString) + ".png"));
files.add(new File(hudRetroDirectory + StringUtils.getCapitalized(skillTypeString) + "_r.png"));
}
// Blank icons

View File

@ -6,8 +6,8 @@ import org.bukkit.command.CommandSender;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.skills.utilities.SkillTools;
import com.gmail.nossr50.skills.utilities.SkillType;
import com.gmail.nossr50.util.Misc;
import com.gmail.nossr50.util.Permissions;
import com.gmail.nossr50.util.StringUtils;
public class XplockCommand extends SpoutCommand {
@Override
@ -52,7 +52,7 @@ public class XplockCommand extends SpoutCommand {
spoutHud.setXpBarLocked(true);
spoutHud.setSkillLock(skill);
spoutHud.updateXpBar();
sender.sendMessage(LocaleLoader.getString("Commands.xplock.locked", Misc.getCapitalized(skill.toString())));
sender.sendMessage(LocaleLoader.getString("Commands.xplock.locked", StringUtils.getCapitalized(skill.toString())));
}
}

View File

@ -13,7 +13,7 @@ import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.skills.utilities.SkillType;
import com.gmail.nossr50.spout.SpoutConfig;
import com.gmail.nossr50.spout.huds.HudType;
import com.gmail.nossr50.util.Misc;
import com.gmail.nossr50.util.StringUtils;
public class XpBar {
private SpoutPlayer spoutPlayer;
@ -204,7 +204,7 @@ public class XpBar {
* @param playerProfile The profile of the player whose XP bar should be updated
*/
private void updateXpBarStandard(SkillType skillType, PlayerProfile playerProfile) {
xpIcon.setUrl(Misc.getCapitalized(skillType.toString()) + ".png");
xpIcon.setUrl(StringUtils.getCapitalized(skillType.toString()) + ".png");
((GenericTexture) xpBar).setUrl(getUrlBar(getXpInc(playerProfile.getSkillXpLevel(skillType), playerProfile.getXpToLevel(skillType), HudType.STANDARD)));
@ -220,7 +220,7 @@ public class XpBar {
private void updateXpBarRetro(SkillType skillType, PlayerProfile playerProfile) {
Color color = getRetroColor(skillType);
xpIcon.setUrl(Misc.getCapitalized(skillType.toString()) + "_r.png");
xpIcon.setUrl(StringUtils.getCapitalized(skillType.toString()) + "_r.png");
xpFill.setBottomColor(color);
xpFill.setTopColor(color);