Skip to content

Commit 7d359bc

Browse files
committed
getFullDisplayName() use
1 parent 9b0d0ae commit 7d359bc

12 files changed

Lines changed: 22 additions & 29 deletions

File tree

commons/src/main/java/net/swofty/commons/StringUtility.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -298,9 +298,4 @@ public static String ntify(int i) {
298298
};
299299
};
300300
}
301-
302-
public static String getFormatedStatistic(ItemStatistic statistic) {
303-
return statistic.getDisplayColor() + statistic.getSymbol() + " " + statistic.getDisplayName();
304-
}
305-
306301
}

type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/bestiary/BestiaryData.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,8 @@ public int getTotalExtraXPPercentage(int tier) {
215215

216216
public List<String> getTotalBonuses(List<String> lore, String name, int tier) {
217217
lore.add("§a" + name + " §aBonuses");
218-
lore.add("§8+" + ItemStatistic.MAGIC_FIND.getDisplayColor() + getTotalMagicFind(tier) + " " + StringUtility.getFormatedStatistic(ItemStatistic.MAGIC_FIND));
219-
lore.add("§8+" + ItemStatistic.STRENGTH.getDisplayColor() + getTotalStrength(tier) + " " + StringUtility.getFormatedStatistic(ItemStatistic.STRENGTH));
218+
lore.add("§8+" + ItemStatistic.MAGIC_FIND.getDisplayColor() + getTotalMagicFind(tier) + " " + ItemStatistic.MAGIC_FIND.getFullDisplayName());
219+
lore.add("§8+" + ItemStatistic.STRENGTH.getDisplayColor() + getTotalStrength(tier) + " " + ItemStatistic.STRENGTH.getFullDisplayName());
220220
lore.add("§8+§6" + getTotalExtraCoinPercentage(tier) + "% §7coin gain");
221221

222222
int totalXp = getTotalExtraXPPercentage(tier);
@@ -231,8 +231,8 @@ public List<String> getTotalBonuses(List<String> lore, String name, int tier) {
231231

232232
public List<String> getNextBonuses(List<String> lore, String name, int tier) {
233233
lore.add("§7Tier " + StringUtility.getAsRomanNumeral(tier) + " Rewards");
234-
lore.add(" §8+" + ItemStatistic.MAGIC_FIND.getDisplayColor() + getMagicFind(tier) + " " + StringUtility.getFormatedStatistic(ItemStatistic.MAGIC_FIND));
235-
lore.add(" §8+" + ItemStatistic.STRENGTH.getDisplayColor() + getStrength(tier) + " " + StringUtility.getFormatedStatistic(ItemStatistic.STRENGTH));
234+
lore.add(" §8+" + ItemStatistic.MAGIC_FIND.getDisplayColor() + getMagicFind(tier) + " " + ItemStatistic.MAGIC_FIND.getFullDisplayName());
235+
lore.add(" §8+" + ItemStatistic.STRENGTH.getDisplayColor() + getStrength(tier) + " " + ItemStatistic.STRENGTH.getFullDisplayName());
236236
lore.add(" §8+§6" + getExtraCoinPercentage(tier) + "% §7coin gain");
237237

238238
int totalXp = getExtraXpPercentage(tier);

type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/enchantment/impl/EnchantmentCritical.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ public class EnchantmentCritical implements Ench, EnchFromTable {
1919

2020
@Override
2121
public String getDescription(int level) {
22-
return "Increases " + ItemStatistic.CRITICAL_DAMAGE.getDisplayColor() + ItemStatistic.CRITICAL_DAMAGE.getSymbol() + " "
23-
+ ItemStatistic.CRITICAL_DAMAGE.getDisplayName() + " §7by §a" + MULTIPLIERS[level - 1] + "%§7.";
22+
return "Increases " + ItemStatistic.CRITICAL_DAMAGE.getFullDisplayName() + " §7by §a" + MULTIPLIERS[level - 1] + "%§7.";
2423
}
2524

2625
@Override

type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/enchantment/impl/EnchantmentGrowth.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class EnchantmentGrowth implements Ench, EnchFromTable {
1818

1919
@Override
2020
public String getDescription(int level) {
21-
return "Grants §a+" + MULTIPLIERS[level - 1] + ItemStatistic.HEALTH.getDisplayColor() + ItemStatistic.HEALTH.getSymbol() + " " + ItemStatistic.HEALTH.getDisplayName();
21+
return "Grants §a+" + MULTIPLIERS[level - 1] + ItemStatistic.HEALTH.getFullDisplayName();
2222
}
2323

2424
@Override

type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/event/actions/custom/bestiary/ActionBestiaryLevelUp.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ public void run(BestiaryUpdateEvent event) {
5353
lines.add(transitionLine);
5454
lines.add("");
5555
lines.add("§6§lREWARDS");
56-
lines.add("§8+§a" + magicFind + " " + mobName + " " + StringUtility.getFormatedStatistic(ItemStatistic.MAGIC_FIND));
57-
lines.add("§8+§a" + strength + " " + mobName + " " + StringUtility.getFormatedStatistic(ItemStatistic.STRENGTH));
56+
lines.add("§8+§a" + magicFind + " " + mobName + " " + ItemStatistic.MAGIC_FIND.getFullDisplayName());
57+
lines.add("§8+§a" + strength + " " + mobName + " " + ItemStatistic.STRENGTH.getFullDisplayName());
5858
lines.add("§8+§6" + coinBonus + "% §a" + mobName + " §7coins");
5959
lines.add("§8+§a" + xpBonus + "% §7chance for extra XP orbs");
6060
lines.add("§8+§b1 SkyBlock XP");

type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/event/actions/custom/skill/ActionSkillLevelUp.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@ public void run(SkillUpdateEvent event) {
5353
case STATS_BASE -> {
5454
ItemStatistic statistic = ((SkillCategory.BaseStatisticReward) unlock).getStatistic();
5555
player.sendMessage(" §8+§a" + StringUtility.decimalify(((SkillCategory.BaseStatisticReward) unlock).amountAdded(), 1)
56-
+ statistic.getSuffix() + " " + statistic.getDisplayColor() + statistic.getSymbol() + " " + statistic.getDisplayName());
56+
+ statistic.getSuffix() + " " + statistic.getFullDisplayName());
5757
}
5858
case STATS_ADDITIVE_PERCENTAGE -> {
5959
ItemStatistic statistic = ((SkillCategory.AdditivePercentageStatisticReward) unlock).getStatistic();
6060
player.sendMessage(" §8+§a" + StringUtility.decimalify(((SkillCategory.AdditivePercentageStatisticReward) unlock).amountAdded(), 1) +
61-
"% " + statistic.getDisplayColor() + statistic.getSymbol() + " " + statistic.getDisplayName());
61+
"% " + statistic.getFullDisplayName());
6262
}
6363
case REGION_ACCESS ->
6464
player.sendMessage(" §8+§aAccess to " + ((SkillCategory.RegionReward) unlock).getRegion());

type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/gui/inventories/sbmenu/stats/GUICombatStats.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ public List<String> buildLore(SkyBlockPlayer player) {
294294

295295
public ItemStack.Builder buildItemStack(SkyBlockPlayer player) {
296296
double value = player.getStatistics().allStatistics().getOverall(statistic);
297-
String title = StringUtility.getFormatedStatistic(statistic) + " §f" +
297+
String title = statistic.getFullDisplayName() + " §f" +
298298
StringUtility.decimalify(value, 1);
299299
List<String> lore = buildLore(player);
300300

@@ -324,7 +324,7 @@ public ItemStack.Builder getItem(HypixelPlayer p) {
324324

325325
statistics.allStatistics().getOverall().forEach((statistic, value) -> {
326326
if (stats.contains(statistic)) {
327-
lore.add(" " + StringUtility.getFormatedStatistic(statistic) + " §f" +
327+
lore.add(" " + statistic.getFullDisplayName() + " §f" +
328328
StringUtility.decimalify(value, 2) + statistic.getSuffix());
329329
}
330330
});

type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/gui/inventories/sbmenu/stats/GUIGatheringStats.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ public List<String> buildLore(SkyBlockPlayer player) {
485485

486486
public ItemStack.Builder buildItemStack(SkyBlockPlayer player) {
487487
double value = player.getStatistics().allStatistics().getOverall(statistic);
488-
String title = StringUtility.getFormatedStatistic(statistic) + " §f" +
488+
String title = statistic.getFullDisplayName() + " §f" +
489489
StringUtility.decimalify(value, 1);
490490
List<String> lore = buildLore(player);
491491

@@ -519,7 +519,7 @@ public ItemStack.Builder getItem(HypixelPlayer p) {
519519

520520
statistics.allStatistics().getOverall().forEach((statistic, value) -> {
521521
if (stats.contains(statistic)) {
522-
lore.add(" " + StringUtility.getFormatedStatistic(statistic) + " §f" +
522+
lore.add(" " + statistic.getFullDisplayName() + " §f" +
523523
StringUtility.decimalify(value, 2) + statistic.getSuffix());
524524
}
525525
});

type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/gui/inventories/sbmenu/stats/GUIMiscStats.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ public List<String> buildLore(SkyBlockPlayer player) {
173173

174174
public ItemStack.Builder buildItemStack(SkyBlockPlayer player) {
175175
double value = player.getStatistics().allStatistics().getOverall(statistic);
176-
String title = StringUtility.getFormatedStatistic(statistic) + " §f" +
176+
String title = statistic.getFullDisplayName() + " §f" +
177177
StringUtility.decimalify(value, 1);
178178
List<String> lore = buildLore(player);
179179

@@ -206,7 +206,7 @@ public ItemStack.Builder getItem(HypixelPlayer p) {
206206

207207
statistics.allStatistics().getOverall().forEach((statistic, value) -> {
208208
if (stats.contains(statistic)) {
209-
lore.add(" " + StringUtility.getFormatedStatistic(statistic) + " §f" +
209+
lore.add(" " + statistic.getFullDisplayName() + " §f" +
210210
StringUtility.decimalify(value, 2) + statistic.getSuffix());
211211
}
212212
});

type.skyblockgeneric/src/main/java/net/swofty/type/skyblockgeneric/gui/inventories/sbmenu/stats/GUIWisdomStats.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public ItemStack.Builder getItem(HypixelPlayer p) {
6060
)); // WISDOM STATS
6161
statistics.allStatistics().getOverall().forEach((statistic, value) -> {
6262
if (stats.contains(statistic)) {
63-
lore.add(" " + StringUtility.getFormatedStatistic(statistic) + " §f" +
63+
lore.add(" " + statistic.getFullDisplayName() + " §f" +
6464
StringUtility.decimalify(value, 2) + statistic.getSuffix());
6565
}
6666
});
@@ -95,7 +95,7 @@ public ItemStack.Builder getItem(HypixelPlayer p) {
9595

9696
if (value == 0D) lore.add("§8You have none of this stat!");
9797
lore.add("§eClick to view!");
98-
return ItemStackCreator.getStack(StringUtility.getFormatedStatistic(statistic) + " §f" +
98+
return ItemStackCreator.getStack(statistic.getFullDisplayName() + " §f" +
9999
StringUtility.decimalify(value, 1),
100100
Material.WRITABLE_BOOK, 1, lore
101101
);

0 commit comments

Comments
 (0)