├── .github ├── FUNDING.yml ├── dependabot.yml └── workflows │ └── maven.yml ├── .gitignore ├── .mvn └── wrapper │ ├── MavenWrapperDownloader.java │ ├── maven-wrapper.jar │ └── maven-wrapper.properties ├── .travis.yml ├── LICENSE ├── README.md ├── api ├── pom.xml └── src │ └── main │ └── java │ └── com │ └── alessiodp │ └── parties │ └── api │ ├── Parties.java │ ├── enums │ ├── DeleteCause.java │ ├── JoinCause.java │ ├── LeaveCause.java │ ├── Status.java │ └── package-info.java │ ├── events │ ├── Cancellable.java │ ├── PartiesEvent.java │ ├── bukkit │ │ ├── BukkitPartiesEvent.java │ │ ├── party │ │ │ ├── BukkitPartiesPartyGetExperienceEvent.java │ │ │ ├── BukkitPartiesPartyLevelUpEvent.java │ │ │ ├── BukkitPartiesPartyPostBroadcastEvent.java │ │ │ ├── BukkitPartiesPartyPostCreateEvent.java │ │ │ ├── BukkitPartiesPartyPostDeleteEvent.java │ │ │ ├── BukkitPartiesPartyPostRenameEvent.java │ │ │ ├── BukkitPartiesPartyPreBroadcastEvent.java │ │ │ ├── BukkitPartiesPartyPreCreateEvent.java │ │ │ ├── BukkitPartiesPartyPreDeleteEvent.java │ │ │ ├── BukkitPartiesPartyPreExperienceDropEvent.java │ │ │ └── BukkitPartiesPartyPreRenameEvent.java │ │ ├── player │ │ │ ├── BukkitPartiesPlayerPostChatEvent.java │ │ │ ├── BukkitPartiesPlayerPostHomeEvent.java │ │ │ ├── BukkitPartiesPlayerPostInviteEvent.java │ │ │ ├── BukkitPartiesPlayerPostJoinEvent.java │ │ │ ├── BukkitPartiesPlayerPostLeaveEvent.java │ │ │ ├── BukkitPartiesPlayerPostTeleportEvent.java │ │ │ ├── BukkitPartiesPlayerPreChatEvent.java │ │ │ ├── BukkitPartiesPlayerPreHomeEvent.java │ │ │ ├── BukkitPartiesPlayerPreInviteEvent.java │ │ │ ├── BukkitPartiesPlayerPreJoinEvent.java │ │ │ ├── BukkitPartiesPlayerPreLeaveEvent.java │ │ │ └── BukkitPartiesPlayerPreTeleportEvent.java │ │ └── unique │ │ │ ├── BukkitPartiesCombustFriendlyFireBlockedEvent.java │ │ │ ├── BukkitPartiesFishHookFriendlyFireBlockedEvent.java │ │ │ ├── BukkitPartiesFriendlyFireBlockedEvent.java │ │ │ ├── BukkitPartiesPotionsFriendlyFireBlockedEvent.java │ │ │ └── BukkitPartiesPreExperienceDropEvent.java │ ├── bungee │ │ ├── BungeePartiesEvent.java │ │ ├── party │ │ │ ├── BungeePartiesPartyGetExperienceEvent.java │ │ │ ├── BungeePartiesPartyLevelUpEvent.java │ │ │ ├── BungeePartiesPartyPostBroadcastEvent.java │ │ │ ├── BungeePartiesPartyPostCreateEvent.java │ │ │ ├── BungeePartiesPartyPostDeleteEvent.java │ │ │ ├── BungeePartiesPartyPostRenameEvent.java │ │ │ ├── BungeePartiesPartyPreBroadcastEvent.java │ │ │ ├── BungeePartiesPartyPreCreateEvent.java │ │ │ ├── BungeePartiesPartyPreDeleteEvent.java │ │ │ ├── BungeePartiesPartyPreExperienceDropEvent.java │ │ │ └── BungeePartiesPartyPreRenameEvent.java │ │ ├── player │ │ │ ├── BungeePartiesPlayerPostChatEvent.java │ │ │ ├── BungeePartiesPlayerPostHomeEvent.java │ │ │ ├── BungeePartiesPlayerPostInviteEvent.java │ │ │ ├── BungeePartiesPlayerPostJoinEvent.java │ │ │ ├── BungeePartiesPlayerPostLeaveEvent.java │ │ │ ├── BungeePartiesPlayerPostTeleportEvent.java │ │ │ ├── BungeePartiesPlayerPreChatEvent.java │ │ │ ├── BungeePartiesPlayerPreHomeEvent.java │ │ │ ├── BungeePartiesPlayerPreInviteEvent.java │ │ │ ├── BungeePartiesPlayerPreJoinEvent.java │ │ │ ├── BungeePartiesPlayerPreLeaveEvent.java │ │ │ └── BungeePartiesPlayerPreTeleportEvent.java │ │ └── unique │ │ │ └── BungeePartiesPartyFollowEvent.java │ ├── common │ │ ├── party │ │ │ ├── IPartyGetExperienceEvent.java │ │ │ ├── IPartyLevelUpEvent.java │ │ │ ├── IPartyPostBroadcastEvent.java │ │ │ ├── IPartyPostCreateEvent.java │ │ │ ├── IPartyPostDeleteEvent.java │ │ │ ├── IPartyPostRenameEvent.java │ │ │ ├── IPartyPreBroadcastEvent.java │ │ │ ├── IPartyPreCreateEvent.java │ │ │ ├── IPartyPreDeleteEvent.java │ │ │ ├── IPartyPreExperienceDropEvent.java │ │ │ └── IPartyPreRenameEvent.java │ │ └── player │ │ │ ├── IPlayerPostChatEvent.java │ │ │ ├── IPlayerPostHomeEvent.java │ │ │ ├── IPlayerPostInviteEvent.java │ │ │ ├── IPlayerPostJoinEvent.java │ │ │ ├── IPlayerPostLeaveEvent.java │ │ │ ├── IPlayerPostTeleportEvent.java │ │ │ ├── IPlayerPreChatEvent.java │ │ │ ├── IPlayerPreHomeEvent.java │ │ │ ├── IPlayerPreInviteEvent.java │ │ │ ├── IPlayerPreJoinEvent.java │ │ │ ├── IPlayerPreLeaveEvent.java │ │ │ └── IPlayerPreTeleportEvent.java │ ├── package-info.java │ └── velocity │ │ ├── VelocityPartiesEvent.java │ │ ├── party │ │ ├── VelocityPartiesPartyGetExperienceEvent.java │ │ ├── VelocityPartiesPartyLevelUpEvent.java │ │ ├── VelocityPartiesPartyPostBroadcastEvent.java │ │ ├── VelocityPartiesPartyPostCreateEvent.java │ │ ├── VelocityPartiesPartyPostDeleteEvent.java │ │ ├── VelocityPartiesPartyPostRenameEvent.java │ │ ├── VelocityPartiesPartyPreBroadcastEvent.java │ │ ├── VelocityPartiesPartyPreCreateEvent.java │ │ ├── VelocityPartiesPartyPreDeleteEvent.java │ │ ├── VelocityPartiesPartyPreExperienceDropEvent.java │ │ └── VelocityPartiesPartyPreRenameEvent.java │ │ ├── player │ │ ├── VelocityPartiesPlayerPostChatEvent.java │ │ ├── VelocityPartiesPlayerPostHomeEvent.java │ │ ├── VelocityPartiesPlayerPostInviteEvent.java │ │ ├── VelocityPartiesPlayerPostJoinEvent.java │ │ ├── VelocityPartiesPlayerPostLeaveEvent.java │ │ ├── VelocityPartiesPlayerPostTeleportEvent.java │ │ ├── VelocityPartiesPlayerPreChatEvent.java │ │ ├── VelocityPartiesPlayerPreHomeEvent.java │ │ ├── VelocityPartiesPlayerPreInviteEvent.java │ │ ├── VelocityPartiesPlayerPreJoinEvent.java │ │ ├── VelocityPartiesPlayerPreLeaveEvent.java │ │ └── VelocityPartiesPlayerPreTeleportEvent.java │ │ └── unique │ │ └── VelocityPartiesPartyFollowEvent.java │ ├── interfaces │ ├── Color.java │ ├── HomeLocation.java │ ├── PartiesAPI.java │ ├── PartiesOptions.java │ ├── Party.java │ ├── PartyAskRequest.java │ ├── PartyColor.java │ ├── PartyHome.java │ ├── PartyInvite.java │ ├── PartyPlayer.java │ ├── PartyRank.java │ ├── Rank.java │ └── package-info.java │ └── package-info.java ├── bukkit ├── dependency-reduced-pom.xml ├── patches │ ├── .gitignore │ ├── clan │ │ ├── messages.yml │ │ └── patch.sh │ ├── guild │ │ ├── messages.yml │ │ └── patch.sh │ └── patch_all.sh ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── alessiodp │ │ │ └── parties │ │ │ └── bukkit │ │ │ ├── BukkitPartiesPlugin.java │ │ │ ├── addons │ │ │ ├── BukkitPartiesAddonManager.java │ │ │ └── external │ │ │ │ ├── BanManagerHandler.java │ │ │ │ ├── BukkitAdvancedBanHandler.java │ │ │ │ ├── BukkitMetricsHandler.java │ │ │ │ ├── ClaimHandler.java │ │ │ │ ├── DynmapHandler.java │ │ │ │ ├── EssentialsChatHandler.java │ │ │ │ ├── EssentialsHandler.java │ │ │ │ ├── MagicHandler.java │ │ │ │ ├── PlaceholderAPIHandler.java │ │ │ │ ├── SkriptHandler.java │ │ │ │ ├── VaultHandler.java │ │ │ │ ├── hooks │ │ │ │ ├── GriefDefenderHook.java │ │ │ │ ├── GriefPreventionHook.java │ │ │ │ ├── MagicHook.java │ │ │ │ └── PAPIHook.java │ │ │ │ └── skript │ │ │ │ ├── Types.java │ │ │ │ ├── conditions │ │ │ │ ├── CondExistsParty.java │ │ │ │ ├── CondInParty.java │ │ │ │ ├── CondPartyFixed.java │ │ │ │ ├── CondPartyFriendlyFire.java │ │ │ │ ├── CondPartyFull.java │ │ │ │ └── CondPlayerLeader.java │ │ │ │ ├── effects │ │ │ │ ├── EffAddToParty.java │ │ │ │ ├── EffCreateParty.java │ │ │ │ ├── EffDeleteParty.java │ │ │ │ └── EffRemoveFromParty.java │ │ │ │ ├── events │ │ │ │ ├── EvtPartyCreate.java │ │ │ │ ├── EvtPartyDelete.java │ │ │ │ ├── EvtPartyExperience.java │ │ │ │ ├── EvtPartyRename.java │ │ │ │ ├── EvtPlayerJoin.java │ │ │ │ └── EvtPlayerLeave.java │ │ │ │ └── expressions │ │ │ │ ├── ExprGetParty.java │ │ │ │ ├── ExprGetPartyOfPlayer.java │ │ │ │ ├── ExprGetPartyPlayer.java │ │ │ │ ├── ExprPartyDescription.java │ │ │ │ ├── ExprPartyExperience.java │ │ │ │ ├── ExprPartyId.java │ │ │ │ ├── ExprPartyKills.java │ │ │ │ ├── ExprPartyLeader.java │ │ │ │ ├── ExprPartyLevel.java │ │ │ │ ├── ExprPartyMembers.java │ │ │ │ ├── ExprPartyMotd.java │ │ │ │ ├── ExprPartyName.java │ │ │ │ ├── ExprPartyPassword.java │ │ │ │ ├── ExprPartyTag.java │ │ │ │ ├── ExprPlayerName.java │ │ │ │ └── ExprPlayerRank.java │ │ │ ├── api │ │ │ └── BukkitPartiesOptionsHandler.java │ │ │ ├── bootstrap │ │ │ └── BukkitPartiesBootstrap.java │ │ │ ├── commands │ │ │ ├── BukkitPartiesCommandManager.java │ │ │ ├── list │ │ │ │ └── BukkitCommands.java │ │ │ ├── main │ │ │ │ ├── BukkitCommandP.java │ │ │ │ └── BukkitCommandParty.java │ │ │ └── sub │ │ │ │ ├── BukkitCommandClaim.java │ │ │ │ ├── BukkitCommandConfirm.java │ │ │ │ ├── BukkitCommandDebug.java │ │ │ │ ├── BukkitCommandHome.java │ │ │ │ ├── BukkitCommandSetHome.java │ │ │ │ └── BukkitCommandTeleport.java │ │ │ ├── configuration │ │ │ ├── BukkitPartiesConfigurationManager.java │ │ │ └── data │ │ │ │ ├── BukkitConfigMain.java │ │ │ │ ├── BukkitConfigParties.java │ │ │ │ └── BukkitMessages.java │ │ │ ├── events │ │ │ └── BukkitEventManager.java │ │ │ ├── listeners │ │ │ ├── BukkitChatListener.java │ │ │ ├── BukkitExpListener.java │ │ │ ├── BukkitFightListener.java │ │ │ ├── BukkitFollowListener.java │ │ │ └── BukkitJoinLeaveListener.java │ │ │ ├── messaging │ │ │ ├── BukkitPartiesMessageDispatcher.java │ │ │ ├── BukkitPartiesMessageListener.java │ │ │ ├── BukkitPartiesMessenger.java │ │ │ └── bungee │ │ │ │ ├── BukkitPartiesBungeecordDispatcher.java │ │ │ │ └── BukkitPartiesBungeecordListener.java │ │ │ ├── parties │ │ │ ├── BukkitPartyManager.java │ │ │ └── objects │ │ │ │ ├── BukkitPartyImpl.java │ │ │ │ └── BukkitPartyTeleportRequest.java │ │ │ ├── players │ │ │ ├── BukkitPlayerManager.java │ │ │ └── objects │ │ │ │ └── BukkitPartyPlayerImpl.java │ │ │ ├── tasks │ │ │ ├── BukkitHomeDelayTask.java │ │ │ └── BukkitTeleportDelayTask.java │ │ │ └── utils │ │ │ ├── BukkitEconomyManager.java │ │ │ ├── BukkitMessageUtils.java │ │ │ └── LastConfirmedCommand.java │ └── resources │ │ ├── bukkit │ │ ├── config.yml │ │ ├── messages.yml │ │ ├── parties.yml │ │ └── skript │ │ │ └── english.lang │ │ └── plugin.yml │ └── test │ └── java │ └── com │ └── alessiodp │ └── parties │ └── bukkit │ └── configuration │ └── BukkitConfigurationTest.java ├── bungeecord ├── dependency-reduced-pom.xml ├── patches │ ├── .gitignore │ ├── clan │ │ ├── messages.yml │ │ └── patch.sh │ ├── guild │ │ ├── messages.yml │ │ └── patch.sh │ └── patch_all.sh ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── alessiodp │ │ │ └── parties │ │ │ └── bungeecord │ │ │ ├── BungeePartiesPlugin.java │ │ │ ├── addons │ │ │ ├── BungeePartiesAddonManager.java │ │ │ └── external │ │ │ │ ├── BungeeAdvancedBanHandler.java │ │ │ │ ├── BungeeChatHandler.java │ │ │ │ ├── BungeeMetricsHandler.java │ │ │ │ ├── PartiesBungeeRedisBungeeHandler.java │ │ │ │ └── PremiumVanishHandler.java │ │ │ ├── api │ │ │ └── BungeePartiesOptionsHandler.java │ │ │ ├── bootstrap │ │ │ └── BungeePartiesBootstrap.java │ │ │ ├── commands │ │ │ ├── BungeePartiesCommandManager.java │ │ │ ├── main │ │ │ │ ├── BungeeCommandP.java │ │ │ │ └── BungeeCommandParty.java │ │ │ └── sub │ │ │ │ ├── BungeeCommandDebug.java │ │ │ │ ├── BungeeCommandHome.java │ │ │ │ ├── BungeeCommandSetHome.java │ │ │ │ └── BungeeCommandTeleport.java │ │ │ ├── configuration │ │ │ ├── BungeePartiesConfigurationManager.java │ │ │ └── data │ │ │ │ ├── BungeeConfigMain.java │ │ │ │ ├── BungeeConfigParties.java │ │ │ │ └── BungeeMessages.java │ │ │ ├── events │ │ │ └── BungeeEventManager.java │ │ │ ├── listeners │ │ │ ├── BungeeChatListener.java │ │ │ ├── BungeeFollowListener.java │ │ │ └── BungeeJoinLeaveListener.java │ │ │ ├── messaging │ │ │ ├── BungeePartiesMessageDispatcher.java │ │ │ ├── BungeePartiesMessageListener.java │ │ │ ├── BungeePartiesMessenger.java │ │ │ ├── bungee │ │ │ │ ├── BungeePartiesBungeecordDispatcher.java │ │ │ │ └── BungeePartiesBungeecordListener.java │ │ │ └── redis │ │ │ │ ├── BungeePartiesRedisBungeeDispatcher.java │ │ │ │ └── BungeePartiesRedisBungeeListener.java │ │ │ ├── parties │ │ │ ├── BungeePartyManager.java │ │ │ └── objects │ │ │ │ ├── BungeePartyImpl.java │ │ │ │ └── BungeePartyTeleportRequest.java │ │ │ ├── players │ │ │ ├── BungeePlayerManager.java │ │ │ └── objects │ │ │ │ └── BungeePartyPlayerImpl.java │ │ │ ├── tasks │ │ │ ├── BungeeHomeDelayTask.java │ │ │ └── BungeeTeleportDelayTask.java │ │ │ └── utils │ │ │ ├── BungeeEconomyManager.java │ │ │ └── BungeeMessageUtils.java │ └── resources │ │ ├── bungee.yml │ │ └── bungee │ │ ├── config.yml │ │ ├── messages.yml │ │ └── parties.yml │ └── test │ └── java │ └── com │ └── alessiodp │ └── parties │ └── bungee │ └── BungeeConfigurationTest.java ├── common ├── dependency-reduced-pom.xml ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── alessiodp │ │ │ └── parties │ │ │ └── common │ │ │ ├── PartiesPlugin.java │ │ │ ├── addons │ │ │ ├── PartiesAddonManager.java │ │ │ ├── external │ │ │ │ ├── AdvancedBanHandler.java │ │ │ │ ├── LLAPIHandler.java │ │ │ │ ├── LuckPermsHandler.java │ │ │ │ └── hooks │ │ │ │ │ ├── LLAPIHook.java │ │ │ │ │ └── LuckPermsHook.java │ │ │ └── internal │ │ │ │ └── PartiesPlaceholder.java │ │ │ ├── api │ │ │ ├── ApiHandler.java │ │ │ └── PartiesOptionsHandler.java │ │ │ ├── commands │ │ │ ├── PartiesCommandManager.java │ │ │ ├── list │ │ │ │ └── CommonCommands.java │ │ │ ├── main │ │ │ │ ├── CommandP.java │ │ │ │ └── CommandParty.java │ │ │ ├── sub │ │ │ │ ├── CommandAccept.java │ │ │ │ ├── CommandAsk.java │ │ │ │ ├── CommandChat.java │ │ │ │ ├── CommandClose.java │ │ │ │ ├── CommandColor.java │ │ │ │ ├── CommandCreate.java │ │ │ │ ├── CommandCreateFixed.java │ │ │ │ ├── CommandDebug.java │ │ │ │ ├── CommandDelete.java │ │ │ │ ├── CommandDeny.java │ │ │ │ ├── CommandDesc.java │ │ │ │ ├── CommandFollow.java │ │ │ │ ├── CommandHelp.java │ │ │ │ ├── CommandHome.java │ │ │ │ ├── CommandIgnore.java │ │ │ │ ├── CommandInfo.java │ │ │ │ ├── CommandInvite.java │ │ │ │ ├── CommandJoin.java │ │ │ │ ├── CommandKick.java │ │ │ │ ├── CommandLeave.java │ │ │ │ ├── CommandList.java │ │ │ │ ├── CommandMotd.java │ │ │ │ ├── CommandMute.java │ │ │ │ ├── CommandNickname.java │ │ │ │ ├── CommandOpen.java │ │ │ │ ├── CommandPassword.java │ │ │ │ ├── CommandProtection.java │ │ │ │ ├── CommandRank.java │ │ │ │ ├── CommandReload.java │ │ │ │ ├── CommandRename.java │ │ │ │ ├── CommandSetHome.java │ │ │ │ ├── CommandSpy.java │ │ │ │ ├── CommandTag.java │ │ │ │ ├── CommandTeleport.java │ │ │ │ └── CommandVersion.java │ │ │ └── utils │ │ │ │ ├── PartiesCommandData.java │ │ │ │ └── PartiesSubCommand.java │ │ │ ├── configuration │ │ │ ├── PartiesConfigurationManager.java │ │ │ ├── PartiesConstants.java │ │ │ └── data │ │ │ │ ├── ConfigMain.java │ │ │ │ ├── ConfigParties.java │ │ │ │ └── Messages.java │ │ │ ├── events │ │ │ └── EventManager.java │ │ │ ├── listeners │ │ │ ├── ChatListener.java │ │ │ └── JoinLeaveListener.java │ │ │ ├── messaging │ │ │ ├── CommonListener.java │ │ │ └── PartiesPacket.java │ │ │ ├── parties │ │ │ ├── ColorManager.java │ │ │ ├── CooldownManager.java │ │ │ ├── ExpManager.java │ │ │ ├── PartyManager.java │ │ │ └── objects │ │ │ │ ├── ExpResult.java │ │ │ │ ├── PartyColorImpl.java │ │ │ │ ├── PartyHomeImpl.java │ │ │ │ └── PartyImpl.java │ │ │ ├── players │ │ │ ├── PlayerManager.java │ │ │ ├── RankManager.java │ │ │ └── objects │ │ │ │ ├── PartyAskRequestImpl.java │ │ │ │ ├── PartyInviteImpl.java │ │ │ │ ├── PartyPlayerImpl.java │ │ │ │ ├── PartyRankImpl.java │ │ │ │ ├── PartyTeleportRequest.java │ │ │ │ ├── RequestCooldown.java │ │ │ │ └── SpyMessage.java │ │ │ ├── storage │ │ │ ├── PartiesDatabaseManager.java │ │ │ ├── dispatchers │ │ │ │ ├── PartiesSQLDispatcher.java │ │ │ │ └── PartiesYAMLDispatcher.java │ │ │ ├── file │ │ │ │ └── PartiesYAMLUpgradeManager.java │ │ │ ├── interfaces │ │ │ │ └── IPartiesDatabase.java │ │ │ └── sql │ │ │ │ └── dao │ │ │ │ ├── parties │ │ │ │ ├── H2PartiesDao.java │ │ │ │ ├── PartiesDao.java │ │ │ │ ├── PartyRowMapper.java │ │ │ │ ├── PostgreSQLPartiesDao.java │ │ │ │ └── SQLitePartiesDao.java │ │ │ │ └── players │ │ │ │ ├── H2PlayersDao.java │ │ │ │ ├── PartyPlayerRowMapper.java │ │ │ │ ├── PlayersDao.java │ │ │ │ ├── PostgreSQLPlayersDao.java │ │ │ │ ├── SQLitePlayersDao.java │ │ │ │ └── UUIDRowMapper.java │ │ │ ├── tasks │ │ │ ├── HomeDelayTask.java │ │ │ ├── MotdTask.java │ │ │ ├── TeleportDelayTask.java │ │ │ └── TeleportingDelayTask.java │ │ │ └── utils │ │ │ ├── CensorUtils.java │ │ │ ├── EconomyManager.java │ │ │ ├── MessageUtils.java │ │ │ ├── PartiesPermission.java │ │ │ ├── PartiesPlayerUtils.java │ │ │ ├── PasswordUtils.java │ │ │ └── RankPermission.java │ └── resources │ │ └── db │ │ └── migrations │ │ ├── h2 │ │ ├── 1__Initial_database.sql │ │ └── 2__Added_open.sql │ │ ├── mariadb │ │ ├── 1__Initial_database.sql │ │ └── 2__Added_open.sql │ │ ├── mysql │ │ ├── 0__Conversion.sql │ │ ├── 1__Initial_database.sql │ │ └── 2__Added_open.sql │ │ ├── postgresql │ │ ├── 1__Initial_database.sql │ │ └── 2__Added_open.sql │ │ └── sqlite │ │ ├── 0__Conversion.sql │ │ ├── 1__Initial_database.sql │ │ └── 2__Added_open.sql │ └── test │ └── java │ └── com │ └── alessiodp │ └── parties │ └── common │ ├── addons │ └── PartiesPlaceholderTest.java │ ├── messaging │ └── PartiesPacketTest.java │ ├── parties │ ├── ExpManagerTest.java │ ├── PartyHomeTest.java │ └── RankManagerTest.java │ ├── storage │ ├── FileDispatcherTest.java │ ├── MigrationsTest.java │ └── SQLDispatcherTest.java │ └── utils │ ├── CensorUtilsTest.java │ └── PasswordUtilsTest.java ├── crowdin.yml ├── locales ├── bukkit │ ├── messages_bg_BG.yml │ ├── messages_cs_CZ.yml │ ├── messages_da_DK.yml │ ├── messages_de_DE.yml │ ├── messages_es_ES.yml │ ├── messages_fa_IR_LTR.yml │ ├── messages_fr_FR.yml │ ├── messages_hu_HU.yml │ ├── messages_it_IT.yml │ ├── messages_ja_JP.yml │ ├── messages_ko_KR.yml │ ├── messages_nl_NL.yml │ ├── messages_pl_PL.yml │ ├── messages_pt_BR.yml │ ├── messages_pt_PT.yml │ ├── messages_ro_RO.yml │ ├── messages_ru_RU.yml │ ├── messages_tr_TR.yml │ ├── messages_uk_UA.yml │ └── messages_zh_CN.yml ├── bungeecord │ ├── messages_bg_BG.yml │ ├── messages_cs_CZ.yml │ ├── messages_da_DK.yml │ ├── messages_de_DE.yml │ ├── messages_es_ES.yml │ ├── messages_fa_IR_LTR.yml │ ├── messages_fr_FR.yml │ ├── messages_hu_HU.yml │ ├── messages_it_IT.yml │ ├── messages_ja_JP.yml │ ├── messages_ko_KR.yml │ ├── messages_nl_NL.yml │ ├── messages_pl_PL.yml │ ├── messages_pt_BR.yml │ ├── messages_pt_PT.yml │ ├── messages_ro_RO.yml │ ├── messages_ru_RU.yml │ ├── messages_tr_TR.yml │ ├── messages_uk_UA.yml │ └── messages_zh_CN.yml └── velocity │ ├── messages_bg_BG.yml │ ├── messages_cs_CZ.yml │ ├── messages_da_DK.yml │ ├── messages_de_DE.yml │ ├── messages_es_ES.yml │ ├── messages_fa_IR_LTR.yml │ ├── messages_fr_FR.yml │ ├── messages_hu_HU.yml │ ├── messages_it_IT.yml │ ├── messages_ja_JP.yml │ ├── messages_ko_KR.yml │ ├── messages_nl_NL.yml │ ├── messages_pl_PL.yml │ ├── messages_pt_BR.yml │ ├── messages_pt_PT.yml │ ├── messages_ro_RO.yml │ ├── messages_ru_RU.yml │ ├── messages_tr_TR.yml │ ├── messages_uk_UA.yml │ └── messages_zh_CN.yml ├── logo.png ├── mvnw ├── mvnw.cmd ├── output ├── dependency-reduced-pom.xml └── pom.xml ├── pom.xml ├── testing ├── database_2_6_X.db └── database_2_6_X.yml └── velocity ├── dependency-reduced-pom.xml ├── patches ├── .gitignore ├── clan │ ├── messages.yml │ └── patch.sh ├── guild │ ├── messages.yml │ └── patch.sh └── patch_all.sh ├── pom.xml └── src ├── main ├── java-templates │ └── com │ │ └── alessiodp │ │ └── parties │ │ └── velocity │ │ └── VelocityConstants.java ├── java │ └── com │ │ └── alessiodp │ │ └── parties │ │ └── velocity │ │ ├── VelocityPartiesPlugin.java │ │ ├── addons │ │ ├── VelocityPartiesAddonManager.java │ │ └── external │ │ │ ├── PartiesVelocityRedisBungeeHandler.java │ │ │ └── VelocityMetricsHandler.java │ │ ├── bootstrap │ │ └── VelocityPartiesBootstrap.java │ │ ├── commands │ │ ├── VelocityPartiesCommandManager.java │ │ ├── main │ │ │ ├── VelocityCommandP.java │ │ │ └── VelocityCommandParty.java │ │ └── sub │ │ │ ├── VelocityCommandDebug.java │ │ │ ├── VelocityCommandHome.java │ │ │ ├── VelocityCommandSetHome.java │ │ │ └── VelocityCommandTeleport.java │ │ ├── configuration │ │ ├── VelocityPartiesConfigurationManager.java │ │ └── data │ │ │ ├── VelocityConfigMain.java │ │ │ ├── VelocityConfigParties.java │ │ │ └── VelocityMessages.java │ │ ├── events │ │ └── VelocityEventManager.java │ │ ├── listeners │ │ ├── VelocityChatListener.java │ │ ├── VelocityFollowListener.java │ │ └── VelocityJoinLeaveListener.java │ │ ├── messaging │ │ ├── VelocityPartiesMessageDispatcher.java │ │ ├── VelocityPartiesMessageListener.java │ │ ├── VelocityPartiesMessenger.java │ │ ├── bungee │ │ │ ├── VelocityPartiesBungeecordDispatcher.java │ │ │ └── VelocityPartiesBungeecordListener.java │ │ └── redis │ │ │ ├── VelocityPartiesRedisBungeeDispatcher.java │ │ │ └── VelocityPartiesRedisBungeeListener.java │ │ ├── parties │ │ ├── VelocityPartyManager.java │ │ └── objects │ │ │ ├── VelocityPartyImpl.java │ │ │ └── VelocityPartyTeleportRequest.java │ │ ├── players │ │ ├── VelocityPlayerManager.java │ │ └── objects │ │ │ └── VelocityPartyPlayerImpl.java │ │ ├── tasks │ │ ├── VelocityHomeDelayTask.java │ │ └── VelocityTeleportDelayTask.java │ │ └── utils │ │ ├── VelocityEconomyManager.java │ │ └── VelocityMessageUtils.java └── resources │ └── velocity │ ├── config.yml │ ├── messages.yml │ └── parties.yml └── test └── java └── com └── alessiodp └── parties └── velocity └── VelocityConfigurationTest.java /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | custom: https://paypal.me/AlessioDP -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: maven 4 | directory: "/" 5 | schedule: 6 | interval: daily 7 | time: "04:00" 8 | open-pull-requests-limit: 10 9 | ignore: 10 | - dependency-name: "org.yaml:snakeyaml" 11 | - dependency-name: "com.h2database:h2" 12 | - dependency-name: "com.zaxxer:HikariCP" 13 | - dependency-name: "org.mariadb.jdbc:mariadb-java-client" 14 | - dependency-name: "mysql:mysql-connector-java" 15 | - dependency-name: "org.postgresql:postgresql" 16 | - dependency-name: "org.xerial:sqlite-jdbc" 17 | - dependency-name: "org.codehaus.mojo:versions-maven-plugin" 18 | - dependency-name: "org.apache.maven.plugins:maven-compiler-plugin" 19 | - dependency-name: "org.apache.maven.plugins:maven-javadoc-plugin" 20 | - dependency-name: "org.jetbrains:annotations" 21 | - dependency-name: "com.alessiodp.core:*" 22 | -------------------------------------------------------------------------------- /.github/workflows/maven.yml: -------------------------------------------------------------------------------- 1 | # This workflow will build a Java project with Maven 2 | # For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven 3 | 4 | name: Java CI with Maven 5 | 6 | on: 7 | push: 8 | branches: [ master ] 9 | 10 | jobs: 11 | build: 12 | 13 | runs-on: ubuntu-latest 14 | 15 | strategy: 16 | matrix: 17 | java-version: [11, 16, 17] 18 | 19 | steps: 20 | - uses: actions/checkout@v3 21 | - name: Set up JDK 22 | uses: actions/setup-java@v3 23 | with: 24 | distribution: 'corretto' 25 | java-version: ${{ matrix.java-version }} 26 | - name: Build with Maven 27 | run: mvn -B package --file pom.xml 28 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by .ignore support plugin (hsz.mobi) 2 | .gradle 3 | **/build/ 4 | 5 | # Ignore Gradle GUI config 6 | gradle-app.setting 7 | 8 | # Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) 9 | !gradle-wrapper.jar 10 | 11 | # Cache of project 12 | .gradletasknamecache 13 | 14 | # # Work around https://youtrack.jetbrains.com/issue/IDEA-116898 15 | # gradle/wrapper/gradle-wrapper.properties 16 | 17 | # IntelliJ project files 18 | .idea 19 | *.iml 20 | out 21 | gen 22 | 23 | # Maven 24 | log/ 25 | target/ 26 | -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlessioDP/Parties/5a6ef6c5599acde3cad265a70a85cfcc98255460/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar 3 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: java 2 | jdk: 3 | - openjdk8 4 | - openjdk11 5 | - openjdk15 6 | branches: 7 | only: 8 | - master -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | 3 | # Parties 4 | Parties is an advanced plugin for Minecraft servers that allows the creation of parties (groups/clans/guilds) on your server. 5 | Everything is configurable and modular, if you don't want a feature, just disable it (it won't have a bad impact on the server). 6 | 7 | [Official project page here!](https://alessiodp.com/parties) 8 | 9 | ## Downloads 10 | [Download from Spigot](https://www.spigotmc.org/resources/parties.3709/) 11 | [Download from Bukkit](https://dev.bukkit.org/projects/parties) 12 | 13 | ## Documentation 14 | [Documentation page here](https://alessiodp.com/docs/parties). 15 | 16 | ## API Usage Example 17 | [Example project](https://github.com/AlessioDP/PartiesExample) 18 | 19 | ## License 20 | [Read the license here](https://github.com/AlessioDP/Parties/blob/master/LICENSE). -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/Parties.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api; 2 | 3 | import com.alessiodp.parties.api.interfaces.PartiesAPI; 4 | 5 | public final class Parties { 6 | private static PartiesAPI api = null; 7 | private static boolean flagHook = false; 8 | 9 | private Parties() { 10 | } 11 | 12 | /** 13 | * Get the {@link PartiesAPI} instance 14 | * 15 | * @return the {@link PartiesAPI} interface 16 | * @throws IllegalStateException if PartiesAPI has not been initialized, in other words, 17 | * PartiesAPI has not been loaded 18 | */ 19 | public static PartiesAPI getApi() throws IllegalStateException { 20 | flagHook = true; 21 | if (api == null) 22 | throw new IllegalStateException("PartiesAPI has not been initialized"); 23 | return api; 24 | } 25 | 26 | /** 27 | * Set the Parties API instance. This should not be used. 28 | * 29 | * @param instance the PartiesAPI instance. 30 | */ 31 | public static void setApi(PartiesAPI instance) { 32 | api = instance; 33 | } 34 | 35 | /** 36 | * Flag to know if Parties has been hooked 37 | * 38 | * @return true if the API has been hooked at least one time 39 | */ 40 | public static boolean isFlagHook() { 41 | return flagHook; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/enums/DeleteCause.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.enums; 2 | 3 | public enum DeleteCause { 4 | 5 | /** 6 | * The last player or leader left the party 7 | */ 8 | LEAVE, 9 | /** 10 | * The last player or leader has been kicked from the party 11 | */ 12 | KICK, 13 | /** 14 | * The party has been deleted 15 | */ 16 | DELETE, 17 | /** 18 | * The last player or leader has been banned from the server 19 | */ 20 | BAN, 21 | /** 22 | * The party got deleted after all players or leader left the server 23 | */ 24 | TIMEOUT, 25 | /** 26 | * Other reasons 27 | */ 28 | OTHERS 29 | } 30 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/enums/JoinCause.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.enums; 2 | 3 | public enum JoinCause { 4 | /** 5 | * Caused by ask command then accepted 6 | */ 7 | ASK, 8 | /** 9 | * Caused by invite command then accepted 10 | */ 11 | INVITE, 12 | /** 13 | * Caused by join command 14 | */ 15 | JOIN, 16 | /** 17 | * Other reasons 18 | */ 19 | OTHERS 20 | } 21 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/enums/LeaveCause.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.enums; 2 | 3 | public enum LeaveCause { 4 | /** 5 | * The player left the party 6 | */ 7 | LEAVE, 8 | /** 9 | * The player has been kicked from the party 10 | */ 11 | KICK, 12 | /** 13 | * The player has been banned from the server 14 | */ 15 | BAN, 16 | /** 17 | * The player got kicked after leaving the server 18 | */ 19 | TIMEOUT, 20 | /** 21 | * Other reasons 22 | */ 23 | OTHERS 24 | } 25 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/enums/Status.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.enums; 2 | 3 | /** 4 | * Status is an enum that provides a result for some Parties API methods. 5 | * @deprecated No longer used 6 | */ 7 | @Deprecated 8 | public enum Status { 9 | /** 10 | * The party doesn't exist 11 | */ 12 | NOEXIST, 13 | /** 14 | * The player isn't in a party 15 | */ 16 | NOPARTY, 17 | /** 18 | * The player is already in a party 19 | */ 20 | ALREADYINPARTY, 21 | /** 22 | * The party already exists 23 | */ 24 | ALREADYEXISTPARTY, 25 | /** 26 | * The party is full 27 | */ 28 | PARTYFULL, 29 | /** 30 | * Action performed successfully 31 | */ 32 | SUCCESS 33 | } 34 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/enums/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Enums used in Parties API 3 | */ 4 | package com.alessiodp.parties.api.enums; -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/Cancellable.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events; 2 | 3 | public interface Cancellable { 4 | /** 5 | * Is the event cancelled? 6 | * 7 | * @return {@code true} if the event is cancelled 8 | */ 9 | boolean isCancelled(); 10 | 11 | /** 12 | * Set the event as cancelled 13 | * 14 | * @param cancel {@code true} to cancel 15 | */ 16 | void setCancelled(boolean cancel); 17 | } 18 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/PartiesEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events; 2 | 3 | import com.alessiodp.parties.api.interfaces.PartiesAPI; 4 | import org.jetbrains.annotations.NotNull; 5 | 6 | public interface PartiesEvent { 7 | /** 8 | * Get the Parties API instance 9 | * 10 | * @return the {@link PartiesAPI} 11 | */ 12 | @NotNull PartiesAPI getApi(); 13 | 14 | /** 15 | * Set the Parties API instance. Used by Parties instance to let you hook directly to the main API. 16 | * 17 | * @param instance {@link PartiesAPI} instance to set 18 | */ 19 | void setApi(PartiesAPI instance); 20 | } 21 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/bukkit/BukkitPartiesEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.bukkit; 2 | 3 | import com.alessiodp.parties.api.events.PartiesEvent; 4 | import com.alessiodp.parties.api.interfaces.PartiesAPI; 5 | import org.bukkit.event.Event; 6 | import org.bukkit.event.HandlerList; 7 | import org.jetbrains.annotations.NotNull; 8 | 9 | public class BukkitPartiesEvent extends Event implements PartiesEvent { 10 | private PartiesAPI api; 11 | private static final HandlerList HANDLERS = new HandlerList(); 12 | 13 | public BukkitPartiesEvent(boolean async) { 14 | super(async); 15 | } 16 | 17 | @Override 18 | public @NotNull PartiesAPI getApi() { 19 | return api; 20 | } 21 | 22 | @Override 23 | public void setApi(PartiesAPI instance) { 24 | api = instance; 25 | } 26 | 27 | @Override 28 | public @NotNull HandlerList getHandlers() { 29 | return HANDLERS; 30 | } 31 | 32 | public static HandlerList getHandlerList() { 33 | return HANDLERS; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/bukkit/party/BukkitPartiesPartyGetExperienceEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.bukkit.party; 2 | 3 | import com.alessiodp.parties.api.events.bukkit.BukkitPartiesEvent; 4 | import com.alessiodp.parties.api.events.common.party.IPartyGetExperienceEvent; 5 | import com.alessiodp.parties.api.interfaces.Party; 6 | import com.alessiodp.parties.api.interfaces.PartyPlayer; 7 | import org.jetbrains.annotations.NotNull; 8 | import org.jetbrains.annotations.Nullable; 9 | 10 | public class BukkitPartiesPartyGetExperienceEvent extends BukkitPartiesEvent implements IPartyGetExperienceEvent { 11 | private final Party party; 12 | private final double experience; 13 | 14 | private final ExpSource source; 15 | private final PartyPlayer killer; 16 | 17 | public BukkitPartiesPartyGetExperienceEvent(Party party, double experience, PartyPlayer killer) { 18 | super(true); 19 | this.party = party; 20 | this.experience = experience; 21 | source = killer != null ? ExpSource.KILL : ExpSource.API; 22 | this.killer = killer; 23 | } 24 | 25 | @Override 26 | public @NotNull Party getParty() { 27 | return party; 28 | } 29 | 30 | @Override 31 | public double getExperience() { 32 | return experience; 33 | } 34 | 35 | @Override 36 | public @NotNull ExpSource getSource() { 37 | return source; 38 | } 39 | 40 | @Override 41 | public @Nullable PartyPlayer getKiller() { 42 | return killer; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/bukkit/party/BukkitPartiesPartyLevelUpEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.bukkit.party; 2 | 3 | import com.alessiodp.parties.api.events.bukkit.BukkitPartiesEvent; 4 | import com.alessiodp.parties.api.events.common.party.IPartyLevelUpEvent; 5 | import com.alessiodp.parties.api.interfaces.Party; 6 | import org.jetbrains.annotations.NotNull; 7 | 8 | public class BukkitPartiesPartyLevelUpEvent extends BukkitPartiesEvent implements IPartyLevelUpEvent { 9 | private final Party party; 10 | private final int newLevel; 11 | 12 | public BukkitPartiesPartyLevelUpEvent(Party party, int newLevel) { 13 | super(true); 14 | this.party = party; 15 | this.newLevel = newLevel; 16 | } 17 | 18 | @Override 19 | public @NotNull Party getParty() { 20 | return party; 21 | } 22 | 23 | @Override 24 | public int getNewLevel() { 25 | return newLevel; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/bukkit/party/BukkitPartiesPartyPostBroadcastEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.bukkit.party; 2 | 3 | import com.alessiodp.parties.api.events.bukkit.BukkitPartiesEvent; 4 | import com.alessiodp.parties.api.events.common.party.IPartyPostBroadcastEvent; 5 | import com.alessiodp.parties.api.interfaces.Party; 6 | import com.alessiodp.parties.api.interfaces.PartyPlayer; 7 | import org.jetbrains.annotations.NotNull; 8 | import org.jetbrains.annotations.Nullable; 9 | 10 | public class BukkitPartiesPartyPostBroadcastEvent extends BukkitPartiesEvent implements IPartyPostBroadcastEvent { 11 | private final Party party; 12 | private final String message; 13 | private final PartyPlayer player; 14 | 15 | public BukkitPartiesPartyPostBroadcastEvent(Party party, String message, PartyPlayer player) { 16 | super(true); 17 | this.party = party; 18 | this.message = message; 19 | this.player = player; 20 | } 21 | 22 | @Override 23 | public @NotNull Party getParty() { 24 | return party; 25 | } 26 | 27 | @Override 28 | public @NotNull String getMessage() { 29 | return message; 30 | } 31 | 32 | @Override 33 | public @Nullable PartyPlayer getPartyPlayer() { 34 | return player; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/bukkit/party/BukkitPartiesPartyPostCreateEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.bukkit.party; 2 | 3 | import com.alessiodp.parties.api.events.bukkit.BukkitPartiesEvent; 4 | import com.alessiodp.parties.api.events.common.party.IPartyPostCreateEvent; 5 | import com.alessiodp.parties.api.interfaces.Party; 6 | import com.alessiodp.parties.api.interfaces.PartyPlayer; 7 | import org.jetbrains.annotations.NotNull; 8 | import org.jetbrains.annotations.Nullable; 9 | 10 | public class BukkitPartiesPartyPostCreateEvent extends BukkitPartiesEvent implements IPartyPostCreateEvent { 11 | private final PartyPlayer player; 12 | private final Party party; 13 | 14 | public BukkitPartiesPartyPostCreateEvent(PartyPlayer player, Party party) { 15 | super(true); 16 | this.player = player; 17 | this.party = party; 18 | } 19 | 20 | @Override 21 | public @Nullable PartyPlayer getCreator() { 22 | return player; 23 | } 24 | 25 | @Override 26 | public @NotNull Party getParty() { 27 | return party; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/bukkit/party/BukkitPartiesPartyPostDeleteEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.bukkit.party; 2 | 3 | import com.alessiodp.parties.api.enums.DeleteCause; 4 | import com.alessiodp.parties.api.events.bukkit.BukkitPartiesEvent; 5 | import com.alessiodp.parties.api.events.common.party.IPartyPostDeleteEvent; 6 | import com.alessiodp.parties.api.interfaces.Party; 7 | import com.alessiodp.parties.api.interfaces.PartyPlayer; 8 | import org.jetbrains.annotations.NotNull; 9 | import org.jetbrains.annotations.Nullable; 10 | 11 | 12 | public class BukkitPartiesPartyPostDeleteEvent extends BukkitPartiesEvent implements IPartyPostDeleteEvent { 13 | private final Party party; 14 | private final DeleteCause cause; 15 | private final PartyPlayer kickedPlayer; 16 | private final PartyPlayer commandSender; 17 | 18 | public BukkitPartiesPartyPostDeleteEvent(Party party, DeleteCause cause, PartyPlayer kickedPlayer, PartyPlayer commandSender) { 19 | super(true); 20 | this.party = party; 21 | this.cause = cause; 22 | this.kickedPlayer = kickedPlayer; 23 | this.commandSender = commandSender; 24 | } 25 | 26 | @Override 27 | public @NotNull Party getParty() { 28 | return party; 29 | } 30 | 31 | @Override 32 | public @NotNull DeleteCause getCause() { 33 | return cause; 34 | } 35 | 36 | @Override 37 | public @Nullable PartyPlayer getKickedPlayer() { 38 | return kickedPlayer; 39 | } 40 | 41 | @Override 42 | public @Nullable PartyPlayer getCommandSender() { 43 | return commandSender; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/bukkit/player/BukkitPartiesPlayerPostChatEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.bukkit.player; 2 | 3 | import com.alessiodp.parties.api.events.bukkit.BukkitPartiesEvent; 4 | import com.alessiodp.parties.api.events.common.player.IPlayerPostChatEvent; 5 | import com.alessiodp.parties.api.interfaces.Party; 6 | import com.alessiodp.parties.api.interfaces.PartyPlayer; 7 | import org.jetbrains.annotations.NotNull; 8 | 9 | public class BukkitPartiesPlayerPostChatEvent extends BukkitPartiesEvent implements IPlayerPostChatEvent { 10 | private final PartyPlayer player; 11 | private final Party party; 12 | private final String formattedMessage; 13 | private final String message; 14 | 15 | public BukkitPartiesPlayerPostChatEvent(PartyPlayer player, Party party, String formattedMessage, String message) { 16 | super(true); 17 | this.player = player; 18 | this.party = party; 19 | this.formattedMessage = formattedMessage; 20 | this.message = message; 21 | } 22 | 23 | @Override 24 | public @NotNull PartyPlayer getPartyPlayer() { 25 | return player; 26 | } 27 | 28 | @Override 29 | public @NotNull Party getParty() { 30 | return party; 31 | } 32 | 33 | @Override 34 | public @NotNull String getFormattedMessage() { 35 | return formattedMessage; 36 | } 37 | 38 | @Override 39 | public @NotNull String getMessage() { 40 | return message; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/bukkit/player/BukkitPartiesPlayerPostHomeEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.bukkit.player; 2 | 3 | import com.alessiodp.parties.api.events.bukkit.BukkitPartiesEvent; 4 | import com.alessiodp.parties.api.events.common.player.IPlayerPostHomeEvent; 5 | import com.alessiodp.parties.api.interfaces.Party; 6 | import com.alessiodp.parties.api.interfaces.PartyHome; 7 | import com.alessiodp.parties.api.interfaces.PartyPlayer; 8 | import org.jetbrains.annotations.NotNull; 9 | 10 | public class BukkitPartiesPlayerPostHomeEvent extends BukkitPartiesEvent implements IPlayerPostHomeEvent { 11 | private final PartyPlayer player; 12 | private final Party party; 13 | private final PartyHome home; 14 | 15 | public BukkitPartiesPlayerPostHomeEvent(PartyPlayer player, Party party, PartyHome home) { 16 | super(false); 17 | this.player = player; 18 | this.party = party; 19 | this.home = home; 20 | } 21 | 22 | @Override 23 | public @NotNull PartyPlayer getPartyPlayer() { 24 | return player; 25 | } 26 | 27 | @Override 28 | public @NotNull Party getParty() { 29 | return party; 30 | } 31 | 32 | @Override 33 | public @NotNull PartyHome getHome() { 34 | return home; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/bukkit/player/BukkitPartiesPlayerPostInviteEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.bukkit.player; 2 | 3 | import com.alessiodp.parties.api.events.bukkit.BukkitPartiesEvent; 4 | import com.alessiodp.parties.api.events.common.player.IPlayerPostInviteEvent; 5 | import com.alessiodp.parties.api.interfaces.Party; 6 | import com.alessiodp.parties.api.interfaces.PartyPlayer; 7 | import org.jetbrains.annotations.NotNull; 8 | import org.jetbrains.annotations.Nullable; 9 | 10 | public class BukkitPartiesPlayerPostInviteEvent extends BukkitPartiesEvent implements IPlayerPostInviteEvent { 11 | private final PartyPlayer invitedPlayer; 12 | private final PartyPlayer inviter; 13 | private final Party party; 14 | 15 | public BukkitPartiesPlayerPostInviteEvent(PartyPlayer invitedPlayer, PartyPlayer inviter, Party party) { 16 | super(true); 17 | this.invitedPlayer = invitedPlayer; 18 | this.inviter = inviter; 19 | this.party = party; 20 | } 21 | 22 | @Override 23 | public @NotNull PartyPlayer getInvitedPlayer() { 24 | return invitedPlayer; 25 | } 26 | 27 | @Override 28 | public @Nullable PartyPlayer getInviter() { 29 | return inviter; 30 | } 31 | 32 | @Override 33 | public @NotNull Party getParty() { 34 | return party; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/bukkit/player/BukkitPartiesPlayerPostJoinEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.bukkit.player; 2 | 3 | import com.alessiodp.parties.api.enums.JoinCause; 4 | import com.alessiodp.parties.api.events.bukkit.BukkitPartiesEvent; 5 | import com.alessiodp.parties.api.events.common.player.IPlayerPostJoinEvent; 6 | import com.alessiodp.parties.api.interfaces.Party; 7 | import com.alessiodp.parties.api.interfaces.PartyPlayer; 8 | import org.jetbrains.annotations.NotNull; 9 | import org.jetbrains.annotations.Nullable; 10 | 11 | public class BukkitPartiesPlayerPostJoinEvent extends BukkitPartiesEvent implements IPlayerPostJoinEvent { 12 | private final PartyPlayer player; 13 | private final Party party; 14 | private final JoinCause cause; 15 | private final PartyPlayer inviter; 16 | 17 | public BukkitPartiesPlayerPostJoinEvent(PartyPlayer player, Party party, JoinCause cause, PartyPlayer inviter) { 18 | super(true); 19 | this.player = player; 20 | this.party = party; 21 | this.cause = cause; 22 | this.inviter = inviter; 23 | } 24 | 25 | @Override 26 | public @NotNull PartyPlayer getPartyPlayer() { 27 | return player; 28 | } 29 | 30 | @Override 31 | public @NotNull Party getParty() { 32 | return party; 33 | } 34 | 35 | @Override 36 | public @NotNull JoinCause getCause() { 37 | return cause; 38 | } 39 | 40 | @Override 41 | public @Nullable PartyPlayer getInviter() { 42 | return inviter; 43 | } 44 | } -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/bukkit/player/BukkitPartiesPlayerPostLeaveEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.bukkit.player; 2 | 3 | import com.alessiodp.parties.api.enums.LeaveCause; 4 | import com.alessiodp.parties.api.events.bukkit.BukkitPartiesEvent; 5 | import com.alessiodp.parties.api.events.common.player.IPlayerPostLeaveEvent; 6 | import com.alessiodp.parties.api.interfaces.Party; 7 | import com.alessiodp.parties.api.interfaces.PartyPlayer; 8 | import org.jetbrains.annotations.NotNull; 9 | import org.jetbrains.annotations.Nullable; 10 | 11 | public class BukkitPartiesPlayerPostLeaveEvent extends BukkitPartiesEvent implements IPlayerPostLeaveEvent { 12 | private final PartyPlayer player; 13 | private final Party party; 14 | private final LeaveCause cause; 15 | private final PartyPlayer kicker; 16 | 17 | public BukkitPartiesPlayerPostLeaveEvent(PartyPlayer player, Party party, LeaveCause cause, PartyPlayer kicker) { 18 | super(true); 19 | this.player = player; 20 | this.party = party; 21 | this.cause = cause; 22 | this.kicker = kicker; 23 | } 24 | 25 | @Override 26 | public @NotNull PartyPlayer getPartyPlayer() { 27 | return player; 28 | } 29 | 30 | @Override 31 | public @NotNull Party getParty() { 32 | return party; 33 | } 34 | 35 | @Override 36 | public @NotNull LeaveCause getCause() { 37 | return cause; 38 | } 39 | 40 | @Override 41 | public @Nullable PartyPlayer getKicker() { 42 | return kicker; 43 | } 44 | } -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/bukkit/player/BukkitPartiesPlayerPostTeleportEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.bukkit.player; 2 | 3 | import com.alessiodp.parties.api.events.bukkit.BukkitPartiesEvent; 4 | import com.alessiodp.parties.api.events.common.player.IPlayerPostTeleportEvent; 5 | import com.alessiodp.parties.api.interfaces.Party; 6 | import com.alessiodp.parties.api.interfaces.PartyPlayer; 7 | import org.bukkit.Location; 8 | import org.jetbrains.annotations.NotNull; 9 | 10 | public class BukkitPartiesPlayerPostTeleportEvent extends BukkitPartiesEvent implements IPlayerPostTeleportEvent { 11 | private final PartyPlayer player; 12 | private final Party party; 13 | private final Location destination; 14 | 15 | public BukkitPartiesPlayerPostTeleportEvent(PartyPlayer player, Party party, Location destination) { 16 | super(false); 17 | this.player = player; 18 | this.party = party; 19 | this.destination = destination; 20 | } 21 | 22 | @Override 23 | public @NotNull PartyPlayer getPartyPlayer() { 24 | return player; 25 | } 26 | 27 | @Override 28 | public @NotNull Party getParty() { 29 | return party; 30 | } 31 | 32 | /** 33 | * Get the destination as Location 34 | * 35 | * @return the {@link Location} 36 | */ 37 | public @NotNull Location getDestination() { 38 | return destination; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/bukkit/player/BukkitPartiesPlayerPreHomeEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.bukkit.player; 2 | 3 | import com.alessiodp.parties.api.events.bukkit.BukkitPartiesEvent; 4 | import com.alessiodp.parties.api.events.common.player.IPlayerPreHomeEvent; 5 | import com.alessiodp.parties.api.interfaces.Party; 6 | import com.alessiodp.parties.api.interfaces.PartyHome; 7 | import com.alessiodp.parties.api.interfaces.PartyPlayer; 8 | import org.bukkit.event.Cancellable; 9 | import org.jetbrains.annotations.NotNull; 10 | 11 | public class BukkitPartiesPlayerPreHomeEvent extends BukkitPartiesEvent implements IPlayerPreHomeEvent, Cancellable { 12 | private boolean cancelled; 13 | private final PartyPlayer player; 14 | private final Party party; 15 | private final PartyHome home; 16 | 17 | public BukkitPartiesPlayerPreHomeEvent(PartyPlayer player, Party party, PartyHome home) { 18 | super(false); 19 | this.player = player; 20 | this.party = party; 21 | this.home = home; 22 | } 23 | 24 | @Override 25 | public @NotNull PartyPlayer getPartyPlayer() { 26 | return player; 27 | } 28 | 29 | @Override 30 | public @NotNull Party getParty() { 31 | return party; 32 | } 33 | 34 | @Override 35 | public @NotNull PartyHome getHome() { 36 | return home; 37 | } 38 | 39 | @Override 40 | public boolean isCancelled() { 41 | return cancelled; 42 | } 43 | 44 | @Override 45 | public void setCancelled(boolean cancel) { 46 | cancelled = cancel; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/bukkit/player/BukkitPartiesPlayerPreInviteEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.bukkit.player; 2 | 3 | import com.alessiodp.parties.api.events.bukkit.BukkitPartiesEvent; 4 | import com.alessiodp.parties.api.events.common.player.IPlayerPreInviteEvent; 5 | import com.alessiodp.parties.api.interfaces.Party; 6 | import com.alessiodp.parties.api.interfaces.PartyPlayer; 7 | import org.bukkit.event.Cancellable; 8 | import org.jetbrains.annotations.NotNull; 9 | import org.jetbrains.annotations.Nullable; 10 | 11 | public class BukkitPartiesPlayerPreInviteEvent extends BukkitPartiesEvent implements IPlayerPreInviteEvent, Cancellable { 12 | private boolean cancelled; 13 | private final PartyPlayer invitedPlayer; 14 | private final PartyPlayer inviter; 15 | private final Party party; 16 | 17 | public BukkitPartiesPlayerPreInviteEvent(PartyPlayer invitedPlayer, PartyPlayer inviter, Party party) { 18 | super(false); 19 | this.invitedPlayer = invitedPlayer; 20 | this.inviter = inviter; 21 | this.party = party; 22 | } 23 | 24 | @Override 25 | public @NotNull PartyPlayer getInvitedPlayer() { 26 | return invitedPlayer; 27 | } 28 | 29 | @Override 30 | public @Nullable PartyPlayer getInviter() { 31 | return inviter; 32 | } 33 | 34 | @Override 35 | public @NotNull Party getParty() { 36 | return party; 37 | } 38 | 39 | @Override 40 | public boolean isCancelled() { 41 | return cancelled; 42 | } 43 | 44 | @Override 45 | public void setCancelled(boolean cancel) { 46 | cancelled = cancel; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/bungee/BungeePartiesEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.bungee; 2 | 3 | import com.alessiodp.parties.api.events.PartiesEvent; 4 | import com.alessiodp.parties.api.interfaces.PartiesAPI; 5 | import net.md_5.bungee.api.plugin.Event; 6 | import org.jetbrains.annotations.NotNull; 7 | 8 | public abstract class BungeePartiesEvent extends Event implements PartiesEvent { 9 | private PartiesAPI api; 10 | 11 | @Override 12 | public @NotNull PartiesAPI getApi() { 13 | return api; 14 | } 15 | 16 | @Override 17 | public void setApi(PartiesAPI instance) { 18 | api = instance; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/bungee/party/BungeePartiesPartyGetExperienceEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.bungee.party; 2 | 3 | import com.alessiodp.parties.api.events.bungee.BungeePartiesEvent; 4 | import com.alessiodp.parties.api.events.common.party.IPartyGetExperienceEvent; 5 | import com.alessiodp.parties.api.interfaces.Party; 6 | import com.alessiodp.parties.api.interfaces.PartyPlayer; 7 | import org.jetbrains.annotations.NotNull; 8 | import org.jetbrains.annotations.Nullable; 9 | 10 | public class BungeePartiesPartyGetExperienceEvent extends BungeePartiesEvent implements IPartyGetExperienceEvent { 11 | private final Party party; 12 | private final double experience; 13 | 14 | private final ExpSource source; 15 | private final PartyPlayer killer; 16 | 17 | public BungeePartiesPartyGetExperienceEvent(Party party, double experience, PartyPlayer killer) { 18 | this.party = party; 19 | this.experience = experience; 20 | source = ExpSource.KILL; 21 | this.killer = killer; 22 | } 23 | 24 | @Override 25 | public @NotNull Party getParty() { 26 | return party; 27 | } 28 | 29 | @Override 30 | public double getExperience() { 31 | return experience; 32 | } 33 | 34 | @Override 35 | public @NotNull ExpSource getSource() { 36 | return source; 37 | } 38 | 39 | @Override 40 | public @Nullable PartyPlayer getKiller() { 41 | return killer; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/bungee/party/BungeePartiesPartyLevelUpEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.bungee.party; 2 | 3 | import com.alessiodp.parties.api.events.bungee.BungeePartiesEvent; 4 | import com.alessiodp.parties.api.events.common.party.IPartyLevelUpEvent; 5 | import com.alessiodp.parties.api.interfaces.Party; 6 | import org.jetbrains.annotations.NotNull; 7 | 8 | public class BungeePartiesPartyLevelUpEvent extends BungeePartiesEvent implements IPartyLevelUpEvent { 9 | private final Party party; 10 | private final int newLevel; 11 | 12 | public BungeePartiesPartyLevelUpEvent(Party party, int newLevel) { 13 | this.party = party; 14 | this.newLevel = newLevel; 15 | } 16 | 17 | @Override 18 | public @NotNull Party getParty() { 19 | return party; 20 | } 21 | 22 | @Override 23 | public int getNewLevel() { 24 | return newLevel; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/bungee/party/BungeePartiesPartyPostBroadcastEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.bungee.party; 2 | 3 | import com.alessiodp.parties.api.events.bungee.BungeePartiesEvent; 4 | import com.alessiodp.parties.api.events.common.party.IPartyPostBroadcastEvent; 5 | import com.alessiodp.parties.api.interfaces.Party; 6 | import com.alessiodp.parties.api.interfaces.PartyPlayer; 7 | import org.jetbrains.annotations.NotNull; 8 | import org.jetbrains.annotations.Nullable; 9 | 10 | public class BungeePartiesPartyPostBroadcastEvent extends BungeePartiesEvent implements IPartyPostBroadcastEvent { 11 | private final Party party; 12 | private final String message; 13 | private final PartyPlayer player; 14 | 15 | public BungeePartiesPartyPostBroadcastEvent(Party party, String message, PartyPlayer player) { 16 | this.party = party; 17 | this.message = message; 18 | this.player = player; 19 | } 20 | 21 | @Override 22 | public @NotNull Party getParty() { 23 | return party; 24 | } 25 | 26 | @Override 27 | public @NotNull String getMessage() { 28 | return message; 29 | } 30 | 31 | @Override 32 | public @Nullable PartyPlayer getPartyPlayer() { 33 | return player; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/bungee/party/BungeePartiesPartyPostCreateEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.bungee.party; 2 | 3 | import com.alessiodp.parties.api.events.bungee.BungeePartiesEvent; 4 | import com.alessiodp.parties.api.events.common.party.IPartyPostCreateEvent; 5 | import com.alessiodp.parties.api.interfaces.Party; 6 | import com.alessiodp.parties.api.interfaces.PartyPlayer; 7 | import org.jetbrains.annotations.NotNull; 8 | import org.jetbrains.annotations.Nullable; 9 | 10 | public class BungeePartiesPartyPostCreateEvent extends BungeePartiesEvent implements IPartyPostCreateEvent { 11 | private final PartyPlayer player; 12 | private final Party party; 13 | 14 | public BungeePartiesPartyPostCreateEvent(PartyPlayer player, Party party) { 15 | this.player = player; 16 | this.party = party; 17 | } 18 | 19 | @Override 20 | public @Nullable PartyPlayer getCreator() { 21 | return player; 22 | } 23 | 24 | @Override 25 | public @NotNull Party getParty() { 26 | return party; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/bungee/party/BungeePartiesPartyPostDeleteEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.bungee.party; 2 | 3 | import com.alessiodp.parties.api.enums.DeleteCause; 4 | import com.alessiodp.parties.api.events.bungee.BungeePartiesEvent; 5 | import com.alessiodp.parties.api.events.common.party.IPartyPostDeleteEvent; 6 | import com.alessiodp.parties.api.interfaces.Party; 7 | import com.alessiodp.parties.api.interfaces.PartyPlayer; 8 | import org.jetbrains.annotations.NotNull; 9 | import org.jetbrains.annotations.Nullable; 10 | 11 | 12 | public class BungeePartiesPartyPostDeleteEvent extends BungeePartiesEvent implements IPartyPostDeleteEvent { 13 | private final Party party; 14 | private final DeleteCause cause; 15 | private final PartyPlayer kickedPlayer; 16 | private final PartyPlayer commandSender; 17 | 18 | public BungeePartiesPartyPostDeleteEvent(Party party, DeleteCause cause, PartyPlayer kickedPlayer, PartyPlayer commandSender) { 19 | this.party = party; 20 | this.cause = cause; 21 | this.kickedPlayer = kickedPlayer; 22 | this.commandSender = commandSender; 23 | } 24 | 25 | @Override 26 | public @NotNull Party getParty() { 27 | return party; 28 | } 29 | 30 | @Override 31 | public @NotNull DeleteCause getCause() { 32 | return cause; 33 | } 34 | 35 | @Override 36 | public @Nullable PartyPlayer getKickedPlayer() { 37 | return kickedPlayer; 38 | } 39 | 40 | @Override 41 | public @Nullable PartyPlayer getCommandSender() { 42 | return commandSender; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/bungee/party/BungeePartiesPartyPostRenameEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.bungee.party; 2 | 3 | import com.alessiodp.parties.api.events.bungee.BungeePartiesEvent; 4 | import com.alessiodp.parties.api.events.common.party.IPartyPostRenameEvent; 5 | import com.alessiodp.parties.api.interfaces.Party; 6 | import com.alessiodp.parties.api.interfaces.PartyPlayer; 7 | import org.jetbrains.annotations.NotNull; 8 | import org.jetbrains.annotations.Nullable; 9 | 10 | public class BungeePartiesPartyPostRenameEvent extends BungeePartiesEvent implements IPartyPostRenameEvent { 11 | private final Party party; 12 | private final String oldName; 13 | private final String newName; 14 | private final PartyPlayer player; 15 | private final boolean isAdmin; 16 | 17 | public BungeePartiesPartyPostRenameEvent(Party party, String oldName, String newName, PartyPlayer player, boolean isAdmin) { 18 | this.party = party; 19 | this.oldName = oldName; 20 | this.newName = newName; 21 | this.player = player; 22 | this.isAdmin = isAdmin; 23 | } 24 | 25 | @Override 26 | public @NotNull Party getParty() { 27 | return party; 28 | } 29 | 30 | @Override 31 | public @Nullable String getOldPartyName() { 32 | return oldName; 33 | } 34 | 35 | @Override 36 | public @Nullable String getNewPartyName() { 37 | return newName; 38 | } 39 | 40 | @Override 41 | public @Nullable PartyPlayer getPartyPlayer() { 42 | return player; 43 | } 44 | 45 | @Override 46 | public boolean isAdmin() { 47 | return isAdmin; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/bungee/party/BungeePartiesPartyPreBroadcastEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.bungee.party; 2 | 3 | import com.alessiodp.parties.api.events.bungee.BungeePartiesEvent; 4 | import com.alessiodp.parties.api.events.common.party.IPartyPreBroadcastEvent; 5 | import com.alessiodp.parties.api.interfaces.Party; 6 | import com.alessiodp.parties.api.interfaces.PartyPlayer; 7 | import org.jetbrains.annotations.NotNull; 8 | import org.jetbrains.annotations.Nullable; 9 | 10 | public class BungeePartiesPartyPreBroadcastEvent extends BungeePartiesEvent implements IPartyPreBroadcastEvent { 11 | private boolean cancelled; 12 | private final Party party; 13 | private String message; 14 | private final PartyPlayer player; 15 | 16 | public BungeePartiesPartyPreBroadcastEvent(Party party, String message, PartyPlayer player) { 17 | this.party = party; 18 | this.message = message; 19 | this.player = player; 20 | } 21 | 22 | @Override 23 | public @NotNull Party getParty() { 24 | return party; 25 | } 26 | 27 | @Override 28 | public @NotNull String getMessage() { 29 | return message; 30 | } 31 | 32 | @Override 33 | public void setMessage(@NotNull String message) { 34 | this.message = message; 35 | } 36 | 37 | @Override 38 | public @Nullable PartyPlayer getPartyPlayer() { 39 | return player; 40 | } 41 | 42 | @Override 43 | public boolean isCancelled() { 44 | return cancelled; 45 | } 46 | 47 | @Override 48 | public void setCancelled(boolean cancel) { 49 | this.cancelled = cancel; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/bungee/party/BungeePartiesPartyPreCreateEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.bungee.party; 2 | 3 | import com.alessiodp.parties.api.events.bungee.BungeePartiesEvent; 4 | import com.alessiodp.parties.api.events.common.party.IPartyPreCreateEvent; 5 | import com.alessiodp.parties.api.interfaces.PartyPlayer; 6 | import org.jetbrains.annotations.Nullable; 7 | 8 | public class BungeePartiesPartyPreCreateEvent extends BungeePartiesEvent implements IPartyPreCreateEvent { 9 | private boolean cancelled; 10 | private final PartyPlayer player; 11 | private String name; 12 | private boolean fixed; 13 | 14 | public BungeePartiesPartyPreCreateEvent(PartyPlayer player, String name, boolean fixed) { 15 | this.player = player; 16 | this.name = name; 17 | this.fixed = fixed; 18 | } 19 | 20 | @Override 21 | public @Nullable PartyPlayer getPartyPlayer() { 22 | return player; 23 | } 24 | 25 | @Override 26 | public @Nullable String getPartyName() { 27 | return name; 28 | } 29 | 30 | @Override 31 | public void setPartyName(@Nullable String name) { 32 | this.name = name; 33 | } 34 | 35 | @Override 36 | public boolean isFixed() { 37 | return fixed; 38 | } 39 | 40 | @Override 41 | public void setFixed(boolean fixed) { 42 | this.fixed = fixed; 43 | } 44 | 45 | @Override 46 | public boolean isCancelled() { 47 | return cancelled; 48 | } 49 | 50 | @Override 51 | public void setCancelled(boolean cancel) { 52 | cancelled = cancel; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/bungee/player/BungeePartiesPlayerPostChatEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.bungee.player; 2 | 3 | import com.alessiodp.parties.api.events.bungee.BungeePartiesEvent; 4 | import com.alessiodp.parties.api.events.common.player.IPlayerPostChatEvent; 5 | import com.alessiodp.parties.api.interfaces.Party; 6 | import com.alessiodp.parties.api.interfaces.PartyPlayer; 7 | import org.jetbrains.annotations.NotNull; 8 | 9 | public class BungeePartiesPlayerPostChatEvent extends BungeePartiesEvent implements IPlayerPostChatEvent { 10 | private final PartyPlayer player; 11 | private final Party party; 12 | private final String formattedMessage; 13 | private final String message; 14 | 15 | public BungeePartiesPlayerPostChatEvent(PartyPlayer player, Party party, String formattedMessage, String message) { 16 | this.player = player; 17 | this.party = party; 18 | this.formattedMessage = formattedMessage; 19 | this.message = message; 20 | } 21 | 22 | @Override 23 | public @NotNull PartyPlayer getPartyPlayer() { 24 | return player; 25 | } 26 | 27 | @Override 28 | public @NotNull Party getParty() { 29 | return party; 30 | } 31 | 32 | @Override 33 | public @NotNull String getFormattedMessage() { 34 | return formattedMessage; 35 | } 36 | 37 | @Override 38 | public @NotNull String getMessage() { 39 | return message; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/bungee/player/BungeePartiesPlayerPostHomeEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.bungee.player; 2 | 3 | import com.alessiodp.parties.api.events.bungee.BungeePartiesEvent; 4 | import com.alessiodp.parties.api.events.common.player.IPlayerPostHomeEvent; 5 | import com.alessiodp.parties.api.interfaces.Party; 6 | import com.alessiodp.parties.api.interfaces.PartyHome; 7 | import com.alessiodp.parties.api.interfaces.PartyPlayer; 8 | import org.jetbrains.annotations.NotNull; 9 | 10 | public class BungeePartiesPlayerPostHomeEvent extends BungeePartiesEvent implements IPlayerPostHomeEvent { 11 | private final PartyPlayer player; 12 | private final Party party; 13 | private final PartyHome home; 14 | 15 | public BungeePartiesPlayerPostHomeEvent(PartyPlayer player, Party party, PartyHome home) { 16 | this.player = player; 17 | this.party = party; 18 | this.home = home; 19 | } 20 | 21 | @Override 22 | public @NotNull PartyPlayer getPartyPlayer() { 23 | return player; 24 | } 25 | 26 | @Override 27 | public @NotNull Party getParty() { 28 | return party; 29 | } 30 | 31 | @Override 32 | public @NotNull PartyHome getHome() { 33 | return home; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/bungee/player/BungeePartiesPlayerPostInviteEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.bungee.player; 2 | 3 | import com.alessiodp.parties.api.events.bungee.BungeePartiesEvent; 4 | import com.alessiodp.parties.api.events.common.player.IPlayerPostInviteEvent; 5 | import com.alessiodp.parties.api.interfaces.Party; 6 | import com.alessiodp.parties.api.interfaces.PartyPlayer; 7 | import org.jetbrains.annotations.NotNull; 8 | import org.jetbrains.annotations.Nullable; 9 | 10 | public class BungeePartiesPlayerPostInviteEvent extends BungeePartiesEvent implements IPlayerPostInviteEvent { 11 | private final PartyPlayer invitedPlayer; 12 | private final PartyPlayer inviter; 13 | private final Party party; 14 | 15 | public BungeePartiesPlayerPostInviteEvent(PartyPlayer invitedPlayer, PartyPlayer inviter, Party party) { 16 | this.invitedPlayer = invitedPlayer; 17 | this.inviter = inviter; 18 | this.party = party; 19 | } 20 | 21 | @Override 22 | public @NotNull PartyPlayer getInvitedPlayer() { 23 | return invitedPlayer; 24 | } 25 | 26 | @Override 27 | public @Nullable PartyPlayer getInviter() { 28 | return inviter; 29 | } 30 | 31 | @Override 32 | public @NotNull Party getParty() { 33 | return party; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/bungee/player/BungeePartiesPlayerPostJoinEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.bungee.player; 2 | 3 | import com.alessiodp.parties.api.enums.JoinCause; 4 | import com.alessiodp.parties.api.events.bungee.BungeePartiesEvent; 5 | import com.alessiodp.parties.api.events.common.player.IPlayerPostJoinEvent; 6 | import com.alessiodp.parties.api.interfaces.Party; 7 | import com.alessiodp.parties.api.interfaces.PartyPlayer; 8 | import org.jetbrains.annotations.NotNull; 9 | import org.jetbrains.annotations.Nullable; 10 | 11 | public class BungeePartiesPlayerPostJoinEvent extends BungeePartiesEvent implements IPlayerPostJoinEvent { 12 | private final PartyPlayer player; 13 | private final Party party; 14 | private final JoinCause cause; 15 | private final PartyPlayer inviter; 16 | 17 | public BungeePartiesPlayerPostJoinEvent(PartyPlayer player, Party party, JoinCause cause, PartyPlayer inviter) { 18 | this.player = player; 19 | this.party = party; 20 | this.cause = cause; 21 | this.inviter = inviter; 22 | } 23 | 24 | @Override 25 | public @NotNull PartyPlayer getPartyPlayer() { 26 | return player; 27 | } 28 | 29 | @Override 30 | public @NotNull Party getParty() { 31 | return party; 32 | } 33 | 34 | @Override 35 | public @NotNull JoinCause getCause() { 36 | return cause; 37 | } 38 | 39 | @Override 40 | public @Nullable PartyPlayer getInviter() { 41 | return inviter; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/bungee/player/BungeePartiesPlayerPostLeaveEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.bungee.player; 2 | 3 | import com.alessiodp.parties.api.enums.LeaveCause; 4 | import com.alessiodp.parties.api.events.bungee.BungeePartiesEvent; 5 | import com.alessiodp.parties.api.events.common.player.IPlayerPostLeaveEvent; 6 | import com.alessiodp.parties.api.interfaces.Party; 7 | import com.alessiodp.parties.api.interfaces.PartyPlayer; 8 | import org.jetbrains.annotations.NotNull; 9 | import org.jetbrains.annotations.Nullable; 10 | 11 | public class BungeePartiesPlayerPostLeaveEvent extends BungeePartiesEvent implements IPlayerPostLeaveEvent { 12 | private final PartyPlayer player; 13 | private final Party party; 14 | private final LeaveCause cause; 15 | private final PartyPlayer kicker; 16 | 17 | public BungeePartiesPlayerPostLeaveEvent(PartyPlayer player, Party party, LeaveCause cause, PartyPlayer kicker) { 18 | this.player = player; 19 | this.party = party; 20 | this.cause = cause; 21 | this.kicker = kicker; 22 | } 23 | 24 | @Override 25 | public @NotNull PartyPlayer getPartyPlayer() { 26 | return player; 27 | } 28 | 29 | @Override 30 | public @NotNull Party getParty() { 31 | return party; 32 | } 33 | 34 | @Override 35 | public @NotNull LeaveCause getCause() { 36 | return cause; 37 | } 38 | 39 | @Override 40 | public @Nullable PartyPlayer getKicker() { 41 | return kicker; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/bungee/player/BungeePartiesPlayerPostTeleportEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.bungee.player; 2 | 3 | import com.alessiodp.parties.api.events.bungee.BungeePartiesEvent; 4 | import com.alessiodp.parties.api.events.common.player.IPlayerPostTeleportEvent; 5 | import com.alessiodp.parties.api.interfaces.Party; 6 | import com.alessiodp.parties.api.interfaces.PartyPlayer; 7 | import net.md_5.bungee.api.config.ServerInfo; 8 | import org.jetbrains.annotations.NotNull; 9 | 10 | public class BungeePartiesPlayerPostTeleportEvent extends BungeePartiesEvent implements IPlayerPostTeleportEvent { 11 | private final PartyPlayer player; 12 | private final Party party; 13 | private final ServerInfo destination; 14 | 15 | public BungeePartiesPlayerPostTeleportEvent(PartyPlayer player, Party party, ServerInfo destination) { 16 | this.player = player; 17 | this.party = party; 18 | this.destination = destination; 19 | } 20 | 21 | @Override 22 | public @NotNull PartyPlayer getPartyPlayer() { 23 | return player; 24 | } 25 | 26 | @Override 27 | public @NotNull Party getParty() { 28 | return party; 29 | } 30 | 31 | /** 32 | * Get the destination as ServerInfo 33 | * 34 | * @return the {@link ServerInfo} 35 | */ 36 | public @NotNull ServerInfo getDestination() { 37 | return destination; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/bungee/player/BungeePartiesPlayerPreHomeEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.bungee.player; 2 | 3 | import com.alessiodp.parties.api.events.bungee.BungeePartiesEvent; 4 | import com.alessiodp.parties.api.events.common.player.IPlayerPreHomeEvent; 5 | import com.alessiodp.parties.api.interfaces.Party; 6 | import com.alessiodp.parties.api.interfaces.PartyHome; 7 | import com.alessiodp.parties.api.interfaces.PartyPlayer; 8 | import org.jetbrains.annotations.NotNull; 9 | 10 | public class BungeePartiesPlayerPreHomeEvent extends BungeePartiesEvent implements IPlayerPreHomeEvent { 11 | private boolean cancelled; 12 | private final PartyPlayer player; 13 | private final Party party; 14 | private final PartyHome home; 15 | 16 | public BungeePartiesPlayerPreHomeEvent(PartyPlayer player, Party party, PartyHome home) { 17 | this.player = player; 18 | this.party = party; 19 | this.home = home; 20 | } 21 | 22 | @Override 23 | public @NotNull PartyPlayer getPartyPlayer() { 24 | return player; 25 | } 26 | 27 | @Override 28 | public @NotNull Party getParty() { 29 | return party; 30 | } 31 | 32 | @Override 33 | public @NotNull PartyHome getHome() { 34 | return home; 35 | } 36 | 37 | @Override 38 | public boolean isCancelled() { 39 | return cancelled; 40 | } 41 | 42 | @Override 43 | public void setCancelled(boolean cancel) { 44 | cancelled = cancel; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/bungee/player/BungeePartiesPlayerPreInviteEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.bungee.player; 2 | 3 | import com.alessiodp.parties.api.events.bungee.BungeePartiesEvent; 4 | import com.alessiodp.parties.api.events.common.player.IPlayerPreInviteEvent; 5 | import com.alessiodp.parties.api.interfaces.Party; 6 | import com.alessiodp.parties.api.interfaces.PartyPlayer; 7 | import org.jetbrains.annotations.NotNull; 8 | import org.jetbrains.annotations.Nullable; 9 | 10 | public class BungeePartiesPlayerPreInviteEvent extends BungeePartiesEvent implements IPlayerPreInviteEvent { 11 | private boolean cancelled; 12 | private final PartyPlayer invitedPlayer; 13 | private final PartyPlayer inviter; 14 | private final Party party; 15 | 16 | public BungeePartiesPlayerPreInviteEvent(PartyPlayer invitedPlayer, PartyPlayer inviter, Party party) { 17 | this.invitedPlayer = invitedPlayer; 18 | this.inviter = inviter; 19 | this.party = party; 20 | } 21 | 22 | @Override 23 | public @NotNull PartyPlayer getInvitedPlayer() { 24 | return invitedPlayer; 25 | } 26 | 27 | @Override 28 | public @Nullable PartyPlayer getInviter() { 29 | return inviter; 30 | } 31 | 32 | @Override 33 | public @NotNull Party getParty() { 34 | return party; 35 | } 36 | 37 | @Override 38 | public boolean isCancelled() { 39 | return cancelled; 40 | } 41 | 42 | @Override 43 | public void setCancelled(boolean cancel) { 44 | cancelled = cancel; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/bungee/unique/BungeePartiesPartyFollowEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.bungee.unique; 2 | 3 | import com.alessiodp.parties.api.events.Cancellable; 4 | import com.alessiodp.parties.api.events.bungee.BungeePartiesEvent; 5 | import com.alessiodp.parties.api.interfaces.Party; 6 | import org.jetbrains.annotations.NotNull; 7 | 8 | public class BungeePartiesPartyFollowEvent extends BungeePartiesEvent implements Cancellable { 9 | private boolean cancelled; 10 | private final Party party; 11 | private final String joinedServer; 12 | 13 | public BungeePartiesPartyFollowEvent(Party party, String joinedServer) { 14 | this.party = party; 15 | this.joinedServer = joinedServer; 16 | } 17 | 18 | @Override 19 | public boolean isCancelled() { 20 | return cancelled; 21 | } 22 | 23 | @Override 24 | public void setCancelled(boolean cancel) { 25 | cancelled = cancel; 26 | } 27 | 28 | /** 29 | * Get the party 30 | * 31 | * @return the {@link Party} 32 | */ 33 | public @NotNull Party getParty() { 34 | return party; 35 | } 36 | 37 | /** 38 | * Get the name of the server that the party will join into 39 | * 40 | * @return the name of the server 41 | */ 42 | public @NotNull String getJoinedServer() { 43 | return joinedServer; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/common/party/IPartyGetExperienceEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.common.party; 2 | 3 | import com.alessiodp.parties.api.events.PartiesEvent; 4 | import com.alessiodp.parties.api.interfaces.Party; 5 | import com.alessiodp.parties.api.interfaces.PartyPlayer; 6 | import org.jetbrains.annotations.NotNull; 7 | import org.jetbrains.annotations.Nullable; 8 | 9 | public interface IPartyGetExperienceEvent extends PartiesEvent { 10 | /** 11 | * Get the party 12 | * 13 | * @return the {@link Party} 14 | */ 15 | @NotNull Party getParty(); 16 | 17 | /** 18 | * Get the experience 19 | * 20 | * @return the experience 21 | */ 22 | double getExperience(); 23 | 24 | /** 25 | * Get experience source 26 | * 27 | * @return the {@link ExpSource} 28 | */ 29 | @NotNull ExpSource getSource(); 30 | 31 | /** 32 | * Get the player who killed the mob 33 | * 34 | * @return the {@link PartyPlayer} 35 | */ 36 | @Nullable PartyPlayer getKiller(); 37 | 38 | enum ExpSource { 39 | /** 40 | * Killed entity by a player 41 | */ 42 | KILL, 43 | /** 44 | * External sources like plugin API 45 | */ 46 | API 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/common/party/IPartyLevelUpEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.common.party; 2 | 3 | import com.alessiodp.parties.api.events.PartiesEvent; 4 | import com.alessiodp.parties.api.interfaces.Party; 5 | import org.jetbrains.annotations.NotNull; 6 | 7 | public interface IPartyLevelUpEvent extends PartiesEvent { 8 | /** 9 | * Get the party that leveled up 10 | * 11 | * @return the {@link Party} 12 | */ 13 | @NotNull Party getParty(); 14 | 15 | /** 16 | * Get the new party level 17 | * 18 | * @return the new level of the party 19 | */ 20 | int getNewLevel(); 21 | } 22 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/common/party/IPartyPostBroadcastEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.common.party; 2 | 3 | import com.alessiodp.parties.api.events.PartiesEvent; 4 | import com.alessiodp.parties.api.interfaces.Party; 5 | import com.alessiodp.parties.api.interfaces.PartyPlayer; 6 | import org.jetbrains.annotations.NotNull; 7 | import org.jetbrains.annotations.Nullable; 8 | 9 | public interface IPartyPostBroadcastEvent extends PartiesEvent { 10 | /** 11 | * Get the party 12 | * 13 | * @return the {@link Party} 14 | */ 15 | @NotNull Party getParty(); 16 | 17 | /** 18 | * Get the message 19 | * 20 | * @return the message 21 | */ 22 | @NotNull String getMessage(); 23 | 24 | /** 25 | * Get the player who sent the message 26 | * 27 | * @return the {@link PartyPlayer} 28 | */ 29 | @Nullable PartyPlayer getPartyPlayer(); 30 | } 31 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/common/party/IPartyPostCreateEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.common.party; 2 | 3 | import com.alessiodp.parties.api.events.PartiesEvent; 4 | import com.alessiodp.parties.api.interfaces.Party; 5 | import com.alessiodp.parties.api.interfaces.PartyPlayer; 6 | import org.jetbrains.annotations.NotNull; 7 | import org.jetbrains.annotations.Nullable; 8 | 9 | public interface IPartyPostCreateEvent extends PartiesEvent { 10 | /** 11 | * Get the creator of the party 12 | * 13 | * @return the {@link PartyPlayer} 14 | */ 15 | @Nullable PartyPlayer getCreator(); 16 | 17 | /** 18 | * Get the party 19 | * 20 | * @return the {@link Party} 21 | */ 22 | @NotNull Party getParty(); 23 | } 24 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/common/party/IPartyPostRenameEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.common.party; 2 | 3 | import com.alessiodp.parties.api.events.PartiesEvent; 4 | import com.alessiodp.parties.api.interfaces.Party; 5 | import com.alessiodp.parties.api.interfaces.PartyPlayer; 6 | import org.jetbrains.annotations.NotNull; 7 | import org.jetbrains.annotations.Nullable; 8 | 9 | public interface IPartyPostRenameEvent extends PartiesEvent { 10 | /** 11 | * Get the renamed party 12 | * 13 | * @return the {@link Party} 14 | */ 15 | @NotNull Party getParty(); 16 | 17 | /** 18 | * Get the old party name 19 | * 20 | * @return the old name of the party 21 | */ 22 | @Nullable String getOldPartyName(); 23 | 24 | /** 25 | * Get the new party name 26 | * 27 | * @return the new name of the party 28 | */ 29 | @Nullable String getNewPartyName(); 30 | 31 | /** 32 | * Get the player who performed the command 33 | * 34 | * @return the {@link PartyPlayer} or null if not executed by a player 35 | */ 36 | @Nullable PartyPlayer getPartyPlayer(); 37 | 38 | /** 39 | * Is it an admin renaming? 40 | * 41 | * @return {@code true} if the rename has been performed by an admin 42 | */ 43 | boolean isAdmin(); 44 | 45 | } 46 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/common/party/IPartyPreBroadcastEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.common.party; 2 | 3 | import com.alessiodp.parties.api.events.Cancellable; 4 | import com.alessiodp.parties.api.events.PartiesEvent; 5 | import com.alessiodp.parties.api.interfaces.Party; 6 | import com.alessiodp.parties.api.interfaces.PartyPlayer; 7 | import org.jetbrains.annotations.NotNull; 8 | import org.jetbrains.annotations.Nullable; 9 | 10 | public interface IPartyPreBroadcastEvent extends PartiesEvent, Cancellable { 11 | /** 12 | * Get the party 13 | * 14 | * @return the {@link Party} 15 | */ 16 | @NotNull Party getParty(); 17 | 18 | /** 19 | * Get the message 20 | * 21 | * @return the message 22 | */ 23 | @NotNull String getMessage(); 24 | 25 | /** 26 | * Set the message of the player 27 | * 28 | * @param message the message to set 29 | */ 30 | void setMessage(@NotNull String message); 31 | 32 | /** 33 | * Get the player who sent the message 34 | * 35 | * @return the {@link PartyPlayer} 36 | */ 37 | @Nullable PartyPlayer getPartyPlayer(); 38 | } 39 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/common/party/IPartyPreCreateEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.common.party; 2 | 3 | import com.alessiodp.parties.api.events.Cancellable; 4 | import com.alessiodp.parties.api.events.PartiesEvent; 5 | import com.alessiodp.parties.api.interfaces.PartyPlayer; 6 | import org.jetbrains.annotations.Nullable; 7 | 8 | public interface IPartyPreCreateEvent extends PartiesEvent, Cancellable { 9 | /** 10 | * Get the player that is creating the party 11 | * 12 | * @return the {@link PartyPlayer} 13 | */ 14 | @Nullable PartyPlayer getPartyPlayer(); 15 | 16 | /** 17 | * Get the name of the party 18 | * 19 | * @return the party name 20 | */ 21 | @Nullable String getPartyName(); 22 | 23 | /** 24 | * Set a new name to the party 25 | * 26 | * @param name the name to set 27 | */ 28 | void setPartyName(@Nullable String name); 29 | 30 | /** 31 | * Is the party fixed? 32 | * 33 | * @return {@code true} if it's fixed 34 | */ 35 | boolean isFixed(); 36 | 37 | /** 38 | * Set if the party is fixed 39 | * 40 | * @param fixed {@code true} to be fixed 41 | */ 42 | void setFixed(boolean fixed); 43 | } 44 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/common/party/IPartyPreDeleteEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.common.party; 2 | 3 | import com.alessiodp.parties.api.enums.DeleteCause; 4 | import com.alessiodp.parties.api.events.Cancellable; 5 | import com.alessiodp.parties.api.events.PartiesEvent; 6 | import com.alessiodp.parties.api.interfaces.Party; 7 | import com.alessiodp.parties.api.interfaces.PartyPlayer; 8 | import org.jetbrains.annotations.NotNull; 9 | import org.jetbrains.annotations.Nullable; 10 | 11 | public interface IPartyPreDeleteEvent extends PartiesEvent, Cancellable { 12 | /** 13 | * Get the party that is getting cancelled 14 | * 15 | * @return the {@link Party} 16 | */ 17 | @NotNull Party getParty(); 18 | 19 | /** 20 | * Get the cause of delete 21 | * 22 | * @return the {@link DeleteCause} of the delete 23 | */ 24 | @NotNull DeleteCause getCause(); 25 | 26 | /** 27 | * Get the kicked player 28 | * 29 | * @return the {@link PartyPlayer} of the kicked player, returns {@code null} 30 | * if the delete cause is {@link DeleteCause#DELETE} or 31 | * {@link DeleteCause#TIMEOUT} 32 | */ 33 | @Nullable PartyPlayer getKickedPlayer(); 34 | 35 | /** 36 | * Get the player who performed the command 37 | * 38 | * @return the {@link PartyPlayer} who did the command, returns 39 | * {@code null} if the delete cause is {@link DeleteCause#TIMEOUT} 40 | */ 41 | @Nullable PartyPlayer getCommandSender(); 42 | } 43 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/common/party/IPartyPreExperienceDropEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.common.party; 2 | 3 | import com.alessiodp.parties.api.events.Cancellable; 4 | import com.alessiodp.parties.api.events.PartiesEvent; 5 | import com.alessiodp.parties.api.interfaces.Party; 6 | import com.alessiodp.parties.api.interfaces.PartyPlayer; 7 | import org.jetbrains.annotations.NotNull; 8 | import org.jetbrains.annotations.Nullable; 9 | 10 | public interface IPartyPreExperienceDropEvent extends PartiesEvent, Cancellable { 11 | /** 12 | * Get the party 13 | * 14 | * @return the {@link Party} 15 | */ 16 | @NotNull Party getParty(); 17 | 18 | /** 19 | * Get the player who killed the entity, null if there isn't any 20 | * 21 | * @return the {@link PartyPlayer} 22 | */ 23 | @Nullable PartyPlayer getPlayer(); 24 | 25 | /** 26 | * Get the killed entity, null if doesn't exist. 27 | * Only Bukkit handles killed entities. 28 | * The object, if not null, its an instance of Bukkit Entity. 29 | * 30 | * @return the killed entity, intance of Bukkit Entity 31 | */ 32 | @Nullable Object getKilledEntity(); 33 | 34 | /** 35 | * Get the dropped experience 36 | * 37 | * @return the number of experience dropped 38 | */ 39 | double getExperience(); 40 | 41 | /** 42 | * Set the dropped experience 43 | * 44 | * @param experience the number of experience dropped 45 | */ 46 | void setExperience(double experience); 47 | } 48 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/common/party/IPartyPreRenameEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.common.party; 2 | 3 | import com.alessiodp.parties.api.events.Cancellable; 4 | import com.alessiodp.parties.api.events.PartiesEvent; 5 | import com.alessiodp.parties.api.interfaces.Party; 6 | import com.alessiodp.parties.api.interfaces.PartyPlayer; 7 | import org.jetbrains.annotations.NotNull; 8 | import org.jetbrains.annotations.Nullable; 9 | 10 | public interface IPartyPreRenameEvent extends PartiesEvent, Cancellable { 11 | /** 12 | * Get the party that is getting renamed 13 | * 14 | * @return the {@link Party} 15 | */ 16 | @NotNull Party getParty(); 17 | 18 | /** 19 | * Get the old party name 20 | * 21 | * @return the old name of the party 22 | */ 23 | @Nullable String getOldPartyName(); 24 | 25 | /** 26 | * Get the new party name 27 | * 28 | * @return the new name of the party 29 | */ 30 | @Nullable String getNewPartyName(); 31 | 32 | /** 33 | * Set the new name of the party 34 | * 35 | * @param name the party name to set 36 | */ 37 | void setNewPartyName(String name); 38 | 39 | /** 40 | * Get the player who performed the command 41 | * 42 | * @return the {@link PartyPlayer} or null if not executed by a player 43 | */ 44 | @Nullable PartyPlayer getPartyPlayer(); 45 | 46 | /** 47 | * Is it an admin renaming? 48 | * 49 | * @return {@code true} if the rename has been performed by an admin 50 | */ 51 | boolean isAdmin(); 52 | 53 | } 54 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/common/player/IPlayerPostChatEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.common.player; 2 | 3 | import com.alessiodp.parties.api.events.PartiesEvent; 4 | import com.alessiodp.parties.api.interfaces.Party; 5 | import com.alessiodp.parties.api.interfaces.PartyPlayer; 6 | import org.jetbrains.annotations.NotNull; 7 | 8 | public interface IPlayerPostChatEvent extends PartiesEvent { 9 | /** 10 | * Get the player who sent the message 11 | * 12 | * @return the {@link PartyPlayer} 13 | */ 14 | @NotNull PartyPlayer getPartyPlayer(); 15 | 16 | /** 17 | * Get the party 18 | * 19 | * @return the {@link Party} 20 | */ 21 | @NotNull Party getParty(); 22 | 23 | /** 24 | * Get the formatted message of the player 25 | * 26 | * @return the formatted message 27 | */ 28 | @NotNull String getFormattedMessage(); 29 | 30 | /** 31 | * Get the message of the player 32 | * 33 | * @return the message 34 | */ 35 | @NotNull String getMessage(); 36 | } 37 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/common/player/IPlayerPostHomeEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.common.player; 2 | 3 | import com.alessiodp.parties.api.events.PartiesEvent; 4 | import com.alessiodp.parties.api.interfaces.Party; 5 | import com.alessiodp.parties.api.interfaces.PartyHome; 6 | import com.alessiodp.parties.api.interfaces.PartyPlayer; 7 | import org.jetbrains.annotations.NotNull; 8 | 9 | public interface IPlayerPostHomeEvent extends PartiesEvent { 10 | /** 11 | * Get the player who got teleported 12 | * 13 | * @return the {@link PartyPlayer} 14 | */ 15 | @NotNull PartyPlayer getPartyPlayer(); 16 | 17 | /** 18 | * Get the party 19 | * 20 | * @return the {@link Party} 21 | */ 22 | @NotNull Party getParty(); 23 | 24 | /** 25 | * Get the destination home 26 | * 27 | * @return the {@link PartyHome} 28 | */ 29 | @NotNull PartyHome getHome(); 30 | } 31 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/common/player/IPlayerPostInviteEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.common.player; 2 | 3 | import com.alessiodp.parties.api.events.PartiesEvent; 4 | import com.alessiodp.parties.api.interfaces.Party; 5 | import com.alessiodp.parties.api.interfaces.PartyPlayer; 6 | import org.jetbrains.annotations.NotNull; 7 | import org.jetbrains.annotations.Nullable; 8 | 9 | public interface IPlayerPostInviteEvent extends PartiesEvent { 10 | /** 11 | * Get the invited player 12 | * 13 | * @return the {@link PartyPlayer} 14 | */ 15 | @NotNull PartyPlayer getInvitedPlayer(); 16 | 17 | /** 18 | * Get the inviter 19 | * 20 | * @return the {@link PartyPlayer} 21 | */ 22 | @Nullable PartyPlayer getInviter(); 23 | 24 | /** 25 | * Get the party 26 | * 27 | * @return the {@link Party} 28 | */ 29 | @NotNull Party getParty(); 30 | } 31 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/common/player/IPlayerPostJoinEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.common.player; 2 | 3 | import com.alessiodp.parties.api.enums.JoinCause; 4 | import com.alessiodp.parties.api.events.PartiesEvent; 5 | import com.alessiodp.parties.api.interfaces.Party; 6 | import com.alessiodp.parties.api.interfaces.PartyPlayer; 7 | import org.jetbrains.annotations.NotNull; 8 | import org.jetbrains.annotations.Nullable; 9 | 10 | public interface IPlayerPostJoinEvent extends PartiesEvent { 11 | /** 12 | * Get the player that joined the party 13 | * 14 | * @return the {@link PartyPlayer} 15 | */ 16 | @NotNull PartyPlayer getPartyPlayer(); 17 | 18 | /** 19 | * Get the party 20 | * 21 | * @return the {@link Party} 22 | */ 23 | @NotNull Party getParty(); 24 | 25 | /** 26 | * Get the join cause 27 | * 28 | * @return the {@code JoinCause} of the event 29 | */ 30 | @NotNull JoinCause getCause(); 31 | 32 | /** 33 | * Has been invited? 34 | * 35 | * @return {@code true} if the player has been invited 36 | */ 37 | @Deprecated 38 | default boolean isInvited() { 39 | return getCause() == JoinCause.INVITE; 40 | } 41 | 42 | /** 43 | * Get the inviter 44 | * 45 | * @return the {@link PartyPlayer} of the inviter, {@code null} if the player joined via join/ask command 46 | */ 47 | @Nullable PartyPlayer getInviter(); 48 | } 49 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/common/player/IPlayerPostLeaveEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.common.player; 2 | 3 | import com.alessiodp.parties.api.enums.LeaveCause; 4 | import com.alessiodp.parties.api.events.PartiesEvent; 5 | import com.alessiodp.parties.api.interfaces.Party; 6 | import com.alessiodp.parties.api.interfaces.PartyPlayer; 7 | import org.jetbrains.annotations.NotNull; 8 | import org.jetbrains.annotations.Nullable; 9 | 10 | public interface IPlayerPostLeaveEvent extends PartiesEvent { 11 | /** 12 | * Get the player that left the party 13 | * 14 | * @return the {@link PartyPlayer} 15 | */ 16 | @NotNull PartyPlayer getPartyPlayer(); 17 | 18 | /** 19 | * Get the party 20 | * 21 | * @return the {@link Party} 22 | */ 23 | @NotNull Party getParty(); 24 | 25 | /** 26 | * Get the leave cause 27 | * 28 | * @return the {@code LeaveCause} of the event 29 | */ 30 | @NotNull LeaveCause getCause(); 31 | 32 | /** 33 | * Has the player been kicked? 34 | * 35 | * @return {@code true} if the player has been kicked 36 | * @deprecated use getCause() instead 37 | */ 38 | @Deprecated 39 | default boolean isKicked() { 40 | return getCause() == LeaveCause.KICK || getCause() == LeaveCause.BAN; 41 | } 42 | 43 | /** 44 | * Get the kicker 45 | * 46 | * @return the {@link PartyPlayer} that has kicked the player, returns {@code null} if {@link #isKicked()} returns {@code false} 47 | */ 48 | @Nullable PartyPlayer getKicker(); 49 | } 50 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/common/player/IPlayerPostTeleportEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.common.player; 2 | 3 | import com.alessiodp.parties.api.events.PartiesEvent; 4 | import com.alessiodp.parties.api.interfaces.Party; 5 | import com.alessiodp.parties.api.interfaces.PartyPlayer; 6 | import org.jetbrains.annotations.NotNull; 7 | 8 | public interface IPlayerPostTeleportEvent extends PartiesEvent { 9 | /** 10 | * Get the player who got teleported 11 | * 12 | * @return the {@link PartyPlayer} 13 | */ 14 | @NotNull PartyPlayer getPartyPlayer(); 15 | 16 | /** 17 | * Get the party 18 | * 19 | * @return the {@link Party} 20 | */ 21 | @NotNull Party getParty(); 22 | } 23 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/common/player/IPlayerPreChatEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.common.player; 2 | 3 | import com.alessiodp.parties.api.events.Cancellable; 4 | import com.alessiodp.parties.api.events.PartiesEvent; 5 | import com.alessiodp.parties.api.interfaces.Party; 6 | import com.alessiodp.parties.api.interfaces.PartyPlayer; 7 | import org.jetbrains.annotations.NotNull; 8 | 9 | public interface IPlayerPreChatEvent extends PartiesEvent, Cancellable { 10 | /** 11 | * Get the player who sent the message 12 | * 13 | * @return the {@link PartyPlayer} 14 | */ 15 | @NotNull PartyPlayer getPartyPlayer(); 16 | 17 | /** 18 | * Get the party 19 | * 20 | * @return the {@link Party} 21 | */ 22 | @NotNull Party getParty(); 23 | 24 | /** 25 | * Get the formatted message of the player 26 | * 27 | * @return the formatted message 28 | */ 29 | @NotNull String getFormattedMessage(); 30 | 31 | /** 32 | * Set the formatted message of the player. This message should contain %message% placeholder 33 | * 34 | * @param formattedMessage the formatted message to set 35 | */ 36 | void setFormattedMessage(String formattedMessage); 37 | 38 | /** 39 | * Get the message of the player 40 | * 41 | * @return the message 42 | */ 43 | @NotNull String getMessage(); 44 | 45 | /** 46 | * Set the message of the player 47 | * 48 | * @param message the message to set 49 | */ 50 | void setMessage(String message); 51 | } 52 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/common/player/IPlayerPreHomeEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.common.player; 2 | 3 | import com.alessiodp.parties.api.events.Cancellable; 4 | import com.alessiodp.parties.api.events.PartiesEvent; 5 | import com.alessiodp.parties.api.interfaces.Party; 6 | import com.alessiodp.parties.api.interfaces.PartyHome; 7 | import com.alessiodp.parties.api.interfaces.PartyPlayer; 8 | import org.jetbrains.annotations.NotNull; 9 | 10 | public interface IPlayerPreHomeEvent extends PartiesEvent, Cancellable { 11 | /** 12 | * Get the player who is getting teleported 13 | * 14 | * @return the {@link PartyPlayer} 15 | */ 16 | @NotNull PartyPlayer getPartyPlayer(); 17 | 18 | /** 19 | * Get the party 20 | * 21 | * @return the {@link Party} 22 | */ 23 | @NotNull Party getParty(); 24 | 25 | /** 26 | * Get the destination home 27 | * 28 | * @return the {@link PartyHome} 29 | */ 30 | @NotNull PartyHome getHome(); 31 | } 32 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/common/player/IPlayerPreInviteEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.common.player; 2 | 3 | import com.alessiodp.parties.api.events.Cancellable; 4 | import com.alessiodp.parties.api.events.PartiesEvent; 5 | import com.alessiodp.parties.api.interfaces.Party; 6 | import com.alessiodp.parties.api.interfaces.PartyPlayer; 7 | import org.jetbrains.annotations.NotNull; 8 | import org.jetbrains.annotations.Nullable; 9 | 10 | public interface IPlayerPreInviteEvent extends PartiesEvent, Cancellable { 11 | /** 12 | * Get the invited player 13 | * 14 | * @return the {@link PartyPlayer} 15 | */ 16 | @NotNull PartyPlayer getInvitedPlayer(); 17 | 18 | /** 19 | * Get the inviter 20 | * 21 | * @return the {@link PartyPlayer} 22 | */ 23 | @Nullable PartyPlayer getInviter(); 24 | 25 | /** 26 | * Get the party 27 | * 28 | * @return the {@link Party} 29 | */ 30 | @NotNull Party getParty(); 31 | } 32 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/common/player/IPlayerPreJoinEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.common.player; 2 | 3 | import com.alessiodp.parties.api.enums.JoinCause; 4 | import com.alessiodp.parties.api.events.Cancellable; 5 | import com.alessiodp.parties.api.events.PartiesEvent; 6 | import com.alessiodp.parties.api.interfaces.Party; 7 | import com.alessiodp.parties.api.interfaces.PartyPlayer; 8 | import org.jetbrains.annotations.NotNull; 9 | import org.jetbrains.annotations.Nullable; 10 | 11 | public interface IPlayerPreJoinEvent extends PartiesEvent, Cancellable { 12 | /** 13 | * Get the player that is joining inside the party 14 | * 15 | * @return the {@link PartyPlayer} 16 | */ 17 | @NotNull PartyPlayer getPartyPlayer(); 18 | 19 | /** 20 | * Get the party 21 | * 22 | * @return the {@link Party} 23 | */ 24 | @NotNull Party getParty(); 25 | 26 | /** 27 | * Get the join cause 28 | * 29 | * @return the {@code JoinCause} of the event 30 | */ 31 | @NotNull JoinCause getCause(); 32 | 33 | /** 34 | * Has been invited? 35 | * 36 | * @return {@code true} if the player has been invited 37 | */ 38 | @Deprecated 39 | default boolean isInvited() { 40 | return getCause() == JoinCause.INVITE; 41 | } 42 | 43 | /** 44 | * Get the inviter 45 | * 46 | * @return the {@link PartyPlayer} of the inviter, {@code null} if the player joined via join/ask command 47 | */ 48 | @Nullable PartyPlayer getInviter(); 49 | } 50 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/common/player/IPlayerPreLeaveEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.common.player; 2 | 3 | import com.alessiodp.parties.api.enums.LeaveCause; 4 | import com.alessiodp.parties.api.events.Cancellable; 5 | import com.alessiodp.parties.api.events.PartiesEvent; 6 | import com.alessiodp.parties.api.interfaces.Party; 7 | import com.alessiodp.parties.api.interfaces.PartyPlayer; 8 | import org.jetbrains.annotations.NotNull; 9 | import org.jetbrains.annotations.Nullable; 10 | 11 | public interface IPlayerPreLeaveEvent extends PartiesEvent, Cancellable { 12 | /** 13 | * Get the player that is leaveing the party 14 | * 15 | * @return the {@link PartyPlayer} 16 | */ 17 | @NotNull PartyPlayer getPartyPlayer(); 18 | 19 | /** 20 | * Get the party 21 | * 22 | * @return the {@link Party} 23 | */ 24 | @NotNull Party getParty(); 25 | 26 | /** 27 | * Get the leave cause 28 | * 29 | * @return the {@code LeaveCause} of the event 30 | */ 31 | @NotNull LeaveCause getCause(); 32 | 33 | /** 34 | * Has the player been kicked? 35 | * 36 | * @return {@code true} if the player has been kicked 37 | * @deprecated use getCause() instead 38 | */ 39 | @Deprecated 40 | default boolean isKicked() { 41 | return getCause() == LeaveCause.KICK || getCause() == LeaveCause.BAN; 42 | } 43 | 44 | /** 45 | * Get the kicker 46 | * 47 | * @return the {@link PartyPlayer} that has kicked the player, returns {@code null} if {@link #isKicked()} returns {@code false} 48 | */ 49 | @Nullable PartyPlayer getKicker(); 50 | } 51 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/common/player/IPlayerPreTeleportEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.common.player; 2 | 3 | import com.alessiodp.parties.api.events.Cancellable; 4 | import com.alessiodp.parties.api.events.PartiesEvent; 5 | import com.alessiodp.parties.api.interfaces.Party; 6 | import com.alessiodp.parties.api.interfaces.PartyPlayer; 7 | import org.jetbrains.annotations.NotNull; 8 | 9 | public interface IPlayerPreTeleportEvent extends PartiesEvent, Cancellable { 10 | /** 11 | * Get the player who is getting teleported 12 | * 13 | * @return the {@link PartyPlayer} 14 | */ 15 | @NotNull PartyPlayer getPartyPlayer(); 16 | 17 | /** 18 | * Get the party 19 | * 20 | * @return the {@link Party} 21 | */ 22 | @NotNull Party getParty(); 23 | } 24 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Events called by Parties 3 | */ 4 | package com.alessiodp.parties.api.events; -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/velocity/VelocityPartiesEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.velocity; 2 | 3 | import com.alessiodp.parties.api.events.PartiesEvent; 4 | import com.alessiodp.parties.api.interfaces.PartiesAPI; 5 | import org.jetbrains.annotations.NotNull; 6 | 7 | public abstract class VelocityPartiesEvent implements PartiesEvent { 8 | private PartiesAPI api; 9 | 10 | @Override 11 | public @NotNull PartiesAPI getApi() { 12 | return api; 13 | } 14 | 15 | @Override 16 | public void setApi(PartiesAPI instance) { 17 | api = instance; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/velocity/party/VelocityPartiesPartyGetExperienceEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.velocity.party; 2 | 3 | import com.alessiodp.parties.api.events.common.party.IPartyGetExperienceEvent; 4 | import com.alessiodp.parties.api.events.velocity.VelocityPartiesEvent; 5 | import com.alessiodp.parties.api.interfaces.Party; 6 | import com.alessiodp.parties.api.interfaces.PartyPlayer; 7 | import org.jetbrains.annotations.NotNull; 8 | import org.jetbrains.annotations.Nullable; 9 | 10 | public class VelocityPartiesPartyGetExperienceEvent extends VelocityPartiesEvent implements IPartyGetExperienceEvent { 11 | private final Party party; 12 | private final double experience; 13 | 14 | private final ExpSource source; 15 | private final PartyPlayer killer; 16 | 17 | public VelocityPartiesPartyGetExperienceEvent(Party party, double experience, PartyPlayer killer) { 18 | this.party = party; 19 | this.experience = experience; 20 | source = ExpSource.KILL; 21 | this.killer = killer; 22 | } 23 | 24 | @Override 25 | public @NotNull Party getParty() { 26 | return party; 27 | } 28 | 29 | @Override 30 | public double getExperience() { 31 | return experience; 32 | } 33 | 34 | @Override 35 | public @NotNull ExpSource getSource() { 36 | return source; 37 | } 38 | 39 | @Override 40 | public @Nullable PartyPlayer getKiller() { 41 | return killer; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/velocity/party/VelocityPartiesPartyLevelUpEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.velocity.party; 2 | 3 | import com.alessiodp.parties.api.events.common.party.IPartyLevelUpEvent; 4 | import com.alessiodp.parties.api.events.velocity.VelocityPartiesEvent; 5 | import com.alessiodp.parties.api.interfaces.Party; 6 | import org.jetbrains.annotations.NotNull; 7 | 8 | public class VelocityPartiesPartyLevelUpEvent extends VelocityPartiesEvent implements IPartyLevelUpEvent { 9 | private final Party party; 10 | private final int newLevel; 11 | 12 | public VelocityPartiesPartyLevelUpEvent(Party party, int newLevel) { 13 | this.party = party; 14 | this.newLevel = newLevel; 15 | } 16 | 17 | @Override 18 | public @NotNull Party getParty() { 19 | return party; 20 | } 21 | 22 | @Override 23 | public int getNewLevel() { 24 | return newLevel; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/velocity/party/VelocityPartiesPartyPostBroadcastEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.velocity.party; 2 | 3 | import com.alessiodp.parties.api.events.common.party.IPartyPostBroadcastEvent; 4 | import com.alessiodp.parties.api.events.velocity.VelocityPartiesEvent; 5 | import com.alessiodp.parties.api.interfaces.Party; 6 | import com.alessiodp.parties.api.interfaces.PartyPlayer; 7 | import org.jetbrains.annotations.NotNull; 8 | import org.jetbrains.annotations.Nullable; 9 | 10 | public class VelocityPartiesPartyPostBroadcastEvent extends VelocityPartiesEvent implements IPartyPostBroadcastEvent { 11 | private final Party party; 12 | private final String message; 13 | private final PartyPlayer player; 14 | 15 | public VelocityPartiesPartyPostBroadcastEvent(Party party, String message, PartyPlayer player) { 16 | this.party = party; 17 | this.message = message; 18 | this.player = player; 19 | } 20 | 21 | @Override 22 | public @NotNull Party getParty() { 23 | return party; 24 | } 25 | 26 | @Override 27 | public @NotNull String getMessage() { 28 | return message; 29 | } 30 | 31 | @Override 32 | public @Nullable PartyPlayer getPartyPlayer() { 33 | return player; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/velocity/party/VelocityPartiesPartyPostCreateEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.velocity.party; 2 | 3 | import com.alessiodp.parties.api.events.common.party.IPartyPostCreateEvent; 4 | import com.alessiodp.parties.api.events.velocity.VelocityPartiesEvent; 5 | import com.alessiodp.parties.api.interfaces.Party; 6 | import com.alessiodp.parties.api.interfaces.PartyPlayer; 7 | import org.jetbrains.annotations.NotNull; 8 | import org.jetbrains.annotations.Nullable; 9 | 10 | public class VelocityPartiesPartyPostCreateEvent extends VelocityPartiesEvent implements IPartyPostCreateEvent { 11 | private final PartyPlayer player; 12 | private final Party party; 13 | 14 | public VelocityPartiesPartyPostCreateEvent(PartyPlayer player, Party party) { 15 | this.player = player; 16 | this.party = party; 17 | } 18 | 19 | @Override 20 | public @Nullable PartyPlayer getCreator() { 21 | return player; 22 | } 23 | 24 | @Override 25 | public @NotNull Party getParty() { 26 | return party; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/velocity/party/VelocityPartiesPartyPostDeleteEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.velocity.party; 2 | 3 | import com.alessiodp.parties.api.enums.DeleteCause; 4 | import com.alessiodp.parties.api.events.common.party.IPartyPostDeleteEvent; 5 | import com.alessiodp.parties.api.events.velocity.VelocityPartiesEvent; 6 | import com.alessiodp.parties.api.interfaces.Party; 7 | import com.alessiodp.parties.api.interfaces.PartyPlayer; 8 | import org.jetbrains.annotations.NotNull; 9 | import org.jetbrains.annotations.Nullable; 10 | 11 | 12 | public class VelocityPartiesPartyPostDeleteEvent extends VelocityPartiesEvent implements IPartyPostDeleteEvent { 13 | private final Party party; 14 | private final DeleteCause cause; 15 | private final PartyPlayer kickedPlayer; 16 | private final PartyPlayer commandSender; 17 | 18 | public VelocityPartiesPartyPostDeleteEvent(Party party, DeleteCause cause, PartyPlayer kickedPlayer, PartyPlayer commandSender) { 19 | this.party = party; 20 | this.cause = cause; 21 | this.kickedPlayer = kickedPlayer; 22 | this.commandSender = commandSender; 23 | } 24 | 25 | @Override 26 | public @NotNull Party getParty() { 27 | return party; 28 | } 29 | 30 | @Override 31 | public @NotNull DeleteCause getCause() { 32 | return cause; 33 | } 34 | 35 | @Override 36 | public @Nullable PartyPlayer getKickedPlayer() { 37 | return kickedPlayer; 38 | } 39 | 40 | @Override 41 | public @Nullable PartyPlayer getCommandSender() { 42 | return commandSender; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/velocity/party/VelocityPartiesPartyPreCreateEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.velocity.party; 2 | 3 | import com.alessiodp.parties.api.events.common.party.IPartyPreCreateEvent; 4 | import com.alessiodp.parties.api.events.velocity.VelocityPartiesEvent; 5 | import com.alessiodp.parties.api.interfaces.PartyPlayer; 6 | import org.jetbrains.annotations.Nullable; 7 | 8 | public class VelocityPartiesPartyPreCreateEvent extends VelocityPartiesEvent implements IPartyPreCreateEvent { 9 | private boolean cancelled; 10 | private final PartyPlayer player; 11 | private String name; 12 | private boolean fixed; 13 | 14 | public VelocityPartiesPartyPreCreateEvent(PartyPlayer player, String name, boolean fixed) { 15 | this.player = player; 16 | this.name = name; 17 | this.fixed = fixed; 18 | } 19 | 20 | @Override 21 | public @Nullable PartyPlayer getPartyPlayer() { 22 | return player; 23 | } 24 | 25 | @Override 26 | public @Nullable String getPartyName() { 27 | return name; 28 | } 29 | 30 | @Override 31 | public void setPartyName(@Nullable String name) { 32 | this.name = name; 33 | } 34 | 35 | @Override 36 | public boolean isFixed() { 37 | return fixed; 38 | } 39 | 40 | @Override 41 | public void setFixed(boolean fixed) { 42 | this.fixed = fixed; 43 | } 44 | 45 | @Override 46 | public boolean isCancelled() { 47 | return cancelled; 48 | } 49 | 50 | @Override 51 | public void setCancelled(boolean cancel) { 52 | cancelled = cancel; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/velocity/player/VelocityPartiesPlayerPostChatEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.velocity.player; 2 | 3 | import com.alessiodp.parties.api.events.common.player.IPlayerPostChatEvent; 4 | import com.alessiodp.parties.api.events.velocity.VelocityPartiesEvent; 5 | import com.alessiodp.parties.api.interfaces.Party; 6 | import com.alessiodp.parties.api.interfaces.PartyPlayer; 7 | import org.jetbrains.annotations.NotNull; 8 | 9 | public class VelocityPartiesPlayerPostChatEvent extends VelocityPartiesEvent implements IPlayerPostChatEvent { 10 | private final PartyPlayer player; 11 | private final Party party; 12 | private final String formattedMessage; 13 | private final String message; 14 | 15 | public VelocityPartiesPlayerPostChatEvent(PartyPlayer player, Party party, String formattedMessage, String message) { 16 | this.player = player; 17 | this.party = party; 18 | this.formattedMessage = formattedMessage; 19 | this.message = message; 20 | } 21 | 22 | @Override 23 | public @NotNull PartyPlayer getPartyPlayer() { 24 | return player; 25 | } 26 | 27 | @Override 28 | public @NotNull Party getParty() { 29 | return party; 30 | } 31 | 32 | @Override 33 | public @NotNull String getFormattedMessage() { 34 | return formattedMessage; 35 | } 36 | 37 | @Override 38 | public @NotNull String getMessage() { 39 | return message; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/velocity/player/VelocityPartiesPlayerPostHomeEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.velocity.player; 2 | 3 | import com.alessiodp.parties.api.events.common.player.IPlayerPostHomeEvent; 4 | import com.alessiodp.parties.api.events.velocity.VelocityPartiesEvent; 5 | import com.alessiodp.parties.api.interfaces.Party; 6 | import com.alessiodp.parties.api.interfaces.PartyHome; 7 | import com.alessiodp.parties.api.interfaces.PartyPlayer; 8 | import org.jetbrains.annotations.NotNull; 9 | 10 | public class VelocityPartiesPlayerPostHomeEvent extends VelocityPartiesEvent implements IPlayerPostHomeEvent { 11 | private final PartyPlayer player; 12 | private final Party party; 13 | private final PartyHome home; 14 | 15 | public VelocityPartiesPlayerPostHomeEvent(PartyPlayer player, Party party, PartyHome home) { 16 | this.player = player; 17 | this.party = party; 18 | this.home = home; 19 | } 20 | 21 | @Override 22 | public @NotNull PartyPlayer getPartyPlayer() { 23 | return player; 24 | } 25 | 26 | @Override 27 | public @NotNull Party getParty() { 28 | return party; 29 | } 30 | 31 | @Override 32 | public @NotNull PartyHome getHome() { 33 | return home; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/velocity/player/VelocityPartiesPlayerPostInviteEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.velocity.player; 2 | 3 | import com.alessiodp.parties.api.events.common.player.IPlayerPostInviteEvent; 4 | import com.alessiodp.parties.api.events.velocity.VelocityPartiesEvent; 5 | import com.alessiodp.parties.api.interfaces.Party; 6 | import com.alessiodp.parties.api.interfaces.PartyPlayer; 7 | import org.jetbrains.annotations.NotNull; 8 | import org.jetbrains.annotations.Nullable; 9 | 10 | public class VelocityPartiesPlayerPostInviteEvent extends VelocityPartiesEvent implements IPlayerPostInviteEvent { 11 | private final PartyPlayer invitedPlayer; 12 | private final PartyPlayer inviter; 13 | private final Party party; 14 | 15 | public VelocityPartiesPlayerPostInviteEvent(PartyPlayer invitedPlayer, PartyPlayer inviter, Party party) { 16 | this.invitedPlayer = invitedPlayer; 17 | this.inviter = inviter; 18 | this.party = party; 19 | } 20 | 21 | @Override 22 | public @NotNull PartyPlayer getInvitedPlayer() { 23 | return invitedPlayer; 24 | } 25 | 26 | @Override 27 | public @Nullable PartyPlayer getInviter() { 28 | return inviter; 29 | } 30 | 31 | @Override 32 | public @NotNull Party getParty() { 33 | return party; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/velocity/player/VelocityPartiesPlayerPostJoinEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.velocity.player; 2 | 3 | import com.alessiodp.parties.api.enums.JoinCause; 4 | import com.alessiodp.parties.api.events.common.player.IPlayerPostJoinEvent; 5 | import com.alessiodp.parties.api.events.velocity.VelocityPartiesEvent; 6 | import com.alessiodp.parties.api.interfaces.Party; 7 | import com.alessiodp.parties.api.interfaces.PartyPlayer; 8 | import org.jetbrains.annotations.NotNull; 9 | import org.jetbrains.annotations.Nullable; 10 | 11 | public class VelocityPartiesPlayerPostJoinEvent extends VelocityPartiesEvent implements IPlayerPostJoinEvent { 12 | private final PartyPlayer player; 13 | private final Party party; 14 | private final JoinCause cause; 15 | private final PartyPlayer inviter; 16 | 17 | public VelocityPartiesPlayerPostJoinEvent(PartyPlayer player, Party party, JoinCause cause, PartyPlayer inviter) { 18 | this.player = player; 19 | this.party = party; 20 | this.cause = cause; 21 | this.inviter = inviter; 22 | } 23 | 24 | @Override 25 | public @NotNull PartyPlayer getPartyPlayer() { 26 | return player; 27 | } 28 | 29 | @Override 30 | public @NotNull Party getParty() { 31 | return party; 32 | } 33 | 34 | @Override 35 | public @NotNull JoinCause getCause() { 36 | return cause; 37 | } 38 | 39 | @Override 40 | public @Nullable PartyPlayer getInviter() { 41 | return inviter; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/velocity/player/VelocityPartiesPlayerPostLeaveEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.velocity.player; 2 | 3 | import com.alessiodp.parties.api.enums.LeaveCause; 4 | import com.alessiodp.parties.api.events.common.player.IPlayerPostLeaveEvent; 5 | import com.alessiodp.parties.api.events.velocity.VelocityPartiesEvent; 6 | import com.alessiodp.parties.api.interfaces.Party; 7 | import com.alessiodp.parties.api.interfaces.PartyPlayer; 8 | import org.jetbrains.annotations.NotNull; 9 | import org.jetbrains.annotations.Nullable; 10 | 11 | public class VelocityPartiesPlayerPostLeaveEvent extends VelocityPartiesEvent implements IPlayerPostLeaveEvent { 12 | private final PartyPlayer player; 13 | private final Party party; 14 | private final LeaveCause cause; 15 | private final PartyPlayer kicker; 16 | 17 | public VelocityPartiesPlayerPostLeaveEvent(PartyPlayer player, Party party, LeaveCause cause, PartyPlayer kicker) { 18 | this.player = player; 19 | this.party = party; 20 | this.cause = cause; 21 | this.kicker = kicker; 22 | } 23 | 24 | @Override 25 | public @NotNull PartyPlayer getPartyPlayer() { 26 | return player; 27 | } 28 | 29 | @Override 30 | public @NotNull Party getParty() { 31 | return party; 32 | } 33 | 34 | @Override 35 | public @NotNull LeaveCause getCause() { 36 | return cause; 37 | } 38 | 39 | @Override 40 | public @Nullable PartyPlayer getKicker() { 41 | return kicker; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/velocity/player/VelocityPartiesPlayerPostTeleportEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.velocity.player; 2 | 3 | import com.alessiodp.parties.api.events.common.player.IPlayerPostTeleportEvent; 4 | import com.alessiodp.parties.api.events.velocity.VelocityPartiesEvent; 5 | import com.alessiodp.parties.api.interfaces.Party; 6 | import com.alessiodp.parties.api.interfaces.PartyPlayer; 7 | import com.velocitypowered.api.proxy.server.RegisteredServer; 8 | import org.jetbrains.annotations.NotNull; 9 | 10 | public class VelocityPartiesPlayerPostTeleportEvent extends VelocityPartiesEvent implements IPlayerPostTeleportEvent { 11 | private final PartyPlayer player; 12 | private final Party party; 13 | private final RegisteredServer destination; 14 | 15 | public VelocityPartiesPlayerPostTeleportEvent(PartyPlayer player, Party party, RegisteredServer destination) { 16 | this.player = player; 17 | this.party = party; 18 | this.destination = destination; 19 | } 20 | 21 | @Override 22 | public @NotNull PartyPlayer getPartyPlayer() { 23 | return player; 24 | } 25 | 26 | @Override 27 | public @NotNull Party getParty() { 28 | return party; 29 | } 30 | 31 | /** 32 | * Get the destination as RegisteredServer 33 | * 34 | * @return the {@link RegisteredServer} 35 | */ 36 | public @NotNull RegisteredServer getDestination() { 37 | return destination; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/velocity/player/VelocityPartiesPlayerPreHomeEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.velocity.player; 2 | 3 | import com.alessiodp.parties.api.events.common.player.IPlayerPreHomeEvent; 4 | import com.alessiodp.parties.api.events.velocity.VelocityPartiesEvent; 5 | import com.alessiodp.parties.api.interfaces.Party; 6 | import com.alessiodp.parties.api.interfaces.PartyHome; 7 | import com.alessiodp.parties.api.interfaces.PartyPlayer; 8 | import org.jetbrains.annotations.NotNull; 9 | 10 | public class VelocityPartiesPlayerPreHomeEvent extends VelocityPartiesEvent implements IPlayerPreHomeEvent { 11 | private boolean cancelled; 12 | private final PartyPlayer player; 13 | private final Party party; 14 | private final PartyHome home; 15 | 16 | public VelocityPartiesPlayerPreHomeEvent(PartyPlayer player, Party party, PartyHome home) { 17 | this.player = player; 18 | this.party = party; 19 | this.home = home; 20 | } 21 | 22 | @Override 23 | public @NotNull PartyPlayer getPartyPlayer() { 24 | return player; 25 | } 26 | 27 | @Override 28 | public @NotNull Party getParty() { 29 | return party; 30 | } 31 | 32 | @Override 33 | public @NotNull PartyHome getHome() { 34 | return home; 35 | } 36 | 37 | @Override 38 | public boolean isCancelled() { 39 | return cancelled; 40 | } 41 | 42 | @Override 43 | public void setCancelled(boolean cancel) { 44 | cancelled = cancel; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/velocity/player/VelocityPartiesPlayerPreInviteEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.velocity.player; 2 | 3 | import com.alessiodp.parties.api.events.common.player.IPlayerPreInviteEvent; 4 | import com.alessiodp.parties.api.events.velocity.VelocityPartiesEvent; 5 | import com.alessiodp.parties.api.interfaces.Party; 6 | import com.alessiodp.parties.api.interfaces.PartyPlayer; 7 | import org.jetbrains.annotations.NotNull; 8 | import org.jetbrains.annotations.Nullable; 9 | 10 | public class VelocityPartiesPlayerPreInviteEvent extends VelocityPartiesEvent implements IPlayerPreInviteEvent { 11 | private boolean cancelled; 12 | private final PartyPlayer invitedPlayer; 13 | private final PartyPlayer inviter; 14 | private final Party party; 15 | 16 | public VelocityPartiesPlayerPreInviteEvent(PartyPlayer invitedPlayer, PartyPlayer inviter, Party party) { 17 | this.invitedPlayer = invitedPlayer; 18 | this.inviter = inviter; 19 | this.party = party; 20 | } 21 | 22 | @Override 23 | public @NotNull PartyPlayer getInvitedPlayer() { 24 | return invitedPlayer; 25 | } 26 | 27 | @Override 28 | public @Nullable PartyPlayer getInviter() { 29 | return inviter; 30 | } 31 | 32 | @Override 33 | public @NotNull Party getParty() { 34 | return party; 35 | } 36 | 37 | @Override 38 | public boolean isCancelled() { 39 | return cancelled; 40 | } 41 | 42 | @Override 43 | public void setCancelled(boolean cancel) { 44 | cancelled = cancel; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/events/velocity/unique/VelocityPartiesPartyFollowEvent.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.events.velocity.unique; 2 | 3 | import com.alessiodp.parties.api.events.Cancellable; 4 | import com.alessiodp.parties.api.events.velocity.VelocityPartiesEvent; 5 | import com.alessiodp.parties.api.interfaces.Party; 6 | import com.velocitypowered.api.proxy.server.RegisteredServer; 7 | import org.jetbrains.annotations.NotNull; 8 | 9 | public class VelocityPartiesPartyFollowEvent extends VelocityPartiesEvent implements Cancellable { 10 | private boolean cancelled; 11 | private final Party party; 12 | private final RegisteredServer joinedServer; 13 | 14 | public VelocityPartiesPartyFollowEvent(Party party, RegisteredServer joinedServer) { 15 | this.party = party; 16 | this.joinedServer = joinedServer; 17 | } 18 | 19 | /** 20 | * Get the party 21 | * 22 | * @return the {@link Party} 23 | */ 24 | public @NotNull Party getParty() { 25 | return party; 26 | } 27 | 28 | /** 29 | * Get the name of the server that the party will join into 30 | * 31 | * @return the name of the server 32 | */ 33 | public @NotNull RegisteredServer getJoinedServer() { 34 | return joinedServer; 35 | } 36 | 37 | @Override 38 | public boolean isCancelled() { 39 | return cancelled; 40 | } 41 | 42 | @Override 43 | public void setCancelled(boolean cancel) { 44 | cancelled = cancel; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/interfaces/Color.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.interfaces; 2 | 3 | /** 4 | * @deprecated Use {@link PartyColor} instead 5 | */ 6 | @Deprecated 7 | public interface Color extends PartyColor { 8 | } 9 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/interfaces/HomeLocation.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.interfaces; 2 | 3 | /** 4 | * @deprecated Use {@link PartyHome} instead 5 | */ 6 | @Deprecated 7 | public interface HomeLocation extends PartyHome { 8 | } 9 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/interfaces/Rank.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.api.interfaces; 2 | 3 | /** 4 | * @deprecated Use {@link PartyRank} instead 5 | */ 6 | @Deprecated 7 | public interface Rank extends PartyRank { 8 | } 9 | -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/interfaces/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Interfaces used in Parties API 3 | */ 4 | package com.alessiodp.parties.api.interfaces; -------------------------------------------------------------------------------- /api/src/main/java/com/alessiodp/parties/api/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Main package of Parties API 3 | */ 4 | package com.alessiodp.parties.api; -------------------------------------------------------------------------------- /bukkit/patches/.gitignore: -------------------------------------------------------------------------------- 1 | **/*.original -------------------------------------------------------------------------------- /bukkit/patches/clan/patch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" 3 | 4 | reg1="s/\/party/\/clan/g" 5 | reg2="s/((:.*[^%/])|(^\s+- '?\"?.*[^%]))(party)([^%])/\1clan\5/g" 6 | reg3="s/((:.*[^%/])|(^\s+- '?\"?.*.*[^%/]))(parties)([^%])/\1clans\5/g" 7 | reg4="s/((:.*[^%/])|(^\s+- '?\"?.*[^%]))(Party)([^%])/\1Clan\5/g" 8 | reg5="s/Parties List/Clans List/g" 9 | 10 | echo "Patching bukkit clan" 11 | cp "$DIR/../../src/main/resources/bukkit/messages.yml" "$DIR/messages.yml" 12 | sed -i.original -r "$reg1;$reg2;$reg3;$reg4;$reg5" "$DIR/messages.yml" 13 | echo "Patch completed" -------------------------------------------------------------------------------- /bukkit/patches/guild/patch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" 3 | 4 | reg1="s/\/party/\/guild/g" 5 | reg2="s/((:.*[^%/])|(^\s+- '?\"?.*[^%]))(party)([^%])/\1guild\5/g" 6 | reg3="s/((:.*[^%/])|(^\s+- '?\"?.*.*[^%/]))(parties)([^%])/\1guilds\5/g" 7 | reg4="s/((:.*[^%/])|(^\s+- '?\"?.*[^%]))(Party)([^%])/\1Guild\5/g" 8 | reg5="s/Parties List/Guilds List/g" 9 | 10 | echo "Patching bukkit guild" 11 | cp "$DIR/../../src/main/resources/bukkit/messages.yml" "$DIR/messages.yml" 12 | sed -i.original -r "$reg1;$reg2;$reg3;$reg4;$reg5" "$DIR/messages.yml" 13 | echo "Patch completed" -------------------------------------------------------------------------------- /bukkit/patches/patch_all.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" 3 | 4 | "$DIR/clan/patch.sh" 5 | "$DIR/guild/patch.sh" 6 | -------------------------------------------------------------------------------- /bukkit/src/main/java/com/alessiodp/parties/bukkit/addons/external/BukkitAdvancedBanHandler.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.bukkit.addons.external; 2 | 3 | import com.alessiodp.parties.bukkit.bootstrap.BukkitPartiesBootstrap; 4 | import com.alessiodp.parties.bukkit.configuration.data.BukkitConfigMain; 5 | import com.alessiodp.parties.common.PartiesPlugin; 6 | import com.alessiodp.parties.common.addons.external.AdvancedBanHandler; 7 | import me.leoko.advancedban.bukkit.event.PunishmentEvent; 8 | import org.bukkit.event.EventHandler; 9 | import org.bukkit.event.Listener; 10 | import org.jetbrains.annotations.NotNull; 11 | 12 | public class BukkitAdvancedBanHandler extends AdvancedBanHandler implements Listener { 13 | 14 | public BukkitAdvancedBanHandler(@NotNull PartiesPlugin plugin) { 15 | super(plugin); 16 | } 17 | 18 | @Override 19 | protected boolean isEnabled() { 20 | return BukkitConfigMain.ADDITIONAL_MODERATION_PLUGINS_ADVANCEDBAN; 21 | } 22 | 23 | @Override 24 | public void registerListener() { 25 | ((BukkitPartiesBootstrap) plugin.getBootstrap()).getServer().getPluginManager().registerEvents(this, (BukkitPartiesBootstrap) plugin.getBootstrap()); 26 | } 27 | 28 | @EventHandler 29 | public void onPlayerBan(PunishmentEvent event) { 30 | onBan(event.getPunishment()); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /bukkit/src/main/java/com/alessiodp/parties/bukkit/addons/external/hooks/MagicHook.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.bukkit.addons.external.hooks; 2 | 3 | import com.alessiodp.parties.bukkit.addons.external.MagicHandler; 4 | import com.alessiodp.parties.common.PartiesPlugin; 5 | import com.alessiodp.parties.common.parties.objects.PartyImpl; 6 | import com.alessiodp.parties.common.players.objects.PartyPlayerImpl; 7 | import com.elmakers.mine.bukkit.api.entity.TeamProvider; 8 | import com.elmakers.mine.bukkit.api.magic.MagicAPI; 9 | import lombok.RequiredArgsConstructor; 10 | import org.bukkit.entity.Entity; 11 | import org.bukkit.entity.Player; 12 | import org.bukkit.plugin.Plugin; 13 | import org.jetbrains.annotations.NotNull; 14 | 15 | @RequiredArgsConstructor 16 | public class MagicHook implements TeamProvider { 17 | @NotNull private final PartiesPlugin plugin; 18 | 19 | public void register(Plugin magicPlugin) { 20 | ((MagicAPI) magicPlugin).getController().register(this); 21 | } 22 | 23 | @Override 24 | public boolean isFriendly(Entity attacker, Entity entity) { 25 | if (MagicHandler.isActive() && attacker instanceof Player && entity instanceof Player) { 26 | if (plugin.getApi().areInTheSameParty(attacker.getUniqueId(), entity.getUniqueId())) { 27 | PartyPlayerImpl partyPlayer = plugin.getPlayerManager().getPlayer(attacker.getUniqueId()); 28 | if (partyPlayer != null) { 29 | PartyImpl party = plugin.getPartyManager().getPartyOfPlayer(partyPlayer); 30 | return party.isFriendlyFireProtected(); 31 | } 32 | } 33 | } 34 | return false; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /bukkit/src/main/java/com/alessiodp/parties/bukkit/addons/external/skript/conditions/CondInParty.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.bukkit.addons.external.skript.conditions; 2 | 3 | import ch.njol.skript.conditions.base.PropertyCondition; 4 | import ch.njol.skript.doc.Description; 5 | import ch.njol.skript.doc.Examples; 6 | import ch.njol.skript.doc.Name; 7 | import ch.njol.skript.doc.Since; 8 | import com.alessiodp.parties.api.Parties; 9 | import com.alessiodp.parties.api.interfaces.PartyPlayer; 10 | import org.bukkit.OfflinePlayer; 11 | 12 | @SuppressWarnings("NullableProblems") 13 | @Name("Player is in Party") 14 | @Description("Checks if a player is in party.") 15 | @Examples({ 16 | "if player is in party:", 17 | "\tmessage \"The player %player% is in a party\"" 18 | }) 19 | @Since("3.0.0") 20 | public class CondInParty extends PropertyCondition { 21 | static { 22 | register(CondInParty.class, "in [a] party", "offlineplayers"); 23 | } 24 | 25 | @Override 26 | public boolean check(OfflinePlayer o) { 27 | PartyPlayer partyPlayer = Parties.getApi().getPartyPlayer(o.getUniqueId()); 28 | return partyPlayer != null && partyPlayer.isInParty(); 29 | } 30 | 31 | @Override 32 | protected String getPropertyName() { 33 | return "in party"; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /bukkit/src/main/java/com/alessiodp/parties/bukkit/addons/external/skript/conditions/CondPartyFixed.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.bukkit.addons.external.skript.conditions; 2 | 3 | import ch.njol.skript.conditions.base.PropertyCondition; 4 | import ch.njol.skript.doc.Description; 5 | import ch.njol.skript.doc.Examples; 6 | import ch.njol.skript.doc.Name; 7 | import ch.njol.skript.doc.Since; 8 | import com.alessiodp.parties.api.interfaces.Party; 9 | 10 | @SuppressWarnings("NullableProblems") 11 | @Name("Party is Fixed") 12 | @Description("Checks if a party is fixed.") 13 | @Examples({ 14 | "if party is fixed:", 15 | "\tmessage \"The party %party% is fixed\"" 16 | }) 17 | @Since("3.0.0") 18 | public class CondPartyFixed extends PropertyCondition { 19 | static { 20 | register(CondPartyFixed.class, "fixed", "party"); 21 | } 22 | 23 | @Override 24 | public boolean check(Party party) { 25 | return party.isFixed(); 26 | } 27 | 28 | @Override 29 | protected String getPropertyName() { 30 | return "fixed"; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /bukkit/src/main/java/com/alessiodp/parties/bukkit/addons/external/skript/conditions/CondPartyFriendlyFire.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.bukkit.addons.external.skript.conditions; 2 | 3 | import ch.njol.skript.conditions.base.PropertyCondition; 4 | import ch.njol.skript.doc.Description; 5 | import ch.njol.skript.doc.Examples; 6 | import ch.njol.skript.doc.Name; 7 | import ch.njol.skript.doc.Since; 8 | import com.alessiodp.parties.api.interfaces.Party; 9 | 10 | @SuppressWarnings("NullableProblems") 11 | @Name("Party is Friendly Fire Protected") 12 | @Description("Checks if a party is friendly fire protected.") 13 | @Examples({ 14 | "if party is friendly fire protected:", 15 | "\tmessage \"The party %party% is protected from friendly fire\"" 16 | }) 17 | @Since("3.0.0") 18 | public class CondPartyFriendlyFire extends PropertyCondition { 19 | static { 20 | register(CondPartyFriendlyFire.class, "[friendly[-]fire] protected [from friendly[-]fire]", "party"); 21 | } 22 | 23 | @Override 24 | public boolean check(Party party) { 25 | return party.isFriendlyFireProtected(); 26 | } 27 | 28 | @Override 29 | protected String getPropertyName() { 30 | return "friendly fire protected"; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /bukkit/src/main/java/com/alessiodp/parties/bukkit/addons/external/skript/conditions/CondPartyFull.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.bukkit.addons.external.skript.conditions; 2 | 3 | import ch.njol.skript.conditions.base.PropertyCondition; 4 | import ch.njol.skript.doc.Description; 5 | import ch.njol.skript.doc.Examples; 6 | import ch.njol.skript.doc.Name; 7 | import ch.njol.skript.doc.Since; 8 | import com.alessiodp.parties.api.interfaces.Party; 9 | 10 | @SuppressWarnings("NullableProblems") 11 | @Name("Party is Full") 12 | @Description("Checks if a party is full.") 13 | @Examples({ 14 | "if party is full:", 15 | "\tmessage \"The party %party% is full\"" 16 | }) 17 | @Since("3.0.0") 18 | public class CondPartyFull extends PropertyCondition { 19 | static { 20 | register(CondPartyFull.class, "full", "party"); 21 | } 22 | 23 | @Override 24 | public boolean check(Party party) { 25 | return party.isFull(); 26 | } 27 | 28 | @Override 29 | protected String getPropertyName() { 30 | return "full"; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /bukkit/src/main/java/com/alessiodp/parties/bukkit/addons/external/skript/conditions/CondPlayerLeader.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.bukkit.addons.external.skript.conditions; 2 | 3 | import ch.njol.skript.conditions.base.PropertyCondition; 4 | import ch.njol.skript.doc.Description; 5 | import ch.njol.skript.doc.Examples; 6 | import ch.njol.skript.doc.Name; 7 | import ch.njol.skript.doc.Since; 8 | import com.alessiodp.parties.api.Parties; 9 | import com.alessiodp.parties.api.interfaces.Party; 10 | import com.alessiodp.parties.api.interfaces.PartyPlayer; 11 | 12 | @SuppressWarnings("NullableProblems") 13 | @Name("Party Player is Leader") 14 | @Description("Checks if the partyplayer is leader.") 15 | @Examples({ 16 | "if event-partyplayer is leader:", 17 | "\tmessage \"The player %name of event-partyplayer% is leader of %party of event-partyplayer%\"" 18 | }) 19 | @Since("3.0.0") 20 | public class CondPlayerLeader extends PropertyCondition { 21 | static { 22 | register(CondPlayerLeader.class, "leader", "partyplayer"); 23 | } 24 | 25 | @Override 26 | public boolean check(PartyPlayer partyPlayer) { 27 | if (partyPlayer.isInParty()) { 28 | Party party = Parties.getApi().getParty(partyPlayer.getPartyId()); 29 | if (party != null) { 30 | return partyPlayer.getPlayerUUID().equals(party.getLeader()); 31 | } 32 | } 33 | return false; 34 | } 35 | 36 | @Override 37 | protected String getPropertyName() { 38 | return "leader"; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /bukkit/src/main/java/com/alessiodp/parties/bukkit/addons/external/skript/expressions/ExprPartyId.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.bukkit.addons.external.skript.expressions; 2 | 3 | import ch.njol.skript.doc.Description; 4 | import ch.njol.skript.doc.Examples; 5 | import ch.njol.skript.doc.Name; 6 | import ch.njol.skript.doc.Since; 7 | import ch.njol.skript.expressions.base.SimplePropertyExpression; 8 | import com.alessiodp.parties.api.interfaces.Party; 9 | 10 | @SuppressWarnings("NullableProblems") 11 | @Name("Party ID") 12 | @Description("Get the id of the given party.") 13 | @Examples({"send \"%id of party with name \"test\"%\"", 14 | "send \"%id of event-party%\""}) 15 | @Since("3.0.0") 16 | public class ExprPartyId extends SimplePropertyExpression { 17 | static { 18 | register(ExprPartyId.class, String.class, "[uu]id", "party"); 19 | } 20 | 21 | @Override 22 | public Class getReturnType() { 23 | return String.class; 24 | } 25 | 26 | @Override 27 | protected String getPropertyName() { 28 | return "id"; 29 | } 30 | 31 | @Override 32 | public String convert(Party party) { 33 | return party.getId().toString(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /bukkit/src/main/java/com/alessiodp/parties/bukkit/addons/external/skript/expressions/ExprPartyLevel.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.bukkit.addons.external.skript.expressions; 2 | 3 | import ch.njol.skript.doc.Description; 4 | import ch.njol.skript.doc.Examples; 5 | import ch.njol.skript.doc.Name; 6 | import ch.njol.skript.doc.Since; 7 | import ch.njol.skript.expressions.base.SimplePropertyExpression; 8 | import com.alessiodp.parties.api.interfaces.Party; 9 | 10 | @SuppressWarnings("NullableProblems") 11 | @Name("Party Level") 12 | @Description("Get the level number of the given party.") 13 | @Examples({"send \"%level of party with name \"test\"%\"", 14 | "send \"%level of event-party%\""}) 15 | @Since("3.0.0") 16 | public class ExprPartyLevel extends SimplePropertyExpression { 17 | static { 18 | register(ExprPartyLevel.class, Integer.class, "level", "party"); 19 | } 20 | 21 | @Override 22 | public Class getReturnType() { 23 | return Integer.class; 24 | } 25 | 26 | @Override 27 | protected String getPropertyName() { 28 | return "level"; 29 | } 30 | 31 | @Override 32 | public Integer convert(Party party) { 33 | return party.getLevel(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /bukkit/src/main/java/com/alessiodp/parties/bukkit/addons/external/skript/expressions/ExprPlayerName.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.bukkit.addons.external.skript.expressions; 2 | 3 | import ch.njol.skript.doc.Description; 4 | import ch.njol.skript.doc.Examples; 5 | import ch.njol.skript.doc.Name; 6 | import ch.njol.skript.doc.Since; 7 | import ch.njol.skript.expressions.base.SimplePropertyExpression; 8 | import com.alessiodp.parties.api.interfaces.PartyPlayer; 9 | 10 | @SuppressWarnings("NullableProblems") 11 | @Name("Party Player Name") 12 | @Description("Get the name of the given partyplayer.") 13 | @Examples({"send \"%name of partyplayer player%\"", 14 | "send \"%name of event-partyplayer%\""}) 15 | @Since("3.0.0") 16 | public class ExprPlayerName extends SimplePropertyExpression { 17 | static { 18 | register(ExprPlayerName.class, String.class, "name", "partyplayer"); 19 | } 20 | 21 | @Override 22 | public Class getReturnType() { 23 | return String.class; 24 | } 25 | 26 | @Override 27 | protected String getPropertyName() { 28 | return "name"; 29 | } 30 | 31 | @Override 32 | public String convert(PartyPlayer partyPlayer) { 33 | return partyPlayer.getName(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /bukkit/src/main/java/com/alessiodp/parties/bukkit/api/BukkitPartiesOptionsHandler.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.bukkit.api; 2 | 3 | import com.alessiodp.parties.bukkit.configuration.data.BukkitConfigMain; 4 | import com.alessiodp.parties.common.api.PartiesOptionsHandler; 5 | import org.jetbrains.annotations.NotNull; 6 | import org.jetbrains.annotations.Nullable; 7 | 8 | public class BukkitPartiesOptionsHandler extends PartiesOptionsHandler { 9 | @Override 10 | public boolean isSkriptHookEnabled() { 11 | return BukkitConfigMain.PARTIES_HOOK_INTO_SKRIPT; 12 | } 13 | 14 | @Override 15 | public @Nullable String getBungeecordName() { 16 | return BukkitConfigMain.PARTIES_BUNGEECORD_SERVER_NAME; 17 | } 18 | 19 | @Override 20 | public @Nullable String getBungeecordId() { 21 | return BukkitConfigMain.PARTIES_BUNGEECORD_SERVER_ID; 22 | } 23 | 24 | @Override 25 | public boolean isClaimEnabled() { 26 | return BukkitConfigMain.ADDONS_CLAIM_ENABLE; 27 | } 28 | 29 | @Override 30 | public boolean isDynmapEnabled() { 31 | return BukkitConfigMain.ADDONS_DYNMAP_ENABLE; 32 | } 33 | 34 | @Override 35 | public @NotNull String getDynmapLayer() { 36 | return BukkitConfigMain.ADDONS_DYNMAP_MARKER_LAYER; 37 | } 38 | 39 | @Override 40 | public boolean isVaultEnabled() { 41 | return BukkitConfigMain.ADDONS_VAULT_ENABLE; 42 | } 43 | 44 | @Override 45 | public boolean isVaultCommandEnabled() { 46 | return BukkitConfigMain.ADDONS_VAULT_CONFIRM_ENABLE; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /bukkit/src/main/java/com/alessiodp/parties/bukkit/bootstrap/BukkitPartiesBootstrap.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.bukkit.bootstrap; 2 | 3 | import com.alessiodp.core.bukkit.bootstrap.ADPBukkitBootstrap; 4 | import com.alessiodp.parties.bukkit.BukkitPartiesPlugin; 5 | 6 | public class BukkitPartiesBootstrap extends ADPBukkitBootstrap { 7 | public BukkitPartiesBootstrap() { 8 | plugin = new BukkitPartiesPlugin(this); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /bukkit/src/main/java/com/alessiodp/parties/bukkit/commands/BukkitPartiesCommandManager.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.bukkit.commands; 2 | 3 | import java.util.ArrayList; 4 | 5 | import com.alessiodp.core.bukkit.commands.utils.BukkitCommandUtils; 6 | import com.alessiodp.core.common.ADPPlugin; 7 | import com.alessiodp.parties.bukkit.commands.main.BukkitCommandP; 8 | import com.alessiodp.parties.bukkit.commands.main.BukkitCommandParty; 9 | import com.alessiodp.parties.common.PartiesPlugin; 10 | import com.alessiodp.parties.common.commands.PartiesCommandManager; 11 | import com.alessiodp.parties.common.configuration.data.ConfigMain; 12 | 13 | public class BukkitPartiesCommandManager extends PartiesCommandManager { 14 | 15 | public BukkitPartiesCommandManager(ADPPlugin plugin) { 16 | super(plugin); 17 | } 18 | 19 | @Override 20 | public void prepareCommands() { 21 | super.prepareCommands(); 22 | commandUtils = new BukkitCommandUtils(plugin, ConfigMain.COMMANDS_MISC_ON, ConfigMain.COMMANDS_MISC_OFF); 23 | } 24 | 25 | @Override 26 | public void registerCommands() { 27 | mainCommands = new ArrayList<>(); 28 | mainCommands.add(new BukkitCommandParty((PartiesPlugin) plugin)); 29 | if (!((PartiesPlugin) plugin).isBungeeCordEnabled()) { 30 | mainCommands.add(new BukkitCommandP((PartiesPlugin) plugin)); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /bukkit/src/main/java/com/alessiodp/parties/bukkit/commands/list/BukkitCommands.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.bukkit.commands.list; 2 | 3 | import com.alessiodp.core.common.commands.list.ADPCommand; 4 | 5 | public enum BukkitCommands implements ADPCommand { 6 | CLAIM, 7 | CONFIRM; 8 | 9 | @Override 10 | public String getOriginalName() { 11 | return this.name(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /bukkit/src/main/java/com/alessiodp/parties/bukkit/commands/main/BukkitCommandP.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.bukkit.commands.main; 2 | 3 | import com.alessiodp.parties.bukkit.configuration.data.BukkitConfigMain; 4 | import com.alessiodp.parties.common.PartiesPlugin; 5 | import com.alessiodp.parties.common.commands.main.CommandP; 6 | 7 | public class BukkitCommandP extends CommandP { 8 | public BukkitCommandP(PartiesPlugin instance) { 9 | super(instance); 10 | 11 | description = BukkitConfigMain.COMMANDS_MAIN_P_DESCRIPTION; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /bukkit/src/main/java/com/alessiodp/parties/bukkit/configuration/BukkitPartiesConfigurationManager.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.bukkit.configuration; 2 | 3 | import com.alessiodp.parties.bukkit.configuration.data.BukkitConfigMain; 4 | import com.alessiodp.parties.bukkit.configuration.data.BukkitConfigParties; 5 | import com.alessiodp.parties.bukkit.configuration.data.BukkitMessages; 6 | import com.alessiodp.parties.bukkit.messaging.BukkitPartiesMessageDispatcher; 7 | import com.alessiodp.parties.common.PartiesPlugin; 8 | import com.alessiodp.parties.common.configuration.PartiesConfigurationManager; 9 | 10 | public class BukkitPartiesConfigurationManager extends PartiesConfigurationManager { 11 | 12 | public BukkitPartiesConfigurationManager(PartiesPlugin plugin) { 13 | super(plugin); 14 | 15 | getConfigs().add(new BukkitMessages(plugin)); 16 | getConfigs().add(new BukkitConfigMain(plugin)); 17 | getConfigs().add(new BukkitConfigParties(plugin)); 18 | } 19 | 20 | public void makeConfigsRequest() { 21 | ((BukkitPartiesMessageDispatcher) plugin.getMessenger().getMessageDispatcher()).sendConfigsRequest(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /bukkit/src/main/java/com/alessiodp/parties/bukkit/listeners/BukkitChatListener.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.bukkit.listeners; 2 | 3 | import com.alessiodp.core.bukkit.user.BukkitUser; 4 | import com.alessiodp.parties.common.PartiesPlugin; 5 | import com.alessiodp.parties.common.listeners.ChatListener; 6 | import org.bukkit.event.EventHandler; 7 | import org.bukkit.event.EventPriority; 8 | import org.bukkit.event.Listener; 9 | import org.bukkit.event.player.AsyncPlayerChatEvent; 10 | import org.bukkit.event.player.PlayerCommandPreprocessEvent; 11 | 12 | public class BukkitChatListener extends ChatListener implements Listener { 13 | 14 | public BukkitChatListener(PartiesPlugin instance) { 15 | super(instance); 16 | } 17 | 18 | @EventHandler(ignoreCancelled = true, priority = EventPriority.LOW) 19 | public void onPlayerChat(AsyncPlayerChatEvent event) { 20 | if (!event.isCancelled()) { 21 | boolean isCancelled = super.onPlayerChat(new BukkitUser(plugin, event.getPlayer()), event.getMessage()); 22 | event.setCancelled(isCancelled); 23 | } 24 | } 25 | 26 | /** 27 | * Auto command listener 28 | */ 29 | @EventHandler 30 | public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event) { 31 | if (!event.isCancelled()) { 32 | super.onPlayerCommandPreprocess(new BukkitUser(plugin, event.getPlayer()), event.getMessage()); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /bukkit/src/main/java/com/alessiodp/parties/bukkit/listeners/BukkitExpListener.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.bukkit.listeners; 2 | 3 | import com.alessiodp.parties.bukkit.BukkitPartiesPlugin; 4 | import com.alessiodp.parties.bukkit.configuration.data.BukkitConfigMain; 5 | import com.alessiodp.parties.common.parties.objects.PartyImpl; 6 | import com.alessiodp.parties.common.players.objects.PartyPlayerImpl; 7 | import lombok.RequiredArgsConstructor; 8 | import org.bukkit.entity.Entity; 9 | import org.bukkit.event.EventHandler; 10 | import org.bukkit.event.EventPriority; 11 | import org.bukkit.event.Listener; 12 | import org.bukkit.event.entity.EntityDeathEvent; 13 | 14 | @RequiredArgsConstructor 15 | public class BukkitExpListener implements Listener { 16 | private final BukkitPartiesPlugin plugin; 17 | 18 | @EventHandler(ignoreCancelled = true, priority = EventPriority.HIGHEST) 19 | public void onEntityDie(EntityDeathEvent event) { 20 | if (BukkitConfigMain.ADDITIONAL_EXP_ENABLE && BukkitConfigMain.ADDITIONAL_EXP_EARN_FROM_MOBS) { 21 | Entity killedEntity = event.getEntity(); 22 | 23 | if (event.getEntity().getKiller() != null) { 24 | PartyPlayerImpl killer = plugin.getPlayerManager().getPlayer(event.getEntity().getKiller().getUniqueId()); 25 | if (killer.isInParty()) { 26 | PartyImpl party = plugin.getPartyManager().getParty(killer.getPartyId()); 27 | if (party != null) { 28 | party.giveExperience(event.getDroppedExp(), killer, killedEntity, true); 29 | } 30 | } 31 | } 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /bukkit/src/main/java/com/alessiodp/parties/bukkit/messaging/BukkitPartiesMessageListener.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.bukkit.messaging; 2 | 3 | import com.alessiodp.core.bukkit.messaging.BukkitMessageListener; 4 | import com.alessiodp.core.common.ADPPlugin; 5 | import com.alessiodp.parties.bukkit.messaging.bungee.BukkitPartiesBungeecordListener; 6 | import org.jetbrains.annotations.NotNull; 7 | 8 | public class BukkitPartiesMessageListener extends BukkitMessageListener { 9 | public BukkitPartiesMessageListener(@NotNull ADPPlugin plugin) { 10 | super(plugin, new BukkitPartiesBungeecordListener(plugin)); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /bukkit/src/main/java/com/alessiodp/parties/bukkit/messaging/BukkitPartiesMessenger.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.bukkit.messaging; 2 | 3 | import com.alessiodp.core.common.ADPPlugin; 4 | import com.alessiodp.core.common.messaging.ADPMessenger; 5 | import com.alessiodp.parties.common.PartiesPlugin; 6 | 7 | public class BukkitPartiesMessenger extends ADPMessenger { 8 | public BukkitPartiesMessenger(ADPPlugin plugin) { 9 | super(plugin); 10 | messageDispatcher = new BukkitPartiesMessageDispatcher(plugin); 11 | messageListener = new BukkitPartiesMessageListener(plugin); 12 | } 13 | 14 | @Override 15 | public void reload() { 16 | if (((PartiesPlugin) plugin).isBungeeCordEnabled()) { 17 | messageDispatcher.register(); 18 | messageListener.register(); 19 | } else { 20 | disable(); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /bukkit/src/main/java/com/alessiodp/parties/bukkit/messaging/bungee/BukkitPartiesBungeecordDispatcher.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.bukkit.messaging.bungee; 2 | 3 | import com.alessiodp.core.bukkit.messaging.bungee.BukkitBungeecordDispatcher; 4 | import com.alessiodp.core.common.ADPPlugin; 5 | import org.jetbrains.annotations.NotNull; 6 | 7 | public class BukkitPartiesBungeecordDispatcher extends BukkitBungeecordDispatcher { 8 | public BukkitPartiesBungeecordDispatcher(@NotNull ADPPlugin plugin) { 9 | super(plugin, true, false, false); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /bukkit/src/main/java/com/alessiodp/parties/bukkit/parties/BukkitPartyManager.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.bukkit.parties; 2 | 3 | import com.alessiodp.parties.bukkit.parties.objects.BukkitPartyImpl; 4 | import com.alessiodp.parties.common.PartiesPlugin; 5 | import com.alessiodp.parties.common.parties.PartyManager; 6 | import com.alessiodp.parties.common.parties.objects.PartyImpl; 7 | 8 | import java.util.UUID; 9 | 10 | public class BukkitPartyManager extends PartyManager { 11 | public BukkitPartyManager(PartiesPlugin plugin) { 12 | super(plugin); 13 | } 14 | 15 | @Override 16 | public PartyImpl initializeParty(UUID id) { 17 | return new BukkitPartyImpl(plugin, id); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /bukkit/src/main/java/com/alessiodp/parties/bukkit/parties/objects/BukkitPartyTeleportRequest.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.bukkit.parties.objects; 2 | 3 | import com.alessiodp.parties.bukkit.commands.sub.BukkitCommandTeleport; 4 | import com.alessiodp.parties.common.PartiesPlugin; 5 | import com.alessiodp.parties.common.players.objects.PartyPlayerImpl; 6 | import com.alessiodp.parties.common.players.objects.PartyTeleportRequest; 7 | import org.bukkit.Bukkit; 8 | import org.bukkit.entity.Player; 9 | import org.jetbrains.annotations.NotNull; 10 | 11 | public class BukkitPartyTeleportRequest extends PartyTeleportRequest { 12 | public BukkitPartyTeleportRequest(@NotNull PartiesPlugin plugin, PartyPlayerImpl player, PartyPlayerImpl requester) { 13 | super(plugin, player, requester); 14 | } 15 | 16 | @Override 17 | protected void teleportPlayer() { 18 | Player bukkitRequester = Bukkit.getPlayer(requester.getPlayerUUID()); 19 | if (bukkitRequester != null) { 20 | BukkitCommandTeleport.teleportSinglePlayer(plugin, player, requester, bukkitRequester.getLocation()); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /bukkit/src/main/java/com/alessiodp/parties/bukkit/players/BukkitPlayerManager.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.bukkit.players; 2 | 3 | import com.alessiodp.parties.bukkit.players.objects.BukkitPartyPlayerImpl; 4 | import com.alessiodp.parties.common.PartiesPlugin; 5 | import com.alessiodp.parties.common.players.PlayerManager; 6 | import com.alessiodp.parties.common.players.objects.PartyPlayerImpl; 7 | 8 | import java.util.UUID; 9 | 10 | public class BukkitPlayerManager extends PlayerManager { 11 | public BukkitPlayerManager(PartiesPlugin plugin) { 12 | super(plugin); 13 | } 14 | 15 | @Override 16 | public PartyPlayerImpl initializePlayer(UUID playerUUID) { 17 | return new BukkitPartyPlayerImpl(plugin, playerUUID); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /bukkit/src/main/java/com/alessiodp/parties/bukkit/utils/LastConfirmedCommand.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.bukkit.utils; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | 6 | public class LastConfirmedCommand { 7 | @Getter @Setter private long timestamp; 8 | @Getter @Setter private String command; 9 | @Getter @Setter private boolean confirmed; 10 | 11 | LastConfirmedCommand(long timestamp, String command) { 12 | this.timestamp = timestamp; 13 | this.command = command; 14 | confirmed = false; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /bukkit/src/main/resources/bukkit/skript/english.lang: -------------------------------------------------------------------------------- 1 | version: ${plugin.version} 2 | 3 | types: 4 | party: party 5 | partyplayer: party player -------------------------------------------------------------------------------- /bungeecord/patches/.gitignore: -------------------------------------------------------------------------------- 1 | **/*.original -------------------------------------------------------------------------------- /bungeecord/patches/clan/patch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" 3 | 4 | reg1="s/\/party/\/clan/g" 5 | reg2="s/((:.*[^%/])|(^\s+- '?\"?.*[^%]))(party)([^%])/\1clan\5/g" 6 | reg3="s/((:.*[^%/])|(^\s+- '?\"?.*.*[^%/]))(parties)([^%])/\1clans\5/g" 7 | reg4="s/((:.*[^%/])|(^\s+- '?\"?.*[^%]))(Party)([^%])/\1Clan\5/g" 8 | reg5="s/Parties List/Clans List/g" 9 | 10 | echo "Patching bungeecord clan" 11 | cp "$DIR/../../src/main/resources/bungee/messages.yml" "$DIR/messages.yml" 12 | sed -i.original -r "$reg1;$reg2;$reg3;$reg4;$reg5" "$DIR/messages.yml" 13 | echo "Patch completed" -------------------------------------------------------------------------------- /bungeecord/patches/guild/patch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" 3 | 4 | reg1="s/\/party/\/guild/g" 5 | reg2="s/((:.*[^%/])|(^\s+- '?\"?.*[^%]))(party)([^%])/\1guild\5/g" 6 | reg3="s/((:.*[^%/])|(^\s+- '?\"?.*.*[^%/]))(parties)([^%])/\1guilds\5/g" 7 | reg4="s/((:.*[^%/])|(^\s+- '?\"?.*[^%]))(Party)([^%])/\1Guild\5/g" 8 | reg5="s/Parties List/Guilds List/g" 9 | 10 | echo "Patching bungeecord guild" 11 | cp "$DIR/../../src/main/resources/bungee/messages.yml" "$DIR/messages.yml" 12 | sed -i.original -r "$reg1;$reg2;$reg3;$reg4;$reg5" "$DIR/messages.yml" 13 | echo "Patch completed" -------------------------------------------------------------------------------- /bungeecord/patches/patch_all.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" 3 | 4 | "$DIR/clan/patch.sh" 5 | "$DIR/guild/patch.sh" 6 | -------------------------------------------------------------------------------- /bungeecord/src/main/java/com/alessiodp/parties/bungeecord/addons/external/BungeeAdvancedBanHandler.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.bungeecord.addons.external; 2 | 3 | import com.alessiodp.parties.bungeecord.bootstrap.BungeePartiesBootstrap; 4 | import com.alessiodp.parties.bungeecord.configuration.data.BungeeConfigMain; 5 | import com.alessiodp.parties.common.PartiesPlugin; 6 | import com.alessiodp.parties.common.addons.external.AdvancedBanHandler; 7 | import me.leoko.advancedban.bungee.event.PunishmentEvent; 8 | import net.md_5.bungee.api.plugin.Listener; 9 | import net.md_5.bungee.event.EventHandler; 10 | import org.jetbrains.annotations.NotNull; 11 | 12 | public class BungeeAdvancedBanHandler extends AdvancedBanHandler implements Listener { 13 | 14 | public BungeeAdvancedBanHandler(@NotNull PartiesPlugin plugin) { 15 | super(plugin); 16 | } 17 | 18 | @Override 19 | protected boolean isEnabled() { 20 | return BungeeConfigMain.ADDITIONAL_MODERATION_PLUGINS_ADVANCEDBAN; 21 | } 22 | 23 | @Override 24 | public void registerListener() { 25 | ((BungeePartiesBootstrap) plugin.getBootstrap()).getProxy().getPluginManager().registerListener((BungeePartiesBootstrap) plugin.getBootstrap(), this); 26 | } 27 | 28 | @EventHandler 29 | public void onPlayerBan(PunishmentEvent event) { 30 | onBan(event.getPunishment()); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /bungeecord/src/main/java/com/alessiodp/parties/bungeecord/addons/external/PartiesBungeeRedisBungeeHandler.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.bungeecord.addons.external; 2 | 3 | import com.alessiodp.core.bungeecord.addons.external.BungeeRedisBungeeHandler; 4 | import com.alessiodp.core.common.ADPPlugin; 5 | import com.alessiodp.core.common.user.User; 6 | import com.alessiodp.parties.bungeecord.messaging.BungeePartiesMessageDispatcher; 7 | import org.jetbrains.annotations.NotNull; 8 | 9 | public class PartiesBungeeRedisBungeeHandler extends BungeeRedisBungeeHandler { 10 | public PartiesBungeeRedisBungeeHandler(@NotNull ADPPlugin plugin) { 11 | super(plugin); 12 | } 13 | 14 | @Override 15 | public void sendMessage(@NotNull User user, @NotNull String message, boolean colorTranslation) { 16 | if (active) { 17 | ((BungeePartiesMessageDispatcher) plugin.getMessenger().getMessageDispatcher()).sendRedisMessage(user, message, colorTranslation); 18 | } 19 | } 20 | 21 | @Override 22 | public void sendTitle(@NotNull User user, @NotNull String message, int fadeInTime, int showTime, int fadeOutTime) { 23 | if (active) { 24 | ((BungeePartiesMessageDispatcher) plugin.getMessenger().getMessageDispatcher()).sendRedisTitle(user, message, fadeInTime, showTime, fadeOutTime); 25 | } 26 | } 27 | 28 | @Override 29 | public void sendChat(@NotNull User user, @NotNull String message) { 30 | if (active) { 31 | ((BungeePartiesMessageDispatcher) plugin.getMessenger().getMessageDispatcher()).sendRedisChat(user, message); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /bungeecord/src/main/java/com/alessiodp/parties/bungeecord/addons/external/PremiumVanishHandler.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.bungeecord.addons.external; 2 | 3 | import com.alessiodp.core.common.configuration.Constants; 4 | import com.alessiodp.parties.common.PartiesPlugin; 5 | import de.myzelyam.api.vanish.BungeeVanishAPI; 6 | import lombok.RequiredArgsConstructor; 7 | import net.md_5.bungee.api.ProxyServer; 8 | import net.md_5.bungee.api.connection.ProxiedPlayer; 9 | import org.jetbrains.annotations.NotNull; 10 | 11 | import java.util.UUID; 12 | 13 | @RequiredArgsConstructor 14 | public class PremiumVanishHandler { 15 | @NotNull private final PartiesPlugin plugin; 16 | private static final String ADDON_NAME = "PremiumVanish"; 17 | 18 | private static boolean active = false; 19 | 20 | public void init() { 21 | active = false; 22 | if (ProxyServer.getInstance().getPluginManager().getPlugin(ADDON_NAME) != null) { 23 | active = true; 24 | 25 | plugin.getLoggerManager().log(String.format(Constants.DEBUG_ADDON_HOOKED, ADDON_NAME), true); 26 | } 27 | } 28 | 29 | public static boolean isPlayerVanished(UUID uuid) { 30 | if (active) { 31 | ProxiedPlayer player = ProxyServer.getInstance().getPlayer(uuid); 32 | if (player != null) 33 | return BungeeVanishAPI.isInvisible(player); 34 | } 35 | return false; 36 | } 37 | } -------------------------------------------------------------------------------- /bungeecord/src/main/java/com/alessiodp/parties/bungeecord/api/BungeePartiesOptionsHandler.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.bungeecord.api; 2 | 3 | import com.alessiodp.parties.bungeecord.configuration.data.BungeeConfigMain; 4 | import com.alessiodp.parties.common.api.PartiesOptionsHandler; 5 | 6 | public class BungeePartiesOptionsHandler extends PartiesOptionsHandler { 7 | @Override 8 | public boolean isRedisBungeeEnabled() { 9 | return BungeeConfigMain.PARTIES_BUNGEECORD_REDIS; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /bungeecord/src/main/java/com/alessiodp/parties/bungeecord/bootstrap/BungeePartiesBootstrap.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.bungeecord.bootstrap; 2 | 3 | import com.alessiodp.core.bungeecord.bootstrap.ADPBungeeBootstrap; 4 | import com.alessiodp.parties.bungeecord.BungeePartiesPlugin; 5 | 6 | public class BungeePartiesBootstrap extends ADPBungeeBootstrap { 7 | public BungeePartiesBootstrap() { 8 | plugin = new BungeePartiesPlugin(this); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /bungeecord/src/main/java/com/alessiodp/parties/bungeecord/commands/BungeePartiesCommandManager.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.bungeecord.commands; 2 | 3 | import com.alessiodp.core.bungeecord.commands.utils.BungeeCommandUtils; 4 | import com.alessiodp.core.common.ADPPlugin; 5 | import com.alessiodp.parties.bungeecord.commands.main.BungeeCommandP; 6 | import com.alessiodp.parties.bungeecord.commands.main.BungeeCommandParty; 7 | import com.alessiodp.parties.common.PartiesPlugin; 8 | import com.alessiodp.parties.common.commands.PartiesCommandManager; 9 | import com.alessiodp.parties.common.configuration.data.ConfigMain; 10 | 11 | import java.util.ArrayList; 12 | 13 | public class BungeePartiesCommandManager extends PartiesCommandManager { 14 | public BungeePartiesCommandManager(ADPPlugin plugin) { 15 | super(plugin); 16 | } 17 | 18 | @Override 19 | public void prepareCommands() { 20 | commandUtils = new BungeeCommandUtils(plugin, ConfigMain.COMMANDS_MISC_ON, ConfigMain.COMMANDS_MISC_OFF); 21 | 22 | super.prepareCommands(); 23 | } 24 | 25 | @Override 26 | public void registerCommands() { 27 | mainCommands = new ArrayList<>(); 28 | mainCommands.add(new BungeeCommandParty((PartiesPlugin) plugin)); 29 | mainCommands.add(new BungeeCommandP((PartiesPlugin) plugin)); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /bungeecord/src/main/java/com/alessiodp/parties/bungeecord/commands/main/BungeeCommandP.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.bungeecord.commands.main; 2 | 3 | import com.alessiodp.parties.common.PartiesPlugin; 4 | import com.alessiodp.parties.common.commands.main.CommandP; 5 | 6 | public class BungeeCommandP extends CommandP { 7 | public BungeeCommandP(PartiesPlugin instance) { 8 | super(instance); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /bungeecord/src/main/java/com/alessiodp/parties/bungeecord/commands/main/BungeeCommandParty.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.bungeecord.commands.main; 2 | 3 | import com.alessiodp.parties.bungeecord.commands.sub.BungeeCommandDebug; 4 | import com.alessiodp.parties.bungeecord.commands.sub.BungeeCommandHome; 5 | import com.alessiodp.parties.bungeecord.commands.sub.BungeeCommandSetHome; 6 | import com.alessiodp.parties.bungeecord.commands.sub.BungeeCommandTeleport; 7 | import com.alessiodp.parties.bungeecord.configuration.data.BungeeConfigParties; 8 | import com.alessiodp.parties.common.PartiesPlugin; 9 | import com.alessiodp.parties.common.commands.main.CommandParty; 10 | import com.alessiodp.parties.common.configuration.data.ConfigMain; 11 | 12 | public class BungeeCommandParty extends CommandParty { 13 | 14 | public BungeeCommandParty(PartiesPlugin instance) { 15 | super(instance); 16 | 17 | // Debug 18 | if (ConfigMain.PARTIES_DEBUG_COMMAND) 19 | super.register(new BungeeCommandDebug(plugin, this)); 20 | 21 | // Home 22 | if (BungeeConfigParties.ADDITIONAL_HOME_ENABLE) { 23 | super.register(new BungeeCommandHome(plugin, this)); 24 | super.register(new BungeeCommandSetHome(plugin, this)); 25 | } 26 | 27 | // Teleport 28 | if (BungeeConfigParties.ADDITIONAL_TELEPORT_ENABLE) 29 | super.register(new BungeeCommandTeleport(plugin, this)); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /bungeecord/src/main/java/com/alessiodp/parties/bungeecord/commands/sub/BungeeCommandSetHome.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.bungeecord.commands.sub; 2 | 3 | import com.alessiodp.core.bungeecord.user.BungeeUser; 4 | import com.alessiodp.core.common.ADPPlugin; 5 | import com.alessiodp.core.common.commands.utils.ADPMainCommand; 6 | import com.alessiodp.core.common.user.User; 7 | import com.alessiodp.parties.bungeecord.messaging.BungeePartiesMessageDispatcher; 8 | import com.alessiodp.parties.common.commands.sub.CommandSetHome; 9 | import com.alessiodp.parties.common.parties.objects.PartyImpl; 10 | import com.alessiodp.parties.common.players.objects.PartyPlayerImpl; 11 | import org.jetbrains.annotations.NotNull; 12 | 13 | public class BungeeCommandSetHome extends CommandSetHome { 14 | 15 | public BungeeCommandSetHome(ADPPlugin plugin, ADPMainCommand mainCommand) { 16 | super(plugin, mainCommand); 17 | } 18 | 19 | @Override 20 | protected void getLocationAndSave(@NotNull PartyPlayerImpl sender, @NotNull PartyImpl party, @NotNull String name) { 21 | User user = plugin.getPlayer(sender.getPlayerUUID()); 22 | if (user != null && ((BungeeUser) user).getServer() != null) { 23 | String serverName = ((BungeeUser) user).getServer().getName(); 24 | 25 | ((BungeePartiesMessageDispatcher) plugin.getMessenger().getMessageDispatcher()).sendAddHome(user, party, name, serverName); 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /bungeecord/src/main/java/com/alessiodp/parties/bungeecord/configuration/BungeePartiesConfigurationManager.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.bungeecord.configuration; 2 | 3 | import com.alessiodp.parties.bungeecord.configuration.data.BungeeConfigMain; 4 | import com.alessiodp.parties.bungeecord.configuration.data.BungeeConfigParties; 5 | import com.alessiodp.parties.bungeecord.configuration.data.BungeeMessages; 6 | import com.alessiodp.parties.bungeecord.messaging.BungeePartiesMessageDispatcher; 7 | import com.alessiodp.parties.common.PartiesPlugin; 8 | import com.alessiodp.parties.common.configuration.PartiesConfigurationManager; 9 | 10 | public class BungeePartiesConfigurationManager extends PartiesConfigurationManager { 11 | 12 | public BungeePartiesConfigurationManager(PartiesPlugin plugin) { 13 | super(plugin); 14 | 15 | getConfigs().add(new BungeeMessages(plugin)); 16 | getConfigs().add(new BungeeConfigMain(plugin)); 17 | getConfigs().add(new BungeeConfigParties(plugin)); 18 | } 19 | 20 | public void makeConfigsSync() { 21 | ((BungeePartiesMessageDispatcher) plugin.getMessenger().getMessageDispatcher()).sendConfigs(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /bungeecord/src/main/java/com/alessiodp/parties/bungeecord/configuration/data/BungeeConfigMain.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.bungeecord.configuration.data; 2 | 3 | import com.alessiodp.core.common.configuration.ConfigOption; 4 | import com.alessiodp.parties.common.PartiesPlugin; 5 | import com.alessiodp.parties.common.configuration.PartiesConstants; 6 | import com.alessiodp.parties.common.configuration.data.ConfigMain; 7 | import lombok.Getter; 8 | 9 | import java.util.List; 10 | 11 | public class BungeeConfigMain extends ConfigMain { 12 | @Getter private final String fileName = "config.yml"; 13 | @Getter private final String resourceName = "bungee/config.yml"; 14 | @Getter private final int latestVersion = PartiesConstants.VERSION_BUNGEE_CONFIG_MAIN; 15 | 16 | 17 | // Plugin settings 18 | @ConfigOption(path = "parties.bungeecord.redis-support") 19 | public static boolean PARTIES_BUNGEECORD_REDIS; 20 | 21 | // Additional settings 22 | @ConfigOption(path = "additional.follow.blocked-servers") 23 | public static List ADDITIONAL_FOLLOW_BLOCKEDSERVERS; 24 | 25 | @ConfigOption(path = "additional.moderation.plugins.advancedban") 26 | public static boolean ADDITIONAL_MODERATION_PLUGINS_ADVANCEDBAN; 27 | @ConfigOption(path = "additional.moderation.plugins.bungeechat") 28 | public static boolean ADDITIONAL_MODERATION_PLUGINS_BUNGEECHAT; 29 | 30 | public BungeeConfigMain(PartiesPlugin plugin) { 31 | super(plugin); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /bungeecord/src/main/java/com/alessiodp/parties/bungeecord/configuration/data/BungeeConfigParties.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.bungeecord.configuration.data; 2 | 3 | import com.alessiodp.core.common.configuration.ConfigOption; 4 | import com.alessiodp.parties.common.PartiesPlugin; 5 | import com.alessiodp.parties.common.configuration.PartiesConstants; 6 | import com.alessiodp.parties.common.configuration.data.ConfigParties; 7 | import lombok.Getter; 8 | 9 | public class BungeeConfigParties extends ConfigParties { 10 | @Getter private final String fileName = "parties.yml"; 11 | @Getter private final String resourceName = "bungee/parties.yml"; 12 | @Getter private final int latestVersion = PartiesConstants.VERSION_BUNGEE_CONFIG_PARTIES; 13 | 14 | @ConfigOption(path = "additional.home.cross-server") 15 | public static boolean ADDITIONAL_HOME_CROSS_SERVER; 16 | @ConfigOption(path = "additional.home.cross-server-delay") 17 | public static int ADDITIONAL_HOME_CROSS_SERVER_DELAY; 18 | 19 | @ConfigOption(path = "additional.teleport.exact-location") 20 | public static boolean ADDITIONAL_TELEPORT_EXACT_LOCATION; 21 | @ConfigOption(path = "additional.teleport.exact-location-delay") 22 | public static int ADDITIONAL_TELEPORT_EXACT_LOCATION_DELAY; 23 | 24 | public BungeeConfigParties(PartiesPlugin plugin) { 25 | super(plugin); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /bungeecord/src/main/java/com/alessiodp/parties/bungeecord/configuration/data/BungeeMessages.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.bungeecord.configuration.data; 2 | 3 | import com.alessiodp.core.common.configuration.ConfigOption; 4 | import com.alessiodp.parties.common.PartiesPlugin; 5 | import com.alessiodp.parties.common.configuration.PartiesConstants; 6 | import com.alessiodp.parties.common.configuration.data.Messages; 7 | import lombok.Getter; 8 | 9 | public class BungeeMessages extends Messages { 10 | @Getter private final String fileName = "messages.yml"; 11 | @Getter private final String resourceName = "bungee/messages.yml"; 12 | @Getter private final int latestVersion = PartiesConstants.VERSION_BUNGEE_MESSAGES; 13 | 14 | // Other messages 15 | @ConfigOption(path = "other.follow.following-server") 16 | public static String OTHER_FOLLOW_SERVER; 17 | 18 | public BungeeMessages(PartiesPlugin plugin) { 19 | super(plugin); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /bungeecord/src/main/java/com/alessiodp/parties/bungeecord/listeners/BungeeChatListener.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.bungeecord.listeners; 2 | 3 | import com.alessiodp.core.bungeecord.user.BungeeUser; 4 | import com.alessiodp.parties.common.PartiesPlugin; 5 | import com.alessiodp.parties.common.listeners.ChatListener; 6 | import net.md_5.bungee.api.connection.ProxiedPlayer; 7 | import net.md_5.bungee.api.event.ChatEvent; 8 | import net.md_5.bungee.api.plugin.Listener; 9 | import net.md_5.bungee.event.EventHandler; 10 | import net.md_5.bungee.event.EventPriority; 11 | 12 | public class BungeeChatListener extends ChatListener implements Listener { 13 | 14 | public BungeeChatListener(PartiesPlugin instance) { 15 | super(instance); 16 | } 17 | 18 | @EventHandler(priority = EventPriority.LOW) 19 | public void onPlayerChat(ChatEvent event) { 20 | if (!event.isCancelled() 21 | && event.getSender() instanceof ProxiedPlayer 22 | && !event.getMessage().startsWith("/")) { 23 | boolean isCancelled = super.onPlayerChat(new BungeeUser(plugin, (ProxiedPlayer) event.getSender()), event.getMessage()); 24 | event.setCancelled(isCancelled); 25 | } 26 | } 27 | 28 | @EventHandler(priority = EventPriority.NORMAL) 29 | public void onPlayerCommand(ChatEvent event) { 30 | if (!event.isCancelled() 31 | && event.getSender() instanceof ProxiedPlayer 32 | && event.getMessage().startsWith("/")) { 33 | super.onPlayerCommandPreprocess(new BungeeUser(plugin, (ProxiedPlayer) event.getSender()), event.getMessage()); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /bungeecord/src/main/java/com/alessiodp/parties/bungeecord/messaging/BungeePartiesMessageListener.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.bungeecord.messaging; 2 | 3 | import com.alessiodp.core.bungeecord.messaging.BungeeMessageListener; 4 | import com.alessiodp.core.common.ADPPlugin; 5 | import com.alessiodp.parties.bungeecord.messaging.bungee.BungeePartiesBungeecordListener; 6 | import com.alessiodp.parties.bungeecord.messaging.redis.BungeePartiesRedisBungeeListener; 7 | import org.jetbrains.annotations.NotNull; 8 | 9 | public class BungeePartiesMessageListener extends BungeeMessageListener { 10 | public BungeePartiesMessageListener(@NotNull ADPPlugin plugin) { 11 | super( 12 | plugin, 13 | new BungeePartiesBungeecordListener(plugin), 14 | new BungeePartiesRedisBungeeListener(plugin) 15 | ); 16 | } 17 | } -------------------------------------------------------------------------------- /bungeecord/src/main/java/com/alessiodp/parties/bungeecord/messaging/BungeePartiesMessenger.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.bungeecord.messaging; 2 | 3 | import com.alessiodp.core.common.ADPPlugin; 4 | import com.alessiodp.core.common.messaging.ADPMessenger; 5 | 6 | public class BungeePartiesMessenger extends ADPMessenger { 7 | public BungeePartiesMessenger(ADPPlugin plugin) { 8 | super(plugin); 9 | messageDispatcher = new BungeePartiesMessageDispatcher(plugin); 10 | messageListener = new BungeePartiesMessageListener(plugin); 11 | } 12 | 13 | @Override 14 | public void reload() { 15 | messageDispatcher.register(); 16 | messageListener.register(); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /bungeecord/src/main/java/com/alessiodp/parties/bungeecord/messaging/bungee/BungeePartiesBungeecordDispatcher.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.bungeecord.messaging.bungee; 2 | 3 | import com.alessiodp.core.bungeecord.messaging.bungee.BungeeBungeecordDispatcher; 4 | import com.alessiodp.core.common.ADPPlugin; 5 | import org.jetbrains.annotations.NotNull; 6 | 7 | public class BungeePartiesBungeecordDispatcher extends BungeeBungeecordDispatcher { 8 | public BungeePartiesBungeecordDispatcher(@NotNull ADPPlugin plugin) { 9 | super(plugin, false, true, false); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /bungeecord/src/main/java/com/alessiodp/parties/bungeecord/messaging/redis/BungeePartiesRedisBungeeDispatcher.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.bungeecord.messaging.redis; 2 | 3 | import com.alessiodp.core.bungeecord.messaging.redis.BungeeRedisBungeeDispatcher; 4 | import com.alessiodp.core.common.ADPPlugin; 5 | import org.jetbrains.annotations.NotNull; 6 | 7 | public class BungeePartiesRedisBungeeDispatcher extends BungeeRedisBungeeDispatcher { 8 | public BungeePartiesRedisBungeeDispatcher(@NotNull ADPPlugin plugin) { 9 | super(plugin, plugin.getPluginName()); 10 | } 11 | } -------------------------------------------------------------------------------- /bungeecord/src/main/java/com/alessiodp/parties/bungeecord/parties/BungeePartyManager.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.bungeecord.parties; 2 | 3 | import com.alessiodp.parties.bungeecord.messaging.BungeePartiesMessageDispatcher; 4 | import com.alessiodp.parties.bungeecord.parties.objects.BungeePartyImpl; 5 | import com.alessiodp.parties.common.PartiesPlugin; 6 | import com.alessiodp.parties.common.parties.PartyManager; 7 | import com.alessiodp.parties.common.parties.objects.PartyImpl; 8 | 9 | import java.util.UUID; 10 | 11 | public class BungeePartyManager extends PartyManager { 12 | public BungeePartyManager(PartiesPlugin plugin) { 13 | super(plugin); 14 | } 15 | 16 | @Override 17 | public PartyImpl initializeParty(UUID id) { 18 | return new BungeePartyImpl(plugin, id); 19 | } 20 | 21 | @Override 22 | public PartyImpl loadParty(UUID id, boolean syncServers) { 23 | PartyImpl ret = super.loadParty(id, syncServers); 24 | 25 | // Only syncs join events 26 | if (syncServers && ret != null) { 27 | ((BungeePartiesMessageDispatcher) plugin.getMessenger().getMessageDispatcher()).sendLoadParty(ret); 28 | } 29 | 30 | return ret; 31 | } 32 | 33 | @Override 34 | public void unloadParty(PartyImpl party) { 35 | super.unloadParty(party); 36 | 37 | ((BungeePartiesMessageDispatcher) plugin.getMessenger().getMessageDispatcher()).sendUnloadParty(party); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /bungeecord/src/main/java/com/alessiodp/parties/bungeecord/parties/objects/BungeePartyTeleportRequest.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.bungeecord.parties.objects; 2 | 3 | import com.alessiodp.parties.bungeecord.commands.sub.BungeeCommandTeleport; 4 | import com.alessiodp.parties.common.PartiesPlugin; 5 | import com.alessiodp.parties.common.players.objects.PartyPlayerImpl; 6 | import com.alessiodp.parties.common.players.objects.PartyTeleportRequest; 7 | import net.md_5.bungee.api.ProxyServer; 8 | import net.md_5.bungee.api.connection.ProxiedPlayer; 9 | import org.jetbrains.annotations.NotNull; 10 | 11 | public class BungeePartyTeleportRequest extends PartyTeleportRequest { 12 | public BungeePartyTeleportRequest(@NotNull PartiesPlugin plugin, PartyPlayerImpl player, PartyPlayerImpl requester) { 13 | super(plugin, player, requester); 14 | } 15 | 16 | @Override 17 | protected void teleportPlayer() { 18 | ProxiedPlayer bungeeRequester = ProxyServer.getInstance().getPlayer(requester.getPlayerUUID()); 19 | if (bungeeRequester != null) { 20 | BungeeCommandTeleport.teleportSinglePlayer(plugin, player, requester, bungeeRequester.getServer().getInfo()); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /bungeecord/src/main/java/com/alessiodp/parties/bungeecord/players/BungeePlayerManager.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.bungeecord.players; 2 | 3 | import com.alessiodp.parties.bungeecord.players.objects.BungeePartyPlayerImpl; 4 | import com.alessiodp.parties.common.PartiesPlugin; 5 | import com.alessiodp.parties.common.players.PlayerManager; 6 | import com.alessiodp.parties.common.players.objects.PartyPlayerImpl; 7 | 8 | import java.util.UUID; 9 | 10 | public class BungeePlayerManager extends PlayerManager { 11 | public BungeePlayerManager(PartiesPlugin plugin) { 12 | super(plugin); 13 | } 14 | 15 | @Override 16 | public PartyPlayerImpl initializePlayer(UUID playerUUID) { 17 | return new BungeePartyPlayerImpl(plugin, playerUUID); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /bungeecord/src/main/java/com/alessiodp/parties/bungeecord/tasks/BungeeHomeDelayTask.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.bungeecord.tasks; 2 | 3 | import com.alessiodp.parties.bungeecord.commands.sub.BungeeCommandHome; 4 | import com.alessiodp.parties.common.PartiesPlugin; 5 | import com.alessiodp.parties.common.parties.objects.PartyHomeImpl; 6 | import com.alessiodp.parties.common.players.objects.PartyPlayerImpl; 7 | import com.alessiodp.parties.common.tasks.HomeDelayTask; 8 | 9 | public class BungeeHomeDelayTask extends HomeDelayTask { 10 | 11 | public BungeeHomeDelayTask(PartiesPlugin plugin, PartyPlayerImpl partyPlayer, long delayTime, PartyHomeImpl home) { 12 | super(plugin, partyPlayer, delayTime, home); 13 | } 14 | 15 | @Override 16 | protected void performTeleport() { 17 | BungeeCommandHome.teleportToPartyHome(plugin, player, partyPlayer, home); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /bungeecord/src/main/java/com/alessiodp/parties/bungeecord/tasks/BungeeTeleportDelayTask.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.bungeecord.tasks; 2 | 3 | import com.alessiodp.parties.bungeecord.bootstrap.BungeePartiesBootstrap; 4 | import com.alessiodp.parties.bungeecord.commands.sub.BungeeCommandTeleport; 5 | import com.alessiodp.parties.common.PartiesPlugin; 6 | import com.alessiodp.parties.common.players.objects.PartyPlayerImpl; 7 | import com.alessiodp.parties.common.tasks.TeleportDelayTask; 8 | import net.md_5.bungee.api.connection.ProxiedPlayer; 9 | 10 | public class BungeeTeleportDelayTask extends TeleportDelayTask { 11 | 12 | public BungeeTeleportDelayTask(PartiesPlugin plugin, PartyPlayerImpl partyPlayer, long delayTime, PartyPlayerImpl targetPlayer) { 13 | super(plugin, partyPlayer, delayTime, targetPlayer); 14 | } 15 | 16 | @Override 17 | protected void performTeleport() { 18 | ProxiedPlayer bungeeTargetPlayer = ((BungeePartiesBootstrap) plugin.getBootstrap()).getProxy().getPlayer(targetPlayer.getPlayerUUID()); 19 | if (bungeeTargetPlayer != null) { 20 | BungeeCommandTeleport.teleportSinglePlayer(plugin, partyPlayer, targetPlayer, bungeeTargetPlayer.getServer().getInfo()); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /bungeecord/src/main/java/com/alessiodp/parties/bungeecord/utils/BungeeEconomyManager.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.bungeecord.utils; 2 | 3 | import com.alessiodp.parties.common.PartiesPlugin; 4 | import com.alessiodp.parties.common.players.objects.PartyPlayerImpl; 5 | import com.alessiodp.parties.common.utils.EconomyManager; 6 | 7 | public class BungeeEconomyManager extends EconomyManager { 8 | 9 | public BungeeEconomyManager(PartiesPlugin plugin) { 10 | super(plugin); 11 | } 12 | 13 | @Override 14 | public boolean payCommand(PaidCommand paidCommand, PartyPlayerImpl partyPlayerEntity, String commandLabel, String[] args) { 15 | return false; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /bungeecord/src/main/java/com/alessiodp/parties/bungeecord/utils/BungeeMessageUtils.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.bungeecord.utils; 2 | 3 | import com.alessiodp.parties.common.PartiesPlugin; 4 | import com.alessiodp.parties.common.utils.MessageUtils; 5 | 6 | public class BungeeMessageUtils extends MessageUtils { 7 | 8 | public BungeeMessageUtils(PartiesPlugin plugin) { 9 | super(plugin); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /bungeecord/src/main/resources/bungee.yml: -------------------------------------------------------------------------------- 1 | name: ${plugin.name} 2 | description: ${plugin.description} 3 | author: ${plugin.author} 4 | website: ${plugin.website} 5 | version: ${plugin.version} 6 | main: com.alessiodp.parties.bungeecord.bootstrap.BungeePartiesBootstrap 7 | softDepends: [LastLoginAPI, LuckPerms, RedisBungee] -------------------------------------------------------------------------------- /common/src/main/java/com/alessiodp/parties/common/addons/PartiesAddonManager.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.common.addons; 2 | 3 | import com.alessiodp.core.common.ADPPlugin; 4 | import com.alessiodp.core.common.addons.AddonManager; 5 | import com.alessiodp.core.common.configuration.Constants; 6 | import com.alessiodp.parties.common.addons.external.LLAPIHandler; 7 | import com.alessiodp.parties.common.addons.external.LuckPermsHandler; 8 | import org.jetbrains.annotations.NotNull; 9 | 10 | public abstract class PartiesAddonManager extends AddonManager { 11 | private final LLAPIHandler llapiHandler; 12 | private final LuckPermsHandler luckPermsHandler; 13 | 14 | public PartiesAddonManager(@NotNull ADPPlugin plugin) { 15 | super(plugin); 16 | llapiHandler = new LLAPIHandler(plugin); 17 | luckPermsHandler = new LuckPermsHandler(plugin); 18 | } 19 | 20 | @Override 21 | public void loadAddons() { 22 | plugin.getLoggerManager().logDebug(Constants.DEBUG_ADDON_INIT, true); 23 | 24 | llapiHandler.init(); 25 | 26 | // Schedule sync later (post load plugins) 27 | plugin.getScheduler().getSyncExecutor().execute(this::postLoadAddons); 28 | } 29 | 30 | public void postLoadAddons() { 31 | luckPermsHandler.init(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /common/src/main/java/com/alessiodp/parties/common/addons/external/hooks/LLAPIHook.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.common.addons.external.hooks; 2 | 3 | import com.alessiodp.core.common.ADPPlugin; 4 | import com.alessiodp.core.common.configuration.Constants; 5 | import com.alessiodp.lastloginapi.api.LastLogin; 6 | import com.alessiodp.lastloginapi.api.interfaces.LastLoginAPI; 7 | import com.alessiodp.lastloginapi.api.interfaces.LastLoginPlayer; 8 | import lombok.RequiredArgsConstructor; 9 | import org.jetbrains.annotations.NotNull; 10 | 11 | import java.util.HashSet; 12 | import java.util.Set; 13 | import java.util.UUID; 14 | 15 | @RequiredArgsConstructor 16 | public class LLAPIHook { 17 | @NotNull private final ADPPlugin plugin; 18 | private LastLoginAPI api; 19 | 20 | public boolean register() { 21 | boolean ret = false; 22 | try { 23 | api = LastLogin.getApi(); 24 | ret = true; 25 | } catch (Exception ex) { 26 | plugin.getLoggerManager().logError(String.format(Constants.DEBUG_ADDON_OUTDATED, "LastLoginAPI"), ex); 27 | } 28 | return ret; 29 | } 30 | 31 | public String getPlayerName(UUID uuid) { 32 | return api.getPlayer(uuid).getName(); 33 | } 34 | 35 | public Set getPlayerByName(String name) { 36 | Set ret = new HashSet<>(); 37 | Set players = api.getPlayerByName(name); 38 | for (LastLoginPlayer pl : players) { 39 | ret.add(pl.getPlayerUUID()); 40 | } 41 | return ret; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /common/src/main/java/com/alessiodp/parties/common/addons/external/hooks/LuckPermsHook.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.common.addons.external.hooks; 2 | 3 | import com.alessiodp.core.common.ADPPlugin; 4 | import com.alessiodp.core.common.configuration.Constants; 5 | import com.alessiodp.core.common.utils.CommonUtils; 6 | import lombok.RequiredArgsConstructor; 7 | import net.luckperms.api.LuckPerms; 8 | import net.luckperms.api.LuckPermsProvider; 9 | import net.luckperms.api.model.user.User; 10 | import org.jetbrains.annotations.NotNull; 11 | 12 | import java.util.UUID; 13 | 14 | @RequiredArgsConstructor 15 | public class LuckPermsHook { 16 | @NotNull private final ADPPlugin plugin; 17 | private LuckPerms api; 18 | 19 | public boolean register() { 20 | boolean ret = false; 21 | try { 22 | api = LuckPermsProvider.get(); 23 | ret = true; 24 | } catch (IllegalStateException ex) { 25 | plugin.getLoggerManager().logError(String.format(Constants.DEBUG_ADDON_OUTDATED, "LuckPerms"), ex); 26 | } 27 | return ret; 28 | } 29 | 30 | public String getPlayerPrefix(UUID uuid) { 31 | User user = api.getUserManager().getUser(uuid); 32 | if (user != null) { 33 | return CommonUtils.getOr(user.getCachedData().getMetaData().getPrefix(), ""); 34 | } 35 | return ""; 36 | } 37 | 38 | public String getPlayerSuffix(UUID uuid) { 39 | User user = api.getUserManager().getUser(uuid); 40 | if (user != null) { 41 | return CommonUtils.getOr(user.getCachedData().getMetaData().getSuffix(), ""); 42 | } 43 | return ""; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /common/src/main/java/com/alessiodp/parties/common/commands/PartiesCommandManager.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.common.commands; 2 | 3 | import com.alessiodp.core.common.ADPPlugin; 4 | import com.alessiodp.core.common.commands.CommandManager; 5 | import com.alessiodp.core.common.commands.utils.CommandData; 6 | import com.alessiodp.parties.common.commands.utils.PartiesCommandData; 7 | import com.alessiodp.parties.common.configuration.data.ConfigMain; 8 | import org.jetbrains.annotations.NotNull; 9 | 10 | import java.util.LinkedList; 11 | 12 | public abstract class PartiesCommandManager extends CommandManager { 13 | protected PartiesCommandManager(ADPPlugin plugin) { 14 | super(plugin); 15 | } 16 | 17 | @Override 18 | public void prepareCommands() { 19 | commandOrder = new LinkedList<>(); 20 | commandOrder.addAll(ConfigMain.COMMANDS_ORDER); 21 | } 22 | 23 | @Override 24 | public @NotNull CommandData initializeCommandData() { 25 | return new PartiesCommandData(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /common/src/main/java/com/alessiodp/parties/common/commands/list/CommonCommands.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.common.commands.list; 2 | 3 | import com.alessiodp.core.common.commands.list.ADPCommand; 4 | 5 | public enum CommonCommands implements ADPCommand { 6 | P, 7 | PARTY, 8 | 9 | HELP, 10 | ACCEPT, 11 | ASK, 12 | CHAT, 13 | CREATE, 14 | DELETE, 15 | DENY, 16 | IGNORE, 17 | INFO, 18 | INVITE, 19 | KICK, 20 | LEAVE, 21 | RANK, 22 | RELOAD, 23 | RENAME, 24 | SPY, 25 | TAG, 26 | VERSION, 27 | 28 | CLOSE, 29 | COLOR, 30 | CREATEFIXED, 31 | DEBUG, 32 | DESC, 33 | FOLLOW, 34 | HOME, 35 | JOIN, 36 | LIST, 37 | MOTD, 38 | MUTE, 39 | NICKNAME, 40 | OPEN, 41 | PASSWORD, 42 | PROTECTION, 43 | SETHOME, 44 | TELEPORT; 45 | 46 | @Override 47 | public String getOriginalName() { 48 | return this.name(); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /common/src/main/java/com/alessiodp/parties/common/commands/utils/PartiesCommandData.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.common.commands.utils; 2 | 3 | import com.alessiodp.core.common.commands.utils.CommandData; 4 | import com.alessiodp.parties.common.parties.objects.PartyImpl; 5 | import com.alessiodp.parties.common.players.objects.PartyPlayerImpl; 6 | import lombok.Getter; 7 | import lombok.Setter; 8 | 9 | public class PartiesCommandData extends CommandData { 10 | @Getter @Setter private PartyPlayerImpl partyPlayer; 11 | @Getter @Setter private PartyImpl party; 12 | } 13 | -------------------------------------------------------------------------------- /common/src/main/java/com/alessiodp/parties/common/parties/objects/ExpResult.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.common.parties.objects; 2 | 3 | import lombok.EqualsAndHashCode; 4 | import lombok.Getter; 5 | import lombok.Setter; 6 | 7 | @EqualsAndHashCode 8 | public class ExpResult { 9 | @Getter @Setter private int level; 10 | @Getter @Setter private double levelExperience; 11 | @Getter @Setter private double levelUpCurrent; 12 | @Getter @Setter private double levelUpNecessary; 13 | 14 | public ExpResult() { 15 | level = 1; 16 | levelExperience = 0; 17 | levelUpCurrent = 0; 18 | levelUpNecessary = 0; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /common/src/main/java/com/alessiodp/parties/common/parties/objects/PartyColorImpl.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.common.parties.objects; 2 | 3 | import com.alessiodp.parties.api.interfaces.PartyColor; 4 | import lombok.AllArgsConstructor; 5 | import lombok.EqualsAndHashCode; 6 | import lombok.Getter; 7 | import lombok.RequiredArgsConstructor; 8 | import lombok.Setter; 9 | import org.jetbrains.annotations.NotNull; 10 | 11 | @RequiredArgsConstructor 12 | @AllArgsConstructor 13 | @EqualsAndHashCode 14 | public class PartyColorImpl implements PartyColor { 15 | @Getter @Setter @NotNull private String name; 16 | @Getter @Setter private String command = ""; 17 | @Getter @Setter private String code = ""; 18 | 19 | @Getter @Setter private int dynamicPriority = -1; 20 | @Getter @Setter private int dynamicMembers = -1; 21 | @Getter @Setter private int dynamicKills = -1; 22 | } 23 | -------------------------------------------------------------------------------- /common/src/main/java/com/alessiodp/parties/common/players/objects/RequestCooldown.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.common.players.objects; 2 | 3 | import com.alessiodp.parties.common.PartiesPlugin; 4 | import lombok.EqualsAndHashCode; 5 | import lombok.Getter; 6 | import org.jetbrains.annotations.Nullable; 7 | 8 | import java.util.UUID; 9 | 10 | @EqualsAndHashCode 11 | public class RequestCooldown { 12 | @EqualsAndHashCode.Exclude @Getter private final PartiesPlugin plugin; 13 | 14 | @Getter private final long startTime; 15 | 16 | @Getter private final UUID sender; 17 | @Getter private final UUID target; 18 | @Getter private final int cooldown; 19 | 20 | public RequestCooldown(PartiesPlugin plugin, UUID sender, @Nullable UUID target, int cooldown) { 21 | this.plugin = plugin; 22 | this.sender = sender; 23 | this.target = target; 24 | this.cooldown = cooldown; 25 | startTime = System.currentTimeMillis() / 1000L; 26 | } 27 | 28 | public boolean isGlobal() { 29 | return target == null; 30 | } 31 | 32 | public long getDiffTime() { 33 | return (System.currentTimeMillis() / 1000L) - startTime; 34 | } 35 | 36 | public boolean isWaiting() { 37 | return getDiffTime() < cooldown; 38 | } 39 | 40 | public long getWaitTime() { 41 | return getCooldown() - getDiffTime(); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /common/src/main/java/com/alessiodp/parties/common/storage/interfaces/IPartiesDatabase.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.common.storage.interfaces; 2 | 3 | import com.alessiodp.parties.common.parties.objects.PartyImpl; 4 | import com.alessiodp.parties.common.players.objects.PartyPlayerImpl; 5 | import com.alessiodp.parties.common.storage.PartiesDatabaseManager; 6 | 7 | import java.util.LinkedHashSet; 8 | import java.util.Set; 9 | import java.util.UUID; 10 | 11 | public interface IPartiesDatabase { 12 | void updatePlayer(PartyPlayerImpl player); 13 | PartyPlayerImpl getPlayer(UUID uuid); 14 | 15 | void updateParty(PartyImpl party); 16 | void removeParty(PartyImpl party); 17 | 18 | PartyImpl getParty(UUID id); 19 | PartyImpl getPartyByName(String name); 20 | boolean existsParty(String name); 21 | boolean existsTag(String tag); 22 | 23 | LinkedHashSet getListParties(PartiesDatabaseManager.ListOrder order, int limit, int offset); 24 | int getListPartiesNumber(); 25 | Set getListFixed(); 26 | } 27 | -------------------------------------------------------------------------------- /common/src/main/java/com/alessiodp/parties/common/storage/sql/dao/parties/H2PartiesDao.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.common.storage.sql.dao.parties; 2 | 3 | import org.jdbi.v3.sqlobject.statement.SqlUpdate; 4 | 5 | public interface H2PartiesDao extends PartiesDao { 6 | String QUERY_UPDATE = "MERGE INTO `parties` (`id`, `name`, `tag`, `leader`, `description`, `motd`, `color`, `kills`, `password`, `home`, `protection`, `experience`, `follow`, `isopen`)" + 7 | " VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; 8 | 9 | @Override 10 | @SqlUpdate(QUERY_UPDATE) 11 | void update(String id, String name, String tag, String leader, String description, String motd, String color, int kills, String password, String home, boolean protection, double experience, boolean follow, Boolean isopen); 12 | } 13 | -------------------------------------------------------------------------------- /common/src/main/java/com/alessiodp/parties/common/storage/sql/dao/parties/SQLitePartiesDao.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.common.storage.sql.dao.parties; 2 | 3 | import org.jdbi.v3.sqlobject.statement.SqlUpdate; 4 | 5 | public interface SQLitePartiesDao extends PartiesDao { 6 | String QUERY_UPDATE = "INSERT OR REPLACE INTO `parties` (`id`, `name`, `tag`, `leader`, `description`, `motd`, `color`, `kills`, `password`, `home`, `protection`, `experience`, `follow`, `isopen`)" + 7 | " VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; 8 | 9 | @Override 10 | @SqlUpdate(QUERY_UPDATE) 11 | void update(String id, String name, String tag, String leader, String description, String motd, String color, int kills, String password, String home, boolean protection, double experience, boolean follow, Boolean isopen); 12 | } 13 | -------------------------------------------------------------------------------- /common/src/main/java/com/alessiodp/parties/common/storage/sql/dao/players/H2PlayersDao.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.common.storage.sql.dao.players; 2 | 3 | import org.jdbi.v3.sqlobject.statement.SqlUpdate; 4 | 5 | public interface H2PlayersDao extends PlayersDao { 6 | String QUERY_UPDATE = "MERGE INTO `players` (`uuid`, `party`, `rank`, `nickname`, `chat`, `spy`, `mute`)" + 7 | " VALUES (?, ?, ?, ?, ?, ?, ?)"; 8 | 9 | @Override 10 | @SqlUpdate(QUERY_UPDATE) 11 | void update(String uuid, String party, int rank, String nickname, boolean chat, boolean spy, boolean mute); 12 | } 13 | -------------------------------------------------------------------------------- /common/src/main/java/com/alessiodp/parties/common/storage/sql/dao/players/PartyPlayerRowMapper.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.common.storage.sql.dao.players; 2 | 3 | import com.alessiodp.core.common.ADPPlugin; 4 | import com.alessiodp.parties.common.PartiesPlugin; 5 | import com.alessiodp.parties.common.players.objects.PartyPlayerImpl; 6 | import org.jdbi.v3.core.mapper.RowMapper; 7 | import org.jdbi.v3.core.statement.StatementContext; 8 | 9 | import java.sql.ResultSet; 10 | import java.sql.SQLException; 11 | import java.util.UUID; 12 | 13 | public class PartyPlayerRowMapper implements RowMapper { 14 | @Override 15 | public PartyPlayerImpl map(ResultSet rs, StatementContext ctx) throws SQLException { 16 | PartyPlayerImpl ret = ((PartiesPlugin) ADPPlugin.getInstance()).getPlayerManager().initializePlayer(UUID.fromString(rs.getString("uuid"))); 17 | ret.setAccessible(true); 18 | if (rs.getString("party") != null && !rs.getString("party").isEmpty()) { 19 | ret.setPartyId(UUID.fromString(rs.getString("party"))); 20 | ret.setRank(rs.getInt("rank")); 21 | ret.setNickname(rs.getString("nickname")); 22 | } 23 | ret.setSpy(rs.getBoolean("spy")); 24 | ret.setMuted(rs.getBoolean("mute")); 25 | ret.setAccessible(false); 26 | return ret; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /common/src/main/java/com/alessiodp/parties/common/storage/sql/dao/players/SQLitePlayersDao.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.common.storage.sql.dao.players; 2 | 3 | import org.jdbi.v3.sqlobject.statement.SqlUpdate; 4 | 5 | public interface SQLitePlayersDao extends PlayersDao { 6 | String QUERY_UPDATE = "INSERT OR REPLACE INTO `players` (`uuid`, `party`, `rank`, `nickname`, `chat`, `spy`, `mute`)" + 7 | " VALUES (?, ?, ?, ?, ?, ?, ?)"; 8 | 9 | @Override 10 | @SqlUpdate(QUERY_UPDATE) 11 | void update(String uuid, String party, int rank, String nickname, boolean chat, boolean spy, boolean mute); 12 | } 13 | -------------------------------------------------------------------------------- /common/src/main/java/com/alessiodp/parties/common/storage/sql/dao/players/UUIDRowMapper.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.common.storage.sql.dao.players; 2 | 3 | import org.jdbi.v3.core.mapper.RowMapper; 4 | import org.jdbi.v3.core.statement.StatementContext; 5 | 6 | import java.sql.ResultSet; 7 | import java.util.UUID; 8 | 9 | public class UUIDRowMapper implements RowMapper { 10 | @Override 11 | public UUID map(ResultSet rs, StatementContext ctx) { 12 | UUID ret = null; 13 | try { 14 | ret = UUID.fromString(rs.getString("uuid")); 15 | } catch (Exception ignored) {} 16 | return ret; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /common/src/main/java/com/alessiodp/parties/common/tasks/HomeDelayTask.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.common.tasks; 2 | 3 | import com.alessiodp.core.common.scheduling.CancellableTask; 4 | import com.alessiodp.parties.common.PartiesPlugin; 5 | import com.alessiodp.parties.common.parties.objects.PartyHomeImpl; 6 | import com.alessiodp.parties.common.players.objects.PartyPlayerImpl; 7 | 8 | public abstract class HomeDelayTask extends TeleportingDelayTask implements Runnable { 9 | protected final PartyHomeImpl home; 10 | 11 | public HomeDelayTask(PartiesPlugin plugin, PartyPlayerImpl partyPlayer, long delayTime, PartyHomeImpl home) { 12 | super(plugin, partyPlayer, delayTime); 13 | this.home = home; 14 | } 15 | 16 | @Override 17 | protected CancellableTask getPendingDelay() { 18 | return partyPlayer.getPendingHomeDelay(); 19 | } 20 | 21 | @Override 22 | public void cancel() { 23 | // Cancel the runnable task in scheduler 24 | if (partyPlayer.getPendingHomeDelay() != null) { 25 | partyPlayer.getPendingHomeDelay().cancel(); 26 | partyPlayer.setPendingHomeDelay(null); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /common/src/main/java/com/alessiodp/parties/common/tasks/TeleportDelayTask.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.common.tasks; 2 | 3 | import com.alessiodp.core.common.scheduling.CancellableTask; 4 | import com.alessiodp.parties.common.PartiesPlugin; 5 | import com.alessiodp.parties.common.players.objects.PartyPlayerImpl; 6 | 7 | public abstract class TeleportDelayTask extends TeleportingDelayTask implements Runnable { 8 | protected final PartyPlayerImpl targetPlayer; 9 | 10 | public TeleportDelayTask(PartiesPlugin plugin, PartyPlayerImpl partyPlayer, long delayTime, PartyPlayerImpl targetPlayer) { 11 | super(plugin, partyPlayer, delayTime); 12 | this.targetPlayer = targetPlayer; 13 | } 14 | 15 | @Override 16 | protected CancellableTask getPendingDelay() { 17 | return partyPlayer.getPendingTeleportDelay(); 18 | } 19 | 20 | @Override 21 | public void cancel() { 22 | // Cancel the runnable task in scheduler 23 | if (partyPlayer.getPendingTeleportDelay() != null) { 24 | partyPlayer.getPendingTeleportDelay().cancel(); 25 | partyPlayer.setPendingTeleportDelay(null); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /common/src/main/java/com/alessiodp/parties/common/utils/CensorUtils.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.common.utils; 2 | 3 | import com.alessiodp.parties.common.PartiesPlugin; 4 | 5 | import java.util.regex.Matcher; 6 | import java.util.regex.Pattern; 7 | 8 | public class CensorUtils { 9 | public static boolean checkCensor(String regex, String text, String regexError) { 10 | boolean ret = false; 11 | if (!regex.isEmpty()) { 12 | try { 13 | Matcher matcher = Pattern.compile(regex, Pattern.CASE_INSENSITIVE).matcher(text); 14 | 15 | if (matcher.find()) { 16 | ret = true; 17 | } 18 | } catch (Exception ex) { 19 | PartiesPlugin.getInstance().getLoggerManager().logError(regexError, ex); 20 | } 21 | } 22 | return ret; 23 | } 24 | 25 | public static boolean checkAllowedCharacters(String regex, String text, String regexError) { 26 | boolean ret = true; 27 | try { 28 | Matcher matcher = Pattern.compile(regex).matcher(text); 29 | 30 | ret = matcher.matches(); 31 | } catch (Exception ex) { 32 | PartiesPlugin.getInstance().getLoggerManager().logError(regexError, ex); 33 | } 34 | return ret; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /common/src/main/java/com/alessiodp/parties/common/utils/EconomyManager.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.common.utils; 2 | 3 | import com.alessiodp.parties.common.PartiesPlugin; 4 | import com.alessiodp.parties.common.players.objects.PartyPlayerImpl; 5 | import lombok.RequiredArgsConstructor; 6 | 7 | @RequiredArgsConstructor 8 | public abstract class EconomyManager { 9 | protected final PartiesPlugin plugin; 10 | 11 | public abstract boolean payCommand(PaidCommand vaultCommand, PartyPlayerImpl partyPlayerImpl, String commandLabel, String[] args); 12 | 13 | public enum PaidCommand { 14 | ASK, CLAIM, CLOSE, COLOR, CREATE, DESC, FOLLOW, HOME, JOIN, MOTD, NICKNAME, OPEN, PASSWORD, PROTECTION, RENAME, SETHOME, TAG, TELEPORT 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /common/src/main/java/com/alessiodp/parties/common/utils/PartiesPlayerUtils.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.common.utils; 2 | 3 | import com.alessiodp.core.common.commands.list.ADPCommand; 4 | import com.alessiodp.core.common.user.User; 5 | import com.alessiodp.core.common.utils.IPlayerUtils; 6 | import com.alessiodp.parties.common.PartiesPlugin; 7 | import com.alessiodp.parties.common.players.objects.PartyPlayerImpl; 8 | import lombok.RequiredArgsConstructor; 9 | import org.jetbrains.annotations.NotNull; 10 | 11 | import java.util.HashSet; 12 | import java.util.Set; 13 | 14 | @RequiredArgsConstructor 15 | public class PartiesPlayerUtils implements IPlayerUtils { 16 | private final PartiesPlugin plugin; 17 | 18 | @Override 19 | public Set getAllowedCommands(@NotNull User user) { 20 | Set ret = new HashSet<>(); 21 | PartyPlayerImpl player = plugin.getPlayerManager().getPlayer(user.getUUID()); 22 | if (player != null) { 23 | ret = player.getAllowedCommands(); 24 | } 25 | return ret; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /common/src/main/java/com/alessiodp/parties/common/utils/RankPermission.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.common.utils; 2 | 3 | public enum RankPermission { 4 | ASK_ACCEPT ("party.ask.accept"), 5 | ASK_DENY ("party.ask.deny"), 6 | CLAIM ("party.claim"), 7 | HOME ("party.home"), 8 | INVITE ("party.invite"), 9 | KICK ("party.kick"), 10 | SENDMESSAGE ("party.sendmessage"), 11 | SENDMESSAGE_COLOR ("party.sendmessage.color"), 12 | TELEPORT_ACCEPT ("party.teleport.accept"), 13 | TELEPORT_DENY ("party.teleport.deny"), 14 | 15 | EDIT_CLOSE ("party.edit.close"), 16 | EDIT_COLOR ("party.edit.color"), 17 | EDIT_DESC ("party.edit.desc"), 18 | EDIT_FOLLOW ("party.edit.follow"), 19 | EDIT_HOME ("party.edit.home"), 20 | EDIT_MOTD ("party.edit.motd"), 21 | EDIT_NICKNAME_OWN ("party.edit.nickname.own"), 22 | EDIT_NICKNAME_OTHERS("party.edit.nickname.others"), 23 | EDIT_OPEN ("party.edit.open"), 24 | EDIT_PASSWORD ("party.edit.password"), 25 | EDIT_PROTECTION ("party.edit.protection"), 26 | EDIT_TAG ("party.edit.tag"), 27 | 28 | ADMIN_RANK ("party.admin.rank"), 29 | ADMIN_RENAME ("party.admin.rename"), 30 | ADMIN_TELEPORT ("party.admin.teleport"), 31 | 32 | WARNONDAMAGE ("party.warnondamage"), 33 | AUTOCOMMAND ("party.autocommand"); 34 | 35 | private final String perm; 36 | RankPermission(String t) { 37 | perm = t; 38 | } 39 | 40 | @Override 41 | public String toString() { 42 | return perm; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /common/src/main/resources/db/migrations/h2/1__Initial_database.sql: -------------------------------------------------------------------------------- 1 | -- H2 database 2 | CREATE TABLE IF NOT EXISTS `parties` ( 3 | `id` CHAR(36) NOT NULL PRIMARY KEY, 4 | `name` VARCHAR(255), 5 | `tag` VARCHAR(255), 6 | `leader` CHAR(36), 7 | `description` VARCHAR(255), 8 | `motd` VARCHAR(500), 9 | `color` VARCHAR(255), 10 | `kills` INT DEFAULT 0, 11 | `password` VARCHAR(255), 12 | `home` VARCHAR(255), 13 | `protection` INT DEFAULT 0, 14 | `experience` REAL DEFAULT 0, 15 | `follow` INT DEFAULT 1 16 | ); 17 | 18 | CREATE TABLE IF NOT EXISTS `players` ( 19 | `uuid` CHAR(36) NOT NULL PRIMARY KEY, 20 | `party` CHAR(36), 21 | `rank` INT DEFAULT 0, 22 | `nickname` VARCHAR(255), 23 | `chat` INT DEFAULT 0, 24 | `spy` INT DEFAULT 0, 25 | `mute` INT DEFAULT 0 26 | ); -------------------------------------------------------------------------------- /common/src/main/resources/db/migrations/h2/2__Added_open.sql: -------------------------------------------------------------------------------- 1 | -- H2 database 2 | ALTER TABLE `parties` ADD `isopen` INT NULL; -------------------------------------------------------------------------------- /common/src/main/resources/db/migrations/mariadb/1__Initial_database.sql: -------------------------------------------------------------------------------- 1 | -- MariaDB database 2 | CREATE TABLE IF NOT EXISTS `parties` ( 3 | `id` CHAR(36) NOT NULL PRIMARY KEY, 4 | `name` VARCHAR(255), 5 | `tag` VARCHAR(255), 6 | `leader` CHAR(36), 7 | `description` VARCHAR(255), 8 | `motd` VARCHAR(500), 9 | `color` VARCHAR(255), 10 | `kills` INTEGER DEFAULT 0, 11 | `password` VARCHAR(255), 12 | `home` VARCHAR(255), 13 | `protection` INTEGER DEFAULT 0, 14 | `experience` REAL DEFAULT 0, 15 | `follow` INTEGER DEFAULT 1 16 | ); 17 | 18 | CREATE TABLE IF NOT EXISTS `players` ( 19 | `uuid` CHAR(36) NOT NULL PRIMARY KEY, 20 | `party` CHAR(36), 21 | `rank` INTEGER DEFAULT 0, 22 | `nickname` VARCHAR(255), 23 | `chat` INTEGER DEFAULT 0, 24 | `spy` INTEGER DEFAULT 0, 25 | `mute` INTEGER DEFAULT 0 26 | ); -------------------------------------------------------------------------------- /common/src/main/resources/db/migrations/mariadb/2__Added_open.sql: -------------------------------------------------------------------------------- 1 | -- H2 database 2 | ALTER TABLE `parties` ADD `isopen` INTEGER NULL; -------------------------------------------------------------------------------- /common/src/main/resources/db/migrations/mysql/1__Initial_database.sql: -------------------------------------------------------------------------------- 1 | -- MySQL database 2 | CREATE TABLE IF NOT EXISTS `parties` ( 3 | `id` CHAR(36) NOT NULL PRIMARY KEY, 4 | `name` VARCHAR(255), 5 | `tag` VARCHAR(255), 6 | `leader` CHAR(36), 7 | `description` VARCHAR(255), 8 | `motd` VARCHAR(500), 9 | `color` VARCHAR(255), 10 | `kills` INTEGER DEFAULT 0, 11 | `password` VARCHAR(255), 12 | `home` VARCHAR(255), 13 | `protection` INTEGER DEFAULT 0, 14 | `experience` REAL DEFAULT 0, 15 | `follow` INTEGER DEFAULT 1 16 | ); 17 | 18 | CREATE TABLE IF NOT EXISTS `players` ( 19 | `uuid` CHAR(36) NOT NULL PRIMARY KEY, 20 | `party` CHAR(36), 21 | `rank` INTEGER DEFAULT 0, 22 | `nickname` VARCHAR(255), 23 | `chat` INTEGER DEFAULT 0, 24 | `spy` INTEGER DEFAULT 0, 25 | `mute` INTEGER DEFAULT 0 26 | ); -------------------------------------------------------------------------------- /common/src/main/resources/db/migrations/mysql/2__Added_open.sql: -------------------------------------------------------------------------------- 1 | -- H2 database 2 | ALTER TABLE `parties` ADD `isopen` INTEGER NULL; -------------------------------------------------------------------------------- /common/src/main/resources/db/migrations/postgresql/1__Initial_database.sql: -------------------------------------------------------------------------------- 1 | -- PostgreSQL database 2 | CREATE TABLE IF NOT EXISTS parties ( 3 | "id" CHAR(36) NOT NULL PRIMARY KEY, 4 | "name" VARCHAR(255), 5 | "tag" VARCHAR(255), 6 | "leader" CHAR(36), 7 | "description" VARCHAR(255), 8 | "motd" VARCHAR(500), 9 | "color" VARCHAR(255), 10 | "kills" INTEGER DEFAULT 0, 11 | "password" VARCHAR(255), 12 | "home" VARCHAR(255), 13 | "protection" BOOL DEFAULT FALSE, 14 | "experience" REAL DEFAULT 0, 15 | "follow" BOOL DEFAULT TRUE 16 | ); 17 | 18 | CREATE TABLE IF NOT EXISTS players ( 19 | "uuid" CHAR(36) NOT NULL PRIMARY KEY, 20 | "party" CHAR(36), 21 | "rank" INTEGER DEFAULT 0, 22 | "nickname" VARCHAR(255), 23 | "chat" BOOL DEFAULT FALSE, 24 | "spy" BOOL DEFAULT FALSE, 25 | "mute" BOOL DEFAULT FALSE 26 | ); -------------------------------------------------------------------------------- /common/src/main/resources/db/migrations/postgresql/2__Added_open.sql: -------------------------------------------------------------------------------- 1 | -- PostgreSQL database 2 | ALTER TABLE parties ADD "isopen" BOOL DEFAULT NULL; -------------------------------------------------------------------------------- /common/src/main/resources/db/migrations/sqlite/1__Initial_database.sql: -------------------------------------------------------------------------------- 1 | -- SQLite database 2 | CREATE TABLE IF NOT EXISTS `parties` ( 3 | 'id' VARCHAR NOT NULL PRIMARY KEY, 4 | 'name' VARCHAR, 5 | 'tag' VARCHAR, 6 | 'leader' VARCHAR, 7 | 'description' VARCHAR, 8 | 'motd' VARCHAR, 9 | 'color' VARCHAR, 10 | 'kills' INTEGER DEFAULT 0, 11 | 'password' VARCHAR, 12 | 'home' VARCHAR, 13 | 'protection' INTEGER DEFAULT 0, 14 | 'experience' REAL DEFAULT 0, 15 | 'follow' INTEGER DEFAULT 1 16 | ); 17 | 18 | CREATE TABLE IF NOT EXISTS `players` ( 19 | 'uuid' VARCHAR NOT NULL PRIMARY KEY, 20 | 'party' VARCHAR, 21 | 'rank' INTEGER DEFAULT 0, 22 | 'nickname' VARCHAR, 23 | 'chat' INTEGER DEFAULT 0, 24 | 'spy' INTEGER DEFAULT 0, 25 | 'mute' INTEGER DEFAULT 0 26 | ); -------------------------------------------------------------------------------- /common/src/main/resources/db/migrations/sqlite/2__Added_open.sql: -------------------------------------------------------------------------------- 1 | -- H2 database 2 | ALTER TABLE `parties` ADD 'isopen' INTEGER NULL; -------------------------------------------------------------------------------- /crowdin.yml: -------------------------------------------------------------------------------- 1 | files: 2 | - source: /bukkit/src/main/resources/bukkit/messages.yml 3 | translation: /locales/bukkit/messages_%locale_with_underscore%.yml 4 | - source: /bungeecord/src/main/resources/bungee/messages.yml 5 | translation: /locales/bungeecord/messages_%locale_with_underscore%.yml 6 | - source: /velocity/src/main/resources/velocity/messages.yml 7 | translation: /locales/velocity/messages_%locale_with_underscore%.yml 8 | -------------------------------------------------------------------------------- /logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlessioDP/Parties/5a6ef6c5599acde3cad265a70a85cfcc98255460/logo.png -------------------------------------------------------------------------------- /testing/database_2_6_X.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlessioDP/Parties/5a6ef6c5599acde3cad265a70a85cfcc98255460/testing/database_2_6_X.db -------------------------------------------------------------------------------- /testing/database_2_6_X.yml: -------------------------------------------------------------------------------- 1 | database-version: 1 2 | players: 3 | 0bd828fb-0337-3389-af9d-204fe4f4f02e: 4 | party: test 5 | rank: 20 6 | 1bd828fb-0337-3389-af9d-204fe4f4f02e: 7 | party: test 8 | rank: 5 9 | 2bd828fb-0337-3389-af9d-204fe4f4f02e: 10 | party: test2 11 | rank: 20 12 | parties: 13 | test: 14 | leader: 0bd828fb-0337-3389-af9d-204fe4f4f02e 15 | members: 16 | - 0bd828fb-0337-3389-af9d-204fe4f4f02e 17 | - 1bd828fb-0337-3389-af9d-204fe4f4f02e 18 | desc: test description 19 | kills: 100 20 | protection: false 21 | experience: 10.0 22 | follow: false 23 | home: world,123.123,123.123,-123.123,0.0,0.0 24 | test2: 25 | leader: 2bd828fb-0337-3389-af9d-204fe4f4f02e 26 | members: 27 | - 2bd828fb-0337-3389-af9d-204fe4f4f02e 28 | kills: 50 29 | protection: false -------------------------------------------------------------------------------- /velocity/patches/.gitignore: -------------------------------------------------------------------------------- 1 | **/*.original -------------------------------------------------------------------------------- /velocity/patches/clan/patch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" 3 | 4 | reg1="s/\/party/\/clan/g" 5 | reg2="s/((:.*[^%/])|(^\s+- '?\"?.*[^%]))(party)([^%])/\1clan\5/g" 6 | reg3="s/((:.*[^%/])|(^\s+- '?\"?.*.*[^%/]))(parties)([^%])/\1clans\5/g" 7 | reg4="s/((:.*[^%/])|(^\s+- '?\"?.*[^%]))(Party)([^%])/\1Clan\5/g" 8 | reg5="s/Parties List/Clans List/g" 9 | 10 | echo "Patching velocity clan" 11 | cp "$DIR/../../src/main/resources/velocity/messages.yml" "$DIR/messages.yml" 12 | sed -i.original -r "$reg1;$reg2;$reg3;$reg4;$reg5" "$DIR/messages.yml" 13 | echo "Patch completed" -------------------------------------------------------------------------------- /velocity/patches/guild/patch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" 3 | 4 | reg1="s/\/party/\/guild/g" 5 | reg2="s/((:.*[^%/])|(^\s+- '?\"?.*[^%]))(party)([^%])/\1guild\5/g" 6 | reg3="s/((:.*[^%/])|(^\s+- '?\"?.*.*[^%/]))(parties)([^%])/\1guilds\5/g" 7 | reg4="s/((:.*[^%/])|(^\s+- '?\"?.*[^%]))(Party)([^%])/\1Guild\5/g" 8 | reg5="s/Parties List/Guilds List/g" 9 | 10 | echo "Patching velocity guild" 11 | cp "$DIR/../../src/main/resources/velocity/messages.yml" "$DIR/messages.yml" 12 | sed -i.original -r "$reg1;$reg2;$reg3;$reg4;$reg5" "$DIR/messages.yml" 13 | echo "Patch completed" -------------------------------------------------------------------------------- /velocity/patches/patch_all.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" 3 | 4 | "$DIR/clan/patch.sh" 5 | "$DIR/guild/patch.sh" 6 | -------------------------------------------------------------------------------- /velocity/src/main/java-templates/com/alessiodp/parties/velocity/VelocityConstants.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.velocity; 2 | 3 | public class VelocityConstants { 4 | public final static String DESCRIPTION = "${plugin.description}"; 5 | public final static String AUTHORS = "${plugin.author}"; 6 | public final static String URL = "${plugin.website}"; 7 | public final static String VERSION = "${plugin.version}"; 8 | } 9 | -------------------------------------------------------------------------------- /velocity/src/main/java/com/alessiodp/parties/velocity/addons/VelocityPartiesAddonManager.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.velocity.addons; 2 | 3 | import com.alessiodp.core.velocity.addons.external.VelocityRedisBungeeHandler; 4 | import com.alessiodp.parties.common.PartiesPlugin; 5 | import com.alessiodp.parties.common.addons.PartiesAddonManager; 6 | import com.alessiodp.parties.velocity.addons.external.PartiesVelocityRedisBungeeHandler; 7 | import com.alessiodp.parties.velocity.configuration.data.VelocityConfigMain; 8 | 9 | public class VelocityPartiesAddonManager extends PartiesAddonManager { 10 | private final VelocityRedisBungeeHandler redisBungee; 11 | 12 | public VelocityPartiesAddonManager(PartiesPlugin plugin) { 13 | super(plugin); 14 | 15 | redisBungee = new PartiesVelocityRedisBungeeHandler(plugin); 16 | } 17 | 18 | @Override 19 | public void loadAddons() { 20 | super.loadAddons(); 21 | 22 | redisBungee.init(VelocityConfigMain.PARTIES_BUNGEECORD_REDIS); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /velocity/src/main/java/com/alessiodp/parties/velocity/addons/external/PartiesVelocityRedisBungeeHandler.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.velocity.addons.external; 2 | 3 | import com.alessiodp.core.common.ADPPlugin; 4 | import com.alessiodp.core.common.user.User; 5 | import com.alessiodp.core.velocity.addons.external.VelocityRedisBungeeHandler; 6 | import com.alessiodp.parties.velocity.messaging.VelocityPartiesMessageDispatcher; 7 | import org.jetbrains.annotations.NotNull; 8 | 9 | public class PartiesVelocityRedisBungeeHandler extends VelocityRedisBungeeHandler { 10 | public PartiesVelocityRedisBungeeHandler(@NotNull ADPPlugin plugin) { 11 | super(plugin); 12 | } 13 | 14 | @Override 15 | public void sendMessage(@NotNull User user, @NotNull String message, boolean colorTranslation) { 16 | if (active) { 17 | ((VelocityPartiesMessageDispatcher) plugin.getMessenger().getMessageDispatcher()).sendRedisMessage(user, message, colorTranslation); 18 | } 19 | } 20 | 21 | @Override 22 | public void sendTitle(@NotNull User user, @NotNull String message, int fadeInTime, int showTime, int fadeOutTime) { 23 | if (active) { 24 | ((VelocityPartiesMessageDispatcher) plugin.getMessenger().getMessageDispatcher()).sendRedisTitle(user, message, fadeInTime, showTime, fadeOutTime); 25 | } 26 | } 27 | 28 | @Override 29 | public void sendChat(@NotNull User user, @NotNull String message) { 30 | if (active) { 31 | ((VelocityPartiesMessageDispatcher) plugin.getMessenger().getMessageDispatcher()).sendRedisChat(user, message); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /velocity/src/main/java/com/alessiodp/parties/velocity/commands/VelocityPartiesCommandManager.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.velocity.commands; 2 | 3 | import com.alessiodp.core.common.ADPPlugin; 4 | import com.alessiodp.core.velocity.commands.utils.VelocityCommandUtils; 5 | import com.alessiodp.parties.common.PartiesPlugin; 6 | import com.alessiodp.parties.common.commands.PartiesCommandManager; 7 | import com.alessiodp.parties.common.configuration.data.ConfigMain; 8 | import com.alessiodp.parties.velocity.commands.main.VelocityCommandP; 9 | import com.alessiodp.parties.velocity.commands.main.VelocityCommandParty; 10 | 11 | import java.util.ArrayList; 12 | 13 | public class VelocityPartiesCommandManager extends PartiesCommandManager { 14 | public VelocityPartiesCommandManager(ADPPlugin plugin) { 15 | super(plugin); 16 | } 17 | 18 | @Override 19 | public void prepareCommands() { 20 | commandUtils = new VelocityCommandUtils(plugin, ConfigMain.COMMANDS_MISC_ON, ConfigMain.COMMANDS_MISC_OFF); 21 | 22 | super.prepareCommands(); 23 | } 24 | 25 | @Override 26 | public void registerCommands() { 27 | mainCommands = new ArrayList<>(); 28 | mainCommands.add(new VelocityCommandParty((PartiesPlugin) plugin)); 29 | mainCommands.add(new VelocityCommandP((PartiesPlugin) plugin)); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /velocity/src/main/java/com/alessiodp/parties/velocity/commands/main/VelocityCommandP.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.velocity.commands.main; 2 | 3 | import com.alessiodp.parties.common.PartiesPlugin; 4 | import com.alessiodp.parties.common.commands.main.CommandP; 5 | 6 | public class VelocityCommandP extends CommandP { 7 | public VelocityCommandP(PartiesPlugin instance) { 8 | super(instance); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /velocity/src/main/java/com/alessiodp/parties/velocity/commands/main/VelocityCommandParty.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.velocity.commands.main; 2 | 3 | import com.alessiodp.parties.common.PartiesPlugin; 4 | import com.alessiodp.parties.common.commands.main.CommandParty; 5 | import com.alessiodp.parties.common.configuration.data.ConfigMain; 6 | import com.alessiodp.parties.velocity.commands.sub.VelocityCommandDebug; 7 | import com.alessiodp.parties.velocity.commands.sub.VelocityCommandHome; 8 | import com.alessiodp.parties.velocity.commands.sub.VelocityCommandSetHome; 9 | import com.alessiodp.parties.velocity.commands.sub.VelocityCommandTeleport; 10 | import com.alessiodp.parties.velocity.configuration.data.VelocityConfigParties; 11 | 12 | public class VelocityCommandParty extends CommandParty { 13 | public VelocityCommandParty(PartiesPlugin instance) { 14 | super(instance); 15 | 16 | // Debug 17 | if (ConfigMain.PARTIES_DEBUG_COMMAND) 18 | super.register(new VelocityCommandDebug(plugin, this)); 19 | 20 | // Home 21 | if (VelocityConfigParties.ADDITIONAL_HOME_ENABLE) { 22 | super.register(new VelocityCommandHome(plugin, this)); 23 | super.register(new VelocityCommandSetHome(plugin, this)); 24 | } 25 | 26 | // Teleport 27 | if (VelocityConfigParties.ADDITIONAL_TELEPORT_ENABLE) 28 | super.register(new VelocityCommandTeleport(plugin, this)); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /velocity/src/main/java/com/alessiodp/parties/velocity/configuration/VelocityPartiesConfigurationManager.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.velocity.configuration; 2 | 3 | import com.alessiodp.parties.common.PartiesPlugin; 4 | import com.alessiodp.parties.common.configuration.PartiesConfigurationManager; 5 | import com.alessiodp.parties.velocity.configuration.data.VelocityConfigMain; 6 | import com.alessiodp.parties.velocity.configuration.data.VelocityConfigParties; 7 | import com.alessiodp.parties.velocity.configuration.data.VelocityMessages; 8 | import com.alessiodp.parties.velocity.messaging.VelocityPartiesMessageDispatcher; 9 | 10 | public class VelocityPartiesConfigurationManager extends PartiesConfigurationManager { 11 | 12 | public VelocityPartiesConfigurationManager(PartiesPlugin plugin) { 13 | super(plugin); 14 | 15 | getConfigs().add(new VelocityMessages(plugin)); 16 | getConfigs().add(new VelocityConfigMain(plugin)); 17 | getConfigs().add(new VelocityConfigParties(plugin)); 18 | } 19 | 20 | public void makeConfigsSync() { 21 | ((VelocityPartiesMessageDispatcher) plugin.getMessenger().getMessageDispatcher()).sendConfigs(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /velocity/src/main/java/com/alessiodp/parties/velocity/configuration/data/VelocityConfigMain.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.velocity.configuration.data; 2 | 3 | import com.alessiodp.core.common.configuration.ConfigOption; 4 | import com.alessiodp.parties.common.PartiesPlugin; 5 | import com.alessiodp.parties.common.configuration.PartiesConstants; 6 | import com.alessiodp.parties.common.configuration.data.ConfigMain; 7 | import lombok.Getter; 8 | 9 | import java.util.List; 10 | 11 | public class VelocityConfigMain extends ConfigMain { 12 | @Getter private final String fileName = "config.yml"; 13 | @Getter private final String resourceName = "velocity/config.yml"; 14 | @Getter private final int latestVersion = PartiesConstants.VERSION_VELOCITY_CONFIG_MAIN; 15 | 16 | 17 | // Plugin settings 18 | @ConfigOption(path = "parties.bungeecord.redis-support") 19 | public static boolean PARTIES_BUNGEECORD_REDIS; 20 | 21 | 22 | // Additional settings 23 | @ConfigOption(path = "additional.follow.blocked-servers") 24 | public static List ADDITIONAL_FOLLOW_BLOCKEDSERVERS; 25 | 26 | public VelocityConfigMain(PartiesPlugin plugin) { 27 | super(plugin); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /velocity/src/main/java/com/alessiodp/parties/velocity/configuration/data/VelocityConfigParties.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.velocity.configuration.data; 2 | 3 | import com.alessiodp.core.common.configuration.ConfigOption; 4 | import com.alessiodp.parties.common.PartiesPlugin; 5 | import com.alessiodp.parties.common.configuration.PartiesConstants; 6 | import com.alessiodp.parties.common.configuration.data.ConfigParties; 7 | import lombok.Getter; 8 | 9 | public class VelocityConfigParties extends ConfigParties { 10 | @Getter private final String fileName = "parties.yml"; 11 | @Getter private final String resourceName = "velocity/parties.yml"; 12 | @Getter private final int latestVersion = PartiesConstants.VERSION_VELOCITY_CONFIG_PARTIES; 13 | 14 | @ConfigOption(path = "additional.home.cross-server") 15 | public static boolean ADDITIONAL_HOME_CROSS_SERVER; 16 | @ConfigOption(path = "additional.home.cross-server-delay") 17 | public static int ADDITIONAL_HOME_CROSS_SERVER_DELAY; 18 | 19 | @ConfigOption(path = "additional.teleport.exact-location") 20 | public static boolean ADDITIONAL_TELEPORT_EXACT_LOCATION; 21 | @ConfigOption(path = "additional.teleport.exact-location-delay") 22 | public static int ADDITIONAL_TELEPORT_EXACT_LOCATION_DELAY; 23 | 24 | public VelocityConfigParties(PartiesPlugin plugin) { 25 | super(plugin); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /velocity/src/main/java/com/alessiodp/parties/velocity/configuration/data/VelocityMessages.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.velocity.configuration.data; 2 | 3 | import com.alessiodp.core.common.configuration.ConfigOption; 4 | import com.alessiodp.parties.common.PartiesPlugin; 5 | import com.alessiodp.parties.common.configuration.PartiesConstants; 6 | import com.alessiodp.parties.common.configuration.data.Messages; 7 | import lombok.Getter; 8 | 9 | public class VelocityMessages extends Messages { 10 | @Getter private final String fileName = "messages.yml"; 11 | @Getter private final String resourceName = "velocity/messages.yml"; 12 | @Getter private final int latestVersion = PartiesConstants.VERSION_VELOCITY_MESSAGES; 13 | 14 | //Additional 15 | @ConfigOption(path = "other.follow.following-server") 16 | public static String OTHER_FOLLOW_SERVER; 17 | 18 | public VelocityMessages(PartiesPlugin plugin) { 19 | super(plugin); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /velocity/src/main/java/com/alessiodp/parties/velocity/listeners/VelocityChatListener.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.velocity.listeners; 2 | 3 | import com.alessiodp.core.velocity.user.VelocityUser; 4 | import com.alessiodp.parties.common.PartiesPlugin; 5 | import com.alessiodp.parties.common.listeners.ChatListener; 6 | import com.velocitypowered.api.event.Subscribe; 7 | import com.velocitypowered.api.event.player.PlayerChatEvent; 8 | 9 | public class VelocityChatListener extends ChatListener { 10 | 11 | public VelocityChatListener(PartiesPlugin instance) { 12 | super(instance); 13 | } 14 | 15 | @Subscribe 16 | public void onPlayerChat(PlayerChatEvent event) { 17 | if (event.getResult().isAllowed() 18 | && !event.getMessage().startsWith("/")) { 19 | boolean isCancelled = super.onPlayerChat(new VelocityUser(plugin, event.getPlayer()), event.getMessage()); 20 | if (isCancelled) 21 | event.setResult(PlayerChatEvent.ChatResult.denied()); 22 | } 23 | } 24 | 25 | @Subscribe 26 | public void onPlayerCommand(PlayerChatEvent event) { 27 | if (event.getResult().isAllowed() 28 | && event.getMessage().startsWith("/")) { 29 | super.onPlayerCommandPreprocess(new VelocityUser(plugin, event.getPlayer()), event.getMessage()); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /velocity/src/main/java/com/alessiodp/parties/velocity/messaging/VelocityPartiesMessageListener.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.velocity.messaging; 2 | 3 | import com.alessiodp.core.common.ADPPlugin; 4 | import com.alessiodp.core.velocity.messaging.VelocityMessageListener; 5 | import com.alessiodp.parties.velocity.messaging.bungee.VelocityPartiesBungeecordListener; 6 | import com.alessiodp.parties.velocity.messaging.redis.VelocityPartiesRedisBungeeListener; 7 | import org.jetbrains.annotations.NotNull; 8 | 9 | public class VelocityPartiesMessageListener extends VelocityMessageListener { 10 | public VelocityPartiesMessageListener(@NotNull ADPPlugin plugin) { 11 | super( 12 | plugin, 13 | new VelocityPartiesBungeecordListener(plugin), 14 | new VelocityPartiesRedisBungeeListener(plugin) 15 | ); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /velocity/src/main/java/com/alessiodp/parties/velocity/messaging/VelocityPartiesMessenger.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.velocity.messaging; 2 | 3 | import com.alessiodp.core.common.ADPPlugin; 4 | import com.alessiodp.core.common.messaging.ADPMessenger; 5 | 6 | public class VelocityPartiesMessenger extends ADPMessenger { 7 | public VelocityPartiesMessenger(ADPPlugin plugin) { 8 | super(plugin); 9 | messageDispatcher = new VelocityPartiesMessageDispatcher(plugin); 10 | messageListener = new VelocityPartiesMessageListener(plugin); 11 | } 12 | 13 | @Override 14 | public void reload() { 15 | messageDispatcher.register(); 16 | messageListener.register(); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /velocity/src/main/java/com/alessiodp/parties/velocity/messaging/bungee/VelocityPartiesBungeecordDispatcher.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.velocity.messaging.bungee; 2 | 3 | import com.alessiodp.core.common.ADPPlugin; 4 | import com.alessiodp.core.velocity.messaging.bungee.VelocityBungeecordDispatcher; 5 | import org.jetbrains.annotations.NotNull; 6 | 7 | public class VelocityPartiesBungeecordDispatcher extends VelocityBungeecordDispatcher { 8 | public VelocityPartiesBungeecordDispatcher(@NotNull ADPPlugin plugin) { 9 | super(plugin, false, true, false); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /velocity/src/main/java/com/alessiodp/parties/velocity/messaging/redis/VelocityPartiesRedisBungeeDispatcher.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.velocity.messaging.redis; 2 | 3 | import com.alessiodp.core.common.ADPPlugin; 4 | import com.alessiodp.core.velocity.messaging.redis.VelocityRedisBungeeDispatcher; 5 | import org.jetbrains.annotations.NotNull; 6 | 7 | public class VelocityPartiesRedisBungeeDispatcher extends VelocityRedisBungeeDispatcher { 8 | public VelocityPartiesRedisBungeeDispatcher(@NotNull ADPPlugin plugin) { 9 | super(plugin, plugin.getPluginName()); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /velocity/src/main/java/com/alessiodp/parties/velocity/parties/VelocityPartyManager.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.velocity.parties; 2 | 3 | import com.alessiodp.parties.common.PartiesPlugin; 4 | import com.alessiodp.parties.common.parties.PartyManager; 5 | import com.alessiodp.parties.common.parties.objects.PartyImpl; 6 | import com.alessiodp.parties.velocity.messaging.VelocityPartiesMessageDispatcher; 7 | import com.alessiodp.parties.velocity.parties.objects.VelocityPartyImpl; 8 | 9 | import java.util.UUID; 10 | 11 | public class VelocityPartyManager extends PartyManager { 12 | public VelocityPartyManager(PartiesPlugin plugin) { 13 | super(plugin); 14 | } 15 | 16 | @Override 17 | public PartyImpl initializeParty(UUID id) { 18 | return new VelocityPartyImpl(plugin, id); 19 | } 20 | 21 | @Override 22 | public PartyImpl loadParty(UUID id, boolean syncServers) { 23 | PartyImpl ret = super.loadParty(id, syncServers); 24 | 25 | // Only syncs join events 26 | if (syncServers && ret != null) { 27 | ((VelocityPartiesMessageDispatcher) plugin.getMessenger().getMessageDispatcher()).sendLoadParty(ret); 28 | } 29 | 30 | return ret; 31 | } 32 | 33 | @Override 34 | public void unloadParty(PartyImpl party) { 35 | super.unloadParty(party); 36 | 37 | ((VelocityPartiesMessageDispatcher) plugin.getMessenger().getMessageDispatcher()).sendUnloadParty(party); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /velocity/src/main/java/com/alessiodp/parties/velocity/parties/objects/VelocityPartyTeleportRequest.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.velocity.parties.objects; 2 | 3 | import com.alessiodp.core.common.user.User; 4 | import com.alessiodp.core.velocity.user.VelocityUser; 5 | import com.alessiodp.parties.common.PartiesPlugin; 6 | import com.alessiodp.parties.common.players.objects.PartyPlayerImpl; 7 | import com.alessiodp.parties.common.players.objects.PartyTeleportRequest; 8 | import com.alessiodp.parties.velocity.commands.sub.VelocityCommandTeleport; 9 | import org.jetbrains.annotations.NotNull; 10 | 11 | public class VelocityPartyTeleportRequest extends PartyTeleportRequest { 12 | public VelocityPartyTeleportRequest(@NotNull PartiesPlugin plugin, PartyPlayerImpl player, PartyPlayerImpl requester) { 13 | super(plugin, player, requester); 14 | } 15 | 16 | @Override 17 | protected void teleportPlayer() { 18 | User user = plugin.getPlayer(requester.getPlayerUUID()); 19 | if (user != null) { 20 | VelocityCommandTeleport.teleportSinglePlayer(plugin, player, requester, ((VelocityUser) user).getServer()); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /velocity/src/main/java/com/alessiodp/parties/velocity/players/VelocityPlayerManager.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.velocity.players; 2 | 3 | import com.alessiodp.parties.common.PartiesPlugin; 4 | import com.alessiodp.parties.common.players.PlayerManager; 5 | import com.alessiodp.parties.common.players.objects.PartyPlayerImpl; 6 | import com.alessiodp.parties.velocity.players.objects.VelocityPartyPlayerImpl; 7 | 8 | import java.util.UUID; 9 | 10 | public class VelocityPlayerManager extends PlayerManager { 11 | public VelocityPlayerManager(PartiesPlugin plugin) { 12 | super(plugin); 13 | } 14 | 15 | @Override 16 | public PartyPlayerImpl initializePlayer(UUID playerUUID) { 17 | return new VelocityPartyPlayerImpl(plugin, playerUUID); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /velocity/src/main/java/com/alessiodp/parties/velocity/tasks/VelocityHomeDelayTask.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.velocity.tasks; 2 | 3 | import com.alessiodp.parties.common.PartiesPlugin; 4 | import com.alessiodp.parties.common.parties.objects.PartyHomeImpl; 5 | import com.alessiodp.parties.common.players.objects.PartyPlayerImpl; 6 | import com.alessiodp.parties.common.tasks.HomeDelayTask; 7 | import com.alessiodp.parties.velocity.commands.sub.VelocityCommandHome; 8 | 9 | public class VelocityHomeDelayTask extends HomeDelayTask { 10 | 11 | public VelocityHomeDelayTask(PartiesPlugin plugin, PartyPlayerImpl partyPlayer, long delayTime, PartyHomeImpl home) { 12 | super(plugin, partyPlayer, delayTime, home); 13 | } 14 | 15 | @Override 16 | protected void performTeleport() { 17 | VelocityCommandHome.teleportToPartyHome(plugin, player, partyPlayer, home); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /velocity/src/main/java/com/alessiodp/parties/velocity/tasks/VelocityTeleportDelayTask.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.velocity.tasks; 2 | 3 | import com.alessiodp.core.common.user.User; 4 | import com.alessiodp.core.velocity.user.VelocityUser; 5 | import com.alessiodp.parties.common.PartiesPlugin; 6 | import com.alessiodp.parties.common.players.objects.PartyPlayerImpl; 7 | import com.alessiodp.parties.common.tasks.TeleportDelayTask; 8 | import com.alessiodp.parties.velocity.commands.sub.VelocityCommandTeleport; 9 | 10 | public class VelocityTeleportDelayTask extends TeleportDelayTask { 11 | 12 | public VelocityTeleportDelayTask(PartiesPlugin plugin, PartyPlayerImpl partyPlayer, long delayTime, PartyPlayerImpl targetPlayer) { 13 | super(plugin, partyPlayer, delayTime, targetPlayer); 14 | } 15 | 16 | @Override 17 | protected void performTeleport() { 18 | User user = plugin.getPlayer(targetPlayer.getPlayerUUID()); 19 | if (user != null) { 20 | VelocityCommandTeleport.teleportSinglePlayer(plugin, partyPlayer, targetPlayer, ((VelocityUser) user).getServer()); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /velocity/src/main/java/com/alessiodp/parties/velocity/utils/VelocityEconomyManager.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.velocity.utils; 2 | 3 | import com.alessiodp.parties.common.PartiesPlugin; 4 | import com.alessiodp.parties.common.players.objects.PartyPlayerImpl; 5 | import com.alessiodp.parties.common.utils.EconomyManager; 6 | 7 | public class VelocityEconomyManager extends EconomyManager { 8 | 9 | public VelocityEconomyManager(PartiesPlugin plugin) { 10 | super(plugin); 11 | } 12 | 13 | @Override 14 | public boolean payCommand(PaidCommand paidCommand, PartyPlayerImpl partyPlayerEntity, String commandLabel, String[] args) { 15 | return false; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /velocity/src/main/java/com/alessiodp/parties/velocity/utils/VelocityMessageUtils.java: -------------------------------------------------------------------------------- 1 | package com.alessiodp.parties.velocity.utils; 2 | 3 | import com.alessiodp.parties.common.PartiesPlugin; 4 | import com.alessiodp.parties.common.utils.MessageUtils; 5 | 6 | public class VelocityMessageUtils extends MessageUtils { 7 | 8 | public VelocityMessageUtils(PartiesPlugin plugin) { 9 | super(plugin); 10 | } 11 | } 12 | --------------------------------------------------------------------------------