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
6 changes: 3 additions & 3 deletions src/main/java/fr/openmc/core/features/city/City.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import fr.openmc.core.features.city.sub.war.War;
import fr.openmc.core.features.city.sub.war.WarManager;
import fr.openmc.core.utils.cache.CacheOfflinePlayer;
import fr.openmc.core.utils.cache.PlayerNameCache;
import fr.openmc.core.utils.cache.CachePlayerName;
import fr.openmc.core.utils.text.DateUtils;
import fr.openmc.core.utils.text.messages.MessageType;
import fr.openmc.core.utils.text.messages.MessagesManager;
Expand Down Expand Up @@ -805,7 +805,7 @@ public void changeRank(Player sender, UUID playerUUID, DBCityRank newRank) {
MessagesManager.sendMessage(sender,
TranslationManager.translation("feature.city.grade.remove_grade",
Component.text(currentRank.getName()).color(NamedTextColor.YELLOW),
PlayerNameCache.name(playerUUID).color(NamedTextColor.GOLD)),
CachePlayerName.name(playerUUID).color(NamedTextColor.GOLD)),
Prefix.CITY, MessageType.SUCCESS, true);
}

Expand All @@ -817,7 +817,7 @@ public void changeRank(Player sender, UUID playerUUID, DBCityRank newRank) {
MessagesManager.sendMessage(sender,
TranslationManager.translation("feature.city.grade.assign_grade",
Component.text(newRank.getName()).color(NamedTextColor.YELLOW),
PlayerNameCache.name(playerUUID).color(NamedTextColor.GOLD)
CachePlayerName.name(playerUUID).color(NamedTextColor.GOLD)
),
Prefix.CITY, MessageType.SUCCESS, true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import fr.openmc.core.features.city.City;
import fr.openmc.core.features.city.CityManager;
import fr.openmc.core.features.city.conditions.CityKickCondition;
import fr.openmc.core.utils.cache.PlayerNameCache;
import fr.openmc.core.utils.cache.CachePlayerName;
import fr.openmc.core.utils.text.messages.MessageType;
import fr.openmc.core.utils.text.messages.MessagesManager;
import fr.openmc.core.utils.text.messages.Prefix;
Expand All @@ -25,7 +25,7 @@ public static void startKick(Player sender, OfflinePlayer playerKick) {
MessagesManager.sendMessage(sender,
TranslationManager.translation(
"feature.city.kick.success",
PlayerNameCache.name(playerKick.getUniqueId()),
CachePlayerName.name(playerKick.getUniqueId()),
Component.text(city.getName())
),
Prefix.CITY,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import fr.openmc.core.features.city.commands.autocomplete.CityPermissionsAutoComplete;
import fr.openmc.core.features.city.conditions.CityPermsConditions;
import fr.openmc.core.features.city.menu.CityPermsMenu;
import fr.openmc.core.utils.cache.PlayerNameCache;
import fr.openmc.core.utils.cache.CachePlayerName;
import fr.openmc.core.utils.text.messages.MessageType;
import fr.openmc.core.utils.text.messages.MessagesManager;
import fr.openmc.core.utils.text.messages.Prefix;
Expand Down Expand Up @@ -43,14 +43,14 @@ public static void swap(Player sender, @SuggestWith(CityMembersAutoComplete.clas
city.removePermission(player.getUniqueId(), permission);
MessagesManager.sendMessage(sender, TranslationManager.translation(
"feature.city.perms.commands.switch.removed",
PlayerNameCache.name(player.getUniqueId()),
CachePlayerName.name(player.getUniqueId()),
Component.text(permission.toString())
), Prefix.CITY, MessageType.SUCCESS, false);
} else {
city.addPermission(player.getUniqueId(), permission);
MessagesManager.sendMessage(sender, TranslationManager.translation(
"feature.city.perms.commands.switch.added",
PlayerNameCache.name(player.getUniqueId()),
CachePlayerName.name(player.getUniqueId()),
permission.getDisplayName()
), Prefix.CITY, MessageType.SUCCESS, false);
}
Expand Down Expand Up @@ -82,15 +82,15 @@ void add(
if (city.hasPermission(player.getUniqueId(), permission)) {
MessagesManager.sendMessage(sender, TranslationManager.translation(
"feature.city.perms.commands.add.already_has",
PlayerNameCache.name(player.getUniqueId())
CachePlayerName.name(player.getUniqueId())
), Prefix.CITY, MessageType.ERROR, false);
return;
}

city.addPermission(player.getUniqueId(), permission);
MessagesManager.sendMessage(sender, TranslationManager.translation(
"feature.city.perms.commands.modified",
PlayerNameCache.name(player.getUniqueId())
CachePlayerName.name(player.getUniqueId())
), Prefix.CITY, MessageType.SUCCESS, false);
}

Expand Down Expand Up @@ -120,15 +120,15 @@ void remove(
if (!city.hasPermission(player.getUniqueId(), permission)) {
MessagesManager.sendMessage(sender, TranslationManager.translation(
"feature.city.perms.commands.remove.does_not_have",
PlayerNameCache.name(player.getUniqueId())
CachePlayerName.name(player.getUniqueId())
), Prefix.CITY, MessageType.ERROR, false);
return;
}

city.removePermission(player.getUniqueId(), permission);
MessagesManager.sendMessage(sender, TranslationManager.translation(
"feature.city.perms.commands.modified",
PlayerNameCache.name(player.getUniqueId())
CachePlayerName.name(player.getUniqueId())
), Prefix.CITY, MessageType.SUCCESS, false);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import fr.openmc.core.features.economy.EconomyManager;
import fr.openmc.core.features.leaderboards.LeaderboardManager;
import fr.openmc.core.utils.bukkit.SkullUtils;
import fr.openmc.core.utils.cache.PlayerNameCache;
import fr.openmc.core.utils.cache.CachePlayerName;
import fr.openmc.core.utils.text.messages.TranslationManager;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.format.NamedTextColor;
Expand Down Expand Up @@ -85,7 +85,7 @@ public List<ItemStack> getItems() {
if (ownerUUID != null) {
List<Component> cityLore = new ArrayList<>();

Component ownerComponent = PlayerNameCache.name(ownerUUID).color(NamedTextColor.GRAY);
Component ownerComponent = CachePlayerName.name(ownerUUID).color(NamedTextColor.GRAY);
Component levelComponent = Component.text(city.getLevel()).color(NamedTextColor.DARK_AQUA);
Component membersCurrent = Component.text(city.getMembers().size()).color(NamedTextColor.GREEN);
Component membersLimit = Component.text(MemberLimitRewards.getMemberLimit(city.getLevel())).color(NamedTextColor.GREEN);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import fr.openmc.core.features.city.sub.milestone.rewards.MemberLimitRewards;
import fr.openmc.core.features.economy.EconomyManager;
import fr.openmc.core.utils.bukkit.SkullUtils;
import fr.openmc.core.utils.cache.PlayerNameCache;
import fr.openmc.core.utils.cache.CachePlayerName;
import fr.openmc.core.utils.text.messages.TranslationManager;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.format.NamedTextColor;
Expand Down Expand Up @@ -106,7 +106,7 @@ public void onInventoryClick(InventoryClickEvent inventoryClickEvent) {
itemMeta -> {
itemMeta.displayName(TranslationManager.translation(
"feature.city.menus.list.details.owner",
PlayerNameCache.name(ownerUUID).color(NamedTextColor.GRAY)
CachePlayerName.name(ownerUUID).color(NamedTextColor.GRAY)
));
itemMeta.lore(loreOwner);
}).hide(ItemUtils.getDataComponentType())
Expand Down Expand Up @@ -140,7 +140,7 @@ public void onInventoryClick(InventoryClickEvent inventoryClickEvent) {
map.put(13, new ItemMenuBuilder(this, SkullUtils.getPlayerSkull(this.city.getPlayerWithPermission(CityPermission.OWNER)),
itemMeta -> itemMeta.displayName(TranslationManager.translation(
"feature.city.menus.list.details.owner",
PlayerNameCache.name(this.city.getPlayerWithPermission(CityPermission.OWNER)).color(NamedTextColor.GRAY)
CachePlayerName.name(this.city.getPlayerWithPermission(CityPermission.OWNER)).color(NamedTextColor.GRAY)
)))
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import fr.openmc.core.features.city.sub.milestone.rewards.MemberLimitRewards;
import fr.openmc.core.features.economy.EconomyManager;
import fr.openmc.core.utils.bukkit.SkullUtils;
import fr.openmc.core.utils.cache.PlayerNameCache;
import fr.openmc.core.utils.cache.CachePlayerName;
import fr.openmc.core.utils.text.messages.TranslationManager;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.format.NamedTextColor;
Expand Down Expand Up @@ -81,7 +81,7 @@ public List<ItemStack> getItems() {

List<Component> cityLore = new ArrayList<>();

Component ownerComponent = PlayerNameCache.name(ownerUUID).color(NamedTextColor.GRAY);
Component ownerComponent = CachePlayerName.name(ownerUUID).color(NamedTextColor.GRAY);
Component levelComponent = Component.text(city.getLevel()).color(NamedTextColor.DARK_AQUA);
Component membersCurrent = Component.text(city.getMembers().size()).color(NamedTextColor.GREEN);
Component membersLimit = Component.text(MemberLimitRewards.getMemberLimit(city.getLevel())).color(NamedTextColor.GREEN);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import fr.openmc.core.features.city.conditions.CityChestConditions;
import fr.openmc.core.features.city.menu.CityChestMenu;
import fr.openmc.core.features.city.sub.milestone.rewards.FeaturesRewards;
import fr.openmc.core.utils.cache.PlayerNameCache;
import fr.openmc.core.utils.cache.CachePlayerName;
import fr.openmc.core.utils.text.messages.TranslationManager;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.format.NamedTextColor;
Expand Down Expand Up @@ -53,7 +53,7 @@ private static List<Component> getDynamicLore(City city, Player player) {
if (city.getChestWatcher() != null) {
lore = TranslationManager.translationLore(
"feature.city.menus.main.chest.lore.opened",
Component.text(PlayerNameCache.getName(city.getChestWatcher())).color(NamedTextColor.RED)
Component.text(CachePlayerName.getName(city.getChestWatcher())).color(NamedTextColor.RED)
);
} else {
lore = TranslationManager.translationLore("feature.city.menus.main.chest.lore.click");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import fr.openmc.core.features.city.CityPermission;
import fr.openmc.core.features.city.menu.CityModifyMenu;
import fr.openmc.core.features.city.sub.milestone.rewards.MemberLimitRewards;
import fr.openmc.core.utils.cache.PlayerNameCache;
import fr.openmc.core.utils.cache.CachePlayerName;
import fr.openmc.core.utils.text.messages.MessageType;
import fr.openmc.core.utils.text.messages.MessagesManager;
import fr.openmc.core.utils.text.messages.Prefix;
Expand Down Expand Up @@ -62,15 +62,15 @@ private static List<Component> getDynamicLore(City city, Player player) {
if (hasPermissionRenameCity || hasPermissionOwner) {
lore = TranslationManager.translationLore(
"feature.city.menus.main.manage.lore.edit",
PlayerNameCache.name(ownerUUID).color(NamedTextColor.GRAY),
CachePlayerName.name(ownerUUID).color(NamedTextColor.GRAY),
mayorName.color(mayorColor).decoration(TextDecoration.ITALIC, false),
Component.text(city.getMembers().size()).color(NamedTextColor.LIGHT_PURPLE),
Component.text(MemberLimitRewards.getMemberLimit(city.getLevel())).color(NamedTextColor.LIGHT_PURPLE)
);
} else {
lore = TranslationManager.translationLore(
"feature.city.menus.main.manage.lore.view",
PlayerNameCache.name(ownerUUID).color(NamedTextColor.GRAY),
CachePlayerName.name(ownerUUID).color(NamedTextColor.GRAY),
mayorName.color(mayorColor).decoration(TextDecoration.ITALIC, false),
Component.text(city.getMembers().size()).color(NamedTextColor.LIGHT_PURPLE),
Component.text(MemberLimitRewards.getMemberLimit(city.getLevel())).color(NamedTextColor.LIGHT_PURPLE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import fr.openmc.core.features.city.conditions.CityKickCondition;
import fr.openmc.core.features.city.menu.CityPermsMenu;
import fr.openmc.core.utils.bukkit.SkullUtils;
import fr.openmc.core.utils.cache.PlayerNameCache;
import fr.openmc.core.utils.cache.CachePlayerName;
import fr.openmc.core.utils.text.messages.TranslationManager;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.format.NamedTextColor;
Expand Down Expand Up @@ -76,7 +76,7 @@ public void onInventoryClick(InventoryClickEvent click) {
} else {
loreKick = TranslationManager.translationLore(
"feature.city.menus.members.manage.kick.info",
PlayerNameCache.name(playerTarget.getUniqueId()).color(NamedTextColor.GRAY)
CachePlayerName.name(playerTarget.getUniqueId()).color(NamedTextColor.GRAY)
);
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import fr.openmc.core.features.city.sub.war.menu.MoreInfoMenu;
import fr.openmc.core.features.economy.EconomyManager;
import fr.openmc.core.utils.bukkit.SkullUtils;
import fr.openmc.core.utils.cache.PlayerNameCache;
import fr.openmc.core.utils.cache.CachePlayerName;
import fr.openmc.core.utils.text.messages.TranslationManager;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.format.NamedTextColor;
Expand Down Expand Up @@ -95,7 +95,7 @@ public List<ItemStack> getItems() {
Component.empty(),
TranslationManager.translation(
"feature.city.war.menu.main.owner",
Component.text(PlainTextComponentSerializer.plainText().serialize(PlayerNameCache.name(player.getUniqueId())))
Component.text(PlainTextComponentSerializer.plainText().serialize(CachePlayerName.name(player.getUniqueId())))
.color(NamedTextColor.LIGHT_PURPLE)
).color(NamedTextColor.GRAY),
TranslationManager.translation(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import fr.openmc.core.registry.loottable.loots.MoneyLoot;
import fr.openmc.core.registry.mobs.CustomMob;
import fr.openmc.core.utils.cache.CacheOfflinePlayer;
import fr.openmc.core.utils.cache.PlayerNameCache;
import fr.openmc.core.utils.cache.CachePlayerName;
import fr.openmc.core.utils.text.messages.TranslationManager;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.event.ClickEvent;
Expand Down Expand Up @@ -69,7 +69,7 @@ public static void giveContributions(CustomMob<?> mob) {
broadcastToWorld(world, TranslationManager.translation(
"feature.dailyevents.bloody_night.vampire_boss.defeated.rank",
Component.text("#"+ (rankInt + 1), LeaderboardManager.getRankColor(rankInt + 1)),
PlayerNameCache.name(entry.getKey()).color(NamedTextColor.GOLD),
CachePlayerName.name(entry.getKey()).color(NamedTextColor.GOLD),
Component.text(String.format("%.1f", entry.getValue()), NamedTextColor.RED)
));
}
Expand All @@ -82,7 +82,7 @@ public static void giveContributions(CustomMob<?> mob) {
player.sendMessage(TranslationManager.translation(
"feature.dailyevents.bloody_night.vampire_boss.defeated.midle",
Component.text((rankInt + 1), LeaderboardManager.getRankColor(rankInt + 1)),
PlayerNameCache.name(entry.getKey()).color(NamedTextColor.GOLD),
CachePlayerName.name(entry.getKey()).color(NamedTextColor.GOLD),
Component.text(String.format("%.1f", entry.getValue()), NamedTextColor.RED)
));
}
Expand Down
Loading
Loading