From c0c300a7078ca373e0351d67ed148886bd51d152 Mon Sep 17 00:00:00 2001 From: Skullian <133133667+Skullians@users.noreply.github.com> Date: Sat, 28 Dec 2024 22:48:23 +0000 Subject: [PATCH] Fix: config, GUI textures, PDC [desc] 1. Config. ChatGPT screwed me over and broke the enum for Messages. 2. ChatGPT ALSO screwed me over by making variables have hyphens rather than underscores, resulting in broken replacements. Plus I accidentally messed up the material and texture checking in GUIAPI#create. 3. PDC - I use the CustomBlockData system which does NOT play nicely when it is used within paper's classloader and uses the legacy string namespace rather than a JavaPlugin instance. Before I WAS using the string namespace and I eventually discovered that CustomBlockData does NOT like it, so I deferred back to supplying the plugin instance in PaperSharedConstants#from. The plugin_namespace can still remain in the common SharedConstants class for future platforms that may work differently, although for Fabric (planned) we will either have to use NBT (https://wiki.fabricmc.net/tutorial:persistent_states) or Custom Data Components (https://docs.fabricmc.net/develop/items/custom-data-components#custom-data-components) which is 1.20.5 - which should actually be fine because we're 1.21+. Still got some bugs left to iron out, especially pagination. --- .../skyfactions/common/api/GUIAPI.java | 11 +- .../common/config/types/Messages.java | 472 +++++++++--------- .../skyfactions/common/user/SkyUser.java | 12 +- .../language/en_US/guis/obelisk/audit_log.yml | 12 +- .../obelisk/invites/join_request_manage.yml | 2 +- .../guis/obelisk/invites/outgoing_invites.yml | 10 +- .../invites/player_faction_invites.yml | 12 +- .../obelisk/invites/player_invite_manage.yml | 4 +- .../invites/player_invite_selection.yml | 2 +- .../guis/obelisk/member/member_management.yml | 10 +- .../guis/obelisk/player_notifications.yml | 8 +- .../en_US/guis/obelisk/player_obelisk.yml | 14 +- .../language/en_US/guis/pagination.yml | 2 +- .../paper/PaperSharedConstants.java | 2 +- .../skyfactions/paper/SkyFactionsReborn.java | 1 + .../paper/api/SpigotDefenceAPI.java | 1 + .../paper/api/SpigotObeliskAPI.java | 1 + .../paper/api/adapter/SpigotAdapter.java | 1 + .../paper/defence/SpigotDefence.java | 1 + .../event/ObeliskInteractionListener.java | 4 + .../defence/DefencePlacementHandler.java | 1 + 21 files changed, 298 insertions(+), 285 deletions(-) diff --git a/common/src/main/java/net/skullian/skyfactions/common/api/GUIAPI.java b/common/src/main/java/net/skullian/skyfactions/common/api/GUIAPI.java index d4eb2def..fcc8d455 100644 --- a/common/src/main/java/net/skullian/skyfactions/common/api/GUIAPI.java +++ b/common/src/main/java/net/skullian/skyfactions/common/api/GUIAPI.java @@ -28,7 +28,7 @@ public class GUIAPI { public static GUIData getGUIData(String guiName, SkyUser user) throws IllegalArgumentException { YamlDocument config = GUIEnums.configs.getOrDefault(SkyApi.getInstance().getPlayerAPI().getLocale(user.getUniqueId()), getFallbackLanguage()).get(guiName); if (config != null) { - String guiTitle = config.getString("title").replace("", user.getName()); + String guiTitle = config.getString("title").replace("", user.getName()); String openSound = config.getString("open-sound"); int openPitch = config.getInt("open-pitch"); List layout = config.getStringList("layout"); @@ -60,7 +60,7 @@ public static List getItemData(String guiName, SkyUser user) throws Il char charValue = !isModel ? itemData.getString("char").charAt(0) : 'x'; String material = itemData.getString("material"); - String text = itemData.getString("text").replace("", user.getName()); + String text = itemData.getString("text").replace("", user.getName()); String sound = itemData.getString("sound"); String texture = itemData.getString("skull"); int pitch = itemData.getInt("pitch"); @@ -93,7 +93,7 @@ public static List getPaginationData(SkyUser user) throws Ru char charValue = itemData.getString("char").charAt(0); String material = itemData.getString("material"); String texture = itemData.getString("skull"); - String itemName = itemData.getString("name").replace("", user.getName()); + String itemName = itemData.getString("name").replace("", user.getName()); String sound = itemData.getString("sound"); int pitch = itemData.getInt("pitch"); String morePagesLore = itemData.getString("more-pages-lore"); @@ -122,8 +122,9 @@ public static SkyItemStack createItem(PaginationItemData data, UUID playerUUID) private static SkyItemStack create(String material, String texture, UUID playerUUID) { SkyItemStack stack; - if (material.equalsIgnoreCase("player-head")) { - if (texture.equalsIgnoreCase("")) { + + if (material.equalsIgnoreCase("PLAYER_HEAD")) { + if (texture.equalsIgnoreCase("")) { stack = SkyApi.getInstance().getPlayerAPI().getPlayerSkull(SkyItemStack.builder().material("PLAYER_HEAD").build(), playerUUID); } else { stack = PlayerAPI.convertToSkull(SkyItemStack.builder().material("PLAYER_HEAD"), texture).build(); diff --git a/common/src/main/java/net/skullian/skyfactions/common/config/types/Messages.java b/common/src/main/java/net/skullian/skyfactions/common/config/types/Messages.java index 72a2b97e..fe4eca64 100644 --- a/common/src/main/java/net/skullian/skyfactions/common/config/types/Messages.java +++ b/common/src/main/java/net/skullian/skyfactions/common/config/types/Messages.java @@ -21,236 +21,238 @@ @Getter public enum Messages { - SERVER_NAME("server.name.message"), - PERMISSION_DENY("permission.deny.message"), - RELOADING("reloading.message"), - RELOADED("reloaded.message"), - COOLDOWN("cooldown.message"), - ERROR("error.message"), - INCORRECT_USAGE("incorrect.usage.message"), - UNKNOWN_PLAYER("unknown.player.message"), - PLEASE_WAIT("please.wait.message"), - BLACKLISTED_PHRASE("blacklisted.phrase.message"), - - SYNC_RUNNING("sync.running.message"), - SYNC_SUCCESS("sync.success.message"), - - INVALID_LANGUAGE("invalid.language.message"), - MODIFYING_LANGUAGE("modifying.language.message"), - LANGUAGE_MODIFIED("language.modified.message"), - - COMMAND_HEAD("commands.command.head.message"), - COMMAND_INFO("commands.command.info.message"), - NO_COMMANDS_FOUND("commands.no.commands.found.message"), - - ISLAND_CREATION_DENY("islands.creation.deny.message"), - ISLAND_CREATING("islands.creating.message"), - ISLAND_CREATED("islands.created.message"), - NO_ISLAND("islands.no.island.message"), - PLAYER_HAS_NO_ISLAND("islands.player.has.no.island.message"), - DELETION_CONFIRM("islands.deletion.confirm.message"), - ISLAND_DELETION_SUCCESS("islands.deletion.success.message"), - DELETION_BLOCK("islands.deletion.block.message"), - DELETION_PROCESSING("islands.deletion.processing.message"), - NETHER_PORTALS_BLOCKED("islands.nether.portals.blocked.message"), - ALREADY_ON_ISLAND("islands.already.on.message"), - VISIT_ALREADY_ON_ISLAND("islands.visit.already.on.message"), - - DISCORD_RAID_MESSAGE("discord.raid.message"), - DISCORD_LINK_SUCCESS("discord.link.success.message"), - DISCORD_ALREADY_LINKED("discord.already.linked.message"), - DISCORD_NOT_LINKED("discord.not.linked.message"), - DISCORD_LINK_PROMPT("discord.link.prompt.message"), - DISCORD_UNLINK_SUCCESS("discord.unlink.success.message"), - DISCORD_APP_LINK_SUCCESS("discord.app.link.success.message"), - DISCORD_APP_LINK_FAILED("discord.app.link.failed.message"), - - NPC_ACCESS_DENY("npc.access.deny.message"), - NPC_RELOADING("npc.reloading.message"), - NPC_RELOADED("npc.reloaded.message"), - NPC_DISABLING("npc.disabling.message"), - NPC_DISABLED("npc.disabled.message"), - NPC_PLAYER_ISLANDS_ACTIONS("npc.actions.player.islands.message"), - NPC_FACTION_ISLANDS_ACTIONS("npc.actions.faction.islands.message"), - - RAID_CONFIRMATION_NAME("raiding.confirmation.name.message"), - RAID_CANCEL_NAME("raiding.cancel.name.message"), - RAID_ON_COOLDOWN("raiding.on.cooldown.message"), - RAID_INSUFFICIENT_GEMS("raiding.insufficient.gems.message"), - RAIDING_COUNTDOWN_SUBTITLE("raiding.countdown.subtitle.message"), - RAID_NO_PLAYERS("raiding.no.players.message"), - RAID_PROCESSING("raiding.processing.message"), - RAID_IMMINENT_MESSAGE("raiding.imminent.message"), - - DEFENCE_INSUFFICIENT_RUNES_LORE("defences.insufficient.runes.lore"), - DEFENCE_INSUFFICIENT_INVENTORY_LORE("defences.insufficient.inventory.lore"), - DEFENCE_INSUFFICIENT_PERMISSIONS_LORE("defences.insufficient.permissions.lore"), - DEFENCE_INSUFFICIENT_PERMISSIONS("defences.insufficient.permissions.message"), - DEFENCE_PURCHASE_SUCCESS("defences.purchase.success.message"), - DEFENCE_DESTROY_DENY("defences.destroy.deny.message"), - DEFENCE_PLACE_SUCCESS("defences.place.success.message"), - TOO_MANY_DEFENCES_MESSAGE("defences.too.many.message"), - DEFENCE_ENABLE_PLACEHOLDER("defences.enable.placeholder.message"), - DEFENCE_DISABLE_PLACEHOLDER("defences.disable.placeholder.message"), - DEFENCE_REMOVE_SUCCESS("defences.remove.success.message"), - - GEMS_COUNT_MESSAGE("gems.count.message"), - GEMS_PAY_SUCCESS("gems.pay.success.message"), - GEMS_PAY_NOTIFY("gems.pay.notify.message"), - GEM_GIVE_SUCCESS("gems.give.success.message"), - INSUFFICIENT_GEMS_COUNT("gems.insufficient.count.message"), - GEMS_INSUFFICIENT_INVENTORY_SPACE("gems.insufficient.inventory.space.message"), - GEMS_WITHDRAW_SUCCESS("gems.withdraw.success.message"), - GEMS_DEPOSIT_SUCCESS("gems.deposit.success.message"), - NO_GEMS_PRESENT("gems.no.present.message"), - GEMS_ITEM_NAME("gems.item.name"), - GEMS_ITEM_LORE("gems.item.lore"), - - TRUST_SUCCESS("islands.trust.success.message"), - UNTRUST_SUCCESS("islands.untrust.success.message"), - UNTRUST_FAILURE("islands.untrust.failure.message"), - PLAYER_NOT_TRUSTED("islands.visit.not.trusted.message"), - VISIT_NO_ISLAND("islands.visit.no.island.message"), - PLAYER_ALREADY_TRUSTED("islands.already.trusted.message"), - VISIT_PROCESSING("islands.visit.processing.message"), - VISIT_IN_RAID("islands.visit.in.raid.message"), - - FACTION_GEMS_DONATION_SUCCESS("factions.gems.donation.success.message"), - FACTION_CREATION_PROCESSING("factions.creation.processing.message"), - FACTION_ACTION_DENY("factions.action.deny.message"), - FACTION_NAME_LENGTH_LIMIT("factions.name.length.limit.message"), - FACTION_NO_NUMBERS("factions.no.numbers.message"), - FACTION_NON_ENGLISH("factions.non.english.message"), - FACTION_NO_SYMBOLS("factions.no.symbols.message"), - FACTION_PLAYER_ISLAND_REQUIRED("factions.player.island.required.message"), - FACTION_INSUFFICIENT_FUNDS("factions.insufficient.funds.message"), - FACTION_CREATION_SUCCESS("factions.creation.success.message"), - FACTION_CREATION_NAME_DUPLICATE("factions.creation.name.duplicate.message"), - - FACTION_LEAVE_SUCCESS("factions.leave.success.message"), - FACTION_LEAVE_OWNER_CONFIRMATION_LORE("factions.leave.owner.confirmation.lore"), - - FACTION_BROADCAST_MODEL("factions.broadcast.model.message"), - - FACTION_OWNER_TITLE("factions.owner.title.message"), - FACTION_ADMIN_TITLE("factions.admin.title.message"), - FACTION_MODERATOR_TITLE("factions.moderator.title.message"), - FACTION_FIGHTER_TITLE("factions.fighter.title.message"), - FACTION_MEMBER_TITLE("factions.member.title.message"), - - FACTION_MANAGE_SELF_DENY("factions.manage.self.deny.message"), - FACTION_MANAGE_SELF_DENY_LORE("factions.manage.self.deny.lore"), - FACTION_MANAGE_KICK_SUCCESS("factions.manage.kick.success.message"), - FACTION_MANAGE_KICK_BROADCAST("factions.manage.kick.broadcast.message"), - FACTION_MANAGE_BAN_SUCCESS("factions.manage.ban.success.message"), - FACTION_MANAGE_BAN_BROADCAST("factions.manage.ban.broadcast.message"), - FACTION_MANAGE_RANK_SELECTED("factions.manage.selected.rank.message"), - RANK_CHANGE_SUCCESS("factions.rank.change.success.message"), - FACTION_MANAGE_HIGHER_RANKS_DENY("factions.manage.higher.ranks.deny.message"), - FACTION_MANAGE_HIGHER_RANKS_DENY_LORE("factions.manage.higher.ranks.deny.lore"), - FACTION_MANAGE_NO_PERMISSIONS("factions.manage.no.permissions.message"), - FACTION_MANAGE_NO_PERMISSIONS_LORE("factions.manage.no.permissions.lore"), - - FACTION_INVITE_SELF_DENY("factions.invite.self.deny.message"), - FACTION_INVITE_IN_SAME_FACTION("factions.invite.same.faction.message"), - FACTION_INVITE_CREATE_SUCCESS("factions.invite.create.success.message"), - JOIN_REQUEST_NOTIFICATION("factions.invite.join.request.notification.message"), - FACTION_INVITE_NOTIFICATION("factions.invite.notification.message"), - JOIN_REQUEST_CREATE_SUCCESS("factions.invite.join.request.create.success.message"), - JOIN_REQUEST_ALREADY_EXISTS("factions.invite.join.request.already.exists.message"), - JOIN_REQUEST_SAME_FACTION("factions.invite.join.request.same.faction.message"), - FACTION_INVITE_DUPLICATE("factions.invite.duplicate.message"), - FACTION_INVITE_PLAYER_BANNED("factions.invite.player.banned.message"), - FACTION_INVITE_REQUEST_JOIN_BANNED("factions.invite.request.join.banned.message"), - FACTION_INVITE_REVOKE_SUCCESS("factions.invite.revoke.success.message"), - FACTION_JOIN_REQUEST_ACCEPT_SUCCESS("factions.invite.join.request.accept.success.message"), - FACTION_JOIN_REQUEST_ACCEPT_NOTIFICATION("factions.invite.join.request.accept.notification.message"), - FACTION_JOIN_REQUEST_REJECT_SUCCESS("factions.invite.join.request.reject.success.message"), - FACTION_JOIN_REQUEST_REJECT_NOTIFICATION("factions.invite.join.request.reject.notification.message"), - FACTION_JOIN_REQUEST_NOT_EXIST("factions.invite.join.request.not.exist.message"), - FACTION_JOIN_REQUEST_REVOKE_SUCCESS("factions.invite.join.request.revoke.success.message"), - FACTION_JOIN_REQUEST_DENY_SUCCESS("factions.invite.join.request.deny.success.message"), - PLAYER_FACTION_JOIN_SUCCESS("factions.invite.player.faction.join.success.message"), - FACTION_INVITE_DENY_SUCCESS("factions.invite.deny.success.message"), - FACTION_JOIN_BROADCAST("factions.invite.join.broadcast.message"), - - FACTION_DISBAND_DELETION_PROCESSING("factions.disband.deletion.processing.message"), - FACTION_DISBAND_OWNER_REQUIRED("factions.disband.owner.required.message"), - FACTION_DISBAND_COMMAND_CONFIRM("factions.disband.command.confirm.message"), - FACTION_DISBAND_SUCCESS("factions.disband.success.message"), - FACTION_DISBAND_BROADCAST("factions.disband.broadcast.message"), - FACTION_DISBAND_COMMAND_BLOCK("factions.disband.command.block.message"), - - ALREADY_IN_FACTION("factions.already.in.faction.message"), - NOT_IN_FACTION("factions.not.in.faction.message"), - FACTION_NOT_FOUND("factions.not.found.message"), - - FACTION_INFO_LIST("factions.info.list.message"), - MOTD_CHANGE_PROCESSING("factions.change.motd.processing.message"), - MOTD_CHANGE_SUCCESS("factions.change.motd.success.message"), - - FACTION_RENAME_ON_COOLDOWN("factions.rename.on.cooldown.message"), - FACTION_RENAME_NO_PERMISSIONS("factions.rename.no.permissions.message"), - FACTION_RENAME_INSUFFICIENT_FUNDS("factions.rename.insufficient.funds.message"), - - NOTIFICATION_PENDING_FACTION_INVITATIONS("notifications.pending.faction.invitations.message"), - NOTIFICATION_PENDING_JOIN_REQUESTS("notifications.pending.join.requests.message"), - UNREAD_NOTIFICATIONS("notifications.unread.messages"), - - OBELISK_ACCESS_DENY("obelisk.access.deny.message"), - OBELISK_DESTROY_DENY("obelisk.destroy.deny.message"), - OBELISK_GUI_DENY("obelisk.gui.deny.message"), - OBELISK_ITEM_NAME("obelisk.item.name.message"), - OBELISK_ITEM_LORE("obelisk.item.lore.message"), - LOADING_ITEM_MATERIAL("obelisk.loading.material.message"), - LOADING_ITEM_TEXT("obelisk.loading.text.message"), - LOADING_ITEM_LORE("obelisk.loading.lore.message"), - - RUNE_ENCHANT_DENY("runes.enchant.deny.message"), - RUNE_GENERAL_DENY("runes.general.deny.message"), - RUNE_CONVERSION_SUCCESS("runes.conversion.success.message"), - RUNE_INSUFFICIENT_ITEMS("runes.insufficient.items.message"), - RUNES_BALANCE_MESSAGE("runes.balance.message"), - RUNES_GIVE_SUCCESS("runes.give.success.message"), - RUNES_RESET_SUCCESS("runes.reset.success.message"), - - AUDIT_FACTION_CREATE_TITLE("audit.logs.faction.create.title.message"), - AUDIT_FACTION_CREATE_DESCRIPTION("audit.logs.faction.create.description.message"), - AUDIT_FACTION_JOIN_TITLE("audit.logs.join.title.message"), - AUDIT_FACTION_JOIN_DESCRIPTION("audit.logs.join.description.message"), - AUDIT_FACTION_LEAVE_TITLE("audit.logs.leave.title.message"), - AUDIT_FACTION_LEAVE_DESCRIPTION("audit.logs.leave.description.message"), - AUDIT_FACTION_MOTD_TITLE("audit.logs.motd.title.message"), - AUDIT_FACTION_MOTD_DESCRIPTION("audit.logs.motd.description.message"), - AUDIT_FACTION_TIMESTAMP_FORMAT("audit.logs.timestamp.format.message"), - AUDIT_FACTION_BROADCAST_TITLE("audit.logs.broadcast.title.message"), - AUDIT_FACTION_BROADCAST_DESCRIPTION("audit.logs.broadcast.description.message"), - AUDIT_FACTION_KICK_TITLE("audit.logs.kick.title.message"), - AUDIT_FACTION_KICK_DESCRIPTION("audit.logs.kick.description.message"), - AUDIT_FACTION_BAN_TITLE("audit.logs.ban.title.message"), - AUDIT_FACTION_BAN_DESCRIPTION("audit.logs.ban.description.message"), - AUDIT_FACTION_INVITE_CREATE_TITLE("audit.logs.invite.create.title.message"), - AUDIT_FACTION_INVITE_CREATE_DESCRIPTION("audit.logs.invite.create.description.message"), - AUDIT_FACTION_JOIN_REQUEST_TITLE("audit.logs.join.request.title.message"), - AUDIT_FACTION_JOIN_REQUEST_DESCRIPTION("audit.logs.join.request.description.message"), - AUDIT_FACTION_INVITE_REVOKE_TITLE("audit.logs.invite.revoke.title.message"), - AUDIT_FACTION_INVITE_REVOKE_DESCRIPTION("audit.logs.invite.revoke.description.message"), - AUDIT_FACTION_JOIN_REQUEST_ACCEPT_TITLE("audit.logs.join.request.accept.title.message"), - AUDIT_FACTION_JOIN_REQUEST_ACCEPT_DESCRIPTION("audit.logs.join.request.accept.description.message"), - AUDIT_FACTION_JOIN_REQUEST_REJECT_TITLE("audit.logs.join.request.reject.title.message"), - AUDIT_FACTION_JOIN_REQUEST_REJECT_DESCRIPTION("audit.logs.join.request.reject.description.message"), - AUDIT_FACTION_PLAYER_JOIN_REQUEST_REVOKE_TITLE("audit.logs.player.join.request.revoke.title.message"), - AUDIT_FACTION_PLAYER_JOIN_REQUEST_REVOKE_DESCRIPTION("audit.logs.player.join.request.revoke.description.message"), - AUDIT_FACTION_PLAYER_JOIN_REQUEST_DENY_TITLE("audit.logs.player.join.request.deny.title.message"), - AUDIT_FACTION_PLAYER_JOIN_REQUEST_DENY_DESCRIPTION("audit.logs.player.join.request.deny.description.message"), - AUDIT_FACTION_PLAYER_INVITE_ACCEPT_TITLE("audit.logs.invite.accept.title.message"), - AUDIT_FACTION_PLAYER_INVITE_ACCEPT_DESCRIPTION("audit.logs.invite.accept.description.message"), - AUDIT_FACTION_PLAYER_INVITE_DENY_TITLE("audit.logs.invite.deny.title.message"), - AUDIT_FACTION_PLAYER_INVITE_DENY_DESCRIPTION("audit.logs.invite.deny.description.message"), - AUDIT_FACTION_DEFENCE_PURCHASE_TITLE("audit.logs.defence.purchase.title.message"), - AUDIT_FACTION_DEFENCE_PURCHASE_DESCRIPTION("audit.logs.defence.purchase.description.message"), - AUDIT_FACTION_DEFENCE_REMOVAL_TITLE("audit.logs.defence.removal.title.message"), - AUDIT_FACTION_DEFENCE_REMOVAL_DESCRIPTION("audit.logs.defence.removal.description.message"), + LANGUAGE_NAME("language-name"), + + SERVER_NAME("server-name"), + PERMISSION_DENY("permission-deny"), + RELOADING("reloading"), + RELOADED("reloaded"), + COOLDOWN("cooldown"), + ERROR("error"), + INCORRECT_USAGE("incorrect-usage"), + UNKNOWN_PLAYER("unknown-player"), + PLEASE_WAIT("please-wait"), + BLACKLISTED_PHRASE("blacklisted-phrase"), + + SYNC_RUNNING("sync-running"), + SYNC_SUCCESS("sync-success"), + + COMMAND_HEAD("commands.command-head"), + COMMAND_INFO("commands.command-info"), + NO_COMMANDS_FOUND("commands.no-commands-found"), + + INVALID_LANGUAGE("language.invalid-language"), + MODIFYING_LANGUAGE("language.modifying-language"), + LANGUAGE_MODIFIED("language.language-modified"), + + ISLAND_CREATION_DENY("islands.island-creation-deny"), + ISLAND_CREATING("islands.creating-message"), + ISLAND_CREATED("islands.created-message"), + NO_ISLAND("islands.no-island"), + PLAYER_HAS_NO_ISLAND("islands.player-has-no-island"), + DELETION_CONFIRM("islands.confirm-deletion"), + ISLAND_DELETION_SUCCESS("islands.deletion-success"), + DELETION_BLOCK("islands.deletion-block"), + DELETION_PROCESSING("islands.deletion-processing"), + NETHER_PORTALS_BLOCKED("islands.nether-portals-blocked"), + ALREADY_ON_ISLAND("islands.already-on-island"), + VISIT_ALREADY_ON_ISLAND("islands.visit-already-on-island"), + + DISCORD_RAID_MESSAGE("discord.discord-raid-message"), + DISCORD_LINK_SUCCESS("discord.link-success-message"), + DISCORD_ALREADY_LINKED("discord.already-linked"), + DISCORD_NOT_LINKED("discord.not-linked"), + DISCORD_LINK_PROMPT("discord.link-prompt"), + DISCORD_UNLINK_SUCCESS("discord.unlink-success"), + DISCORD_APP_LINK_SUCCESS("discord.discord-link-success-message"), + DISCORD_APP_LINK_FAILED("discord.link-failed"), + + NPC_ACCESS_DENY("npc.npc-access-deny"), + NPC_RELOADING("npc.npc-reloading"), + NPC_RELOADED("npc.npc-reloaded"), + NPC_DISABLING("npc.npc-disabling"), + NPC_DISABLED("npc.npc-disabled"), + NPC_PLAYER_ISLANDS_ACTIONS("npc.actions.player-islands"), + NPC_FACTION_ISLANDS_ACTIONS("npc.actions.faction-islands"), + + RAID_CONFIRMATION_NAME("raiding.raid-confirmation-name"), + RAID_CANCEL_NAME("raiding.raid-cancel-name"), + RAID_ON_COOLDOWN("raiding.raid-on-cooldown"), + RAID_INSUFFICIENT_GEMS("raiding.raid-insufficient-gems"), + RAIDING_COUNTDOWN_SUBTITLE("raiding.countdown-subtitle"), + RAID_NO_PLAYERS("raiding.no-players"), + RAID_PROCESSING("raiding.raid-processing"), + RAID_IMMINENT_MESSAGE("raiding.raided-notification"), + + DEFENCE_INSUFFICIENT_RUNES_LORE("defences.insufficient-runes-lore"), + DEFENCE_INSUFFICIENT_INVENTORY_LORE("defences.insufficient-inventory-lore"), + DEFENCE_INSUFFICIENT_PERMISSIONS_LORE("defences.insufficient-permissions-lore"), + DEFENCE_INSUFFICIENT_PERMISSIONS("defences.defence-insufficient-permissions"), + DEFENCE_PURCHASE_SUCCESS("defences.defence-purchase-success"), + DEFENCE_DESTROY_DENY("defences.defence-destroy-deny"), + DEFENCE_PLACE_SUCCESS("defences.defence-place-success"), + TOO_MANY_DEFENCES_MESSAGE("defences.too-many-defences"), + DEFENCE_ENABLE_PLACEHOLDER("defences.enable-placeholder"), + DEFENCE_DISABLE_PLACEHOLDER("defences.disable-placeholder"), + DEFENCE_REMOVE_SUCCESS("defences.defence-remove-success"), + + GEMS_COUNT_MESSAGE("gems.gem-count"), + GEMS_PAY_SUCCESS("gems.gems-pay-success"), + GEMS_PAY_NOTIFY("gems.gems-pay-notify"), + GEM_GIVE_SUCCESS("gems.gem-give-success"), + INSUFFICIENT_GEMS_COUNT("gems.insufficient-gem-count"), + GEMS_INSUFFICIENT_INVENTORY_SPACE("gems.insufficient-inventory-space"), + GEMS_WITHDRAW_SUCCESS("gems.gems-withdraw-success"), + GEMS_DEPOSIT_SUCCESS("gems.gems-deposit-success"), + NO_GEMS_PRESENT("gems.no-gems-present"), + GEMS_ITEM_NAME("gems.item-name"), + GEMS_ITEM_LORE("gems.item-lore"), + + TRUST_SUCCESS("islands.trust-success"), + UNTRUST_SUCCESS("islands.untrust-success"), + UNTRUST_FAILURE("islands.untrust-failure"), + PLAYER_NOT_TRUSTED("islands.visit-not-trusted"), + VISIT_NO_ISLAND("islands.visit-no-island"), + PLAYER_ALREADY_TRUSTED("islands.already-trusted"), + VISIT_PROCESSING("islands.visit-processing"), + VISIT_IN_RAID("islands.visit-in-raid"), + + FACTION_GEMS_DONATION_SUCCESS("factions.gems-donation-success"), + FACTION_CREATION_PROCESSING("factions.faction-creation.faction-create-processing"), + FACTION_ACTION_DENY("factions.action-deny"), + FACTION_NAME_LENGTH_LIMIT("factions.faction-creation.name-length-limit"), + FACTION_NO_NUMBERS("factions.faction-creation.name-no-numbers"), + FACTION_NON_ENGLISH("factions.faction-creation.name-non-english"), + FACTION_NO_SYMBOLS("factions.faction-creation.name-no-symbols"), + FACTION_PLAYER_ISLAND_REQUIRED("factions.faction-creation.player-island-required"), + FACTION_INSUFFICIENT_FUNDS("factions.faction-creation.insufficient-funds"), + FACTION_CREATION_SUCCESS("factions.faction-creation.faction-create-success"), + FACTION_CREATION_NAME_DUPLICATE("factions.faction-creation.duplicate-name"), + + FACTION_LEAVE_SUCCESS("factions.faction-leave.faction-leave-success"), + FACTION_LEAVE_OWNER_CONFIRMATION_LORE("factions.faction-leave.owner-confirmation-lore"), + + FACTION_BROADCAST_MODEL("factions.faction-broadcast.broadcast-model"), + + FACTION_OWNER_TITLE("factions.faction-titles.owner"), + FACTION_ADMIN_TITLE("factions.faction-titles.admin"), + FACTION_MODERATOR_TITLE("factions.faction-titles.moderator"), + FACTION_FIGHTER_TITLE("factions.faction-titles.fighter"), + FACTION_MEMBER_TITLE("factions.faction-titles.member"), + + FACTION_MANAGE_SELF_DENY("factions.faction-manage.manage-self-deny"), + FACTION_MANAGE_SELF_DENY_LORE("factions.faction-manage.manage-self-deny-lore"), + FACTION_MANAGE_KICK_SUCCESS("factions.faction-manage.kick-success"), + FACTION_MANAGE_KICK_BROADCAST("factions.faction-manage.kick-broadcast"), + FACTION_MANAGE_BAN_SUCCESS("factions.faction-manage.ban-success"), + FACTION_MANAGE_BAN_BROADCAST("factions.faction-manage.ban-broadcast"), + FACTION_MANAGE_RANK_SELECTED("factions.faction-manage.selected"), + RANK_CHANGE_SUCCESS("factions.faction-manage.rank-change-success"), + FACTION_MANAGE_HIGHER_RANKS_DENY("factions.faction-manage.manage-higher-ranks-deny"), + FACTION_MANAGE_HIGHER_RANKS_DENY_LORE("factions.faction-manage.manage-higher-ranks-deny-lore"), + FACTION_MANAGE_NO_PERMISSIONS("factions.faction-manage.manage-no-permissions"), + FACTION_MANAGE_NO_PERMISSIONS_LORE("factions.faction-manage.manage-no-permissions-lore"), + + FACTION_INVITE_SELF_DENY("factions.faction-invite.invite-self-deny"), + FACTION_INVITE_IN_SAME_FACTION("factions.faction-invite.invite-in-same-faction"), + FACTION_INVITE_CREATE_SUCCESS("factions.faction-invite.invite-create-success"), + JOIN_REQUEST_NOTIFICATION("factions.faction-invite.join-request-notification"), + FACTION_INVITE_NOTIFICATION("factions.faction-invite.invite-notification"), + JOIN_REQUEST_CREATE_SUCCESS("factions.faction-invite.join-request-create-success"), + JOIN_REQUEST_ALREADY_EXISTS("factions.faction-invite.join-request-already-exists"), + JOIN_REQUEST_SAME_FACTION("factions.faction-invite.join-request-same-faction"), + FACTION_INVITE_DUPLICATE("factions.faction-invite.invite-duplicate"), + FACTION_INVITE_PLAYER_BANNED("factions.faction-invite.invite-player-banned"), + FACTION_INVITE_REQUEST_JOIN_BANNED("factions.faction-invite.request-join-banned"), + FACTION_INVITE_REVOKE_SUCCESS("factions.faction-invite.invite-revoke-success"), + FACTION_JOIN_REQUEST_ACCEPT_SUCCESS("factions.faction-invite.join-request-accept-success"), + FACTION_JOIN_REQUEST_ACCEPT_NOTIFICATION("factions.faction-invite.join-request-accept-notification"), + FACTION_JOIN_REQUEST_REJECT_SUCCESS("factions.faction-invite.join-request-reject-success"), + FACTION_JOIN_REQUEST_REJECT_NOTIFICATION("factions.faction-invite.join-request-reject-notification"), + FACTION_JOIN_REQUEST_NOT_EXIST("factions.faction-invite.join-request-not-exist"), + FACTION_JOIN_REQUEST_REVOKE_SUCCESS("factions.faction-invite.join-request-revoke-success"), + FACTION_JOIN_REQUEST_DENY_SUCCESS("factions.faction-invite.join-request-deny-success"), + PLAYER_FACTION_JOIN_SUCCESS("factions.faction-invite.player-faction-join-success"), + FACTION_INVITE_DENY_SUCCESS("factions.faction-invite.faction-invite-deny-success"), + FACTION_JOIN_BROADCAST("factions.faction-invite.faction-join-broadcast"), + + FACTION_DISBAND_DELETION_PROCESSING("factions.faction-disband.deletion-processing"), + FACTION_DISBAND_OWNER_REQUIRED("factions.faction-disband.faction-disband-owner-required"), + FACTION_DISBAND_COMMAND_CONFIRM("factions.faction-disband.faction-disband-command-confirm"), + FACTION_DISBAND_SUCCESS("factions.faction-disband.faction-disband-success"), + FACTION_DISBAND_BROADCAST("factions.faction-disband.faction-disband-broadcast"), + FACTION_DISBAND_COMMAND_BLOCK("factions.faction-disband.faction-disband-command-block"), + + ALREADY_IN_FACTION("factions.already-in-faction"), + NOT_IN_FACTION("factions.not-in-faction"), + FACTION_NOT_FOUND("factions.faction-not-found"), + + FACTION_INFO_LIST("factions.faction-info.information-message"), + MOTD_CHANGE_PROCESSING("factions.change-motd.motd-processing"), + MOTD_CHANGE_SUCCESS("factions.change-motd.motd-change-success"), + + FACTION_RENAME_ON_COOLDOWN("factions.faction-rename.rename-on-cooldown"), + FACTION_RENAME_NO_PERMISSIONS("factions.faction-rename.rename-no-permissions"), + FACTION_RENAME_INSUFFICIENT_FUNDS("factions.faction-rename.rename-insufficient-funds"), + + NOTIFICATION_PENDING_FACTION_INVITATIONS("notifications.pending-faction-invitations"), + NOTIFICATION_PENDING_JOIN_REQUESTS("notifications.pending-join-requests"), + UNREAD_NOTIFICATIONS("notifications.unread-notifications"), + + OBELISK_ACCESS_DENY("obelisk.access-deny"), + OBELISK_DESTROY_DENY("obelisk.destroy-deny"), + OBELISK_GUI_DENY("obelisk.obelisk-gui-deny"), + OBELISK_ITEM_NAME("obelisk.obelisk-block.item-name"), + OBELISK_ITEM_LORE("obelisk.obelisk-block.item-lore"), + LOADING_ITEM_MATERIAL("obelisk.loading.material"), + LOADING_ITEM_TEXT("obelisk.loading.text"), + LOADING_ITEM_LORE("obelisk.loading.lore"), + + RUNE_ENCHANT_DENY("runes.enchants-deny"), + RUNE_GENERAL_DENY("runes.general-deny"), + RUNE_CONVERSION_SUCCESS("runes.conversion-success"), + RUNE_INSUFFICIENT_ITEMS("runes.insufficient-items"), + RUNES_BALANCE_MESSAGE("runes.runes-balance"), + RUNES_GIVE_SUCCESS("runes.runes-give-success"), + RUNES_RESET_SUCCESS("runes.runes-reset-success"), + + AUDIT_FACTION_CREATE_TITLE("audit-logs.faction-create-title"), + AUDIT_FACTION_CREATE_DESCRIPTION("audit-logs.faction-create-description"), + AUDIT_FACTION_JOIN_TITLE("audit-logs.join-title"), + AUDIT_FACTION_JOIN_DESCRIPTION("audit-logs.join-description"), + AUDIT_FACTION_LEAVE_TITLE("audit-logs.leave-title"), + AUDIT_FACTION_LEAVE_DESCRIPTION("audit-logs.leave-description"), + AUDIT_FACTION_MOTD_TITLE("audit-logs.motd-title"), + AUDIT_FACTION_MOTD_DESCRIPTION("audit-logs.motd-description"), + AUDIT_FACTION_TIMESTAMP_FORMAT("audit-logs.audit-timestamp"), + AUDIT_FACTION_BROADCAST_TITLE("audit-logs.broadcast-title"), + AUDIT_FACTION_BROADCAST_DESCRIPTION("audit-logs.broadcast-description"), + AUDIT_FACTION_KICK_TITLE("audit-logs.kick-title"), + AUDIT_FACTION_KICK_DESCRIPTION("audit-logs.kick-description"), + AUDIT_FACTION_BAN_TITLE("audit-logs.ban-title"), + AUDIT_FACTION_BAN_DESCRIPTION("audit-logs.ban-description"), + AUDIT_FACTION_INVITE_CREATE_TITLE("audit-logs.invite-create-title"), + AUDIT_FACTION_INVITE_CREATE_DESCRIPTION("audit-logs.invite-create-description"), + AUDIT_FACTION_JOIN_REQUEST_TITLE("audit-logs.join-request-title"), + AUDIT_FACTION_JOIN_REQUEST_DESCRIPTION("audit-logs.join-request-description"), + AUDIT_FACTION_INVITE_REVOKE_TITLE("audit-logs.invite-revoke-title"), + AUDIT_FACTION_INVITE_REVOKE_DESCRIPTION("audit-logs.invite-revoke-description"), + AUDIT_FACTION_JOIN_REQUEST_ACCEPT_TITLE("audit-logs.join-request-accept-title"), + AUDIT_FACTION_JOIN_REQUEST_ACCEPT_DESCRIPTION("audit-logs.join-request-accept-description"), + AUDIT_FACTION_JOIN_REQUEST_REJECT_TITLE("audit-logs.join-request-reject-title"), + AUDIT_FACTION_JOIN_REQUEST_REJECT_DESCRIPTION("audit-logs.join-request-reject-description"), + AUDIT_FACTION_PLAYER_JOIN_REQUEST_REVOKE_TITLE("audit-logs.player-join-request-revoke-title"), + AUDIT_FACTION_PLAYER_JOIN_REQUEST_REVOKE_DESCRIPTION("audit-logs.player-join-request-revoke-description"), + AUDIT_FACTION_PLAYER_JOIN_REQUEST_DENY_TITLE("audit-logs.player-join-request-deny-title"), + AUDIT_FACTION_PLAYER_JOIN_REQUEST_DENY_DESCRIPTION("audit-logs.player-join-request-deny-description"), + AUDIT_FACTION_PLAYER_INVITE_ACCEPT_TITLE("audit-logs.invite-accept-title"), + AUDIT_FACTION_PLAYER_INVITE_ACCEPT_DESCRIPTION("audit-logs.invite-accept-description"), + AUDIT_FACTION_PLAYER_INVITE_DENY_TITLE("audit-logs.invite-deny-title"), + AUDIT_FACTION_PLAYER_INVITE_DENY_DESCRIPTION("audit-logs.invite-deny-description"), + AUDIT_FACTION_DEFENCE_PURCHASE_TITLE("audit-logs.defence-purchase-title"), + AUDIT_FACTION_DEFENCE_PURCHASE_DESCRIPTION("audit-logs.defence-purchase-description"), + AUDIT_FACTION_DEFENCE_REMOVAL_TITLE("audit-logs.defence-removal-title"), + AUDIT_FACTION_DEFENCE_REMOVAL_DESCRIPTION("audit-logs.defence-removal-description"), NOTIFICATION_TIMESTAMP_FORMAT("notifications.notification-types.notification-timestamp"), NOTIFICATION_FACTION_INVITE_TITLE("notifications.notification-types.faction-invite-title"), @@ -262,10 +264,10 @@ public enum Messages { NOTIFICATION_FACTION_KICKED_TITLE("notifications.notification-types.faction-kicked-title"), NOTIFICATION_FACTION_KICKED_DESCRIPTION("notifications.notification-types.faction-kicked-description"), NOTIFICATION_DISMISS_SUCCESS("notifications.notification-dismiss-success"), - NOTIFICATION_FACTION_DISBANDED_TITLE("notifications.faction-disbanded-title"), - NOTIFICATION_FACTION_DISBANDED_DESCRIPTION("notifications.faction-disbanded-description"), - NOTIFICATION_FACTION_RANK_UPDATED_TITLE("notifications.faction-rank-updated-title"), - NOTIFICATION_FACTION_RANK_UPDATED_DESCRIPTION("notifications.faction-rank-updated-description"),; + NOTIFICATION_FACTION_DISBANDED_TITLE("notifications.notification-types.faction-disbanded-title"), + NOTIFICATION_FACTION_DISBANDED_DESCRIPTION("notifications.notification-types.faction-disbanded-description"), + NOTIFICATION_FACTION_RANK_UPDATED_TITLE("notifications.notification-types.faction-rank-updated-title"), + NOTIFICATION_FACTION_RANK_UPDATED_DESCRIPTION("notifications.notification-types.faction-rank-updated-description"); public static final Map configs = new HashMap<>(); private final String path; @@ -367,7 +369,7 @@ public void send(Object receiver, String locale, Object... replacements) { Component message; if (value == null) { - message = TextUtility.color(SERVER_NAME.get(locale) + " Message not found: " + this.path, locale, receiver instanceof SkyUser ? (SkyUser) receiver : null , replacements); + message = TextUtility.color(SERVER_NAME.getString(locale) + " Message not found: " + this.path, locale, receiver instanceof SkyUser ? (SkyUser) receiver : null , replacements); } else { message = value instanceof List ? TextUtility.fromList((List) value, locale, receiver instanceof SkyUser ? (SkyUser) receiver : null, replacements) : TextUtility.color(String.valueOf(value), locale, receiver instanceof SkyUser ? (SkyUser) receiver : null, replacements); } diff --git a/common/src/main/java/net/skullian/skyfactions/common/user/SkyUser.java b/common/src/main/java/net/skullian/skyfactions/common/user/SkyUser.java index c5e64d75..c5d619cc 100644 --- a/common/src/main/java/net/skullian/skyfactions/common/user/SkyUser.java +++ b/common/src/main/java/net/skullian/skyfactions/common/user/SkyUser.java @@ -23,7 +23,7 @@ public abstract class SkyUser { public OptionalInt gems = OptionalInt.empty(); public OptionalInt runes = OptionalInt.empty(); public Optional island = Optional.empty(); - public Optional> incomingInvites = Optional.empty(); + public List incomingInvites; public Optional activeJoinRequest = Optional.empty(); @Getter public final boolean console; @@ -93,16 +93,16 @@ public void removeRunes(int amount) { } public CompletableFuture> getIncomingInvites() { - return this.incomingInvites.map(CompletableFuture::completedFuture).orElseGet(() -> SkyApi.getInstance().getDatabaseManager().getFactionInvitesManager().getInvitesOfPlayer(getUniqueId()).whenComplete((invites, ex) -> { + return this.incomingInvites != null ? CompletableFuture.completedFuture(this.incomingInvites) : SkyApi.getInstance().getDatabaseManager().getFactionInvitesManager().getInvitesOfPlayer(getUniqueId()).whenComplete((invites, ex) -> { if (ex != null) return; - this.incomingInvites = Optional.of(invites); - })); - + this.incomingInvites = invites; + }); } + @Nullable public List getCachedInvites() { - return this.incomingInvites.orElse(new ArrayList<>()); + return this.incomingInvites; } public void onCacheComplete(int runesAddition, int gemsAddition) { diff --git a/common/src/main/resources/language/en_US/guis/obelisk/audit_log.yml b/common/src/main/resources/language/en_US/guis/obelisk/audit_log.yml index 3fa10b57..6c1a5317 100644 --- a/common/src/main/resources/language/en_US/guis/obelisk/audit_log.yml +++ b/common/src/main/resources/language/en_US/guis/obelisk/audit_log.yml @@ -33,7 +33,7 @@ items: prompt: char: "p" # This is the character to use in the layout! material: "NETHER_STAR" - skull: "" # You can set custom skull textures (e.g. from minecraft-heads.com). 'material' MUST BE SET TO 'PLAYER_HEAD'. Placeholders: - Skull texture of the player. + skull: "" # You can set custom skull textures (e.g. from minecraft-heads.com). 'material' MUST BE SET TO 'PLAYER_HEAD'. Placeholders: - Skull texture of the player. text: "Audit Log" sound: "" # Sound played when the item is clicked. Set to 'none' to disable. pitch: 1 # Pitch of the sound. Does not apply if 'sound' is 'none.'. @@ -53,17 +53,17 @@ items: lore: "" # This is the item that displays each audit log. - # You cannot edit the character, however everythign else is customisable. + # You cannot edit the character, however everything else is customisable. model: material: "PLAYER_HEAD" - skull: "" # Placeholders: - Skull texture of the player. - text: "" # Placeholders: - Title of the audit log (e.g. "Player Joined") + skull: "" # Placeholders: - Skull texture of the player. + text: "" # Placeholders: - Title of the audit log (e.g. "Player Joined") sound: "ui.button.click" pitch: 1 - # Placeholders: - Description of the audit log. The format & coloring is configured in the language files. + # Placeholders: - Description of the audit log. The format & coloring is configured in the language files. # Placeholders: - Timestamp of the audit log. lore: - - "" + - "" - "" - "" diff --git a/common/src/main/resources/language/en_US/guis/obelisk/invites/join_request_manage.yml b/common/src/main/resources/language/en_US/guis/obelisk/invites/join_request_manage.yml index f7c6db9b..11a81d6b 100644 --- a/common/src/main/resources/language/en_US/guis/obelisk/invites/join_request_manage.yml +++ b/common/src/main/resources/language/en_US/guis/obelisk/invites/join_request_manage.yml @@ -27,7 +27,7 @@ items: prompt: char: "p" # This is the character to use in the layout! material: "NETHER_STAR" - skull: "" # You can set custom skull textures (e.g. from minecraft-heads.com). 'material' MUST BE SET TO 'PLAYER_HEAD'. Placeholders: - Skull texture of the player. + skull: "" # You can set custom skull textures (e.g. from minecraft-heads.com). 'material' MUST BE SET TO 'PLAYER_HEAD'. Placeholders: - Skull texture of the player. text: "Invite Type" sound: "" # Sound played when the item is clicked. Set to 'none' to disable. pitch: 1 # Pitch of the sound. Does not apply if 'sound' is 'none.'. diff --git a/common/src/main/resources/language/en_US/guis/obelisk/invites/outgoing_invites.yml b/common/src/main/resources/language/en_US/guis/obelisk/invites/outgoing_invites.yml index 12030cc1..e65f95b2 100644 --- a/common/src/main/resources/language/en_US/guis/obelisk/invites/outgoing_invites.yml +++ b/common/src/main/resources/language/en_US/guis/obelisk/invites/outgoing_invites.yml @@ -32,7 +32,7 @@ items: prompt: char: "p" # This is the character to use in the layout! material: "NETHER_STAR" - skull: "" # You can set custom skull textures (e.g. from minecraft-heads.com). 'material' MUST BE SET TO 'PLAYER_HEAD'. Placeholders: - Skull texture of the player. + skull: "" # You can set custom skull textures (e.g. from minecraft-heads.com). 'material' MUST BE SET TO 'PLAYER_HEAD'. Placeholders: - Skull texture of the player. text: "Outgoing Invites" sound: "" # Sound played when the item is clicked. Set to 'none' to disable. pitch: 1 # Pitch of the sound. Does not apply if 'sound' is 'none.'. @@ -55,14 +55,14 @@ items: # You can customise the text, lore and sound though. model: material: "PLAYER_HEAD" - skull: "" - text: "" # Placeholders: - Name of player. + skull: "" + text: "" # Placeholders: - Name of player. sound: "ui.button.click" # The obelisk UI by default is set to make a sound. Don't want to trigger it twice. pitch: 1 - # Placeholders: - Name of player invited / - Play who invited them. + # Placeholders: - Name of player invited / - Play who invited them. # Placeholders: - Timestamp of invite. lore: - - " invited " + - " invited " - "to your Faction." - "" - " ago" diff --git a/common/src/main/resources/language/en_US/guis/obelisk/invites/player_faction_invites.yml b/common/src/main/resources/language/en_US/guis/obelisk/invites/player_faction_invites.yml index ccfb4c8d..a5b706b4 100644 --- a/common/src/main/resources/language/en_US/guis/obelisk/invites/player_faction_invites.yml +++ b/common/src/main/resources/language/en_US/guis/obelisk/invites/player_faction_invites.yml @@ -32,7 +32,7 @@ items: prompt: char: "p" # This is the character to use in the layout! material: "NETHER_STAR" - skull: "" # You can set custom skull textures (e.g. from minecraft-heads.com). 'material' MUST BE SET TO 'PLAYER_HEAD'. Placeholders: - Skull texture of the player. + skull: "" # You can set custom skull textures (e.g. from minecraft-heads.com). 'material' MUST BE SET TO 'PLAYER_HEAD'. Placeholders: - Skull texture of the player. text: "Incoming Invites" sound: "" # Sound played when the item is clicked. Set to 'none' to disable. pitch: 1 # Pitch of the sound. Does not apply if 'sound' is 'none.'. @@ -55,14 +55,14 @@ items: # You can customise the text, lore and sound though. model: material: "PLAYER_HEAD" - skull: "" - text: "" # Placeholders: - Name of the faction who is inviting you. + skull: "" + text: "" # Placeholders: - Name of the faction who is inviting you. sound: "" # The obelisk UI by default is set to make a sound. Don't want to trigger it twice. pitch: 1 - # Placeholders: - Name of player / - Name of Faction. + # Placeholders: - Name of player / - Name of Faction. lore: - - " wants you" - - "to join ." + - " wants you" + - "to join ." - "" - "Click for actions." diff --git a/common/src/main/resources/language/en_US/guis/obelisk/invites/player_invite_manage.yml b/common/src/main/resources/language/en_US/guis/obelisk/invites/player_invite_manage.yml index 9bfffc05..28d7fdb3 100644 --- a/common/src/main/resources/language/en_US/guis/obelisk/invites/player_invite_manage.yml +++ b/common/src/main/resources/language/en_US/guis/obelisk/invites/player_invite_manage.yml @@ -27,8 +27,8 @@ items: prompt: char: "p" # This is the character to use in the layout! material: "PLAYER_HEAD" - skull: "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNTczZGI5NmY3YjlmNzhlZGU5MjY5NDEwYzY1OTI4NWZjYTIwZWZiYzhkZmE5ZGVmZjRiYmU1NDM0OTNhNDQ0NSJ9fX0=" # You can set custom skull textures (e.g. from minecraft-heads.com). 'material' MUST BE SET TO 'PLAYER_HEAD'. Placeholders: - Skull texture of the player. - text: "" # Placeholders: - Name of the Faction you are requesting to join. + skull: "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNTczZGI5NmY3YjlmNzhlZGU5MjY5NDEwYzY1OTI4NWZjYTIwZWZiYzhkZmE5ZGVmZjRiYmU1NDM0OTNhNDQ0NSJ9fX0=" # You can set custom skull textures (e.g. from minecraft-heads.com). 'material' MUST BE SET TO 'PLAYER_HEAD'. Placeholders: - Skull texture of the player. + text: "" # Placeholders: - Name of the Faction you are requesting to join. sound: "" # Sound played when the item is clicked. Set to 'none' to disable. pitch: 1 # Pitch of the sound. Does not apply if 'sound' is 'none.'. lore: diff --git a/common/src/main/resources/language/en_US/guis/obelisk/invites/player_invite_selection.yml b/common/src/main/resources/language/en_US/guis/obelisk/invites/player_invite_selection.yml index ecd24700..f07bef1a 100644 --- a/common/src/main/resources/language/en_US/guis/obelisk/invites/player_invite_selection.yml +++ b/common/src/main/resources/language/en_US/guis/obelisk/invites/player_invite_selection.yml @@ -23,7 +23,7 @@ items: prompt: char: "p" # This is the character to use in the layout! material: "NETHER_STAR" - skull: "" # You can set custom skull textures (e.g. from minecraft-heads.com). 'material' MUST BE SET TO 'PLAYER_HEAD'. Placeholders: - Skull texture of the player. + skull: "" # You can set custom skull textures (e.g. from minecraft-heads.com). 'material' MUST BE SET TO 'PLAYER_HEAD'. Placeholders: - Skull texture of the player. text: "Invite Type" sound: "" # Sound played when the item is clicked. Set to 'none' to disable. pitch: 1 # Pitch of the sound. Does not apply if 'sound' is 'none.'. diff --git a/common/src/main/resources/language/en_US/guis/obelisk/member/member_management.yml b/common/src/main/resources/language/en_US/guis/obelisk/member/member_management.yml index e5238abd..bc928cc1 100644 --- a/common/src/main/resources/language/en_US/guis/obelisk/member/member_management.yml +++ b/common/src/main/resources/language/en_US/guis/obelisk/member/member_management.yml @@ -32,7 +32,7 @@ items: prompt: char: "p" # This is the character to use in the layout! material: "NETHER_STAR" - skull: "" # You can set custom skull textures (e.g. from minecraft-heads.com). 'material' MUST BE SET TO 'PLAYER_HEAD'. Placeholders: - Skull texture of the player. + skull: "" # You can set custom skull textures (e.g. from minecraft-heads.com). 'material' MUST BE SET TO 'PLAYER_HEAD'. Placeholders: - Skull texture of the player. text: "Manage Members" sound: "" # Sound played when the item is clicked. Set to 'none' to disable. pitch: 1 # Pitch of the sound. Does not apply if 'sound' is 'none.'. @@ -55,13 +55,13 @@ items: # You can customise the text, lore and sound though. model: material: "PLAYER_HEAD" - skull: "" - text: "" # Placeholders: - Name of player. + skull: "" + text: "" # Placeholders: - Name of player. sound: "" # Sound already configured in manage-member.yml pitch: 1 - # Placeholders: - Rank of player. + # Placeholders: - Rank of player. lore: - - "Rank: " + - "Rank: " - "" - "Click to manage this player." diff --git a/common/src/main/resources/language/en_US/guis/obelisk/player_notifications.yml b/common/src/main/resources/language/en_US/guis/obelisk/player_notifications.yml index d693719f..290f38f1 100644 --- a/common/src/main/resources/language/en_US/guis/obelisk/player_notifications.yml +++ b/common/src/main/resources/language/en_US/guis/obelisk/player_notifications.yml @@ -33,7 +33,7 @@ items: prompt: char: "p" # This is the character to use in the layout! material: "NETHER_STAR" - skull: "" # You can set custom skull textures (e.g. from minecraft-heads.com). 'material' MUST BE SET TO 'PLAYER_HEAD'. Placeholders: - Skull texture of the player. + skull: "" # You can set custom skull textures (e.g. from minecraft-heads.com). 'material' MUST BE SET TO 'PLAYER_HEAD'. Placeholders: - Skull texture of the player. text: "Audit Log" sound: "" # Sound played when the item is clicked. Set to 'none' to disable. pitch: 1 # Pitch of the sound. Does not apply if 'sound' is 'none.'. @@ -57,13 +57,13 @@ items: model: material: "PLAYER_HEAD" skull: "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYjRiZDlkZDEyOGM5NGMxMGM5NDVlYWRhYTM0MmZjNmQ5NzY1ZjM3YjNkZjJlMzhmN2IwNTZkYzdjOTI3ZWQifX19" - text: "" # Placeholders: - Title of the notification (e.g. "Faction Invite") + text: "" # Placeholders: - Title of the notification (e.g. "Faction Invite") sound: "ui.button.click" pitch: 1 - # Placeholders: - Description of the notification. The format & coloring is configured in the language files. + # Placeholders: - Description of the notification. The format & coloring is configured in the language files. # Placeholders: - Timestamp of the audit log. lore: - - "" + - "" - "" - "" - "Right click to dismiss." diff --git a/common/src/main/resources/language/en_US/guis/obelisk/player_obelisk.yml b/common/src/main/resources/language/en_US/guis/obelisk/player_obelisk.yml index 79bdeac5..2d0e2075 100644 --- a/common/src/main/resources/language/en_US/guis/obelisk/player_obelisk.yml +++ b/common/src/main/resources/language/en_US/guis/obelisk/player_obelisk.yml @@ -25,17 +25,17 @@ items: head: char: "p" # This is the character to use in the layout! material: "PLAYER_HEAD" - skull: "" # You can set custom skull textures (e.g. from minecraft-heads.com). 'material' MUST BE SET TO 'PLAYER_HEAD'. Placeholders: - Skull texture of the player. - text: "'s Obelisk" # Supported placeholders: - Player's Name + skull: "" # You can set custom skull textures (e.g. from minecraft-heads.com). 'material' MUST BE SET TO 'PLAYER_HEAD'. Placeholders: - Skull texture of the player. + text: "'s Obelisk" # Supported placeholders: - Player's Name sound: "" # Sound played when the item is clicked. Set to 'none' to disable. pitch: 1 # Pitch of the sound. Does not apply if 'sound' is 'none.'. lore: # Placeholders: - Current Island Level - # Placeholders: - Total Rune Count / - Total Gem Count + # Placeholders: - Total Rune Count / - Total Gem Count - "Stats" - "Level: " - - "Runes: " - - "Gems: " + - "Runes: " + - "Gems: " notifications: char: "n" @@ -45,11 +45,11 @@ items: sound: "" pitch: 1 lore: - # Placeholders: - Current unread notification count. + # Placeholders: - Current unread notification count. - "View and Manage your" - "unread Notifications." - "" - - "You currently have unread" + - "You currently have unread" - "Notifications." # UI to convert select blocks into runes diff --git a/common/src/main/resources/language/en_US/guis/pagination.yml b/common/src/main/resources/language/en_US/guis/pagination.yml index f2bcd992..127328f6 100644 --- a/common/src/main/resources/language/en_US/guis/pagination.yml +++ b/common/src/main/resources/language/en_US/guis/pagination.yml @@ -9,7 +9,7 @@ items: forward-button: char: ">" # This is the character used in the layout. material: "PLAYER_HEAD" - # You can set custom skull textures (e.g. from minecraft-heads.com). 'material' MUST BE SET TO 'PLAYER_HEAD'. Placeholders: - Skull texture of the player. + # You can set custom skull textures (e.g. from minecraft-heads.com). 'material' MUST BE SET TO 'PLAYER_HEAD'. Placeholders: - Skull texture of the player. skull: "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOTYzMzlmZjJlNTM0MmJhMThiZGM0OGE5OWNjYTY1ZDEyM2NlNzgxZDg3ODI3MmY5ZDk2NGVhZDNiOGFkMzcwIn19fQ==" # name: "Next Page" # Name of the item. sound: "item.book.page_turn" # Sound played when the item is clicked. Set to 'none' to disable. diff --git a/paper/src/main/java/net/skullian/skyfactions/paper/PaperSharedConstants.java b/paper/src/main/java/net/skullian/skyfactions/paper/PaperSharedConstants.java index 2b8e2b09..fff62e48 100644 --- a/paper/src/main/java/net/skullian/skyfactions/paper/PaperSharedConstants.java +++ b/paper/src/main/java/net/skullian/skyfactions/paper/PaperSharedConstants.java @@ -24,6 +24,6 @@ public class PaperSharedConstants { @NotNull private static NamespacedKey from(@NotNull String key) { - return new NamespacedKey(SharedConstants.PLUGIN_NAMESPACE, key); + return new NamespacedKey(SkyFactionsReborn.getInstance(), key); } } diff --git a/paper/src/main/java/net/skullian/skyfactions/paper/SkyFactionsReborn.java b/paper/src/main/java/net/skullian/skyfactions/paper/SkyFactionsReborn.java index be267357..1e9bb4e5 100644 --- a/paper/src/main/java/net/skullian/skyfactions/paper/SkyFactionsReborn.java +++ b/paper/src/main/java/net/skullian/skyfactions/paper/SkyFactionsReborn.java @@ -2,6 +2,7 @@ import net.skullian.skyfactions.common.api.SkyApi; import net.skullian.skyfactions.paper.api.SpigotSkyAPI; +import org.bukkit.Bukkit; import org.bukkit.plugin.java.JavaPlugin; public final class SkyFactionsReborn extends JavaPlugin { diff --git a/paper/src/main/java/net/skullian/skyfactions/paper/api/SpigotDefenceAPI.java b/paper/src/main/java/net/skullian/skyfactions/paper/api/SpigotDefenceAPI.java index 87295e1b..cffcb4d1 100644 --- a/paper/src/main/java/net/skullian/skyfactions/paper/api/SpigotDefenceAPI.java +++ b/paper/src/main/java/net/skullian/skyfactions/paper/api/SpigotDefenceAPI.java @@ -1,6 +1,7 @@ package net.skullian.skyfactions.paper.api; import com.jeff_media.customblockdata.CustomBlockData; +import net.skullian.skyfactions.common.SharedConstants; import net.skullian.skyfactions.common.api.DefenceAPI; import net.skullian.skyfactions.common.api.PlayerAPI; import net.skullian.skyfactions.common.api.SkyApi; diff --git a/paper/src/main/java/net/skullian/skyfactions/paper/api/SpigotObeliskAPI.java b/paper/src/main/java/net/skullian/skyfactions/paper/api/SpigotObeliskAPI.java index 2c84ac24..2a53261a 100644 --- a/paper/src/main/java/net/skullian/skyfactions/paper/api/SpigotObeliskAPI.java +++ b/paper/src/main/java/net/skullian/skyfactions/paper/api/SpigotObeliskAPI.java @@ -3,6 +3,7 @@ import com.github.puregero.multilib.MultiLib; import com.jeff_media.customblockdata.CustomBlockData; import lombok.Getter; +import net.skullian.skyfactions.common.SharedConstants; import net.skullian.skyfactions.common.api.ObeliskAPI; import net.skullian.skyfactions.common.config.types.ObeliskConfig; import net.skullian.skyfactions.common.config.types.Settings; diff --git a/paper/src/main/java/net/skullian/skyfactions/paper/api/adapter/SpigotAdapter.java b/paper/src/main/java/net/skullian/skyfactions/paper/api/adapter/SpigotAdapter.java index 4bf9e2db..365e1a84 100644 --- a/paper/src/main/java/net/skullian/skyfactions/paper/api/adapter/SpigotAdapter.java +++ b/paper/src/main/java/net/skullian/skyfactions/paper/api/adapter/SpigotAdapter.java @@ -3,6 +3,7 @@ import com.destroystokyo.paper.profile.PlayerProfile; import com.destroystokyo.paper.profile.ProfileProperty; import com.sk89q.worldedit.math.BlockVector3; +import net.skullian.skyfactions.common.SharedConstants; import net.skullian.skyfactions.common.api.SkyApi; import net.skullian.skyfactions.common.config.types.Messages; import net.skullian.skyfactions.common.user.SkyUser; diff --git a/paper/src/main/java/net/skullian/skyfactions/paper/defence/SpigotDefence.java b/paper/src/main/java/net/skullian/skyfactions/paper/defence/SpigotDefence.java index 3f92e4d4..c72e2725 100644 --- a/paper/src/main/java/net/skullian/skyfactions/paper/defence/SpigotDefence.java +++ b/paper/src/main/java/net/skullian/skyfactions/paper/defence/SpigotDefence.java @@ -5,6 +5,7 @@ import com.github.puregero.multilib.MultiLib; import com.jeff_media.customblockdata.CustomBlockData; import io.lumine.mythic.bukkit.MythicBukkit; +import net.skullian.skyfactions.common.SharedConstants; import net.skullian.skyfactions.common.api.SkyApi; import net.skullian.skyfactions.common.defence.Defence; import net.skullian.skyfactions.common.defence.hologram.DefenceTextHologram; diff --git a/paper/src/main/java/net/skullian/skyfactions/paper/event/ObeliskInteractionListener.java b/paper/src/main/java/net/skullian/skyfactions/paper/event/ObeliskInteractionListener.java index 9a0fa07f..5d7dead9 100644 --- a/paper/src/main/java/net/skullian/skyfactions/paper/event/ObeliskInteractionListener.java +++ b/paper/src/main/java/net/skullian/skyfactions/paper/event/ObeliskInteractionListener.java @@ -1,6 +1,7 @@ package net.skullian.skyfactions.paper.event; import com.jeff_media.customblockdata.CustomBlockData; +import net.skullian.skyfactions.common.SharedConstants; import net.skullian.skyfactions.common.api.SkyApi; import net.skullian.skyfactions.common.config.types.Messages; import net.skullian.skyfactions.common.config.types.ObeliskConfig; @@ -11,6 +12,7 @@ import net.skullian.skyfactions.paper.PaperSharedConstants; import net.skullian.skyfactions.paper.SkyFactionsReborn; import org.bukkit.Material; +import org.bukkit.NamespacedKey; import org.bukkit.block.Block; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; @@ -79,9 +81,11 @@ public void onBlockBreak(BlockBreakEvent event) { public void onInteract(PlayerInteractEvent event) { if (!event.getAction().equals(Action.RIGHT_CLICK_BLOCK)) return; if (!event.hasBlock()) return; + Block block = event.getClickedBlock(); if (block.getType() != Material.getMaterial(ObeliskConfig.OBELISK_MATERIAL.getString()) && block.getType() != Material.BARRIER) return; + Player player = event.getPlayer(); PersistentDataContainer container = new CustomBlockData(block, SkyFactionsReborn.getInstance()); diff --git a/paper/src/main/java/net/skullian/skyfactions/paper/event/defence/DefencePlacementHandler.java b/paper/src/main/java/net/skullian/skyfactions/paper/event/defence/DefencePlacementHandler.java index f564f73d..65d30500 100644 --- a/paper/src/main/java/net/skullian/skyfactions/paper/event/defence/DefencePlacementHandler.java +++ b/paper/src/main/java/net/skullian/skyfactions/paper/event/defence/DefencePlacementHandler.java @@ -2,6 +2,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.jeff_media.customblockdata.CustomBlockData; +import net.skullian.skyfactions.common.SharedConstants; import net.skullian.skyfactions.common.api.SkyApi; import net.skullian.skyfactions.common.config.types.DefencesConfig; import net.skullian.skyfactions.common.config.types.Messages;