Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions commons/src/main/java/net/swofty/commons/StringUtility.java
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,4 @@ public static String ntify(int i) {
};
};
}

public static String getFormatedStatistic(ItemStatistic statistic) {
return statistic.getDisplayColor() + statistic.getSymbol() + " " + statistic.getDisplayName();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,8 @@ public int getTotalExtraXPPercentage(int tier) {

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

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

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

int totalXp = getExtraXpPercentage(tier);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ public class EnchantmentCritical implements Ench, EnchFromTable {

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

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class EnchantmentGrowth implements Ench, EnchFromTable {

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

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ public void run(BestiaryUpdateEvent event) {
lines.add(transitionLine);
lines.add("");
lines.add("§6§lREWARDS");
lines.add("§8+§a" + magicFind + " " + mobName + " " + StringUtility.getFormatedStatistic(ItemStatistic.MAGIC_FIND));
lines.add("§8+§a" + strength + " " + mobName + " " + StringUtility.getFormatedStatistic(ItemStatistic.STRENGTH));
lines.add("§8+§a" + magicFind + " " + mobName + " " + ItemStatistic.MAGIC_FIND.getFullDisplayName());
lines.add("§8+§a" + strength + " " + mobName + " " + ItemStatistic.STRENGTH.getFullDisplayName());
lines.add("§8+§6" + coinBonus + "% §a" + mobName + " §7coins");
lines.add("§8+§a" + xpBonus + "% §7chance for extra XP orbs");
lines.add("§8+§b1 SkyBlock XP");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ public void run(SkillUpdateEvent event) {
case STATS_BASE -> {
ItemStatistic statistic = ((SkillCategory.BaseStatisticReward) unlock).getStatistic();
player.sendMessage(" §8+§a" + StringUtility.decimalify(((SkillCategory.BaseStatisticReward) unlock).amountAdded(), 1)
+ statistic.getSuffix() + " " + statistic.getDisplayColor() + statistic.getSymbol() + " " + statistic.getDisplayName());
+ statistic.getSuffix() + " " + statistic.getFullDisplayName());
}
case STATS_ADDITIVE_PERCENTAGE -> {
ItemStatistic statistic = ((SkillCategory.AdditivePercentageStatisticReward) unlock).getStatistic();
player.sendMessage(" §8+§a" + StringUtility.decimalify(((SkillCategory.AdditivePercentageStatisticReward) unlock).amountAdded(), 1) +
"% " + statistic.getDisplayColor() + statistic.getSymbol() + " " + statistic.getDisplayName());
"% " + statistic.getFullDisplayName());
}
case REGION_ACCESS ->
player.sendMessage(" §8+§aAccess to " + ((SkillCategory.RegionReward) unlock).getRegion());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ public List<String> buildLore(SkyBlockPlayer player) {

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

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

statistics.allStatistics().getOverall().forEach((statistic, value) -> {
if (stats.contains(statistic)) {
lore.add(" " + StringUtility.getFormatedStatistic(statistic) + " §f" +
lore.add(" " + statistic.getFullDisplayName() + " §f" +
StringUtility.decimalify(value, 2) + statistic.getSuffix());
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ public List<String> buildLore(SkyBlockPlayer player) {

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

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

statistics.allStatistics().getOverall().forEach((statistic, value) -> {
if (stats.contains(statistic)) {
lore.add(" " + StringUtility.getFormatedStatistic(statistic) + " §f" +
lore.add(" " + statistic.getFullDisplayName() + " §f" +
StringUtility.decimalify(value, 2) + statistic.getSuffix());
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public List<String> buildLore(SkyBlockPlayer player) {

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

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

statistics.allStatistics().getOverall().forEach((statistic, value) -> {
if (stats.contains(statistic)) {
lore.add(" " + StringUtility.getFormatedStatistic(statistic) + " §f" +
lore.add(" " + statistic.getFullDisplayName() + " §f" +
StringUtility.decimalify(value, 2) + statistic.getSuffix());
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public ItemStack.Builder getItem(HypixelPlayer p) {
)); // WISDOM STATS
statistics.allStatistics().getOverall().forEach((statistic, value) -> {
if (stats.contains(statistic)) {
lore.add(" " + StringUtility.getFormatedStatistic(statistic) + " §f" +
lore.add(" " + statistic.getFullDisplayName() + " §f" +
StringUtility.decimalify(value, 2) + statistic.getSuffix());
}
});
Expand Down Expand Up @@ -95,7 +95,7 @@ public ItemStack.Builder getItem(HypixelPlayer p) {

if (value == 0D) lore.add("§8You have none of this stat!");
lore.add("§eClick to view!");
return ItemStackCreator.getStack(StringUtility.getFormatedStatistic(statistic) + " §f" +
return ItemStackCreator.getStack(statistic.getFullDisplayName() + " §f" +
StringUtility.decimalify(value, 1),
Material.WRITABLE_BOOK, 1, lore
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public ItemStack.Builder getItemDisplay(SkyBlockPlayer player, int level) {
List<String> statisticsDisplay = new ArrayList<>();
statistics.getStatisticsAdditive().forEach((key, value) -> {
if (value > 0)
statisticsDisplay.add("§8 +§a" + value + key.getSuffix() + " " + key.getDisplayColor() + key.getSymbol() + " " + key.getDisplayName());
statisticsDisplay.add("§8 +§a" + value + key.getSuffix() + " " + key.getFullDisplayName());
});

if (statisticsDisplay.isEmpty()) {
Expand All @@ -50,7 +50,7 @@ public List<String> getDisplay(SkyBlockPlayer player, int level) {
ArrayList<String> lore = new ArrayList<>();
statistics.getStatisticsAdditive().forEach((key, value) -> {
if (value > 0)
lore.add("§8 +§a" + value + key.getSuffix() + " " + key.getDisplayColor() + key.getSymbol() + " " + key.getDisplayName());
lore.add("§8 +§a" + value + key.getSuffix() + " " + key.getFullDisplayName());
});
return lore;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,12 @@ public List<String> getDisplay(List<String> lore) {
case STATS_BASE -> {
ItemStatistic statistic = ((BaseStatisticReward) unlock).getStatistic();
lore.add("§7 §8+§a" + StringUtility.decimalify(((BaseStatisticReward) unlock).amountAdded(), 1) +
statistic.getSuffix() + " " + statistic.getDisplayColor() + statistic.getSymbol() + " " +
statistic.getDisplayName());
statistic.getSuffix() + " " + statistic.getFullDisplayName());
}
case STATS_ADDITIVE_PERCENTAGE -> {
ItemStatistic statistic = ((AdditivePercentageStatisticReward) unlock).getStatistic();
lore.add("§7 §8+§a" + StringUtility.decimalify(((AdditivePercentageStatisticReward) unlock).amountAdded() * 100, 1) +
"% " + statistic.getDisplayColor() + statistic.getSymbol() + " " + statistic.getDisplayName());
"% " + statistic.getFullDisplayName());
}
case RUNE -> lore.add("§7 Access to Level §d" + ((RuneReward) unlock).getRuneLevel() + " §7Runes");
}
Expand Down