Compare commits

...
647 Commits
Author SHA1 Message Date
NotAlexNoyle 07c630deaf Point submodules at canonical Gitea repositories 2026-11-01 12:54:06 -05:00
NotAlexNoyle 88ff9fe559 Update canonical Gitea links 2026-10-31 11:39:48 -04:00
NotAlexNoyle a0b4b2ffa0 Update canonical Gitea links 2026-10-31 11:39:48 -04:00
NotAlexNoyle 541b3c1c72 Update canonical Gitea links 2026-10-31 11:39:48 -04:00
NotAlexNoyle 56dfe76ffa Update canonical Gitea links 2026-10-31 11:39:48 -04:00
NotAlexNoyle 42a07a697b Exclude CODEOWNERS from language statistics 2026-10-31 09:54:56 -04:00
NotAlexNoyle 78a41622f4 Add CODEOWNERS (one staff approval) 2026-10-31 09:54:56 -04:00
NotAlexNoyle 59bd8d87ab universal pvp toggle 2026-09-14 11:16:20 -04:00
NotAlexNoyle 46e776cdc5 Update Utilities-OG 2026-09-14 02:01:11 -04:00
NotAlexNoyle a3993384d9 Fix same case rename 2026-08-20 11:33:28 -04:00
NotAlexNoyle 00c08e6eb5 v2.5.1 update 2026-08-15 10:12:50 -04:00
NotAlexNoyle ace6904cf6 v2.5 Release 2026-08-13 16:25:17 -04:00
NotAlexNoyle e2d3ebfe70 Update commands 2026-08-12 12:11:15 -04:00
NotAlexNoyle a61ae9894f v2.4 Release 2026-08-10 11:10:11 -04:00
NotAlexNoyle 0d6f429e1e Update tag format 2026-08-09 12:02:30 -04:00
NotAlexNoyle a02ef45497 Change home timer to 5s 2026-08-09 11:09:38 -04:00
NotAlexNoyle 6650799f71 Remove union verification 2026-08-08 15:31:26 -04:00
NotAlexNoyle 449c0b3961 No more untrust 2026-08-08 11:25:43 -04:00
NotAlexNoyle 6d5e6f38e6 Remove update checker 2026-07-29 17:14:08 -04:00
NotAlexNoyle 035f4dcba6 Update DiamondBank-OG API 2026-07-29 12:19:03 -04:00
NotAlexNoyle cf583f481e Old database migration 2026-07-29 12:18:58 -04:00
NotAlexNoyle 7091da2d3d Update DiamondBank-OG 2026-07-27 07:57:56 -04:00
NotAlexNoyle 358bb00180 Spotless formatting 2026-07-24 12:47:36 -04:00
NotAlexNoyle a9e6f3fa4d Merge pull request #2 from true-og/agent/reorder-main-gui-union-banking
Reorder main GUI and add Union Banking preview
2026-07-24 12:36:52 -04:00
NotAlexNoyle bb4cd6fc1b Reorder main GUI and add Union Banking preview 2026-07-24 12:33:15 -04:00
NotAlexNoyle 2a0a181399 Update DiamondBank-OG 2026-07-22 07:09:20 -04:00
NotAlexNoyle 32e90b1c80 Vault -> DiamondBank 2026-07-20 14:47:04 -04:00
NotAlexNoyle 3f13f63c18 Make union chat /u 2026-07-20 10:18:35 -04:00
NotAlexNoyle 240a1fc42d Update Utilities-OG API 2026-07-20 00:49:08 -04:00
NotAlexNoyle e85a4007eb Disable bulliten board at startup 2026-06-24 11:40:00 -04:00
NotAlexNoyle 870bff28c8 Remove Template-OG artifact 2026-06-21 21:08:24 -04:00
NotAlexNoyle 76c728688e Update Utilities-OG 2026-05-20 11:10:47 -04:00
NotAlexNoyle 245fa36e1d Update Utilities-OG 2026-05-11 00:44:01 -04:00
NotAlexNoyle f437980d8e Prevent calling Unions None 2026-05-06 14:46:43 -04:00
NotAlexNoyle f1cceaca0c Add MiniPlaceholder support via UtilitiesOG 2026-05-05 23:56:07 -04:00
NotAlexNoyle 3b152d6578 Disable clan verification, update case sensitivity 2026-05-04 17:06:10 -04:00
NotAlexNoyle 0782fd753d Add default placeholder 2026-04-24 11:56:37 -04:00
NotAlexNoyle 941cd4c20d Add /union color command 2026-04-22 15:06:19 -04:00
NotAlexNoyle 9ce6641489 Add /union command 2026-04-22 14:28:39 -04:00
NotAlexNoyle 3886c87637 Release Unions-OG 2026-04-22 13:07:12 -04:00
NotAlexNoyle 1e70ade03e Fix tests 2026-03-30 04:52:40 -04:00
NotAlexNoyle 700e29ce97 Use WorldEdit/WorldGuard 7 API instead of legacy WE6 reflection 2026-03-30 04:25:04 -04:00
NotAlexNoyle 3de15c9adb Merge remote-tracking branch 'upstream/master'
# Conflicts:
#	src/main/java/net/sacredlabyrinth/phaed/simpleclans/managers/StorageManager.java
2026-03-30 04:13:12 -04:00
Edson Passos 0406c61b0f fix: kills table prefix
closes #470
2026-01-08 23:33:54 -03:00
NotAlexNoyle 3969d52184 Fix jar 2025-12-08 22:43:59 -05:00
NotAlexNoyle f4d413e0b3 Update shadow to 8.3.8 2025-09-24 17:28:32 -04:00
NotAlexNoyle 28e545a4ff Add gradle wrapper 2025-09-02 13:08:07 -04:00
NotAlexNoyle 9c921be01a Maven -> Gradle 8.14.3 2025-09-02 12:52:41 -04:00
Edson Passos a2e59c9401 fix: return null when username is not found - UUIDFetcher (#466) 2025-07-17 20:46:05 -03:00
Edson Passos b1b5fef7bf feat(lang): new crowdin updates (#439) 2025-07-14 19:44:41 -03:00
Edson Passos 2bdd6bc3bf fix: check bungee channel version and ownership (#460) 2025-03-18 11:33:56 -03:00
Edson Passos f7081499b2 fix: placeholders being parsed in clan chat 2025-03-08 21:30:35 -03:00
Edson Passos 0f50d498cb build: downgraded to JDK 8 (#459)
Removed built-in support for WorldGuard7 (https://github.com/RoinujNosde/SimpleClans-WorldGuard7)
2025-03-08 21:09:33 -03:00
Edson PassosandTomut0 da8d343897 feat: only send bungee messages to allowed servers (#455)
Co-authored-by: Tomut0 <minat0_@outlook.com>
2025-03-06 20:09:33 -03:00
Minat0_ ee1feb4276 fix: created_at migration should use prefixed table (#456) 2025-03-06 20:07:11 -03:00
Edson Passos 24af2c03d0 fix: missing import for charset 2025-03-05 20:07:50 -03:00
Edson PassosandTomut0 6b2a3f85ac feat: adds completions to clan create command (#452)
Co-authored-by: Tomut0 <minat0_@outlook.com>
2025-03-05 19:54:32 -03:00
Edson PassosandTomut0 57076fb033 fix: uuid bulk fetching over Mojang and minetools APIs (#451)
Co-authored-by: Tomut0 <minat0_@outlook.com>
2025-03-05 19:45:36 -03:00
RoinujNosde 52ff77e6c1 fix: no need to create ClanPlayer on placeholder request 2025-02-17 20:04:30 -03:00
Tomut0 146713fd48 fix: player can change locale even if selector is disabled 2025-02-08 20:40:50 -03:00
RoinujNosde c8e67cfd4f fix: Bukkit#getOfflinePlayers causing the server to hang 2025-02-08 20:31:08 -03:00
Tomut0 f4f47b2060 fix: clan disband should require a confirmation in gui 2025-01-30 21:12:59 -03:00
Minat0_ 13cf348084 feat: compile under Java 21 LTS (#446) 2025-01-19 19:07:44 -03:00
RoinujNosde b37512be7d fix: RequestManager requesting data from Mojang servers 2024-12-26 19:19:35 -03:00
RoinujNosde 9097fa02fa fix: getAnyClanPlayer(String) requesting data from Mojang servers 2024-12-21 20:34:17 -03:00
Minat0_ a759884b8d fix(discord): use fresh reference for guild and role objects and non-cached channels (#438) 2024-11-11 16:26:40 -03:00
Minat0_ f5e1387246 feat(db): add datetime column to sc_kills (#432)
Co-authored-by: Minat0_ <minat0_@outlook.com>
2024-11-08 22:53:24 -03:00
Edson PassosandMinat0_ cddde547b1 fix: missed name in /clan stats command
Co-authored-by: Minat0_ <minat0_@outlook.com>
2024-11-08 17:29:14 -03:00
Lucas f466a86309 feat: added reload event for better plugin integration (#441) 2024-09-24 19:02:20 -03:00
Edson Passos 9f4f39a420 feat(lang): new crowdin updates (#332) 2024-08-18 22:52:11 -03:00
Edson Passos 46702f90ab feat: added config for the db table prefix (#408) 2024-08-15 07:46:27 -03:00
Minat0_ 5a490b11a3 fix(discord): more debug messages for DiscordHook (#437) 2024-08-08 18:36:57 +03:00
Edson Passos 3b51299dd6 docs: added mikasa's banner 2024-06-12 16:08:19 -03:00
Edson Passos 5212296d62 fix: NPE while setting owner of skull 2024-05-12 12:35:27 -03:00
Edson Passos 67d3e70f58 fix: fire FrameOpenEvent sync 2024-04-25 16:25:14 -03:00
Edson Passos 8cd0b2e454 fix: order of FrameOpenEvent 2024-04-25 16:17:31 -03:00
RoinujNosde da9ec6c917 fix: players not getting removed from clans on purge 2024-04-19 20:17:25 -03:00
Nishikiyama cb314dbe7b feat: limit unverified clan members (#422) 2024-03-19 17:55:33 +03:00
ThiagoROX 01c79862b9 feat: add %simpleclans_is_invite_enabled% placeholder (#424) 2024-03-07 15:03:11 -03:00
Nishikiyama c9df6acb13 feat: possibility to set a default rank for new clans (#418) 2024-02-01 17:12:57 +03:00
Minat0_ ad910e9c30 fix(discord): bump DiscordSRV to 1.27.0 (#414)
Possibly fixes IncompatibleClassChangeError for newest DiscordSRV version.
2024-01-09 20:29:25 +03:00
Minat0_ d4d144fe36 fix: update the Mojang API endpoint (#413)
As of 23w42a, the "Usernames to UUIDs" endpoint moved to:
POST https://api.minecraftservices.com/minecraft/profile/lookup/bulk/byname
2024-01-08 15:27:08 +03:00
Minat0_ 1375679df8 fix(discord): revoke discord leader role on events (#411) 2024-01-06 14:49:02 +03:00
ThiagoROXandRoinujNosde b2c7d12b60 feat: added price and date formatters (#401)
Co-authored-by: RoinujNosde <edsonpassosjr@outlook.com>
2023-11-13 10:39:26 -03:00
Edson Passos b363efe530 fix: more fixes for RequestManager (#405) 2023-10-25 10:29:19 -03:00
RoinujNosde 876b5ac50e fix: rename command not checking length 2023-10-22 19:17:32 -03:00
Edson Passos d2825df01b fix: wrong request key in requestAllLeaders 2023-10-04 07:13:36 -03:00
RoinujNosde bc85864134 fix: players not able to vote on some requests
PROMOTE, RENAME and DISBAND

Also fixed the requester's name placeholder
2023-10-03 19:23:21 -03:00
WolfBot 4808addaa5 chore(master): release 2.19.3-SNAPSHOT (#399) 2023-08-03 19:38:27 -03:00
WolfBot 05e7abccbd chore(master): release 2.19.2 (#398) 2023-08-03 19:30:23 -03:00
WolfBot cfd1ff851d chore(master): release 2.19.2-SNAPSHOT (#395) 2023-08-03 19:24:05 -03:00
Minat0_ f29bc746af fix: cause check should return true on granting (#397) 2023-08-03 19:21:35 -03:00
WolfBot e12ee8aaed chore(master): release 2.19.1 (#393) 2023-08-03 13:22:44 -03:00
Edson Passos fe60b25f61 fix: charge money on deposit (#394) 2023-08-03 13:12:07 -03:00
Minat0_ 503d67903e fix: consider uppercase when checking for disallowed colors (#391) 2023-08-02 09:03:59 -03:00
Minat0_ e1625d38c8 ci: ensure running on maven 3.9.3 (#390)
* ci: Upgrade JDK to 16 at modrinth workflow

* ci: Upgrade JDK to 16 at curseforge workflow

* ci: ensure running on maven 3.9.3

* ci: ensure running on maven 3.9.3 (#389)

* Set executable permission for mvnw

* using newer release option for compiler plugin
2023-07-27 19:58:04 -03:00
WolfBot 4fa1aeaccc chore(master): release 2.19.1-SNAPSHOT (#387) 2023-07-27 16:55:43 -03:00
WolfBot 1b44edeec5 chore(master): release 2.19.0 (#340) 2023-07-27 16:54:35 -03:00
d21dc02dff feat: EconomyTransactionEvent creation (#384)
Co-authored-by: Anony <contacto@anderhurtado.com>
Co-authored-by: Tomut0 <minat0_@outlook.com>
2023-07-27 16:53:11 -03:00
Minat0_ ad6bb7b13b feat: hide reset kdr in main frame if perm denied (#385) 2023-07-23 20:56:42 +03:00
Minat0_ 8269d80831 fix: resets error message when validating a clan tag (#383) 2023-06-23 19:44:32 +03:00
Minat0_ 57b9987e9b fix: tnt explosion doesn't count a kill (#381) 2023-06-20 00:02:47 +03:00
ThiagoROX f8ce0f415f feat: add %simpleclans_has_rank% placeholder (#379) 2023-06-20 00:01:04 +03:00
3ef3169942 feat: validating tag by regex (#363)
* Special Characters

* Changed default value from True to False

* Apparently useless in the PR

* Changed cleanTag.toLowerCase() to cleanTag
replaced string cleanTag = ChatUtils.stripColors(this.tag) with string cleanTag = Helper.cleanTag(tag);

* added simpleclans.iml back to fix any errors

* Added SimpleClans.iml to .gitignore; correct me if i'm wrong, but I believe this is for the better.

* Added 'SimpleClans.iml' to .gitignore :)

~ Side note: Shoot me a message if this should be undone.

* Added original SimpleClans.iml

I have no idea what went wrong last time.

* fix: bb migration settings save

* feat: tag regex implement

* refactor tag length set

* delete auto-generated files from git

* optimize imports

* speed up tag validation process by creating one TagValidator per plugin reload

rollback accept-other-alphabets-letters-on-tag

* we don't need to save config twice on bb migration

* don't create new instance of tagValidator on plugin reload

* fix even if regex matches it checks the alphabet

---------

Co-authored-by: BuildTools <unconfigured@null.spigotmc.org>
Co-authored-by: Tomut0 <minat0_@outlook.com>
2023-06-17 18:52:55 +03:00
Minat0_ 5cf64a672d feat: add a command to set player's locale (#378) 2023-06-17 00:28:22 +03:00
Minat0_ c49b2d9dc2 Merge pull request #375 from Tomut0/dev 2023-05-12 17:53:59 +03:00
Tomut0 8801e8e855 build: add surface plugin, upgrade tests to JUnit 5 2023-05-12 17:41:07 +03:00
Tomut0 bc4775c293 build: upgrade javadoc plugin, suppress warnings on build 2023-05-12 17:40:32 +03:00
Tomut0 74e39c2666 I don't think we need META-INF file anymore
It's a maven task to create it, I believe
2023-05-12 17:40:32 +03:00
Tomut0 f73e798e65 ci: upload artifact with jdk 16 2023-05-12 17:40:32 +03:00
Tomut0 f101ea4768 build: delete dependency-reduced-pom.xml from git 2023-05-12 17:40:32 +03:00
Tomut0 f5d547ab27 docs: author tag isn't available at methods 2023-05-12 17:40:31 +03:00
Minat0_ 7fcb964f41 fix: prevent clan name renaming with colors (#374) 2023-05-12 16:15:08 +03:00
ThiagoROX d4f1a74dee feat: add confirmation before reset kdr (#371) 2023-05-10 21:03:29 +03:00
Edson Passos 3e192a70da build: update junit 2023-05-09 19:55:18 -03:00
Edson Passos 103f1e56c7 ci: update Reposilite workflow 2023-05-07 18:06:14 -03:00
Edson Passos 103b4055f3 ci: update CI workflow 2023-05-07 17:52:28 -03:00
RoinujNosde c91442cd1e Merge remote-tracking branch 'origin/master' 2023-05-07 17:47:49 -03:00
RoinujNosde e368ead04a fix: bump JDK to 16 2023-05-07 17:47:23 -03:00
ThiagoROX d68ec28f8e feat: add PlayerResetKdrEvent (#370) 2023-05-03 12:16:22 +03:00
RoinujNosde 2f4ad00f1c fix: migrates land permissions on GP claim resize 2023-04-30 18:40:23 -03:00
RoinujNosde 524e407620 fix: NPE on EntityDamageByEntityEvent listener (LandProtection) 2023-04-30 18:14:21 -03:00
ThiagoROX 992166de66 ci: update checkout and setup-java actions (#369) 2023-04-28 00:18:07 +03:00
ThiagoROX 0b74355467 fix: display hex message on bulletin board (#365) 2023-04-26 20:30:53 +03:00
ThiagoROX 105a8cad51 feat: add subcommand /clan mod bb display (#367) 2023-04-26 19:26:15 +03:00
Minat0_ 0f693329ca feat: adds the possibility to rename a clan (#360) 2023-03-26 18:45:29 -03:00
Minat0_ 263d129325 feat: bb message language key (#358) 2023-03-21 22:37:24 -03:00
ThiagoROX 442096e9da fix: added clan suggestion in staff bb commands (#359) 2023-03-19 21:32:59 -03:00
Minat0_ 36084dbfa3 perf(discord): remove discord channels from creation (#353) 2023-02-13 08:53:31 -03:00
RoinujNosde 8a05dbbf00 fix: possibly fixes CME on SpyChatHandler 2023-01-31 18:47:08 -03:00
Minat0_ 8a3529377f fix(discord): permission overrides reset only existing members (#349) 2023-01-28 21:26:28 -03:00
Minat0_ 5f519c477a fix: remove abandoned channels before validating (#348) 2023-01-27 23:30:32 -03:00
Minat0_ 7eb748bb9a fix: async permission reset & category deletion (#347) 2023-01-27 20:46:12 -03:00
Minat0_ 18507016a8 fix: view permission applies only to cached channels (#346) 2023-01-20 16:53:02 -03:00
Edson Passos ed243f72ec fix(bungee): updates kills count immediately 2023-01-08 20:42:29 -03:00
RoinujNosde 5021b8ad7b fix: players not able to strip logs/fertilize blocks 2023-01-03 19:37:17 -03:00
Edson Passos f98868c776 fix: invalid colors being used in tags, pt. 2
* Added test for another invalid variant
* Updated patterns
2023-01-03 16:29:48 -03:00
RoinujNosde 2850e59d37 fix: invalid colors being used in tags 2023-01-02 19:35:42 -03:00
RoinujNosde 86d4fac938 fix: players not able to break vehicles/exit horses 2022-12-28 20:12:00 -03:00
Edson Passos 0258a75c81 fix(bungee): removes players from clan on delete 2022-12-27 09:56:34 -03:00
RoinujNosde 61dcb3d440 fix: players unable to interact with armor stands, paintings, etc 2022-12-24 17:26:50 -03:00
RoinujNosde bf1033af76 fix: default username-regex 2022-12-23 20:28:04 -03:00
RoinujNosde 807d39afeb fix: players not able to use water buckets (WorldGuard) 2022-12-23 20:27:37 -03:00
RoinujNosde bc046d4b2a refactor: code cleanup on LandProtection 2022-12-22 22:20:18 -03:00
RoinujNosde 545dd1652f Merge remote-tracking branch 'origin/master' 2022-12-21 21:29:57 -03:00
RoinujNosde e9ec283ace fix: players not able to sleep on beds (WorldGuard) 2022-12-21 21:29:19 -03:00
Minat0_ 718868b2d9 docs: updated version in README (#343) 2022-12-08 08:41:10 -03:00
Edson Passos 2a139aba03 feat(chat): adds permissions to use colors and formats (#341) 2022-12-04 13:06:15 -03:00
RoinujNosde 046aa1d96d fix: sets duplicate names to something unique 2022-11-30 20:01:40 -03:00
WolfBot e44775e994 chore(master): release 2.18.2-SNAPSHOT (#339) 2022-11-29 19:54:00 -03:00
WolfBot 43da5bd1f1 chore(master): release 2.18.1 (#335) 2022-11-29 19:53:16 -03:00
Minat0_ 8fa465da38 fix: missing getHandlerList on HomeRegroupEvent (#338) 2022-11-29 14:48:31 -03:00
RoinujNosde 56c7908c33 fix(bungee): error deserializing clan banners 2022-11-23 20:14:14 -03:00
RoinujNosde fc81e76521 fix: added check for clan_member on land commands 2022-11-18 19:21:01 -03:00
RoinujNosde f7fe5c4ad4 refactor: ignore unknown subchannels 2022-11-08 20:19:57 -03:00
RoinujNosde 8f4f763c37 refactor: added debug messages to BungeeManager 2022-11-04 23:15:09 -03:00
RoinujNosde 7a37382264 fix: default ranks were getting re-added on config load 2022-11-03 20:37:29 -03:00
RoinujNosde 7f9d133051 fix: channel auto creation setting not respected on join/link 2022-11-02 14:55:00 -03:00
RoinujNosde 26ba9f7329 fix: attempt at fixing NPE on getAllClanPlayers 2022-11-01 21:43:31 -03:00
Minat0_ d8cb61b0fc fix: money was not given back when channel creation failed (#336) 2022-10-31 18:39:26 -03:00
Minat0_ 3f1b06dcf9 fix: wrong path of discord economy section (#334) 2022-10-31 17:14:10 -03:00
WolfBot b043eb0742 chore(master): release 2.18.1-SNAPSHOT (#331) 2022-10-14 18:15:11 -03:00
github-actions[bot]andWolfBot 7691a4b719 chore(master): release 2.18.0 (#318)
Co-authored-by: WolfBot <112733600+bot-wolf@users.noreply.github.com>
2022-10-14 18:13:47 -03:00
Edson Passos 87ece22036 feat(lang): new crowdin updates (#319) 2022-10-14 18:10:47 -03:00
RoinujNosde f7e7ec6624 fix: removes duplicate /clan from help 2022-10-03 19:59:02 -03:00
RoinujNosde 25197cdd72 feat: add help-size config 2022-09-30 18:43:00 -03:00
Edson Passos 30a501c063 fix: ConfigurationSerializableAdapter NPE 2022-09-27 10:22:47 -03:00
RoinujNosde f14c425488 fix: NPE while purging data 2022-09-24 19:43:14 -03:00
Edson Passos cc2e32984d ci: added modrinth action 2022-09-20 20:07:56 -03:00
Edson Passos 2c9b0f98fe feat: Improves Bungee support (#327) 2022-09-17 11:22:11 -03:00
Edson Passos f484bc16c6 fix: set useSSL to false 2022-08-30 08:30:42 -03:00
RoinujNosde 37f0ecff50 fix: supports '.' and '*' as username prefix by default 2022-08-28 12:33:01 -03:00
Minat0_ c8969f2196 chore: update dependency version at README.md (#329) 2022-08-28 12:03:20 -03:00
Edson Passos b9c3cfd640 ci: adds name to job 2022-08-24 22:02:56 -03:00
RoinujNosde a440834347 feat: adds starter-ranks
A list of ranks, defined in the config, which are added to new clans
2022-08-16 19:09:10 -03:00
RoinujNosde 1adec0b89d fix: changes size of some frames for better visualization on Bedrock 2022-08-15 20:27:53 -03:00
RoinujNosde d56a0a979a feat: adds permission to bypass the teleport delay
Node: simpleclans.vip.teleport-delay
2022-08-15 20:18:53 -03:00
RoinujNosde af07988103 fix: getPastClans() preserves the insertion order 2022-08-15 19:37:17 -03:00
Edson Passos 96a13d8d6c fix: updates join date when joining a clan (#326) 2022-08-15 11:33:14 -03:00
Edson Passos 2a1ad5b5c8 fix: removes rank and join date on disband 2022-08-15 10:28:50 -03:00
RoinujNosde 1311423a17 refactor: changed members list to <ClanPlayer> 2022-08-01 19:38:50 -03:00
RoinujNosde 59e9c4caed refactor: changed clanPlayers map to <UUID, ClanPlayer> 2022-08-01 19:17:00 -03:00
RoinujNosde 4ab53d1613 perf: improved UUID lookup performance 2022-07-11 22:55:13 -03:00
RoinujNosde 2ea744443f feat: added method for registering protection providers 2022-06-27 18:58:05 -03:00
Edson Passos 8bd8bb6466 ci: disable fork on release-please 2022-06-24 19:29:58 -03:00
Minat0_ e7f756f306 fix: NPE while sending a message to spies (#322) 2022-06-24 19:27:34 -03:00
Edson Passos b7961acd5c ci: use fork on release-please 2022-06-12 15:12:43 -03:00
RoinujNosde c47289c5bf fix: NPE while collecting fees
ClanPlayer#toPlayer() returns null when the player is not connected
2022-06-12 15:10:32 -03:00
Edson Passos 7769060f4d ci: updated release-please token
This fixes actions listening to "release" not running
2022-06-10 19:35:52 -03:00
RoinujNosde a859928622 fix: NoClassDefFoundError in WorldGuard6Provider 2022-06-09 23:38:55 -03:00
RoinujNosde becb88b763 feat: adds PlayerHomeClearEvent
and fires PlayerHomeSetEvent when the mod command is used
2022-06-09 14:15:14 -03:00
RoinujNosde 711f81f3da ci: update java version
here we go again
2022-06-08 21:41:15 -03:00
RoinujNosde 7fae6f8b8a ci: added missing required input 2022-06-08 21:36:57 -03:00
RoinujNosde 62a8d304f4 ci: adds snapshots repository and udpated setup-jdk 2022-06-08 21:32:22 -03:00
Edson Passos fe8668abb0 Merge pull request #317 from RoinujNosde/release-please--branches--master
chore(master): release 2.17.1-SNAPSHOT
2022-06-08 21:04:55 -03:00
github-actions[bot] 36f5739f06 chore(master): release 2.17.1-SNAPSHOT 2022-06-09 00:01:26 +00:00
RoinujNosde f7465941b2 ci: updated crowdin.yml and publish actions 2022-06-08 21:00:08 -03:00
Edson Passos 2aa5b9aad3 bump version... 2022-06-08 20:20:55 -03:00
Edson Passos 51f82ba988 New Crowdin updates (#316) 2022-06-08 19:57:45 -03:00
Edson Passos 327bcf3980 v2.17.0 2022-06-08 19:45:19 -03:00
Edson Passos 5c3bb558cf feat(lang): new Crowdin updates (#295) 2022-06-08 19:27:22 -03:00
RoinujNosde c726e2bb3c feature: adds coordinates to Land 2022-06-07 14:27:17 -03:00
Edson Passos af6c72eda9 fix: war end via request 2022-06-05 12:53:56 -03:00
RoinujNosde d48c17f1f9 feature: adds permission FEE_BYPASS to ranks
removes simpleclans.member.bypass-fee
2022-05-31 19:14:00 -03:00
RoinujNosde 93eef5c727 fix: catches exceptions when creating Discord channels 2022-05-22 22:01:01 -03:00
RoinujNosde 714aa10701 fix: adds groups (Vault) to the global storage, instead of per world 2022-05-20 19:53:50 -03:00
Minat0_ b2d271b23b fix: don't confuse auto-group-groupname and auto-groups 2022-05-18 17:54:57 +03:00
RoinujNosde 7dad746269 fix: possibly improves performance of ClanPlayer lookup 2022-05-17 20:28:30 -03:00
RoinujNosde 37399cd50b fix: refactored ConfirmationPrompts 2022-05-10 20:03:09 -03:00
RoinujNosde 132eac98e2 fix: doesn't try saving Players with duplicate names 2022-05-09 20:21:15 -03:00
RoinujNosde ba68e8f70a fix: doesn't try saving Players with null names 2022-05-08 18:48:25 -03:00
RoinujNosde 0d3542b4aa Merge remote-tracking branch 'origin/dev' into dev 2022-05-08 17:40:28 -03:00
RoinujNosde 94eed8710c fix!: removed PlotSquared3Provider
Maven repo is down
2022-05-08 17:40:06 -03:00
RoinujNosde 0d3d4981c0 fix: removed PlotSquared3Provider
Maven repo is down
2022-05-08 17:35:56 -03:00
Minat0_ 73fa75fccc fix!: Log "API" when player is offline (#310) 2022-05-08 16:44:17 -03:00
RoinujNosde a855b51617 fix: pending invites could bypass the max members limit 2022-05-03 20:32:39 -03:00
RoinujNosde 83e7ad4ae1 fix: duplicate usernames logic 2022-05-02 21:24:18 -03:00
RoinujNosde 05cddb7e7f feature: adds ClanPlayerTeleportEvent 2022-04-08 14:23:05 -03:00
RoinujNosde 8d1ed8cf41 fix: refactored DBCore, added caller's stack trace to db exceptions 2022-04-05 20:00:33 -03:00
RoinujNosde f8862299f2 fix: optimizes player lookup by using Bukkit#getOfflinePlayers #306 2022-04-02 20:35:09 -03:00
RoinujNosde 1de339addc fix: parsing placeholders that return new placeholders 2022-03-30 19:23:39 -03:00
RoinujNosde e929b58cd7 fix: player not removed from Discord channel on kick #305 2022-03-17 18:55:42 -03:00
RoinujNosde 237755b5d5 fix: remove colors from logged chat messages 2022-03-13 20:02:47 -03:00
RoinujNosde c648343cdc fix: stop setting player locale on insert
The player has not set a language yet
2022-03-13 00:02:19 -03:00
RoinujNosde f34b9273cc fix: setting server's default language as the player's 2022-03-12 23:44:00 -03:00
Minat0_andRoinujNosde d07bc160e6 fix: Strips only Spy and Discord chats (#304)
Co-authored-by: RoinujNosde <edsonpassosjr@outlook.com>
2022-03-12 23:24:31 -03:00
RoinujNosde 6f1f919977 fix: NoSuchFieldException on PlayerHeadCacheTask 2022-03-11 18:13:11 -03:00
Edson Passos 12a5aa92bb fix: disallows 'k' format in tags by default 2022-03-08 12:11:28 -03:00
RoinujNosde 5d7ad0808d fix: checks for valid alphabet even for players with bypass permission 2022-03-06 10:58:02 -03:00
RoinujNosde ac0e2f2116 fix: checks for spaces in tag when ACCEPT_OTHER_ALPHABETS_LETTERS is enabled 2022-03-06 10:57:10 -03:00
Edson Passos 2d553234a3 Update maven.yml 2022-03-06 01:03:38 -03:00
RoinujNosde e4588fe1ef fix: error parsing username regex 2022-03-05 22:29:09 -03:00
RoinujNosde 4221cc2fa1 fix: teleporting to highest block if home is set on a slab #301 2022-03-05 22:18:49 -03:00
RoinujNosde 5db69775a3 feature: adds username regex to config 2022-03-04 20:40:40 -03:00
Minat0_ 88f61a150f Lack of permissions when auto-create is false (#300)
* fix: Lack of permissions when auto-create is false
2022-03-03 20:06:23 -03:00
Edson Passos f0df4435be Bump version 2022-03-02 15:09:53 -03:00
Minat0_andEdson Passos 05c0f734b5 Disband command requires confirmation (#299)
* build: Add maven dependency plugin

* feature: Disband command requires confirmation

* fix: Don't create clans (event) if auto-creation is false

* Updates env variable for testing purpose

* Makes confirm and decline methods abstract

* Testing dependency plugin config

Co-authored-by: Edson Passos <edsonpassosjr@outlook.com>
2022-03-02 17:03:49 +03:00
Edson Passos 4f0b721d49 Updates SCMessage with ChatEvent changes #298 2022-03-02 07:57:11 -03:00
RoinujNosde 3ebb041a3f Merge remote-tracking branch 'origin/dev' into dev 2022-02-26 22:13:47 -03:00
RoinujNosde 3b8dc4992d fix: first time players marked as "not played before" 2022-02-26 22:13:28 -03:00
Edson Passos 16be0c12a0 Fixes line breaks in changelog 2022-02-24 22:36:27 -03:00
Edson Passos 18c7c41ac4 Updated badges and repo info 2022-02-24 22:26:21 -03:00
Edson Passos cb201eb4b8 Update publish_reposilite.yml 2022-02-24 22:01:47 -03:00
Edson Passos 7a8ac9509b Bump version 2022-02-24 21:45:33 -03:00
Edson Passos 587bd9b445 Merge pull request #296 from RoinujNosde/dev
2.16.2
2022-02-24 21:42:42 -03:00
Edson Passos 6419e16eb0 Merge branch 'master' into dev 2022-02-24 21:38:59 -03:00
RoinujNosde 59d2bfc5f8 fix: middle-click actions stopped working on 1.18 #294 2022-02-24 20:37:52 -03:00
Edson Passos e452441380 Adds 1.18 to curseforge supported versions 2022-02-24 19:00:52 -03:00
Edson Passos 4d8fc0f0e5 Updates distributionManagement 2022-02-24 16:01:42 -03:00
Edson Passos 6bbb12e901 Create publish_reposilite.yml 2022-02-24 13:07:10 -03:00
RoinujNosde 002939f2df fix: bad usage of > in javadocs 2022-02-20 15:53:02 -03:00
RoinujNosde 6f27da4bdb fix: bad usage of > in javadocs 2022-02-20 15:48:58 -03:00
RoinujNosde 268f4752d6 feature: adds javadoc plugin 2022-02-20 15:32:15 -03:00
RoinujNosde 204858dee7 fix: uses - instead of space as commit hash separator 2022-02-20 14:18:27 -03:00
RoinujNosde a0ced58a02 feature: adds commit hash to version 2022-02-20 14:15:08 -03:00
RoinujNosde b8cbf831b3 fix: sc_players.name unique constraint not being respected in some cases 2022-02-19 22:59:45 -03:00
RoinujNosde d6ec0c3a3d fix: removes duplicate methods getHealthString and getHungerString 2022-02-19 22:10:51 -03:00
RoinujNosde bf3fc03f93 fix: checks if player name is null before processing death 2022-02-19 21:58:54 -03:00
Edson Passos 52348096a0 Merge pull request #293 from RoinujNosde/l10n_dev
New Crowdin updates
2022-02-18 11:06:29 -03:00
Edson Passos 00a48b24dd New translations messages.properties (Lithuanian) 2022-02-18 11:04:44 -03:00
Edson Passos c9aae0d781 Adds Lithuanian translation (#292)
* New translations messages.properties (Russian)

* New translations messages.properties (Norwegian)

* New translations messages.properties (Lithuanian)
2022-02-18 09:35:12 -03:00
Edson Passos d0bba163a0 New Crowdin updates (#284) 2022-02-18 09:31:32 -03:00
Edson Passos cd0e75483a Merge pull request #290 from Tomut0/dev
Some fixes on messages.properties
2022-02-16 09:40:08 -03:00
Edson Passos 2c365c5d54 Updates insufficient balance message 2022-02-16 09:38:53 -03:00
Minat0_ 9704562353 fix: Fixes "your.clan.doesnt.have.minimum.linked.player" message key 2022-02-16 11:51:43 +03:00
Minat0_ 836fc9d6a0 fix: Returns needed money as argument of "not.sufficient.money" key 2022-02-15 19:54:43 +03:00
Minat0_ cd01b0cd47 fix: Added missing message when player creates a discord channel 2022-02-15 19:54:43 +03:00
Minat0_ d797ab0908 feature: Leaders can create discord channel (#288)
* fix: CNFE on ChatManager#getDiscordHook

* Makes possible to turn off automatic discord channels creation
2022-02-14 22:32:42 -03:00
RoinujNosde fd58f4abda feature: chat listener priority can be changed via config #286 2022-02-03 18:52:34 -03:00
RoinujNosde 6653c6f8c0 feature: staffers can bypass the teleport timer 2022-02-02 19:09:45 -03:00
RoinujNosde 4dee178403 fix: removed PlotSquared5Provider 2022-02-02 18:55:01 -03:00
RoinujNosde 908451c65c feature: %rel_simpleclans_color% is configurable 2022-01-31 19:08:17 -03:00
RoinujNosde d468bd0df2 fix: temporarily removed PlotSquared5Provider as its maven repo is unavailable 2022-01-30 15:26:07 -03:00
RoinujNosde 3779585645 fix: incompatibility with UltimateChat's latest version
Added missing enum ConfigField.TAG_SEPARATOR_char (deprecated)
2022-01-30 14:36:15 -03:00
RoinujNosde c346fdf967 fix: removes player's own name from kick completion #263 2022-01-29 22:36:18 -03:00
Minat0_ 240a782774 Fixes missing clanTag argument at exception 2022-01-30 02:02:47 +03:00
Edson PassosandMinat0_ dce26a784f 2.16.1 (#283)
Adds Landlord 4 support
Fixes bug on create land event
Fixes a bug where JDA was loaded earlier than SC's DiscordHook
Fixes resetKdr not resetting ally kills
LanguageChooser now uses _ instead of -
Adds %clean-tag% placeholder for chat messages
Fixes bb settings
Fixes Vault groups getting removed only on join
Probably adds support for older GriefPrevention versions
Possibly fixes bug on home item on ClanDetailsFrame (staff)
Fixes unban command not saving changes
Strips colors from chat messages
Adds missing language keys
Fixes disallowed tags setting
Adds feature to limit past clans
Hides the player's own clan from some completions
Adds placeholder for bank bb messages
Adds bb commands for staff
Fixes player' permission was not deleted after kicking from the clan
Place command now supports offline players
Fixes not kicking a member if there is at least one leader
Adds sender to DisbandClanEvent
Fixes opening double chests - war and land sharing
Adds method to validate min, max on values
HEX support message on server startup
Bumps discordsrv to 1.24.1-SNAPSHOT
DiscordHook improvements and bug fixes
Messages updated
Removes floody debugs from ProtectionManager

Co-authored-by: Minat0_ <42711312+Tomut0@users.noreply.github.com>
2022-01-23 17:25:06 -03:00
RoinujNosde 3cac8067a6 Removes floody debugs from ProtectionManager 2022-01-23 17:04:08 -03:00
Edson Passos 993578f13e New Crowdin updates (#266) 2022-01-23 16:49:15 -03:00
Minat0_ 96da1b3936 DiscordHook improvement and fixing (#281)
Removes invalid channels on startup
Updates role after channel creation
Creating a channel on player' linking, joining
New setting - min-linked-players-to-create
Throws new exception ChannelExistsException
Makes DiscordHook#deleteChannel return boolean
2022-01-23 14:43:32 -03:00
RoinujNosde 2fc8a1aa1b Bumps discordsrv to 1.24.1-SNAPSHOT 2022-01-16 22:44:32 -03:00
Edson Passos b4cf94dab2 Merge pull request #279 from Tomut0/fix-discord-clan-creation
Fixes skipping channel creation conditions
2022-01-16 18:19:15 -03:00
Minat0_ a793e933ae Checking resolved 2022-01-17 00:07:10 +03:00
Minat0_ a0ec61cec7 Fixes skipping channel creation conditions, part 3
Capitalizes TAG_SEPARATOR_CHAR
2022-01-16 18:56:14 +03:00
Edson Passos 10b24b99a2 Testing cache setting 2022-01-13 23:43:32 -03:00
RoinujNosde 4ed174970e Merge remote-tracking branch 'origin/dev' into dev 2022-01-13 23:33:36 -03:00
RoinujNosde f7b4f5dfd9 Bumps discordsrv to 1.24.0 2022-01-13 23:33:21 -03:00
Edson Passos 8b7d8e4a72 Merge pull request #280 from Tomut0/dev
HEX support message on server startup
2022-01-12 20:11:17 -03:00
Minat0_ 8ab89cd03f HEX support message on server startup 2022-01-13 01:25:29 +03:00
RoinujNosde 47a5948157 Merge remote-tracking branch 'origin/dev' into dev 2022-01-11 19:38:53 -03:00
RoinujNosde 48e3da9716 Adds method to validate min, max on values
Overrides context resolvers from ACF to check for finite numbers (float and double)
2022-01-11 19:38:16 -03:00
Minat0_ 05ec2241f0 Revert "Replaces deprecated getItemInHand"
This reverts commit 71ad4ce160.
2022-01-10 18:25:16 +03:00
Minat0_ 4c881f4601 Fixes skipping channel creation conditions, part 2 2022-01-10 18:18:13 +03:00
Minat0_ 71ad4ce160 Replaces deprecated getItemInHand 2022-01-10 18:08:52 +03:00
Minat0_ 3c2d5c9b81 Fixes skipping channel creation conditions
Updates PaperLib to the latest
2022-01-10 17:26:27 +03:00
Edson Passos b0a0f951fa Merge pull request #278 from RoinujNosde/fix-leader-role
Fixes adding the leader role to anyone
2022-01-09 16:50:23 -03:00
Minat0_ 408647161e Fixes adding the leader role to anyone 2022-01-09 22:34:12 +03:00
RoinujNosde 55f95b405e Possibly fixes opening double chests - war and land sharing 2022-01-04 19:03:18 -03:00
RoinujNosde 0aeb153293 Adds sender to DisbandClanEvent #271 2021-12-10 19:02:02 -03:00
Edson Passos cdc185c8e7 Merge pull request #272 from RoinujNosde/Tomut0-patch-1
Fixes not kicking a member if there is at least one leader
2021-12-09 13:34:41 -03:00
Minat0_ 1f128e8368 Fixes not kicking a member if there is at least one leader
### Example:
Clan 1:
* Minat0_ (Leader)
* RoinujNosde (Member)

Following the current code logic: let's kick RoinujNosde (Member) -> check if clan leaders size == 1 (true) -> send message, return.
The solution is to *check* if this player is a leader and clan leaders size. ☕
2021-12-09 11:53:42 +03:00
RoinujNosde 2e68e7fe2f Place command now supports offline players 2021-11-29 18:16:47 -03:00
Minat0_ 388d17fe99 Fixes player' permission was not deleted after kicking from the clan (#269) 2021-11-19 15:58:38 -03:00
RoinujNosde 89d59a39d9 Adds bb commands for staff #265 2021-11-07 12:15:40 -03:00
Edson Passos d88c14359a New Crowdin updates (#261) 2021-11-07 11:45:53 -03:00
RoinujNosde ae40b35325 Adds placeholder for bank bb messages #246 2021-11-07 11:44:37 -03:00
RoinujNosde 6a410354e5 Hides the player's own clan from some completions
#263
2021-11-07 11:29:52 -03:00
Minat0_ 96c2b8c718 Adds feature to limit past clans (#264)
* Adds a view limit of past clans

* Removes Helper#toMessage

* Removes Helper#stripTrailing
2021-11-02 13:07:36 -03:00
RoinujNosde 4bf0e69734 Fixes disallowed tags setting #262 2021-10-18 21:24:43 -03:00
RoinujNosde 6803b001ce Adds missing language keys 2021-10-12 18:21:14 -03:00
Edson Passos 366863b63e New Crowdin updates (#254) 2021-10-12 18:02:53 -03:00
RoinujNosde 5c391e33c4 Strips colors from chat messages 2021-10-10 19:38:49 -03:00
RoinujNosde 448cc6093e Fixes unban command not saving changes 2021-10-08 23:33:40 -03:00
RoinujNosde 9d910759cb Possibly fixes bug on home item on ClanDetailsFrame (staff) 2021-10-06 13:42:45 -03:00
RoinujNosde cdc1808078 Fixes NoClassDefFoundError on older GriefPrevention versions 2021-09-29 21:38:06 -03:00
RoinujNosde 87541f9742 Probably adds support for older GriefPrevention versions #258 2021-09-28 23:43:44 -03:00
RoinujNosde 54f3f4ba40 Fixes Vault groups getting removed only on join #259 2021-09-28 23:34:22 -03:00
Edson Passos 4e8850e734 Fixes bb settings 2021-09-25 16:27:20 -03:00
RoinujNosde 9e55a00d68 Adds %clean-tag% placeholder for chat messages 2021-09-19 18:05:10 -03:00
Edson Passos f898631ace Merge pull request #256 from mehmet-27/patch-1
Update LanguageSelectorFrame.java
2021-09-19 16:29:36 -03:00
Mehmet f71a84a70e Update LanguageSelectorFrame.java
underscores should be used in languages shown as desired in the config
2021-09-19 22:15:22 +03:00
RoinujNosde b51f27e68b Merge remote-tracking branch 'origin/dev' into dev 2021-09-18 18:27:23 -03:00
RoinujNosde ad38548440 Fixes resetKdr not resetting ally kills 2021-09-18 18:26:28 -03:00
Edson Passos f69207f0d4 Probably fixes a bug, where JDA was loaded earlier than SC's DiscordHook. (#255) 2021-09-17 18:11:59 -03:00
Minat0_ 9fb42b7093 Probably fixes a bug, where JDA was loaded earlier than SC's DiscordHook. 2021-09-17 23:21:52 +03:00
RoinujNosde bf0670cb88 Fixes bug on create land event 2021-09-17 14:19:30 -03:00
RoinujNosde d4507f41fa Adds Landlord 4 support 2021-09-16 19:36:00 -03:00
Edson Passos 41a978a278 Added 1.17 to curseforge workflow 2021-09-13 20:54:29 -03:00
Edson Passos 6ad79b6879 Merge pull request #253 from RoinujNosde/dev
2.16.0
2021-09-13 20:28:55 -03:00
Edson Passos 30cc1759e9 Merge branch 'master' into dev 2021-09-13 20:24:30 -03:00
Edson Passos 3bae27db2d New Crowdin updates (#252) 2021-09-13 20:11:38 -03:00
RoinujNosde 33ea872e4d Bump version 2021-09-13 20:10:38 -03:00
RoinujNosde 558f13dccb Merge remote-tracking branch 'origin/dev' into dev 2021-09-12 10:27:40 -03:00
RoinujNosde 08aae94637 Changes tasks to be sync 2021-09-12 10:27:18 -03:00
Thiago GebrimandEdson Passos c25bd8206c Adição do R antes do $ para ficar: "R$" (#250)
* Adição do R antes do $ para ficar: "R$", pois PT-BR fica mais certo, e tradução de algumas mensagens.

* Changed currency symbol position

Co-authored-by: Edson Passos <edsonpassosjr@outlook.com>
2021-09-09 19:59:10 -03:00
Edson Passos da397676f6 New Crowdin updates (#245) 2021-09-09 19:38:41 -03:00
RoinujNosde 4a56f9e87a Merge remote-tracking branch 'origin/dev' into dev 2021-09-07 19:22:32 -03:00
RoinujNosde 51241b3ae5 Adds /clan list balance command
Permission: simpleclans.anyone.list.balance - default false
2021-09-07 19:22:23 -03:00
Minat0_ e66e187566 Running checks on different Java versions (#248) 2021-09-04 23:59:02 -03:00
RoinujNosde 031227ddaf Merge remote-tracking branch 'origin/dev' into dev 2021-09-04 21:27:51 -03:00
RoinujNosde c3b9c68d45 Creates a ClanPlayer object on placeholder request 2021-09-04 21:27:41 -03:00
Minat0_ 37ffb93808 Adds new metrics for discord chat feature (#247)
* Adds new metrics for discord chat feature
Marks CommandHelper as deprecated

* Deletes CommandHelper.java && DamageRecord.java because of non-usage
2021-09-04 18:51:29 +03:00
RoinujNosde 84dd6a4cbd Adds command /clan resign confirm #163
This will bypass the conversation to confirm the resign
2021-09-03 23:55:14 -03:00
RoinujNosde 8eaa86ae45 Marks annoying provider messages as debug
Logs when a provider is registered
Adds debug messages for ProtectionManager#can()
Checks if getPlot exists on PlotSquared5Provider
2021-09-03 20:13:49 -03:00
Mehmet 55e82dab5f Toggle Clan Invitation (#244)
#57
2021-08-30 18:57:58 -03:00
Edson Passos 0f1e016483 New Crowdin updates (#239) 2021-08-30 18:43:31 -03:00
Minat0_ 3a8a316f3d GitBook: [master] 15 pages modified 2021-08-30 16:40:00 +00:00
Minat0_ f350025796 GitBook: [master] no pages and one asset modified 2021-08-30 16:20:46 +00:00
Minat0_ 36bbb91b61 GitBook: [master] 15 pages and one asset modified 2021-08-30 15:45:02 +00:00
Minat0_ f468a28476 GitBook: [master] no pages and 6 assets modified 2021-08-30 15:13:28 +00:00
RoinujNosde 115e1c5083 Checks if user has already played in the server before saving to db 2021-08-28 20:40:46 -03:00
RoinujNosde 420d8fae8e Added debug messages to some conditions 2021-08-28 19:20:20 -03:00
RoinujNosde fef3763039 Fixes empty tag brackets 2021-08-28 19:11:53 -03:00
RoinujNosde ebe79fe340 Fixes casting exception on config default values 2021-08-28 13:50:41 -03:00
Edson Passos 4a40e4c03d Merge pull request #242 from Tomut0/abandon-conversation
Returns message after conversation expiring
2021-08-27 23:45:50 -03:00
Minat0_ 47d4a215fb Returns message after conversation expiring
Fixes getting null of all players on PlayerListFrame
Updates JavaDoc
Updates messages.properties
2021-08-28 04:50:53 +03:00
Minat0_ ad22a4c75c ChatManager implementation | Refactoring (#215)
Adds integration with Discord
Removes deprecated methods in Helper.java
New config value: settings.global-friendly-fire
Using ACF commands for ally/clan chat
ClanPlayer#setMuted and ClanPlayer#setMutedAlly was moved to ClanPlayer#mute
You may use HEX colors at chat format. 😎
This PR also solves Spy: ally chat has the same format as clan chat #160 and adds spy chat for DiscordChat.
Updates maven dependencies: bStats, JetBrain Annotations and JUnit.
Adds a message, if player tries to join to the same chat (ally/clan)
Adds a message, if chat is disabled (ally/clan)
Adds a message, if player tries to leave the chat, in which it is not located
Adds a message, if staff sends message trough discord to minecraft and he is not located in current clan.
Adds a message, if admin player tries to demote someone, who is not a leader.
2021-08-26 23:26:25 -03:00
RoinujNosde 9811e2e1db Implements relational placeholder color
%rel_simpleclans_color%
This returns GREEN when both players are in the same clan, RED for rivals, AQUA for allies
2021-08-19 13:52:02 -03:00
Edson Passos f81318d458 Merge pull request #236 from RoinujNosde/l10n_dev
New Crowdin updates
2021-08-06 10:56:57 -03:00
RoinujNosde 4d0c39c0dc Suppresses exceptions on GriefPreventionProvider #237 2021-08-03 18:43:26 -03:00
Edson Passos 74752b4341 New translations messages.properties (Spanish) 2021-08-02 01:14:01 -03:00
RoinujNosde 099cf2e8d1 Merge remote-tracking branch 'origin/dev' into dev 2021-07-26 19:52:42 -03:00
RoinujNosde b4447054fb Replaces Threads with BukkitTasks on MySQLCore 2021-07-26 19:52:29 -03:00
Edson Passos 387ea7fb7b New translations messages.properties (Vietnamese) 2021-07-22 16:33:18 -03:00
Edson Passos 5a2efab233 New translations messages.properties (Vietnamese) 2021-07-21 16:37:44 -03:00
Edson Passos 7b415e883f New translations messages.properties (Hungarian) 2021-07-15 16:21:28 -03:00
Edson Passos 339bacf6d4 New translations messages.properties (Portuguese) 2021-07-14 16:19:02 -03:00
Edson Passos 650d8d4d50 New translations messages.properties (Swedish) 2021-07-13 15:57:06 -03:00
Edson Passos c1a3a5a5fe New translations messages.properties (Chinese Simplified) 2021-07-12 10:37:40 -03:00
Edson Passos ca550c13c4 Merge pull request #235 from Tomut0/dev
Fixes StaffCommands#demote for permanent feature
2021-07-11 17:30:52 -03:00
Minat0_ 4738fcae97 Fixes StaffCommands#demote for permanent feature 2021-07-11 23:22:43 +03:00
RoinujNosde e6a4d94ea7 Updated intellij module 2021-07-11 10:49:04 -03:00
RoinujNosde c4baa6b7f8 Merge remote-tracking branch 'origin/master'
# Conflicts:
#	SimpleClans.iml
2021-07-11 10:44:26 -03:00
RoinujNosde 2eba58cd1c Bumped version
Changed url on pom
Removed Minecraft facet from module
2021-07-11 10:43:19 -03:00
Edson Passos bc4c1280b0 Merge pull request #234 from RoinujNosde/dev
v2.15.3
2021-07-11 10:39:23 -03:00
Edson Passos 0881f69900 New Crowdin updates (#228)
* New translations messages.properties (Russian)

* New translations messages.properties (Russian)

* New translations messages.properties (Russian)

* New translations messages.properties (Greek)

* New translations messages.properties (Greek)
2021-07-11 10:27:40 -03:00
RoinujNosde e3d6fdfe4a Makes registerProvider public 2021-07-09 18:39:28 -03:00
RoinujNosde 935c86c43d Revert "Adds support for PlotSquared 6"
This reverts commit ae1f8460
2021-07-08 21:09:06 -03:00
RoinujNosde ae1f846077 Adds support for PlotSquared 6 2021-07-08 20:54:49 -03:00
Minat0_ ddbd56e447 GitBook: [master] no pages and 2 assets modified 2021-07-06 15:54:40 +00:00
Minat0_ 35cba37cbe GitBook: [master] no pages and 2 assets modified 2021-07-06 15:30:57 +00:00
Minat0_ 1bd9191267 GitBook: [master] no pages and 2 assets modified 2021-07-05 10:04:51 +00:00
Minat0_ b8b1c6a02e GitBook: [master] 15 pages modified 2021-07-02 17:06:40 +00:00
RoinujNosde 001382558b Optimizes lookup command to not use OfflinePlayer 2021-07-02 13:27:26 -03:00
RoinujNosde eaf9cf6e19 Blocks clicking multiple times on the same button while it's loading 2021-07-01 18:16:13 -03:00
RoinujNosde 5297739002 Merge remote-tracking branch 'origin/dev' into dev 2021-06-28 18:52:59 -03:00
RoinujNosde c826db3549 Fixes max-kills-per-victim
Enabled bank-logger by default
2021-06-28 18:52:45 -03:00
Edson Passos 6b4e18338b New translations messages.properties (Dutch) (#227) 2021-06-28 08:49:16 -03:00
Edson Passos 44f1e6014f New Crowdin updates (#225)
* New translations messages.properties (German)

* New translations messages.properties (German)
2021-06-27 20:03:32 -03:00
Minat0_ c05e978faf SettingsManager cleanup (#226) 2021-06-27 20:02:53 -03:00
mehmet yılmaz 90f66681d0 GitBook: [master] 15 pages modified 2021-06-24 20:47:18 +00:00
mehmet yılmaz 536c18744a GitBook: [master] 15 pages modified 2021-06-24 20:18:37 +00:00
mehmet yılmaz ee00ffbf58 GitBook: [master] 15 pages modified 2021-06-24 19:54:41 +00:00
mehmet yılmaz 8b2cf58f9f GitBook: [master] 15 pages modified 2021-06-24 19:43:37 +00:00
mehmet yılmaz 194ed5cae8 GitBook: [master] 15 pages modified 2021-06-24 19:10:15 +00:00
mehmet yılmaz 747683aa99 GitBook: [master] 7 pages and one asset modified 2021-06-24 18:59:39 +00:00
RoinujNosde 2f6afdb6e0 Fixes regex for hex colors 2021-06-22 18:58:38 -03:00
Edson Passos 4aae97b033 New Crowdin updates (#213)
* New translations messages.properties (Spanish)

* New translations messages.properties (Turkish)

* New translations messages.properties (German)

* New translations messages.properties (French)

* New translations messages.properties (Hungarian)

* New translations messages.properties (Polish)

* New translations messages.properties (Chinese Simplified)

* New translations messages.properties (Russian)

* New translations messages.properties (Portuguese, Brazilian)

* New translations messages.properties (Russian)

* New translations messages.properties (Polish)

* New translations messages.properties (Chinese Simplified)

* New translations messages.properties (Finnish)

* New translations messages.properties (Spanish)

* New translations messages.properties (Chinese Simplified)

* New translations messages.properties (Chinese Simplified)

* New translations messages.properties (Polish)

* New translations messages.properties (Spanish)

* New translations messages.properties (Russian)

* New translations messages.properties (Arabic)

* New translations messages.properties (Vietnamese)

* New translations messages.properties (Russian)

* New translations messages.properties (Turkish)

* New translations messages.properties (Spanish)

* New translations messages.properties (Portuguese, Brazilian)
2021-06-21 15:59:18 -03:00
Edson Passos 51a88d0e5b Merge pull request #222 from Tomut0/patch-1
Removes unnecessary task canceling
2021-06-20 20:49:17 -03:00
Minat0_ d2a15f84f9 Removes unnecessary task canceling 2021-06-21 02:46:31 +03:00
Minat0_ d5e456a4b6 Fixes possibility to have multiple conversations (#220)
* Fixes possibility to have multiple conversation
* Fixes the missing resign message
2021-06-16 15:54:35 -03:00
RoinujNosde d2530ebc72 Merge remote-tracking branch 'origin/dev' into dev 2021-06-14 19:52:55 -03:00
RoinujNosde 1670c2da54 Added ignored list for BREAK 2021-06-14 19:52:37 -03:00
RoinujNosde eda29fbfad Adds debug messages for getLandsAt 2021-05-27 18:59:47 -03:00
RoinujNosde daff6952e5 Merge remote-tracking branch 'origin/dev' into dev 2021-05-26 19:42:39 -03:00
RoinujNosde be12935e2f Fixes GUI not respecting show-unverified-on-list
#212
2021-05-26 19:42:22 -03:00
RoinujNosde d17be1d834 Fixes wording on max members message
The max members can now be disabled by setting it to < 0
2021-05-26 19:39:27 -03:00
Edson Passos 38e6d6853f New Crowdin updates (#191)
* New translations messages.properties (Chinese Simplified)

* New translations messages.properties (Chinese Simplified)

* New translations messages.properties (Italian)

* New translations messages.properties (Italian)

* New translations messages.properties (Polish)

* New translations messages.properties (Hungarian)

* New translations messages.properties (Hungarian)
2021-05-26 19:36:34 -03:00
Minat0_ 5e1791d953 A little cleanup (#211)
* Adds javadocs to BankLog, CSVBankLogger

* Marks unused methods as deprecated in ChatBlock

* Removes useless mChatIntegration in SettingsManager

* Removes useless mChatIntegration in SettingsManager

* A little cleanup

* Changes javadocs description
2021-05-26 13:22:31 -03:00
Minat0_ f4f592da92 Fixes "Trusted color is ignored on clan/ally chat #186" (#202) 2021-05-21 19:44:20 -03:00
RoinujNosde aa130710ee Relocates javassist to prevent classloader problems 2021-05-18 20:12:18 -03:00
Edson Passos 0a664543a7 New Crowdin updates (#189)
* New translations messages.properties (Arabic)

* New translations messages.properties (Chinese Simplified)

* New translations messages.properties (Czech)

* New translations messages.properties (Spanish)

* New translations messages.properties (Russian)
2021-05-13 10:56:15 -03:00
Minat0_ 8338dc2ac7 Let's log bank transactions! 😃 (#190) 2021-05-12 13:03:49 -03:00
Edson Passos c621823d46 New Crowdin updates (#187)
* New translations messages.properties (Russian)

* New translations messages.properties (German)

* New translations messages.properties (Portuguese, Brazilian)
2021-05-05 09:26:03 -03:00
Edson Passos 612d923b12 New Crowdin updates (#182) 2021-05-04 20:03:34 -03:00
Minat0_ 7c0834845b Colored "none" message (#185)
#19
2021-05-04 09:11:49 -03:00
RoinujNosde 29f85228e8 Fixes clan-less leaders not being purged 2021-05-03 18:44:57 -03:00
Minat0_ c0741a3554 Cancel clan/rank creation (#184) 2021-05-02 14:19:47 -03:00
RoinujNosde 6e6503d480 getAnyClanPlayer(String) searches by name first 2021-05-01 18:54:01 -03:00
Edson Passos 1d5a8beb3d Merge pull request #181 from RoinujNosde/dev
v2.15.2
2021-04-30 19:37:51 -03:00
RoinujNosde 82a14a8f24 Probably fixes kick command #180 2021-04-30 19:25:44 -03:00
RoinujNosde d07ff8aa17 Bump version 2021-04-30 19:18:28 -03:00
RoinujNosde 855927e1cd Fixes merge problem 2021-04-30 19:17:39 -03:00
RoinujNosde a67beb0fda Merge remote-tracking branch 'origin/master' into dev
# Conflicts:
#	src/main/java/net/sacredlabyrinth/phaed/simpleclans/Clan.java
#	src/main/java/net/sacredlabyrinth/phaed/simpleclans/commands/SCCommandManager.java
#	src/main/java/net/sacredlabyrinth/phaed/simpleclans/events/DeleteRankEvent.java
#	src/main/resources/messages.properties
#	src/main/resources/messages_af_ZA.properties
#	src/main/resources/messages_ar_SA.properties
#	src/main/resources/messages_ca_ES.properties
#	src/main/resources/messages_cs_CZ.properties
#	src/main/resources/messages_da_DK.properties
#	src/main/resources/messages_de_DE.properties
#	src/main/resources/messages_el_GR.properties
#	src/main/resources/messages_es_ES.properties
#	src/main/resources/messages_fi_FI.properties
#	src/main/resources/messages_fr_FR.properties
#	src/main/resources/messages_he_IL.properties
#	src/main/resources/messages_hu_HU.properties
#	src/main/resources/messages_it_IT.properties
#	src/main/resources/messages_ja_JP.properties
#	src/main/resources/messages_ko_KR.properties
#	src/main/resources/messages_nl_NL.properties
#	src/main/resources/messages_no_NO.properties
#	src/main/resources/messages_pl_PL.properties
#	src/main/resources/messages_pt_BR.properties
#	src/main/resources/messages_pt_PT.properties
#	src/main/resources/messages_ro_RO.properties
#	src/main/resources/messages_ru_RU.properties
#	src/main/resources/messages_sr_SP.properties
#	src/main/resources/messages_sv_SE.properties
#	src/main/resources/messages_tr_TR.properties
#	src/main/resources/messages_uk_UA.properties
#	src/main/resources/messages_vi_VN.properties
#	src/main/resources/messages_zh_CN.properties
#	src/main/resources/messages_zh_TW.properties
2021-04-30 19:13:40 -03:00
Edson Passos b3e2720bc9 New translations messages.properties (Russian) (#179) 2021-04-30 19:07:33 -03:00
Minat0_ 99cb9e332a Show bank balance on staff GUI #89 (#178) 2021-04-29 22:23:55 -03:00
RoinujNosde 541e775fdb Merge remote-tracking branch 'origin/dev' into dev 2021-04-29 18:51:11 -03:00
RoinujNosde 0c220c79f2 Adds ignore-list for block place listeners 2021-04-29 18:50:59 -03:00
Edson Passos abc0bfe3ae New Crowdin updates (#177) 2021-04-28 21:02:44 -03:00
Edson Passos ff28d67e4b New Crowdin updates (#168) 2021-04-28 18:47:13 -03:00
RoinujNosde a723e8acff Only saves to db if set balance cause is not LOADING 2021-04-28 18:36:09 -03:00
RoinujNosde 9c20ef0575 Actually fixes spaces in BB 2021-04-27 22:51:15 -03:00
RoinujNosde 00b19d8c99 Fixes spaces in BB #172 2021-04-27 22:38:51 -03:00
Minat0_andRoinujNosde 8bcb1f2177 Bank commands for admins #88 (#174)
Co-authored-by: RoinujNosde <edsonpassosjr@outlook.com>
2021-04-27 22:04:14 -03:00
Edson Passos 37be7fbfc7 Checks if the Connection is valid before returning 2021-04-27 20:12:45 -03:00
RoinujNosde 29ef92e3b8 Refactored Clan and ClanPlayer update statements 2021-04-25 21:42:00 -03:00
RoinujNosde accddf319d Fixes negative KDR 2021-04-24 22:09:33 -03:00
RoinujNosde dafae75b21 Adds ALLY as kill type #99 2021-04-20 18:59:01 -03:00
RoinujNosde 6e477ec091 Adds name and clean name placeholders 2021-04-15 21:04:42 -03:00
RoinujNosde 8ae504024e Merge remote-tracking branch 'origin/dev' into dev 2021-04-11 10:20:44 -03:00
RoinujNosde 665ac47150 Sets PlotSquared as provided 2021-04-11 10:20:24 -03:00
Minat0_ f6d1356873 Hide vanished players from the invite command #128 (#167) 2021-04-07 22:15:21 -03:00
Edson Passos 40a749b304 New Crowdin updates (#150) 2021-04-07 19:46:13 -03:00
Minat0_ 628b26543f Disabling war requests, PlayerRankUpdateEvent (#166) 2021-04-06 12:33:57 -03:00
RoinujNosde c25c982264 Suppresses stacktrace from ProtectionProvider#setup
Adds support for PlotSquared 3 (untested)
2021-04-03 22:15:18 -03:00
RoinujNosde 32e21dbf50 Fixes clan home teleporting to surface if set in cave 2021-04-02 21:12:25 -03:00
RoinujNosde 7653b494fe Adds support for PlotSquared 5 (untested)
Attempts to add compatibility with CMI chat
2021-04-02 15:00:09 -03:00
RoinujNosde d20def4647 Adds support for WorldGuard 6 2021-03-29 23:44:26 -03:00
RoinujNosde 759796402e Fixes exception when using WG <7 2021-03-29 22:38:06 -03:00
RoinujNosde 13281ebff9 Fixes javadoc 2021-03-27 11:17:21 -03:00
Minat0_andRoinujNosde 2d52da106b Permanent clans (#157)
* Added permanent command
* Permanent clans are not purged
* Shows permanent status on profile
* Shows infinity symbol if a clan is permanent or purging is disabled

Co-authored-by: RoinujNosde <edsonpassosjr@outlook.com>
2021-03-26 16:01:52 -03:00
RoinujNosde 587f74e6aa Fixes NPE on ProtectionManager 2021-03-26 13:47:50 -03:00
RoinujNosde 74ba2ff568 Adds KDR resolver for placeholders
Changes KDR format to #.## in placeholders

Adds getClan() to PreCreateRankEvent
2021-03-20 22:05:31 -03:00
Minat0_andRoinujNosde 7e658c08b6 Rank events (PreCreateRankEvent, CreateRankEvent, DeleteRankEvent) (#151)
Adds events PreCreateRankEvent, CreateRankEvent, DeleteRankEvent

Co-authored-by: RoinujNosde <edsonpassosjr@outlook.com>
2021-03-20 13:32:08 -03:00
RoinujNosde cdda69d8b6 Adds option to edit all lands or only one 2021-03-19 22:37:47 -03:00
RoinujNosde 41721b02a7 Fixes ally invite still sent after disband #143 2021-03-19 22:20:46 -03:00
RoinujNosde 6bb3afb707 Revert "Adds compatibility with mute plugins"
This reverts commit 1f0b2518
2021-03-19 21:19:43 -03:00
RoinujNosde 3550d3909e Merge remote-tracking branch 'origin/dev' into dev 2021-03-18 21:46:06 -03:00
RoinujNosde 1f0b251885 Adds compatibility with mute plugins 2021-03-18 21:45:53 -03:00
Edson Passos 701d70681f Merge pull request #146 from RoinujNosde/l10n_dev
New Crowdin updates
2021-03-18 12:28:50 -03:00
Edson Passos 9f312800e1 New translations messages.properties (German) 2021-03-17 19:26:15 -03:00
Edson Passos d892b03142 Bump version 2021-03-16 19:44:31 -03:00
Edson PassosandMinat0_ 105ed018b1 v2.15.1 (#145)
Updated messages
Add event for deleting a rank
Fixes InventoryOpenEvent on older versions
Fixed players without rank unable to send chat messages

Co-authored-by: Minat0_ <42711312+Tomut0@users.noreply.github.com>
2021-03-16 19:39:00 -03:00
Edson Passos 7d872f1a4b New Crowdin updates (#142) 2021-03-16 19:31:38 -03:00
Minat0_ 5a1173f257 Add event for deleting a rank (#144) 2021-03-15 21:40:02 -03:00
Edson Passos 567e64462b New translations messages.properties (Russian) (#139) 2021-03-11 09:56:58 -03:00
RoinujNosde 95c5b11352 Merge remote-tracking branch 'origin/dev' into dev 2021-03-10 13:24:17 -03:00
RoinujNosde 26ceb59564 Fixes InventoryOpenEvent on older versions 2021-03-10 13:23:36 -03:00
Edson Passos ddf11b732f New Crowdin updates (#137)
* Update source file messages.properties
* New translations messages.properties (Polish)
* New translations messages.properties (Portuguese, Brazilian)
2021-03-07 14:29:22 -03:00
Edson Passos d35007b369 Updated messages 2021-03-06 15:01:16 -03:00
RoinujNosde aa011357bc Fixed players without rank unable to send chat messages 2021-03-06 13:59:27 -03:00
Edson Passos 53296485e8 Update Crowdin configuration file 2021-03-06 00:07:26 -03:00
Edson Passos 3f4fe0429f Update Crowdin configuration file 2021-03-06 00:00:16 -03:00
Edson Passos 31389485fd Deleted test action 2021-03-05 23:23:34 -03:00
Edson Passos c84f88b607 Fixed wrong path in publish action 2021-03-05 23:20:53 -03:00
Edson Passos a3cee92371 Update test_curseforge.yml 2021-03-05 22:54:52 -03:00
Edson Passos 8ae79e6b3d Testing curse forge action 2021-03-05 22:42:39 -03:00
Edson Passos 93fb4eafd4 Attemps to fix publish_curseforge action 2021-03-05 22:39:22 -03:00
RoinujNosde 5f2c20fe13 Deleted bintray action
Updated readme with new repo
2021-03-05 22:16:09 -03:00
Edson Passos 27b81f00d1 v2.15.0 (#132)
Added War and protection
Added clan color placeholder (#130)
Refactored flags
Fixed invitation message being sent even after invited created clan
Probably fixed exception thrown when two players modify the same part of the Clan via GUI
Fixed inverted bypass permission
Fixed allowDeposit and allowWithdraw not saving to db #125
2021-03-05 21:31:19 -03:00
RoinujNosde 0d0ad0a73f Changes maven repo to CodeMC 2021-03-05 20:50:40 -03:00
Edson Passos 7f20cd47f2 Renamed bintray action 2021-02-16 20:22:00 -03:00
Edson Passos ddabe9f86e Creates action to publish to CurseForge 2021-02-16 20:19:27 -03:00
Edson Passos 22cee2c494 Create LICENSE 2021-02-15 18:55:45 -03:00
Edson Passos 4f74885e8f v2.14.7 (#122)
Fixes wrapping long colored strings/words
Fixes kicking players via GUI
Probably fixes purge message
Fixes clickable accept and deny not working on translated configs
Refactored PAPI Expansion
Fixes RGB colors on BB
Fixes next button on some frames
Probably fixes placeholder not found warning
Ignore comments when loading translation status
Stores clan home location x, y and z as double
Stops wrapping messages to fit in one line
Players with bypass permission can view the profile/roster of non-verified clans
Adds kick command for moderators
Allows the removal of lines from lore
Adds debug messages to permission checks and deaths
Added topplayers placeholder
2021-02-08 20:46:35 -03:00
Edson Passos c4a253efb7 v2.14.6 (#115)
Adds delay for PvP denied messages #106
Adds 60 seconds timeout for conversations
Adds message for admin promote success
Adds Default Ranks #110
Adds warning about LuckPerms and auto-group-groupname
Warns when moving the last leader from a clan #94
PlayerDetailsFrame now gets the nickname from ClanPlayer to avoid rare cases where the player data file was deleted
Updated StaffFrame to reflect command changes #114
Fixes parsing large colored strings on wordWrap
Fixes clickable messages on <=1.12
Updated language files
2021-01-03 12:31:44 -03:00
Edson Passos f34b947e59 v2.14.5 (#108)
Adds clickable messages (accept and deny)
Added support to RGB colors
Added modtag for staff
Request messages are now 100% customizable
Moved mod commands to subcommand "mod"
Clan home now saves yaw and pitch
Fixed {clan} showing on chat when not in clan
Shows status "in rank" for untrusted players
Increased color_tag column size to 255
2020-12-17 20:19:11 -03:00
Edson Passos 5c98c1ecda GitBook: [master] 2 pages modified 2020-11-27 22:16:03 +00:00
Edson Passos 61b37d0907 GitBook: [master] 2 pages modified 2020-11-27 21:34:55 +00:00
Edson Passos e974af3c0e GitBook: [master] one page modified 2020-11-27 17:38:12 +00:00
Edson Passos 182e6e15c8 v2.14.4.1 (#93)
Fixed VanishUtils
2020-11-23 00:07:59 -03:00
Edson Passos c11a0e326c v2.14.4 (#92)
Re-added API methods that use player names instead of UUID to regain compatibility with old plugins (those names are converted to UUID)
Added PreCreateClanEvent #87
Added BankDepositEvent and BankWithdrawEvent #51
Added check for last minute changes of the member fee #75
Added suggestions for chat subcommands
Create clan command now accepts tag and name (optional arguments) #76 
Removed unused PlayerNameTabCompleter
Removed chat subcommands on and off
Fixed vanished players showing in online count #83
Fixes SQLite drop index syntax #52
Fixed saved banner not loading #90
Before caching the player head, the plugin now checks if the task was cancelled (on disable) #49
Fixed chat NPE and messages not being sent
Shaded Reflections lib to fix compatibility issues with other plugins
Changed priorities of some listeners
Updated language files
2020-11-22 17:37:18 -03:00
Edson Passos 1087235ecb GitBook: [master] 16 pages modified 2020-11-22 15:01:00 +00:00
Edson Passos cf45e73448 Added latest version badge 2020-11-18 19:19:06 -03:00
Edson Passos 6cf8517606 Added bStats badges 2020-11-16 20:29:47 -03:00
Tom Lewis f73ac56bde Added quick links to all doc (#85)
* Added quick links to all doc
* Warning for auto giving super permissions
* Added missing permissions
2020-11-09 11:09:36 -03:00
Edson Passosandxtomyserrax be5dc77e24 v2.14.3 (#84)
Changes disabled resetkdr message Closes #77
Fixes set fee allowing negative values Closes #74
Fixes exception on interacting with a wolf whose owner is offline Closes #73
Extracted events related to the TamableMobsSharing feature to their own class
Adds confirmation messages for accepting/denying invitations. Closes #44
The plugin now sends messages when attacks are cancelled. Closes #71
Refactored listeners related to the FriendlyFire and PvPOnlyInWar features
Refactored the PlayerDeathEvent listener
Fixed not being able to post more than one word to the bb
Plugin now gets ACF messages from ENGLISH when missing
Changed main GUI title to "{server name} - clan menu" Closes #63
Added staff lore message Closes #32
Removes spaces from subcommands
Fixes mute clan chat command
Updated language files

Co-authored-by: xtomyserrax <xtomyserrax@users.noreply.github.com>
2020-11-08 21:39:04 -03:00
Edson Passos db17074ac0 GitBook: [master] 2 pages modified 2020-11-06 17:26:10 +00:00
Tom Lewis 40d506c389 Adds doc link with commands & permissions links (#72) 2020-10-25 13:00:03 -03:00
Edson Passos d9f87420e1 2.14.2 (#69)
Fixed ally chat command not changing
Help command is now translatable
Added missing clan_member condition to chat commands
Updated language files
Fixes teleport blocks not respecting config
Adds a different way to check for vanished players
Fixes Lookup showing vanished players as online
Basic permissions are now default true
2020-10-23 20:13:00 -03:00
RoinujNosde bfa50407a7 Probably fixes #55 2020-10-19 19:52:48 -03:00
RoinujNosde 238ee17de8 Fixes ACF Name Annotation bug
Fixes InviteFrame's next page button. Closes #61
Added TagChangeEvent. Closes #58
2020-10-19 19:44:56 -03:00
Edson Passos 1b8a3fee6e Implemented ACF 2020-10-18 22:40:42 -03:00
RoinujNosde 69f75af088 Merge remote-tracking branch 'origin/master' 2020-08-22 20:29:16 -03:00
RoinujNosde 895ff3a44c Added lore length to the config 2020-08-22 19:54:04 -03:00
RoinujNosde 22d961b663 Bump version 2020-08-21 20:15:54 -03:00
RoinujNosde c006de7c08 Implemented lore length limiter Closes #36
Showing clan tag instead of name on alliances/rivalries Closes #40
Renaming old language files to messages_en Closes #42
Hid the head cache setting Closes #39
2020-08-21 20:09:37 -03:00
RoinujNosde c0ba056e54 New events and some fixes
Fixed roster not switching pages #39
Moved min-to-verify setting
Added task for caching player heads #39
Added FrameOpenEvent and ComponentClickEvent Closes #35
Added ability to hit oneself Closes #38
Added missing has.been.purged message Closes #37
2020-08-18 20:48:38 -03:00
Armageddon 2c7a594c56 GitBook: [master] 14 pages and 2 assets modified 2020-08-11 15:04:43 +00:00
srbedrock 29db5da1dc Merge branch 'master' into master 2020-08-11 10:34:58 -03:00
srbedrock 1d3ebafd6c Update maven.yml 2020-08-11 10:32:46 -03:00
RoinujNosde 07be81b456 Merge branch 'dev'
# Conflicts:
#	.github/workflows/bintray-publish.yml
#	.github/workflows/brintray-publish-1.8.yml
#	pom.xml
2020-08-09 20:12:29 -03:00
RoinujNosde e7b088d833 Bump version 2020-08-09 20:04:18 -03:00
RoinujNosde 9ad41ee3d6 Added translations
Added setbanner to help command
Added German translation
Added Turkish translation
Added Dutch translation
2020-08-09 19:30:41 -03:00
RoinujNosde a053911f00 Added banner for clans
Added command to set banners
Fixed insufficient permissions message
2020-08-09 14:39:44 -03:00
Edson Passos 1a2cf1d3b9 GitBook: [master] 10 pages modified 2020-08-09 17:28:54 +00:00
srbedrock cc3d7f9502 Wiki 2 (#30) 2020-08-07 08:59:03 -03:00
Thiago Kenis 98c69ed9e9 Update Clan Upkeep and Land Claims Plugins 2020-08-07 08:55:30 -03:00
Thiago Kenis f2bc1f12bd Update Configuration.md 2020-08-07 08:51:45 -03:00
Thiago Kenis 04a2fd603f Add Member Fee and Placeholder API Support 2020-08-07 08:47:27 -03:00
srbedrock 4e0c123879 Merge branch 'master' into master 2020-08-07 08:31:22 -03:00
Edson Passos 3bf8e77133 GitBook: [master] 27 pages and 2 assets modified 2020-08-06 21:23:53 +00:00
srbedrock 11e0344181 Wiki (#1) 2020-08-06 15:33:33 -03:00
srbedrock 34d4590d7e Commit Inicial mudança da Wiki (#29) 2020-08-06 15:00:37 -03:00
Edson Passos d1c98f802c Added Bintray Publish Action (#28) 2020-08-06 14:24:08 -03:00
Lucas 8f4dbc9f28 PAPI hook improved (#23) 2020-08-06 14:05:07 -03:00
srbedrock a5510b98ad Update and rename maven-master.yml to maven.yml 2020-08-06 11:43:18 -03:00
srbedrock a7d11f763c Update and rename maven.yml to maven-master.yml 2020-08-06 11:35:15 -03:00
srbedrock c50f6dc931 Create maven.yml 2020-08-06 10:56:56 -03:00
xtomyserrax 2b4e335b14 Fixes issue with item-list for dropping when teleporting home (#22) 2020-08-05 20:23:53 -03:00
RoinujNosde 34b0f32f1b Added DENSE ranking type
Fixed demote command
Changed kdr-exempt permission from default false to op to try to prevent a bug where everyone has it
2020-08-05 20:02:11 -03:00
Edson Passos 9ebe483850 Create .gitbook.yaml 2020-08-05 19:52:30 -03:00
RoinujNosde 7757f712cd Added StaffFrame
Added ClanDetailsFrame (staff)
Added PlayerDetailsFrame (staff)
Added PlayerListFrame (staff)
Added ClanListFrame (staff)
Fixed some messages not using the player's locale

marcelo-mason/SimpleClans#600
marcelo-mason/SimpleClans#614
2020-07-31 18:28:37 -03:00
RoinujNosde 2b562ac466 Added ConfirmationFrame
marcelo-mason/SimpleClans#616
2020-07-29 20:37:05 -03:00
Edson Passos 9038f97403 Merge pull request #21 from SrBedrock/patch-1
Update README.md
2020-07-29 07:53:30 -03:00
srbedrock 0892545252 Update README.md 2020-07-29 02:10:15 -03:00
Edson Passos 554e5f25bb Experimenting with Travis 2020-07-28 19:59:10 -03:00
RoinujNosde a0114a517d Implemented async teleport #3 2020-07-28 19:43:15 -03:00
RoinujNosde 960e40b387 Changed separator in auto groups to underscore
Fixes incompatibility issues with storing groups in YAML config files
2020-07-28 18:58:59 -03:00
RoinujNosde 0ca66fb6a4 Fixed placeholder registration
Added metric for language_chooser

marcelo-mason/SimpleClans#639
2020-07-26 13:40:38 -03:00
RoinujNosde e2a083f09a Added minimum members to verify 2020-07-26 10:35:59 -03:00
RoinujNosde c825fdd7ab Finished the language update
Removed usage of deprecated getLang
Added translation status for every language
Added link to the crowdin project and for every language
2020-07-26 01:05:06 -03:00
RoinujNosde 7e12fa6d01 Merge xtomyserrax's master into dev 2020-07-21 20:43:33 -03:00
RoinujNosde 113ef19966 Removed wrong import 2020-07-20 21:11:33 -03:00
RoinujNosde 93cb11532a Created LanguageSelectorFrame frame 2020-07-20 21:08:04 -03:00
Edson Passos 7d5699d75e Update README.md
Updated badges
Added maven repo info
Added API examples
2020-07-05 15:03:54 -03:00
RoinujNosde ae09353ab4 Fixes Exception on ChatEvent
getHandlerList() was missing

marcelo-mason/SimpleClans#634
2020-07-03 18:42:53 -03:00
RoinujNosde 33f9ee7adc Fixes NPE thrown if a color in the config is empty or doesn't exist 2020-07-02 22:16:37 -03:00
Edson Passos 2ba027f89a Delete bintray-publish.yml 2020-07-02 20:23:31 -03:00
Edson Passos d2ed8ac366 Delete bintray-publish-mc-1.8.yml 2020-07-02 20:23:21 -03:00
RoinujNosde 5e03bf53e7 Added support for different alphabets on tags
marcelo-mason/SimpleClans#618
2020-07-02 19:49:29 -03:00
RoinujNosde 01dc9d2304 Implemented rank creation via Conversation
marcelo-mason/SimpleClans#606
2020-07-01 19:47:05 -03:00
RoinujNosde 4eafe9afa8 Implemented clan creation via Conversation
Changed the command to /clan create (no args)
Created TagValidator class to have tag validation logic in one place
2020-07-01 18:42:43 -03:00
Edson Passos f2ba4b8a5c Added issue templates 2020-07-01 10:47:13 -03:00
RoinujNosde 7ba439eafc Added support for line breaks in an item's lore marcelo-mason/SimpleClans#611 2020-06-28 19:26:02 -03:00
RoinujNosde 5781f64796 Implemented disable-messages settings marcelo-mason/SimpleClans#597
If enabled, server announcements will not be sent
2020-06-28 18:56:32 -03:00
RoinujNosde 4d634901b0 GUI items now show their prices marcelo-mason/SimpleClans#620 2020-06-28 13:16:47 -03:00
RoinujNosde c1c4a35b82 Merge remote-tracking branch 'origin/dev' into dev
# Conflicts:
#	.github/workflows/maven-publish-mc-1.8.yml
#	.github/workflows/maven-publish.yml
2020-06-28 11:39:37 -03:00
RoinujNosde fd0954b510 Added promote command for admins marcelo-mason/SimpleClans#628 2020-06-28 11:38:51 -03:00
Edson Passos 2e1339e08e Delete bintray-publish.yml 2020-06-27 18:51:20 -03:00
Edson Passos cec163add9 Delete bintray-publish-mc-1.8.yml 2020-06-27 18:51:09 -03:00
Edson Passos 43e21924ee Renaming workflows again... 2020-06-27 18:48:00 -03:00
RoinujNosde 2bfc37d780 Merge remote-tracking branch 'origin/master' 2020-06-27 18:24:46 -03:00
RoinujNosde 3e4a744fc3 Renaming the workflows 2020-06-27 18:24:30 -03:00
Edson Passos f203554a64 Renamed workflows 2020-06-26 21:25:41 -03:00
RoinujNosde 116e99104c Merge branch 'master' into dev 2020-06-26 21:02:10 -03:00
RoinujNosde b5f81ccf79 Merge remote-tracking branch 'origin/master' 2020-06-26 20:57:26 -03:00
RoinujNosde 1ee1c288bd Changed distributionManagement 2020-06-26 20:56:58 -03:00
Edson Passos 03b95bbedf Updated issues link 2020-06-26 18:40:23 -03:00
rafael59r2 37ea6fe665 Added AddKillEvent (#631) 2020-06-25 19:55:41 -03:00
RoinujNosde 23832888e0 Fixes NPE on killing a NPC #630 2020-06-25 19:28:04 -03:00
RoinujNosde 50666a222a Added Friendly Fire permission to ranks
#625
2020-06-22 19:39:07 -03:00
RoinujNosde 0c63974180 Add info about clan/ally on MenuCommand
Added usage of the clan/ally chat commands to the MenuCommand and to the Chat Button
#582
2020-06-21 13:18:59 -03:00
RoinujNosde aa95ce09a4 Fixed too long colored tag on ModTag #598 2020-06-20 18:50:02 -03:00
RoinujNosde 960200a45f Added limit to the number of alliances
-1 disables it
#609
2020-06-19 21:54:09 -03:00
RoinujNosde 6c7bfa1752 Fixes NPE on a PlayerDeathEvent fired by PvPManager
#623
2020-06-19 21:27:26 -03:00
RoinujNosde 6554a91800 Forgot to replace other uses of Arrow #619 2020-06-14 16:23:47 -03:00
RoinujNosde 73616ddef9 ResetKDR price is displayed on the button and changed its permission #616 2020-06-14 16:13:40 -03:00
RoinujNosde ef894a36df Fixed place command and EntityListener
Fixed place command Closes #621
Fixed friendly fire not blocked if using tridents Closes #619
Added authors to plugin.yml
2020-06-14 15:54:16 -03:00
Edson Passos 598e420fa6 Added link to Discord server 2020-06-09 18:30:33 -03:00
RoinujNosde 68065a3b79 Fixed massive lag when opening the Leaderboard Frame
Closes #617
Added loading message to the buttons lore
Previous and Next page buttons now hide if they have no use
2020-06-06 19:00:38 -03:00
RoinujNosde 6e255fc7cb Added top clans placeholders
%simpleclans_topclans_POSITION_color_tag%
%simpleclans_topclans_POSITION_kdr%
%simpleclans_topclans_POSITION_total_kills%
Closes #610
2020-06-02 20:44:20 -03:00
Edson Passos 36a3d3732a Fixed maven build action
Ref was in the wrong action
2020-05-31 23:30:21 -03:00
RoinujNosde 934263063e Added a workflow for 1.8 2020-05-31 22:59:57 -03:00
RoinujNosde af9e9539f9 Fixed lpp on bb messages 2020-05-30 21:00:52 -03:00
RoinujNosde 14be85a84c Added getLocale check for older MC versions 2020-05-29 23:54:23 -03:00
RoinujNosde 3a789adf61 Implemented lpp on RequestManager 2020-05-29 23:47:58 -03:00
RoinujNosde 2c39603da9 Merge remote-tracking branch 'origin/master' 2020-05-28 21:00:24 -03:00
RoinujNosde 6dddc64a95 Fixed clan command not working on older Minecraft versions
Added messages for join/leave/mute/unmute chat Closes #603
Fixed clan tag min length Closes #608
Added a check for too long colored tag Closes #598
2020-05-28 20:59:42 -03:00
RoinujNosde 82f94d1149 Fixed clan command not working on older Minecraft versions
Added messages for join/leave/mute/unmute chat Closes #603
Fixed clan tag min length Closes #608
Added a check for too long colored tag Closes #598
2020-05-28 20:55:39 -03:00
RoinujNosde edd19a42d6 Implemented lpp on TabCompleter and ResignPrompt 2020-05-28 19:39:48 -03:00
RoinujNosde 26d41c2d98 Implemented language per player on ClanPlayer and Dates 2020-05-27 20:47:25 -03:00
RoinujNosde d928cf8e39 Merge branch 'master' of https://github.com/xtomyserrax/SimpleClans into lang-pp 2020-05-27 20:12:50 -03:00
xtomyserrax 4e1d538ef2 Added support for per player language. 2020-05-26 00:11:21 -03:00
Edson Passos b4fbcdd0de Added resource page 2020-05-25 20:47:03 -03:00
xtomyserrax 0ead15ff25 Update .gitignore 2020-05-25 20:43:28 -03:00
Edson Passos 3db5a71bbe Added maven package badge
Change links
2020-05-25 20:32:46 -03:00
RoinujNosde ae86f5b68f Updated language files 2020-05-25 19:17:48 -03:00
Edson Passos 1ca26319db Added a GUI
The plugin accepts & as an alternative color code
Fixed PurgeCommand not purging players without clan
2020-05-25 19:02:24 -03:00
Edson Passos 0bb9fd5b53 Removed old repo 2020-05-24 15:50:38 -03:00
Edson Passos c548f7749e Added Maven Package workflow 2020-05-24 15:41:58 -03:00
Edson Passos 888366ce27 Added new distribution repo and changed vault repo 2020-05-24 15:40:50 -03:00
RoinujNosde dc7d414393 Fixed globalff usage
Fixed Russian translation for the ff commands ("allow", "block" and
"auto")
Closes #594
2020-05-13 20:38:26 -03:00
RoinujNosde f5c0920cc9 Fixed rank command and added new languages 2020-05-13 20:14:49 -03:00
RoinujNosde fe866d959a Now saving periodically to db
Added update checker
Removed usage of SimpleClans#getLog()
2020-05-08 18:31:06 -03:00
LucasandRoinujNosde 6083766a12 Added PlaceholderAPI support (#587)
Added PlaceholderAPI support
Refactored PlaceholderHook

Co-authored-by: RoinujNosde <edsonpassosjr@outlook.com>
2020-05-01 14:54:28 -03:00
14b663801d Added spanish translation
Removed the usage of Helper.capitalize()
Fixed some messages in English
Converted spanish file to properties

Co-authored-by: RoinujNosde <edsonpassosjr@outlook.com>
Co-authored-by: CrazyDev <hugosilvaf2@gmail.com>
2020-04-27 22:45:22 -03:00
RoinujNosde b331e2c236 Merge branch 'master' of https://github.com/marcelo-mason/SimpleClans.git 2020-04-27 20:18:18 -03:00
RoinujNosde b3d5be1ec0 Updated language system Closes #573
The language file format is now .properties
If a message is not present in the messages file in the plugin's folder,
the plugin will search inside the jar
You can switch languages in the config
Fixed the vote system
Added message "resign request cancelled" Closes #580
Chat command is on the Menu command
2020-04-27 20:17:33 -03:00
Edson Passos b6d9c3a605 Removed disclaimer 2020-04-27 11:32:22 -03:00
Edson Passos e2c7b109d9 Added translation badge 2020-04-27 07:32:52 -03:00
CrazyDev 6bb370facd Fix command /clan home regroup (#584)
Fix loc null in /clan home regroup
2020-04-23 11:05:42 -03:00
RoinujNosde b3c8131c96 Fixed confirmation for promote Closes #581
Refactored the code to process votes
2020-04-22 21:32:02 -03:00
RoinujNosde d4c9537296 Fixed KDR not recording
Changed the kdr-exempt permission to simpleclans.other.kdr-exempt Closes
#579
2020-04-21 19:32:56 -03:00
RoinujNosde f89d446ac0 Fixed confirmation for demote/promote still asking after voting
Closes #482
2020-04-21 19:29:19 -03:00
RoinujNosde 009564f732 Fixed leaders online to demote
Closes #575
2020-04-18 19:15:55 -03:00
RoinujNosde a6e10da510 Checking if connection is null or closed
Closes #572
2020-04-18 19:11:34 -03:00
RoinujNosde a9fe589794 Forgot to update table 2020-04-16 07:02:51 -03:00
RoinujNosde 2d0b524557 Removed forRemoval from @Deprecated 2020-04-15 21:43:19 -03:00
RoinujNosde ba66f16f54 Fixed last seen and menu command messages
Fixed last seen not updating Closes #566
Fixed weird space in Menu command Closes #483
Fixed Menu command messages getting cropped Closes #392
Fixed Mojang URL
Removed deprecated code
2020-04-15 21:32:57 -03:00
RoinujNosde 4d6a489b43 SQLite queries use threads if enabled
Fixes #568
2020-04-13 20:22:45 -03:00
xtomyserrax 92da40ca76 Small fixes on commands
Fixes a small issue when ally wasn't verified, it was sending a message but not returning the code.
Fixes NPE on Ban command.
ChatEvent is ignored if cancelled.
Menu command will show /clan fee only if member fee is enabled
Added disabled message to Fee command
2020-04-10 13:35:44 -03:00
Edson Passos f1d0741ac8 Corrected version number 2020-04-10 11:28:24 -03:00
RoinujNosde 03b2f73e74 Rank name is lowercase 2020-04-10 10:35:54 -03:00
Edson Passos 2a65295e8b Finalized ranks with permissions
Closes #544

Fixed config resetting. Closes #564
2020-04-10 01:37:07 -03:00
Edson Passos a7cb9ed171 Update pom.xml 2020-04-03 19:13:10 -03:00
RoinujNosde ac0a387198 Removed kdr-exempt from anyone.*
Closes #561
2020-04-02 07:35:59 -03:00
Edson Passos e3cd7d37a8 Merge pull request #559 from xtomyserrax/patch-1
Added check for null home on regroup
2020-03-31 07:58:22 -03:00
Edson Passos 63595258f4 Removed wrong message 2020-03-31 07:48:21 -03:00
xtomyserrax 0c866044df /clan home command fixes
- Fixes this error when there is no home set for the clan (I just copied and pasted the loc == null statement): https://pastebin.com/jiXneTvK

Also can you please fix this placeholder? I dont want to touch anything there as maybe it breaks some stuff or it meant to be something: https://imgur.com/a/KWPDTk7
It says: "Clan home-base set to: {0}" + Location. I guess the 0 meant to be the location? Maybe adding a replace would fix it, unless the idea was to make something else.

Thanks for the awesome plugin and sorry for making another merge for the same, I just noticed it! 

Also another idea, what if instead of saying Insufficient Permission when you write a command wrongly it sends a usage message? For example, if I type /clan home tp, I get a no permission message, if I write /clan home tp test, then I go to the home of test clan. 

Thanks!
2020-03-30 22:45:34 -03:00
Edson Passos 2217efa8a7 Merge pull request #558 from xtomyserrax/patch-1
Fix bypassing /clan home regroup
2020-03-30 21:22:49 -03:00
xtomyserrax df97e43c4d Fix bypassing /clan home regroup
Clan members can use /clan home regroup without being leaders and also without having the permission simpleclans.leader.home-regroup

Just added a return statement to both conditionals.
2020-03-30 21:05:03 -03:00
RoinujNosde 169b44e793 Added permission for using colors/formats on setrank
Closes #548
2020-03-26 20:19:45 -03:00
RoinujNosde f2303c5336 Allow server owners to edit the time to collect member fee and upkeep
Closes #543
2020-03-25 20:13:35 -03:00
RoinujNosde af8cd133c2 Added permission to prevent the player's kdr from being affected
Closes #549
2020-03-21 23:48:52 -03:00
RoinujNosde fa66424402 Prevents code &k to transform the spaces between columns on clan roster
Closes #554
2020-03-21 23:31:12 -03:00
RoinujNosde 2727203bed Fixed spy chat and banned list
- The remaining chat codes (k, m, n, o, r) are now stripped from the Spy
Chat messages. Closes #550
- The banned players list is now saved to the config. Closes #546
2020-02-07 19:48:26 -03:00
RoinujNosde eedc743d5b Created a full PT-BR language file 2019-09-20 22:07:49 -03:00
RoinujNosde 4e12e4d6f5 KDR grinding prevention
Added two ways to prevent players from grinding KDR. Closes #276
When a player joins a clan, they automatically receive the
"group.tagname permission". Closes #541
Removed the usage of SimpleClans#hasUUID()
2019-09-20 20:40:11 -03:00
RoinujNosde 32855c2611 Fixed database not being loaded #542 2019-09-10 21:34:08 -03:00
RoboMWM d7118aea82 Updated Bukkit dependency to 1.13
Now the plugin supports 1.13 and 1.14
2019-09-08 09:41:16 -03:00
RoinujNosde f472432eb6 Rejoin, clan list and member fee improved
- Cooldown on rejoining clans added. Closes #280
- You can now sort the clan list by name, size, etc. Closes #530
- Added a permission to bypass the member fee. Closes #540
2019-09-06 20:15:59 -03:00
RoinujNosde e07c8a9343 Updating download link 2019-08-26 22:02:05 -03:00
RoinujNosde b84e46d156 Clans can now have a description
It can be changed using the /clan description command
Its max and min length can be set in the config

Closes #537
2019-08-26 21:55:02 -03:00
RoinujNosde daba767a5a Charge upkeep if member fee is enabled
Closes #539
2019-08-26 19:27:25 -03:00
RoinujNosde e59a760776 Upkeep system implemented
Closes #524
2019-08-25 17:14:39 -03:00
RoinujNosde 6aa30a5d2d Closes #535 2019-08-14 19:42:29 -03:00
455 changed files with 58874 additions and 18222 deletions

No files matched your search

+1
View File
@@ -0,0 +1 @@
.gitea/CODEOWNERS linguist-detectable=false
+3
View File
@@ -0,0 +1,3 @@
# Pull requests request review from the eligible staff team(s).
# One approval from either an Admin or Developer satisfies branch protection.
* @trueog/Admins @trueog/Developers
+11 -3
View File
@@ -1,3 +1,11 @@
/target/
/.idea/
SimpleClans.iml
.idea/
bin/
.classpath
.project
*.jar
build/
.gradle/
.settings
.factorypath
SimpleClans.iml
/unions.txt
+6
View File
@@ -0,0 +1,6 @@
[submodule "libs/Utilities-OG"]
path = libs/Utilities-OG
url = https://git.trueog.net/trueog/Utilities-OG
[submodule "libs/DiamondBank-OG"]
path = libs/DiamondBank-OG
url = https://git.trueog.net/trueog/DiamondBank-OG
-19
View File
@@ -1,19 +0,0 @@
# Use https://travis-ci.org/ for automatic testing
# This is a java project
language: java
script: mvn install
jdk: [openjdk8]
# if one build failed, exit testing
matrix:
fast_finish: true
# Disable caching in order to get notified if there are some repo/dependency issues
## Cache maven dependencies
#sudo: false
#cache:
# directories:
# - '$HOME/.m2/repository'
+126
View File
@@ -0,0 +1,126 @@
# Unions-OG Changelog
This changelog records only changes made by the Unions-OG soft fork relative
to upstream [SimpleClans](https://github.com/RoinujNosde/SimpleClans). Changes
inherited unchanged from SimpleClans are intentionally omitted.
## [2.5.1] - 2026-08-15
- Inactivity purges removed. Unions and player data are no longer deleted on startup.
## [2.5] - 2026-08-13
### Added
- Clickable chat buttons for request responses. Accept and deny regroup requests
now display green `[ACCEPT]` and red `[DENY]` buttons in chat that players can
click instead of typing commands. Hover text explains each button's action.
Command-based responses still work for full backward compatibility.
- Adventure/MiniMessage dependency for rich text rendering and interactive chat
components.
- Fix union commands and help menu
## [2.4] - 2026-08-10
### Added
- Unions decide by member vote. `disband`, `home set` and `war start` now open
a proposal that passes when half the members are in favour, is rejected once
half becomes unreachable, and expires after 7 days. Votes are stored in the
database, so members can vote when they next log in.
- `/union vote` shows the open proposal and its tally; `/union vote yes|no`
casts a vote. A vote screen in the GUI does the same, and is shown once on
login to members who have not voted.
- Disbanding a union splits its bank evenly between all members. Inert until
union bank accounts are enabled.
- `/clan`, `/clans`, `/factions`, `/guilds`, `/party`, `/tribe`, `/nation`,
`/crew`, `/squad` and `/gang` tell the player to use `/union` instead.
`/f`, `/faction` and `/guild` are left to Utilities-OG.
### Changed
- Unions are flat. Every union command is member-level, and the three actions
above are the only ones needing more than one member's say-so.
- Folded `unionsog.leader.*` into `unionsog.member.*`, which is granted by
default. Union ally management is `unionsog.member.ally-set` and union
friendly fire is `unionsog.member.union-ff`, to avoid clashing with the
existing ally-chat and personal-friendly-fire nodes.
- Renamed clan to union across the API, config sections and message keys:
`Clan` is `Union`, `clan:` is `union:`, `clanchat:` is `unionchat:`.
Database identifiers and PlaceholderAPI placeholder names deliberately keep
their `clan` spelling.
- Renamed `/union clanff` to `/union unionff`.
- Chat and display formats accept `{union}`; `{clan}` still works.
- A union now ends with its last member.
- `/union war start` no longer asks the target union, so the member-count
guard always applies. Removed `war-and-protection.war-start.request-enabled`.
- Inter-union requests are answered by the first member of the asked union
rather than by its leaders.
- Set the union GUI title to "Union Management".
### Removed
- Ranks, promotion and demotion, with their commands, settings, events and GUI
screens.
- The leader role: no leader flag, leader-only command, tag colour, Discord
role or `sc_leader` LuckPerms group. The `sc_players.leader` column is kept
and always written `0` for data compatibility.
- The leaders-only land creation option.
- The in-game Crowdin translation prompts.
### Fixed
- `/union lookup` and `/union profile` no longer print a literal
`%player_rank%` or `%clan_leaders%`.
- Removed a stale `%rank%` token from the default chat formats.
- `/union unionff block` now requires union membership, matching
`/union unionff allow`.
- The legacy database importer no longer reads or writes leader relationships.
## [2.3] - Initial release
### Added
- `/union` and `/unions` as primary command aliases, keeping `/clan` and
`/clans`.
- `/u [message]` for union chat. Running `/u` alone toggles the channel.
- `/union color <color>` with named, legacy and hex color support.
- `simpleunions` PlaceholderAPI aliases alongside the legacy `simpleclans`
identifier, plus MiniPlaceholders support through Utilities-OG.
- A Union Banking preview in the main GUI.
- A configuration-gated legacy database migration from `unions_parties` and
`unions_players`. It never touches the source tables, requires empty
transactional destinations, is idempotent, and aborts startup on failure so
the server cannot run on partially migrated data.
### Changed
- Renamed the plugin and artifact to Unions-OG, moved the namespace to
`net.trueog.unionsog` and permission nodes to `unionsog.*`.
- Replaced Vault with DiamondBank-OG and its shard-based balances. Legacy
Vault-denominated union balances are zeroed once. Union-bank commands are
disabled until DiamondBank-OG provides union-owned accounts.
- Unions are treated as verified without the upstream verification workflow.
- Reserved `None` as a union name or tag, and made the no-union color-tag
placeholder return a stable `&8None`.
- Bulletin-board messages no longer show on login by default.
- Reordered the main GUI around the union overview, banking preview, lists,
leaderboards and administrative tools.
- Replaced the WorldGuard 6 reflection provider with the WorldEdit and
WorldGuard 7 APIs.
- Updated MySQL driver loading for Connector/J 8, MariaDB and JDBC service
discovery.
- Migrated the build from Maven to Gradle with a Java 17 toolchain,
reproducible shaded jars, and the Utilities-OG and DiamondBank-OG submodules.
### Removed
- The Vault dependency, along with the member-fee and upkeep tasks it backed.
- The legacy WorldGuard 6 provider.
- bStats telemetry.
## Fork baseline
The fork last merged upstream SimpleClans history through commit `0406c61b`
on 2026-03-30. Earlier SimpleClans release history belongs to the upstream
project.
+674
View File
@@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.
+140 -15
View File
@@ -1,15 +1,140 @@
SimpleClans
==========
Full featured clan system for PVP Minecraft Servers
[![Build Status](https://travis-ci.org/marcelo-mason/SimpleClans.svg)](https://travis-ci.org/marcelo-mason/SimpleClans)
[![Download](https://img.shields.io/badge/snapshot-download-blue.svg)](https://github.com/marcelo-mason/SimpleClans/releases/latest)
[![Issues](https://img.shields.io/github/issues/marcelo-mason/SimpleClans.svg)](https://github.com/marcelo-mason/SimpleClans/issues)
[![ghit.me](https://ghit.me/badge.svg?repo=marcelo-mason/SimpleClans)](https://ghit.me/repo/marcelo-mason/SimpleClans)
## Disclaimer:
Active development for this plugin has stopped. It is in maintenance mode and will continue to be kept up to date as-is with any new Minecraft version indefinitely.
Pull-requests for bug fixes or new features are welcomed and will be merged in if they do not break existing functionalities.
![Unions-OG Logo](https://i.imgur.com/9vgfVdX.png)
# Unions-OG
A full-featured union system for PvP Minecraft servers.
> [!IMPORTANT]
> Unions-OG is an unofficial soft fork of
> [SimpleClans](https://github.com/RoinujNosde/SimpleClans), maintained for the
> TrueOG Network. Upstream behavior is retained where practical, while
> branding, integrations, and selected gameplay behavior intentionally differ.
Current fork version: **2.4**
- [Fork-only changelog](CHANGELOG.md)
- [PlaceholderAPI and MiniPlaceholders reference](placeholder-info.txt)
- [Upstream SimpleClans project](https://github.com/RoinujNosde/SimpleClans)
## Main fork differences
### Flat unions
Unions have no internal hierarchy. Ranks, promotion, demotion and the leader
role itself were removed, so every member holds the same powers.
- Every union command is member-level. There is no leader flag, no rank
system, and no way to grant one member authority over another.
- A union ends with its last member: resigning, or being kicked or moved out
as the only member, disbands it.
### Decisions by member consensus
Three actions need a vote of the union's own members instead of a leader's
say-so: **disband**, **home set**, and **war start**.
- A proposal passes as soon as half the members (rounded up) vote in favour,
and is rejected as soon as enough vote against that half can no longer be
reached.
- Votes are stored in the database, so a member who is offline when a
proposal opens can still vote the next time they log in. Proposals expire
after 7 days.
- A union can only have one proposal open at a time.
- Members vote with `/union vote yes|no`, or by clicking the vote buttons in
the union GUI. The GUI is presented once on login to members who have not
voted yet.
- `/union vote` on its own shows the open proposal and the running tally.
### Other differences
- Uses Unions-OG branding and union terminology throughout, including config
sections (`union:`, `unionchat:`) and message keys.
- Provides `/union` and `/unions`. Other group words — `/clan`, `/clans`,
`/factions`, `/guilds`, `/party`, `/tribe`, `/nation`, `/crew`, `/squad` and
`/gang` — are registered as signposts that tell the player to run the same command with
`/union` instead. `/f`, `/faction` and `/guild` belong to Utilities-OG,
which already redirects them.
- Uses `/u` for union chat; a bare `/u` toggles the union-chat channel.
- Adds `/union rename <name>` and `/union color <color>`, both open to any
member.
- Union-wide friendly fire is `/union unionff allow|block`, aliased as
`/union pvp on|off`. The per-player friendly fire opt-in (`/union ff`)
is removed, so friendly fire is decided only by the union setting or the
staff-wide `globalff` override.
- Supports both `simpleclans` and `simpleunions` placeholder identifiers in
PlaceholderAPI and MiniPlaceholders.
- Uses DiamondBank-OG instead of Vault for player economy access. Union-owned
bank accounts remain under development, so their commands are currently
disabled. Once enabled, disbanding a union splits its bank evenly between
all members.
- Treats unions as verified without requiring the upstream verification
workflow.
- Includes a configuration-gated, transactional importer for the legacy
unions database.
See the [changelog](CHANGELOG.md) for the complete list of changes maintained
by this fork. Upstream SimpleClans changes are intentionally not repeated
there.
## Documentation
The [Unions-OG wiki](wiki/) documents this fork, and is the reference to use.
- [Commands](wiki/commands-and-permissions/commands.md)
- [Permissions](wiki/commands-and-permissions/permissions.md)
- [Proposals and Voting](wiki/commands-and-permissions/proposals-and-voting.md)
- [Union Alliances and Rivalries](wiki/commands-and-permissions/alliances-and-rivalries.md)
- [Configuration](wiki/how-to-setup/configuration.md)
- [PlaceholderAPI Support](wiki/other/placeholderapi-support.md)
- [API example](wiki/other/unions-og-api.md)
> [!WARNING]
> The [upstream SimpleClans documentation](https://simpleclans.gitbook.io/simpleclans/)
> no longer describes this fork. Its pages on leaders, ranks, promotion,
> demotion, member fees and upkeep do **not** apply, and its command,
> permission and configuration names have all been renamed here.
For the unmodified upstream plugin and its public releases, use the
[SimpleClans Spigot page](https://www.spigotmc.org/resources/simpleclans.71242/).
That download is not an Unions-OG build.
## Building
The build requires Java 17. Clone with submodules, then run:
```bash
git submodule update --init --recursive
./gradlew build
```
The shaded plugin is produced under `build/libs/` with the
`Unions-OG-2.4.jar` name.
## Developer compatibility
- Java and Gradle namespace: `net.trueog.unionsog`
- Bukkit main class: `net.trueog.unionsog.UnionsOG`
- API types use union naming: `Union`, `UnionPlayer`, `UnionManager`,
`Proposal`, `DisbandUnionEvent`
- Permission prefix: `unionsog.*`. Union actions all live under
`unionsog.member.*`, which is granted by default; there is no
`unionsog.leader.*` tree
- Command aliases: `union` and `unions`. Other group words are redirect-only
signposts, not aliases, and never execute a union command
- Placeholder identifiers: `simpleunions` and the retained `simpleclans`
compatibility identifier. Placeholder **names** deliberately keep their
upstream `clan` spelling (`%simpleunions_clan_name%`) so existing setups
keep resolving
- Database identifiers are unchanged for live-data compatibility: the table
prefix stays `sc_`, and the `clans` table and `leader` column are retained
even though the leader column is no longer used
- Chat and display formats accept `{union}`; the legacy `{clan}` token still
works
The old SimpleClans Maven coordinates and Java packages do not describe this
fork and should not be used as Unions-OG API coordinates.
## Credits and license
Unions-OG is derived from SimpleClans by its original and upstream
contributors. This fork remains licensed under the [GNU GPL v3](LICENSE).
-28
View File
@@ -1,28 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.bukkit:bukkit:1.9-R0.1-SNAPSHOT" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: commons-lang:commons-lang:2.6" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.googlecode.json-simple:json-simple:1.1.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: junit:junit:4.10" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.hamcrest:hamcrest-core:1.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.guava:guava:17.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.code.gson:gson:2.2.4" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.avaje:ebean:2.8.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: javax.persistence:persistence-api:1.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.yaml:snakeyaml:1.15" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.milkbowl.vault:VaultAPI:1.4" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.nijikokun.bukkit:Permissions:2.7.4" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.sacredlabyrinth.Phaed:PreciousStones:9.7.0" level="project" />
<orderEntry type="library" name="Maven: org.getspout:spoutplugin:dev-SNAPSHOT" level="project" />
</component>
</module>
File diff suppressed because it is too large. Load diff
Executable
+4
View File
@@ -0,0 +1,4 @@
#!/usr/bin/bash
# Fetch all submodule content.
git submodule update --force --recursive --init
+181
View File
@@ -0,0 +1,181 @@
import org.gradle.kotlin.dsl.provideDelegate
/* ------------------------------ Plugins ------------------------------ */
plugins {
id("java") // Import Java plugin.
id("java-library") // Import Java Library plugin.
id("com.diffplug.spotless") version "8.1.0" // Import Spotless plugin.
id("com.gradleup.shadow") version "8.3.9" // Import Shadow plugin.
id("checkstyle") // Import Checkstyle plugin.
eclipse // Import Eclipse plugin.
kotlin("jvm") version "2.1.21" // Import Kotlin JVM plugin.
}
extra["kotlinAttribute"] = Attribute.of("kotlin-tag", Boolean::class.javaObjectType)
val kotlinAttribute: Attribute<Boolean> by rootProject.extra
/* --------------------------- JDK / Kotlin ---------------------------- */
java {
sourceCompatibility = JavaVersion.VERSION_17 // Compile with JDK 17 compatibility.
toolchain { // Select Java toolchain.
languageVersion.set(JavaLanguageVersion.of(17)) // Use JDK 17.
vendor.set(JvmVendorSpec.GRAAL_VM) // Use GraalVM CE.
}
}
kotlin { jvmToolchain(17) }
/* ----------------------------- Metadata ------------------------------ */
group = "net.trueog.unionsog" // Declare bundle identifier.
version = "2.5.1" // Declare plugin version (will be in .jar).
val apiVersion = "1.19" // Declare minecraft server target version.
/* ----------------------------- Resources ----------------------------- */
tasks.named<ProcessResources>("processResources") {
val props = mapOf("version" to version, "apiVersion" to apiVersion)
inputs.properties(props) // Indicates to rerun if version changes.
filesMatching("plugin.yml") { expand(props) }
from("LICENSE") { into("/") } // Bundle licenses into jarfiles.
}
/* ---------------------------- Repos ---------------------------------- */
repositories {
mavenCentral() // Import the Maven Central Maven Repository.
gradlePluginPortal() // Import the Gradle Plugin Portal Maven Repository.
maven { url = uri("https://repo.purpurmc.org/snapshots") } // Import the PurpurMC Maven Repository.
maven { url = uri("https://hub.spigotmc.org/nexus/content/repositories/snapshots/") }
maven { url = uri("https://repo.extendedclip.com/content/repositories/placeholderapi/") }
maven { url = uri("https://repo.codemc.org/repository/maven-public") }
maven { url = uri("https://repo.papermc.io/repository/maven-public/") }
maven { url = uri("https://repo.aikar.co/content/groups/aikar/") }
maven { url = uri("https://maven.enginehub.org/repo/") }
maven { url = uri("https://nexus.scarsz.me/content/groups/public/") }
maven { url = uri("https://eldonexus.de/repository/maven-public") }
maven { url = uri("https://jitpack.io") }
maven { url = uri("file://${System.getProperty("user.home")}/.m2/repository") }
System.getProperty("SELF_MAVEN_LOCAL_REPO")?.let {
val dir = file(it)
if (dir.isDirectory) {
println("Using SELF_MAVEN_LOCAL_REPO at: $it")
maven { url = uri("file://${dir.absolutePath}") }
} else {
logger.error("TrueOG Bootstrap not found, defaulting to ~/.m2 for mavenLocal()")
mavenLocal()
}
} ?: logger.error("TrueOG Bootstrap not found, defaulting to ~/.m2 for mavenLocal()")
}
/* ---------------------- Java project deps ---------------------------- */
dependencies {
compileOnly("org.purpurmc.purpur:purpur-api:1.19.4-R0.1-SNAPSHOT")
compileOnly("net.luckperms:api:5.5") // Import LuckPerms API.
compileOnlyApi(project(":libs:Utilities-OG")) // Import TrueOG Network Utilities-OG Java API (from source).
compileOnlyApi(project(":libs:DiamondBank-OG")) {
attributes { attribute(kotlinAttribute, true) }
} // Import TrueOG network DiamondBank-OG Kotlin API (from source).
compileOnly("me.clip:placeholderapi:2.11.3")
compileOnly("org.jetbrains:annotations:24.0.1")
implementation("io.papermc:paperlib:1.0.8-SNAPSHOT")
implementation("net.kyori:adventure-api:4.14.0")
implementation("net.kyori:adventure-text-minimessage:4.14.0")
implementation("net.kyori:adventure-platform-bukkit:4.3.0")
implementation("co.aikar:acf-paper:0.5.1-SNAPSHOT")
implementation("com.github.cryptomorin:XSeries:11.2.0.1")
compileOnly("com.sk89q.worldedit:worldedit-bukkit:7.3.0-SNAPSHOT") { isTransitive = false }
compileOnly("com.sk89q.worldedit:worldedit-core:7.3.0-SNAPSHOT") { isTransitive = false }
compileOnly("com.sk89q.worldguard:worldguard-bukkit:7.0.8") { isTransitive = false }
compileOnly("com.sk89q.worldguard:worldguard-core:7.0.8") { isTransitive = false }
compileOnly("com.github.TechFortress:GriefPrevention:17.0.0")
compileOnly("com.discordsrv:discordsrv:1.28.0")
implementation("com.google.code.gson:gson:2.10.1")
testImplementation("org.purpurmc.purpur:purpur-api:1.19.4-R0.1-SNAPSHOT")
testImplementation("org.junit.jupiter:junit-jupiter-api:5.11.3")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.11.3")
testImplementation("org.junit.jupiter:junit-jupiter-params:5.11.3")
testImplementation("org.mockito:mockito-core:5.14.2")
testImplementation("org.mockito:mockito-junit-jupiter:5.14.2")
testImplementation("com.h2database:h2:2.3.232")
}
apply(from = "eclipse.gradle.kts") // Import eclipse classpath support script.
/* ---------------------- Reproducible jars ---------------------------- */
tasks.withType<AbstractArchiveTask>().configureEach { // Ensure reproducible .jars
isPreserveFileTimestamps = false
isReproducibleFileOrder = true
}
/* ----------------------------- Shadow -------------------------------- */
tasks.shadowJar {
relocate("io.papermc.lib", "net.trueog.unionsog.paperlib")
relocate("co.aikar.commands", "net.trueog.unionsog.acf")
relocate("co.aikar.locales", "net.trueog.unionsog.locales")
relocate("com.cryptomorin.xseries", "net.trueog.unionsog.xseries")
relocate("com.google.gson", "net.trueog.unionsog.gson")
dependencies { exclude(dependency("org.jetbrains:annotations:.*")) }
archiveBaseName.set("Unions-OG")
archiveClassifier.set("")
}
tasks.jar { archiveClassifier.set("part") } // Applies to root jarfile only.
tasks.build { dependsOn(tasks.spotlessApply, tasks.shadowJar, tasks.javadoc) } // Build depends on spotless and shadow.
/* --------------------------- Javac opts ------------------------------- */
tasks.withType<JavaCompile>().configureEach {
options.compilerArgs.add("-parameters") // Enable reflection for java code.
options.isFork = true // Run javac in its own process.
options.compilerArgs.add("-Xlint:deprecation") // Trigger deprecation warning messages.
options.encoding = "UTF-8" // Use UTF-8 file encoding.
}
tasks.test { useJUnitPlatform() }
/* ----------------------------- Auto Formatting ------------------------ */
spotless {
java {
eclipse().configFile("config/formatter/eclipse-java-formatter.xml") // Eclipse java formatting.
leadingTabsToSpaces() // Convert leftover leading tabs to spaces.
removeUnusedImports() // Remove imports that aren't being called.
}
kotlinGradle {
ktfmt().kotlinlangStyle().configure { it.setMaxWidth(120) } // JetBrains Kotlin formatting.
target("build.gradle.kts", "settings.gradle.kts") // Gradle files to format.
}
}
checkstyle {
toolVersion = "10.18.1" // Declare checkstyle version to use.
configFile = file("config/checkstyle/checkstyle.xml") // Point checkstyle to config file.
isIgnoreFailures = true // Don't fail the build if checkstyle does not pass.
isShowViolations = true // Show the violations in any IDE with the checkstyle plugin.
}
tasks.named("compileJava") {
dependsOn("spotlessApply") // Run spotless before compiling with the JDK.
}
tasks.named("spotlessCheck") {
dependsOn("spotlessApply") // Run spotless before checking if spotless ran.
}
/* ------------------------------ Eclipse SHIM ------------------------- */
// This can't be put in eclipse.gradle.kts because Gradle is weird.
subprojects {
apply(plugin = "java-library")
apply(plugin = "eclipse")
eclipse.project.name = "${project.name}-${rootProject.name}"
tasks.withType<Jar>().configureEach { archiveBaseName.set("${project.name}-${rootProject.name}") }
}
tasks.register<Copy>("copyToTestServer") {
val out = System.getenv("TEST_SERVER")?.let { file("$it/plugins") }
onlyIf { out != null }
dependsOn(tasks.shadowJar)
from(tasks.shadowJar)
into(out ?: layout.buildDirectory.dir("noop").get().asFile)
}
+11
View File
@@ -0,0 +1,11 @@
<root>
<item name='co.aikar.commands.BukkitCommandCompletionContext org.bukkit.entity.Player getPlayer()'>
<annotation name='org.jetbrains.annotations.Nullable'/>
</item>
<item name='co.aikar.commands.BukkitCommandExecutionContext org.bukkit.entity.Player getPlayer()'>
<annotation name='org.jetbrains.annotations.Nullable'/>
</item>
<item name='co.aikar.commands.BukkitCommandIssuer org.bukkit.entity.Player getPlayer()'>
<annotation name='org.jetbrains.annotations.Nullable'/>
</item>
</root>
+34
View File
@@ -0,0 +1,34 @@
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
"https://checkstyle.org/dtds/configuration_1_3.dtd">
<module name="Checker">
<module name="FileTabCharacter">
<property name="eachLine" value="true"/>
<property name="severity" value="error"/>
</module>
<module name="TreeWalker">
<module name="FinalLocalVariable"/>
<module name="AvoidStarImport"/>
<module name="Indentation">
<property name="severity" value="ignore"/>
</module>
</module>
<module name="RegexpSingleline">
<property name="format" value="\borg\.junit\.jupiter\.api\.Assertions\.fail\s*\(\s*&quot;Not yet implemented&quot;\s*\)\s*;"/>
<property name="message" value="Remove placeholder fail() and implement the test."/>
<property name="ignoreCase" value="true"/>
<property name="severity" value="warning"/>
</module>
<module name="RegexpSingleline">
<property name="format" value="(?&lt;!\w)fail\s*\(\s*&quot;Not yet implemented&quot;\s*\)\s*;"/>
<property name="message" value="Remove placeholder fail() and implement the test."/>
<property name="severity" value="warning"/>
</module>
</module>
+404
View File
@@ -0,0 +1,404 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<profiles version="23">
<profile kind="CodeFormatterProfile" name="TrueOG Network Formatting" version="23">
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.align_with_spaces" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="2"/>
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_before_code_block" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_switch_case_expressions" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.enabling_tag" value="@formatter:on"/>
<setting id="org.eclipse.jdt.core.formatter.comment.count_line_length_from_starting_position" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_record_components" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_logical_operator" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_annotation_declaration_on_one_line" value="one_line_never"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_record_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_abstract_method" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.keep_enum_constant_declaration_on_one_line" value="one_line_never"/>
<setting id="org.eclipse.jdt.core.formatter.align_variable_declarations_on_columns" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.keep_anonymous_type_declaration_on_one_line" value="one_line_never"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_switch_case_expressions" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_before_shift_operator" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="next_line_on_wrap"/>
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_code_block" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_bitwise_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_type_parameters" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_loops" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.keep_simple_for_body_on_same_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_before_switch_case_arrow_operator" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_enum_constant" value="49"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.text_block_indentation" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_module_statements" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.align_tags_names_descriptions" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_if_then_body_block_on_one_line" value="one_line_never"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.align_assignment_statements_on_columns" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_permitted_types" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value="next_line_on_wrap"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression_chain" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_type_annotations" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_before_assertion_message_operator" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_method_declaration" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines" value="2147483647"/>
<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value="next_line_on_wrap"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_resources_in_try" value="80"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_not_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.indent_empty_lines" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_type_arguments" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_package" value="49"/>
<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_label" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_case" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_permitted_types_in_type_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_record_header" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.comment.javadoc_do_not_separate_block_tags" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.indent_tag_description" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_record_constructor" value="next_line_on_wrap"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_string_concatenation" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value="next_line_on_wrap"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_shift_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_shift_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_simple_do_while_body_on_same_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_record_components" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_before_additive_operator" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.keep_simple_getter_setter_on_one_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case_after_arrow" value="next_line_on_wrap"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.join_lines_in_comments" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_record_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_relational_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_logical_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_record_declaration" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_default" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.disabling_tag" value="@formatter:off"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_method_body" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_case" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.keep_switch_body_block_on_one_line" value="one_line_never"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="next_line_on_wrap"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_switch_case_with_arrow" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.align_tags_descriptions_grouped" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="80"/>
<setting id="org.eclipse.jdt.core.formatter.use_on_off_tags" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.keep_method_body_on_one_line" value="one_line_never"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_loop_body_block_on_one_line" value="one_line_never"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="next_line_on_wrap"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_type_declaration_on_one_line" value="one_line_never"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_additive_operator" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_record_constructor" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_relational_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_record_declaration_on_one_line" value="one_line_never"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="next_line_on_wrap"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_lambda_body" value="next_line_on_wrap"/>
<setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_parameter" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_relational_operator" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.align_arrows_in_switch_on_columns" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_additive_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.format_line_comments" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.align_selector_in_method_invocation_on_expression_first_line" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_record_declaration" value="next_line_on_wrap"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_switch_case_with_arrow_on_one_line" value="one_line_never"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_switch_case_with_colon" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_after_code_block" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value="80"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_type" value="49"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_local_variable" value="49"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="next_line_on_wrap"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_default" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_between_different_tags" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_additive_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.join_wrapped_lines" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_field" value="49"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_before_conditional_operator" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.join_line_comments" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_shift_operator" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.keep_code_block_on_one_line" value="one_line_never"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_record_components" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="4"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_bitwise_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value="2"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_record_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_before_assignment_operator" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="next_line_on_wrap"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_switch_case_with_arrow" value="20"/>
<setting id="org.eclipse.jdt.core.formatter.keep_lambda_body_block_on_one_line" value="one_line_never"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_method" value="49"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_record_constructor_on_one_line" value="one_line_never"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_record_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_assertion_message" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_logical_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_record_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_before_relational_operator" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_last_class_body_declaration" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.keep_simple_while_body_on_same_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_before_logical_operator" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_statement_group_in_switch" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_permitted_types" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_enum_declaration_on_one_line" value="one_line_never"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="next_line_on_wrap"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="next_line_on_wrap"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_code_block" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="space"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_before_string_concatenation" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="120"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/>
</profile>
</profiles>
+7
View File
@@ -0,0 +1,7 @@
pull_request_title: "feat(lang): new crowdin updates"
pull_request_labels: ["l10n"]
commit_message: "feat(lang): new translations for %language%"
append_commit_message: false
files:
- source: src/main/resources/messages.properties
translation: /src/main/resources/%file_name%_%locale_with_underscore%.%file_extension%
+151
View File
@@ -0,0 +1,151 @@
/* This is free and unencumbered software released into the public domain */
import org.gradle.plugins.ide.eclipse.model.EclipseModel
import java.nio.file.Files
import javax.xml.parsers.DocumentBuilderFactory
import javax.xml.transform.OutputKeys
import javax.xml.transform.TransformerFactory
import javax.xml.transform.dom.DOMSource
import javax.xml.transform.stream.StreamResult
val kotlinAttribute: Attribute<Boolean> by rootProject.extra
val kotlinPluginProjects = configurations
.getByName("compileClasspath")
.allDependencies
.filterIsInstance<ProjectDependency>()
.filter { it -> it.attributes.getAttribute(kotlinAttribute) != null }
.map { it.path }
kotlinPluginProjects.forEach { evaluationDependsOn(it) }
val ideLibs: Configuration by
configurations.creating {
isCanBeResolved = true
isCanBeConsumed = false
}
configure<EclipseModel> {
project {
name = "Template-OG-Plugin"
}
classpath {
plusConfigurations.add(ideLibs)
}
}
val ideLibDir = layout.buildDirectory.dir("ide-libs")
val hashRegex = Regex("-[0-9a-fA-F]{10}(?=\\.jar$)") // Black magic.
val copyTasks = mutableListOf<TaskProvider<Copy>>()
kotlinPluginProjects.forEach { path ->
val sub = project(path)
val shadowJarProv = sub.tasks.named("shadowJar")
val copyTask =
tasks.register<Copy>("ideCopy${sub.name.replaceFirstChar(Char::titlecase)}") {
dependsOn(shadowJarProv)
from(shadowJarProv)
into(ideLibDir)
rename { it.replace(hashRegex, "") } // Remove git commit hash from jarfile.
}
copyTasks += copyTask
}
/* Ensure the jars exist before .classpath is generated */
tasks.named("eclipseClasspath").configure { dependsOn(copyTasks) }
/* Supply those jars to the ideLibs configuration (after evaluation) */
afterEvaluate { dependencies { add("ideLibs", fileTree(ideLibDir) { include("*.jar") }) } }
val injectIdeLibs =
tasks.register("injectIdeLibs") {
dependsOn("eclipse") // run after all eclipse files are generated
doLast {
val cpFile = file(".classpath")
if (!cpFile.exists()) return@doLast
val jars = fileTree(ideLibDir.get()) { include("*.jar") }.files.sortedBy { it.name }
if (jars.isEmpty()) return@doLast
// Parse DOM
val dbf = DocumentBuilderFactory.newInstance()
val doc = dbf.newDocumentBuilder().parse(cpFile)
val root = doc.documentElement
// Helper to see if an entry already exists
fun exists(path: String): Boolean =
root.getElementsByTagName("classpathentry").let { list ->
(0 until list.length).any { i ->
val n = list.item(i)
val kind = n.attributes?.getNamedItem("kind")?.nodeValue
val p = n.attributes?.getNamedItem("path")?.nodeValue
kind == "lib" && p == path
}
}
// Remove any entry that points to ide-libs dir (folder or jars) to avoid dupes
val toRemove = mutableListOf<org.w3c.dom.Node>()
val list = root.getElementsByTagName("classpathentry")
val dirPath = ideLibDir.get().asFile.absolutePath
for (i in 0 until list.length) {
val n = list.item(i)
val kind = n.attributes?.getNamedItem("kind")?.nodeValue
val p = n.attributes?.getNamedItem("path")?.nodeValue ?: ""
if (kind == "lib" && (p == dirPath || p.startsWith("$dirPath/"))) {
toRemove += n
}
}
toRemove.forEach { root.removeChild(it) }
// Append our jar entries LAST
jars.forEach { f ->
val abs = f.absolutePath
if (!exists(abs)) {
val entry = doc.createElement("classpathentry")
entry.setAttribute("kind", "lib")
entry.setAttribute("path", abs)
root.appendChild(entry)
}
}
// Write back pretty
val tf =
TransformerFactory.newInstance().newTransformer().apply {
setOutputProperty(OutputKeys.INDENT, "yes")
setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "1")
setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "no")
setOutputProperty(OutputKeys.ENCODING, "UTF-8")
}
Files.newBufferedWriter(cpFile.toPath()).use { w -> tf.transform(DOMSource(doc), StreamResult(w)) }
}
}
tasks.named("eclipse").configure { finalizedBy(injectIdeLibs) }
val eclipseModel = extensions.getByType<EclipseModel>()
fun Project.addResolvableEclipseConfigs() {
val jarAttr =
objects.named(org.gradle.api.attributes.LibraryElements::class, org.gradle.api.attributes.LibraryElements.JAR)
val apiAttr = objects.named(org.gradle.api.attributes.Usage::class, org.gradle.api.attributes.Usage.JAVA_API)
val compileOnlyRes =
configurations.create("eclipseCompileOnly") {
extendsFrom(configurations.getByName("compileOnly"))
isCanBeResolved = true
isCanBeConsumed = false
attributes.attribute(org.gradle.api.attributes.Usage.USAGE_ATTRIBUTE, apiAttr)
attributes.attribute(org.gradle.api.attributes.LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, jarAttr)
}
val compileOnlyApiRes =
configurations.create("eclipseCompileOnlyApi") {
extendsFrom(configurations.getByName("compileOnlyApi"))
isCanBeResolved = true
isCanBeConsumed = false
attributes.attribute(org.gradle.api.attributes.Usage.USAGE_ATTRIBUTE, apiAttr)
attributes.attribute(org.gradle.api.attributes.LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, jarAttr)
}
eclipseModel.classpath.plusConfigurations.addAll(listOf(compileOnlyRes, compileOnlyApiRes))
}
addResolvableEclipseConfigs()
+2
View File
@@ -0,0 +1,2 @@
org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=1024m -Dfile.encoding=UTF-8
Binary file not shown.
+7
View File
@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Vendored Executable
+251
View File
@@ -0,0 +1,251 @@
#!/bin/sh
#
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#
##############################################################################
#
# Gradle start up script for POSIX generated by Gradle.
#
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
app_path=$0
# Need this for daisy-chained symlinks.
while
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
[ -h "$app_path" ]
do
ls=$( ls -ld "$app_path" )
link=${ls#*' -> '}
case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
warn () {
echo "$*"
} >&2
die () {
echo
echo "$*"
echo
exit 1
} >&2
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "$( uname )" in #(
CYGWIN* ) cygwin=true ;; #(
Darwin* ) darwin=true ;; #(
MSYS* | MINGW* ) msys=true ;; #(
NONSTOP* ) nonstop=true ;;
esac
CLASSPATH="\\\"\\\""
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD=$JAVA_HOME/jre/sh/java
else
JAVACMD=$JAVA_HOME/bin/java
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD=java
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi
# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
fi
# Collect all arguments for the java command, stacking in reverse order:
# * args from the command line
# * the main class name
# * -classpath
# * -D...appname settings
# * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
JAVACMD=$( cygpath --unix "$JAVACMD" )
# Now convert the arguments - kludge to limit ourselves to /bin/sh
for arg do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ] ;; #(
*) false ;;
esac
then
arg=$( cygpath --path --ignore --mixed "$arg" )
fi
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift # remove old arg
set -- "$@" "$arg" # push replacement arg
done
fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
"$@"
# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'
exec "$JAVACMD" "$@"
Vendored
+94
View File
@@ -0,0 +1,94 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
:execute
@rem Setup the command line
set CLASSPATH=
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
:end
@rem End local scope for the variables with windows NT shell
if %ERRORLEVEL% equ 0 goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
Submodule libs/DiamondBank-OG added at 39d5a2b936.
+1
Submodule libs/Utilities-OG added at 8b5c86cc9c.
+7
View File
@@ -0,0 +1,7 @@
<root>
<item name='org.bukkit.configuration.MemorySection java.lang.String getString(java.lang.String, java.lang.String)'>
<annotation name='org.jetbrains.annotations.Contract'>
<val val="&quot;_, _ -&gt; !null&quot;"/>
</annotation>
</item>
</root>
+194
View File
@@ -0,0 +1,194 @@
Unions-OG Placeholder Reference
===============================
Unions-OG registers legacy PlaceholderAPI placeholders when PlaceholderAPI is installed.
It also registers MiniPlaceholders through the Utilities-OG API when Utilities-OG is installed.
Identifiers
-----------
All placeholders use both identifiers:
- simpleclans
- simpleunions
In the syntax patterns below, replace {id} with either identifier.
Legacy PlaceholderAPI syntax:
- Player placeholder: %{id}_{player-placeholder}%
- Union placeholder: %{id}_clan_{union-placeholder}%
- Union compatibility alias: %{id}_union_{union-placeholder}%
- Relational color placeholder: %rel_{id}_color%
MiniPlaceholders syntax:
- Player placeholder: <{id}_{player-placeholder}>
- Union placeholder: <{id}_clan_{union-placeholder}>
- Union compatibility alias: <{id}_union_{union-placeholder}>
- Relational color placeholder: <{id}_rel_color>
MiniPlaceholders are audience placeholders unless marked relational. They require a player audience.
Relational MiniPlaceholders require a relational MiniPlaceholders context.
Boolean output follows PlaceholderAPI's boolean.true and boolean.false config values when PlaceholderAPI is loaded.
Without PlaceholderAPI, boolean placeholders return yes or no.
Player Placeholders
-------------------
These resolve against the requested player:
- name
- clean_name
- lastseendays
- total_kills
- rival_kills
- civilian_kills
- neutral_kills
- ally_kills
- is_friendlyfire_on
- deaths
- weighted_kills
- kdr
- topplayers_position
- join_date
- lastseen
- inactive_days
- in_clan
- tag
- tag_label
- is_trusted
- is_member
- clanchat_player_color
- allychat_player_color
- is_bb_enabled
- is_invite_enabled
- is_tag_enabled
- is_muted
- is_mutedally
Player compatibility aliases:
- in_union maps to in_clan
- unionchat_player_color maps to clanchat_player_color
Examples:
- %simpleclans_name%
- %simpleunions_in_union%
- <simpleclans_name>
- <simpleunions_in_union>
Union Placeholders
------------------
These resolve against the requested player's union:
- name
- balance
- balance_formatted
- tag
- color
- inactivedays
- friendly_fire
- allies_count
- founded
- color_tag
- size
- rivals_count
- is_permanent
- onlinemembers_count
- total_kdr
- topclans_position
- total_deaths
- average_wk
- total_kills
- total_rival
- total_neutral
- total_civilian
- total_ally
- is_anyonline
- is_unrivable
- allow_withdraw
- allow_deposit
Union compatibility aliases:
- Use union_ instead of clan_ for any union placeholder.
- topunions_position maps to topclans_position.
Examples:
- %simpleclans_clan_name%
- %simpleclans_union_name%
- %simpleunions_clan_color_tag%
- %simpleunions_union_topunions_position%
- <simpleclans_clan_name>
- <simpleclans_union_name>
- <simpleunions_clan_color_tag>
- <simpleunions_union_topunions_position>
Top Player Placeholders
-----------------------
Legacy PlaceholderAPI syntax:
- %{id}_topplayers_{position}_{player-placeholder}%
MiniPlaceholders syntax:
- <{id}_topplayers_{player-placeholder}:{position}>
The {position} value is 1-based. The {player-placeholder} value can be any player placeholder or player compatibility alias listed above.
Examples:
- %simpleclans_topplayers_1_name%
- %simpleunions_topplayers_3_kdr%
- <simpleclans_topplayers_name:1>
- <simpleunions_topplayers_kdr:3>
Top Union Placeholders
----------------------
Legacy PlaceholderAPI syntax:
- %{id}_topclans_{position}_clan_{union-placeholder}%
- %{id}_topunions_{position}_union_{union-placeholder}%
MiniPlaceholders syntax:
- <{id}_topclans_clan_{union-placeholder}:{position}>
- <{id}_topunions_union_{union-placeholder}:{position}>
The {position} value is 1-based. The {union-placeholder} value can be any union placeholder or union compatibility alias listed above.
Examples:
- %simpleclans_topclans_1_clan_name%
- %simpleclans_topunions_1_union_name%
- %simpleunions_topclans_5_clan_total_kdr%
- <simpleclans_topclans_clan_name:1>
- <simpleclans_topunions_union_name:1>
- <simpleunions_topclans_clan_total_kdr:5>
Relational Color Placeholder
----------------------------
The relational color placeholder returns a color code based on the relationship between two players:
- same union: &a
- ally: &b
- rival: &c
- unrelated: empty string
Legacy PlaceholderAPI syntax:
- %rel_simpleclans_color%
- %rel_simpleunions_color%
MiniPlaceholders syntax:
- <simpleclans_rel_color>
- <simpleunions_rel_color>
-134
View File
@@ -1,134 +0,0 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>net.sacredlabyrinth.phaed.simpleclans</groupId>
<artifactId>SimpleClans</artifactId>
<version>2.7.19</version>
<name>SimpleClans</name>
<url>http://dev.bukkit.org/server-mods/simpleclans/</url>
<build>
<finalName>${project.name}</finalName>
<!-- Resources -->
<resources>
<resource>
<targetPath>.</targetPath>
<filtering>true</filtering>
<directory>${basedir}/src/main/resources</directory>
<includes>
<include>plugin.yml</include>
<include>config.yml</include>
<include>language.yml</include>
<include>language-br.yml</include>
<include>language-zh.yml</include>
</includes>
</resource>
</resources>
<!-- Plugins -->
<plugins>
<!-- Compilation plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<showDeprecation>true</showDeprecation>
<showWarnings>true</showWarnings>
<fork>true</fork>
</configuration>
</plugin>
<!-- JAR creation plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
</plugin>
<!-- Release plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.3.2</version>
</plugin>
</plugins>
</build>
<!-- Dependencies -->
<dependencies>
<dependency>
<groupId>com.destroystokyo.paper</groupId>
<artifactId>paper-api</artifactId>
<version>1.12.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>1.12-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>net.milkbowl.vault</groupId>
<artifactId>VaultAPI</artifactId>
<version>1.6</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1.1</version>
</dependency>
</dependencies>
<!-- Repositories -->
<repositories>
<repository>
<id>vault-repo</id>
<url>http://nexus.hc.to/content/repositories/pub_releases</url>
</repository>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
<repository>
<id>paper-repo</id>
<url>https://repo.destroystokyo.com/repository/maven-public/</url>
</repository>
</repositories>
<!-- GitHub/Jenkins -->
<ciManagement>
<system>jenkins</system>
<url>http://104.236.246.108:8080</url>
</ciManagement>
<scm>
<connection>scm:git:git:@github.com:marcelo-mason/SimpleClans.git</connection>
<developerConnection>scm:git:git:@github.com:marcelo-mason/SimpleClans.git</developerConnection>
<url>http://github.com/marcelo-mason/SimpleClans.git/tree/master/</url>
<tag>SimpleClans</tag>
</scm>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<!-- Upstream Distribution -->
<distributionManagement>
<repository>
<id>SacredCoding</id>
<name>SacredCoding-releases</name>
<url>http://104.236.246.108:8081/artifactory/plugins-release-local</url>
</repository>
<snapshotRepository>
<id>SacredCoding</id>
<name>SacredCoding-snapshots</name>
<url>http://104.236.246.108:8081/artifactory/plugins-release-local</url>
</snapshotRepository>
</distributionManagement>
</project>
+13
View File
@@ -0,0 +1,13 @@
rootProject.name = "Unions-OG"
ProcessBuilder("sh", "bootstrap.sh").directory(rootDir).inheritIO().start().let {
if (it.waitFor() != 0) throw GradleException("bootstrap.sh failed")
}
file("libs")
.listFiles()
?.filter { it.isDirectory && !it.name.startsWith(".") }
?.forEach { dir ->
include(":libs:${dir.name}")
project(":libs:${dir.name}").projectDir = dir
}
-3
View File
@@ -1,3 +0,0 @@
Manifest-Version: 1.0
Main-Class: net.sacredlabyrinth.phaed.simpleclans.SimpleClans
@@ -1,98 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans;
import net.sacredlabyrinth.phaed.simpleclans.managers.SettingsManager;
import org.bukkit.configuration.file.FileConfiguration;
/**
*
* @author RoinujNosde
*/
public class ChatFormatMigration {
SimpleClans plugin = SimpleClans.getInstance();
public void migrateClanChat() {
SettingsManager sm = plugin.getSettingsManager();
FileConfiguration c = sm.getConfig();
if (c.getString("clanchat.name-color") == null) {
return;
}
StringBuilder sb = new StringBuilder();
sb.append('&');
sb.append(sm.getClanChatBracketColor());
sb.append(sm.getClanChatTagBracketLeft());
sb.append("%clan%");
sb.append("&");
sb.append(sm.getClanChatBracketColor());
sb.append(sm.getClanChatTagBracketRight());
sb.append(" ");
sb.append('&');
sb.append(sm.getClanChatNameColor());
sb.append(sm.getClanChatPlayerBracketLeft());
sb.append("%nick-color%");
sb.append("%player%");
sb.append('&');
sb.append(sm.getClanChatNameColor());
sb.append(sm.getClanChatPlayerBracketRight());
sb.append(" %rank%: ");
sb.append('&');
sb.append(sm.getClanChatMessageColor());
sb.append("%message%");
c.set("clanchat.format", sb.toString());
c.set("clanchat.rank", "&f[%rank%&f]");
c.set("clanchat.rank.color", null);
c.set("clanchat.name-color", null);
c.set("clanchat.player-bracket", null);
c.set("clanchat.message-color", null);
c.set("clanchat.tag-bracket", null);
sm.save();
}
public void migrateAllyChat() {
SettingsManager sm = SimpleClans.getInstance().getSettingsManager();
FileConfiguration c = sm.getConfig();
//Checks if the old format is still in use
if (c.getString("allychat.tag-color") == null) {
return;
}
StringBuilder sb = new StringBuilder();
sb.append('&');
sb.append(sm.getAllyChatBracketColor());
sb.append(sm.getAllyChatTagBracketLeft());
sb.append('&');
sb.append(sm.getAllyChatTagColor());
sb.append(sm.getCommandAlly());
sb.append('&');
sb.append(sm.getAllyChatBracketColor());
sb.append(sm.getAllyChatTagBracketRight());
sb.append(" ");
sb.append("&4<%clan%&4> ");
sb.append('&');
sb.append(sm.getAllyChatBracketColor());
sb.append(sm.getAllyChatPlayerBracketLeft());
sb.append("%nick-color%");
sb.append("%player%");
sb.append('&');
sb.append(sm.getAllyChatBracketColor());
sb.append(sm.getAllyChatPlayerBracketRight());
sb.append(" %rank%: ");
sb.append('&');
sb.append(sm.getAllyChatMessageColor());
sb.append("%message%");
c.set("allychat.format", sb.toString());
c.set("allychat.rank", "&f[%rank%&f]");
c.set("allychat.tag-color", null);
c.set("allychat.name-color", null);
c.set("allychat.player-bracket", null);
c.set("allychat.message-color", null);
c.set("allychat.tag-bracket", null);
sm.save();
}
}
File diff suppressed because it is too large. Load diff
@@ -1,965 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans;
import org.bukkit.ChatColor;
import org.bukkit.OfflinePlayer;
import org.bukkit.entity.Player;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.json.simple.JSONValue;
import java.io.Serializable;
import java.sql.Timestamp;
import java.text.MessageFormat;
import java.util.*;
/**
* @author phaed
*/
public class ClanPlayer implements Serializable, Comparable<ClanPlayer>
{
private static final long serialVersionUID = 1L;
private UUID uniqueId;
private String displayName;
private boolean leader;
private boolean trusted;
private String tag;
private Clan clan;
private boolean friendlyFire;
private int neutralKills;
private int rivalKills;
private int civilianKills;
private int deaths;
private long lastSeen;
private long joinDate;
private Set<String> pastClans = new HashSet<>();
private VoteResult vote;
private Channel channel;
private boolean useChatShortcut = false;
private boolean globalChat = true;
private boolean allyChat = true;
private boolean clanChat = true;
private boolean bbEnabled = true;
private boolean tagEnabled = true;
private boolean capeEnabled = true;
private boolean allyChatMute = false;
private boolean clanChatMute = false;
private String rank = "";
/**
*
*/
public ClanPlayer()
{
this.tag = "";
this.channel = Channel.NONE;
}
/**
* @param playerName
*/
@Deprecated
public ClanPlayer(String playerName)
{
this.displayName = playerName;
this.lastSeen = (new Date()).getTime();
this.joinDate = (new Date()).getTime();
this.neutralKills = 0;
this.rivalKills = 0;
this.civilianKills = 0;
this.tag = "";
this.channel = Channel.NONE;
}
/**
* @param playerUniqueId
*/
public ClanPlayer(UUID playerUniqueId)
{
this.uniqueId = playerUniqueId;
Player OnlinePlayer = SimpleClans.getInstance().getServer().getPlayer(playerUniqueId);
if (OnlinePlayer != null)
{
this.displayName = OnlinePlayer.getName();
} else
{
OfflinePlayer OfflinePlayer = SimpleClans.getInstance().getServer().getOfflinePlayer(playerUniqueId);
this.displayName = OfflinePlayer.getName();
}
this.lastSeen = (new Date()).getTime();
this.joinDate = (new Date()).getTime();
this.neutralKills = 0;
this.rivalKills = 0;
this.civilianKills = 0;
this.tag = "";
this.channel = Channel.NONE;
}
@Override
public int hashCode()
{
return getName().hashCode() >> 13;
}
@Override
public boolean equals(Object obj)
{
if (!(obj instanceof ClanPlayer))
{
return false;
}
ClanPlayer other = (ClanPlayer) obj;
return other.getName().equals(this.getName());
}
@Override
public int compareTo(ClanPlayer other)
{
if (SimpleClans.getInstance().hasUUID())
{
return this.getUniqueId().compareTo(other.getUniqueId());
} else
{
return this.getName().compareToIgnoreCase(other.getName());
}
}
@Override
public String toString()
{
return displayName;
}
/**
* (used internally)
*
* @return the name
*/
public String getName()
{
return displayName;
}
/**
* (used internally)
*
* @return the uniqueId
*/
public UUID getUniqueId()
{
return uniqueId;
}
/**
* Returns the clean name for this player (lowercase)
*
* @return the name
*/
public String getCleanName()
{
return displayName.toLowerCase();
}
/**
* (used internally)
*
* @param name the name to set
*/
public void setName(String name)
{
this.displayName = name;
}
/**
* (used internally)
*
* @param uniqueId the name to set
*/
public void setUniqueId(UUID uniqueId)
{
this.uniqueId = uniqueId;
}
/**
* Whether this player is a leader or not
*
* @return the leader
*/
public boolean isLeader()
{
return leader;
}
/**
* Sets this player as a leader (does not update clanplayer to db)
*
* @param leader the leader to set
*/
public void setLeader(boolean leader)
{
if (leader)
{
trusted = leader;
}
this.leader = leader;
}
/**
* Check whether the player is an ally with another player
*
* @param player
* @return
*/
public boolean isAlly(Player player)
{
ClanPlayer allycp = SimpleClans.getInstance().getClanManager().getClanPlayer(player);
if (allycp != null)
{
return allycp.getClan().isAlly(tag);
}
return false;
}
/**
* Check whether the player is an rival with another player
*
* @param player
* @return
*/
public boolean isRival(Player player)
{
ClanPlayer allycp = SimpleClans.getInstance().getClanManager().getClanPlayer(player);
if (allycp != null)
{
return allycp.getClan().isRival(tag);
}
return false;
}
/**
* Returns the last seen date for this player in milliseconds
*
* @return the lastSeen
*/
public long getLastSeen()
{
return lastSeen;
}
/**
* (used internally)
*
* @param lastSeen the lastSeen to set
*/
public void setLastSeen(long lastSeen)
{
this.lastSeen = lastSeen;
}
/**
* Updates last seen date to today
*/
public void updateLastSeen()
{
this.lastSeen = (new Date()).getTime();
}
/**
* Returns a verbal representation of how many days ago a player was last seen
*
* @return
*/
public String getLastSeenDaysString()
{
double days = Dates.differenceInDays(new Timestamp(lastSeen), new Timestamp((new Date()).getTime()));
if (days < 1)
{
return SimpleClans.getInstance().getLang("today");
}
else if (Math.round(days) == 1)
{
return MessageFormat.format(SimpleClans.getInstance().getLang("1.color.day"), ChatColor.GRAY);
}
else
{
return MessageFormat.format(SimpleClans.getInstance().getLang("many.color.days"), Math.round(days), ChatColor.GRAY);
}
}
/**
* Returns number of days since the player was last seen
*
* @return
*/
public double getLastSeenDays()
{
return Dates.differenceInDays(new Timestamp(lastSeen), new Timestamp((new Date()).getTime()));
}
/**
* Returns the number of rival kills this player has
*
* @return the rivalKills
*/
public int getRivalKills()
{
return rivalKills;
}
/**
* (used internally)
*
* @param rivalKills the rivalKills to set
*/
public void setRivalKills(int rivalKills)
{
this.rivalKills = rivalKills;
}
/**
* Adds one rival kill to this player (does not update clanplayer to db)
*/
public void addRivalKill()
{
setRivalKills(getRivalKills() + 1);
}
/**
* Returns the number of civilian kills this player has
*
* @return the civilianKills
*/
public int getCivilianKills()
{
return civilianKills;
}
/**
* (used internally)
*
* @param civilianKills the civilianKills to set
*/
public void setCivilianKills(int civilianKills)
{
this.civilianKills = civilianKills;
}
/**
* Adds one civilian kill to this player (does not update clanplayer to db)
*/
public void addCivilianKill()
{
setCivilianKills(getCivilianKills() + 1);
}
/**
* Returns the number of neutral kills this player has
*
* @return the neutralKills
*/
public int getNeutralKills()
{
return neutralKills;
}
/**
* (used internally)
*
* @param neutralKills the neutralKills to set
*/
public void setNeutralKills(int neutralKills)
{
this.neutralKills = neutralKills;
}
/**
* Adds one civilian kill to this player (does not update clanplayer to db)
*/
public void addNeutralKill()
{
setNeutralKills(getNeutralKills() + 1);
}
/**
* Whether this player is allowing friendly fire
*
* @return the friendlyFire
*/
public boolean isFriendlyFire()
{
return friendlyFire;
}
/**
* Sets whether this player is allowing friendly fire (does not update clanplayer to db)
*
* @param friendlyFire the friendlyFire to set
*/
public void setFriendlyFire(boolean friendlyFire)
{
this.friendlyFire = friendlyFire;
}
/**
* (used internally)
*
* @return the vote
*/
public VoteResult getVote()
{
return vote;
}
/**
* (used internally)
*
* @param vote the vote to set
*/
public void setVote(VoteResult vote)
{
this.vote = vote;
}
/**
* Returns the number of deaths this player has
*
* @return the deaths
*/
public int getDeaths()
{
return deaths;
}
/**
* (used internally)
*
* @param deaths the deaths to set
*/
public void setDeaths(int deaths)
{
this.deaths = deaths;
}
/**
* Adds one death to this player (does not update clanplayer to db)
*/
public void addDeath()
{
setDeaths(getDeaths() + 1);
}
/**
* Returns weighted kill score for this player (kills multiplied by the different weights)
*
* @return
*/
public double getWeightedKills()
{
SimpleClans plugin = SimpleClans.getInstance();
return ((double) rivalKills * plugin.getSettingsManager().getKwRival()) + ((double) neutralKills * plugin.getSettingsManager().getKwNeutral()) + ((double) civilianKills * plugin.getSettingsManager().getKwCivilian());
}
/**
* Returns weighted-kill/death ratio
*
* @return
*/
public float getKDR()
{
int totalDeaths = getDeaths();
if (totalDeaths == 0)
{
totalDeaths = 1;
}
return ((float) getWeightedKills()) / ((float) totalDeaths);
}
/**
* Returns the player's join date to his current clan in milliseconds, 0 if not in a clan
*
* @return the joinDate
*/
public long getJoinDate()
{
return joinDate;
}
/**
* (used internally)
*
* @param joinDate the joinDate to set
*/
public void setJoinDate(long joinDate)
{
this.joinDate = joinDate;
}
/**
* Returns a string representation of the join date, blank if not in a clan
*
* @return
*/
public String getJoinDateString()
{
if (joinDate == 0)
{
return "";
}
return new java.text.SimpleDateFormat("MMM dd, ''yy h:mm a").format(new Date(this.joinDate));
}
/**
* Returns a string representation of the last seen date
*
* @return
*/
public String getLastSeenString()
{
return new java.text.SimpleDateFormat("MMM dd, ''yy h:mm a").format(new Date(this.lastSeen));
}
/**
* Returns the number of days the player has been inactive
*
* @return
*/
public int getInactiveDays()
{
Timestamp now = new Timestamp((new Date()).getTime());
return (int) Math.floor(Dates.differenceInDays(new Timestamp(getLastSeen()), now));
}
/**
* (used internally)
*
* @return the PackedPastClans
*/
public String getPackedPastClans()
{
String PackedPastClans = "";
Set<String> pt = getPastClans();
for (String pastClan : pt)
{
PackedPastClans += pastClan + "|";
}
return Helper.stripTrailing(PackedPastClans, "|");
}
/**
* (used internally)
*
* @param PackedPastClans the PackedPastClans to set
*/
public void setPackedPastClans(String PackedPastClans)
{
this.pastClans = Helper.fromArray2(PackedPastClans.split("[|]"));
}
/**
* Adds a past clan to the player (does not update the clanplayer to db)
*
* @param tag
*/
public void addPastClan(String tag)
{
this.getPastClans().add(tag);
}
/**
* Removes a past clan from the player (does not update the clanplayer to db)
*
* @param tag is the clan's colored tag
*/
public void removePastClan(String tag)
{
this.getPastClans().remove(tag);
}
/**
* Returns a separator delimited string with the color tags for all past clans this player has been in
*
* @param sep
* @return
*/
public String getPastClansString(String sep)
{
String out = "";
for (String pastClan : getPastClans())
{
out += pastClan + sep;
}
out = Helper.stripTrailing(out, sep);
if (out.trim().isEmpty())
{
return SimpleClans.getInstance().getLang("none");
}
return out;
}
/**
* Returns a list with all past clans color tags this player has been in
*
* @return the pastClans
*/
public Set<String> getPastClans()
{
// HashSet<String> pc = new HashSet<>();
// pc.addAll(pastClans);
// return pc;
return pastClans;
}
/**
* Returns this player's clan
*
* @return the clan
*/
public Clan getClan()
{
return clan;
}
/**
* (used internally)
*
* @param clan the clan to set
*/
public void setClan(Clan clan)
{
if (clan == null)
{
this.tag = "";
}
else
{
this.tag = clan.getTag();
}
this.clan = clan;
}
/**
* Returns this player's clan's tag. Empty string if he's not in a clan.
*
* @return the tag
*/
public String getTag()
{
return tag;
}
/**
* Returns this player's clan's tag label. Empty string if he's not in a clan.
*
* @return the tag
*/
public String getTagLabel()
{
if (clan == null)
{
return "";
}
return clan.getTagLabel(isLeader());
}
/**
* Returns this player's trusted status
*
* @return the trusted
*/
public boolean isTrusted()
{
return leader || trusted;
}
/**
* Sets this player's trusted status (does not update the clanplayer to db)
*
* @param trusted the trusted to set
*/
public void setTrusted(boolean trusted)
{
this.trusted = trusted;
}
/**
* Return the list of flags and their data as a json string
*
* @return the flags
*/
public String getFlags()
{
JSONObject json = new JSONObject();
// the player's rank inside his clan
if (rank != null)
{
json.put("rank", rank);
}
// writing the list of flags to json
json.put("channel", channel.toString());
// writing the channel state settings flags
List<Boolean> settings = new LinkedList<>();
settings.add(globalChat);
settings.add(allyChat);
settings.add(clanChat);
json.put("channel-state", settings);
// couple of toggles
json.put("chat-shortcut", useChatShortcut);
json.put("bb-enabled", bbEnabled);
json.put("hide-tag", tagEnabled);
json.put("cape-enabled", capeEnabled);
return json.toString();
}
/**
* Read the list of flags in from a json string
*
* @param flagString the flags to set
*/
public void setFlags(String flagString)
{
if (flagString != null && !flagString.isEmpty())
{
Object obj = JSONValue.parse(flagString);
JSONObject flags = (JSONObject) obj;
if (flags != null)
{
for (Object flag : flags.keySet())
{
try
{
if (flag.equals("rank"))
{
if(flags.get(flag) == null)
{
continue;
}
rank = flags.get(flag).toString();
}
if (flag.equals("channel"))
{
String chn = flags.get(flag).toString();
if (chn != null && !chn.isEmpty())
{
if (chn.equalsIgnoreCase("clan"))
{
channel = Channel.CLAN;
}
else if (chn.equalsIgnoreCase("ally"))
{
channel = Channel.ALLY;
}
else
{
channel = Channel.NONE;
}
}
}
if (flag.equals("channel-state"))
{
JSONArray settings = (JSONArray) flags.get(flag);
if (settings != null && !settings.isEmpty())
{
globalChat = (Boolean) settings.get(0);
allyChat = (Boolean) settings.get(1);
clanChat = (Boolean) settings.get(2);
}
}
if (flag.equals("bb-enabled"))
{
bbEnabled = (Boolean) flags.get(flag);
}
if (flag.equals("hide-tag"))
{
tagEnabled = (Boolean) flags.get(flag);
}
if (flag.equals("cape-enabled"))
{
capeEnabled = (Boolean) flags.get(flag);
}
if (flag.equals("chat-shortcut"))
{
useChatShortcut = (Boolean) flags.get(flag);
}
}
catch (Exception ex)
{
for (StackTraceElement el : ex.getStackTrace())
{
System.out.print("Failed reading flag: " + flag);
System.out.print("Value: " + flags.get(flag));
System.out.print(el.toString());
}
}
}
}
}
}
public Channel getChannel()
{
return channel;
}
public boolean isGlobalChat()
{
return globalChat;
}
public boolean isAllyChat()
{
return allyChat;
}
public boolean isClanChat()
{
return clanChat;
}
public void setGlobalChat(boolean globalChat)
{
this.globalChat = globalChat;
}
public void setAllyChat(boolean allyChat)
{
this.allyChat = allyChat;
}
public void setClanChat(boolean clanChat)
{
this.clanChat = clanChat;
}
public void setChannel(Channel channel)
{
this.channel = channel;
}
public boolean isBbEnabled()
{
return bbEnabled;
}
public void setBbEnabled(boolean bbEnabled)
{
this.bbEnabled = bbEnabled;
SimpleClans.getInstance().getStorageManager().updateClanPlayer(this);
}
public boolean isCapeEnabled()
{
return capeEnabled;
}
public void setCapeEnabled(boolean capeEnabled)
{
this.capeEnabled = capeEnabled;
SimpleClans.getInstance().getStorageManager().updateClanPlayer(this);
}
public boolean isTagEnabled()
{
return tagEnabled;
}
public void setTagEnabled(boolean tagEnabled)
{
this.tagEnabled = tagEnabled;
SimpleClans.getInstance().getStorageManager().updateClanPlayer(this);
SimpleClans.getInstance().getClanManager().updateDisplayName(this.toPlayer());
}
public boolean isUseChatShortcut()
{
return useChatShortcut;
}
public String getRank()
{
return rank;
}
public void setRank(String rank)
{
this.rank = rank;
}
public enum Channel
{
CLAN,
ALLY,
NONE
}
public Player toPlayer()
{
if (this.uniqueId != null)
{
return SimpleClans.getInstance().getServer().getPlayer(this.uniqueId);
} else
{
return SimpleClans.getInstance().getServer().getPlayer(this.displayName);
}
}
public void setMuted(boolean b)
{
clanChatMute = b;
}
public void setMutedAlly(boolean b)
{
allyChatMute = b;
}
public boolean isMuted()
{
return clanChatMute;
}
public boolean isMutedAlly()
{
return allyChatMute;
}
}
@@ -1,10 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans;
/**
* Clan Requests
* @author phaed
*/
public enum ClanRequest
{
DEMOTE, PROMOTE, DISBAND, INVITE, CREATE_ALLY, BREAK_RIVALRY, START_WAR, END_WAR
}
@@ -1,60 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandMap;
import org.bukkit.command.PluginCommand;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.SimplePluginManager;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.util.Arrays;
public class CommandHelper {
private CommandHelper() {
}
public static void registerCommand(String... aliases) {
if (aliases != null) {
PluginCommand command = getCommand(aliases[0], SimpleClans.getInstance());
if (command != null) {
command.setAliases(Arrays.asList(aliases));
getCommandMap().register(SimpleClans.getInstance().getDescription().getName(), command);
}
}
}
private static PluginCommand getCommand(String name, Plugin plugin) {
PluginCommand command = null;
try {
Constructor<PluginCommand> c = PluginCommand.class.getDeclaredConstructor(String.class, Plugin.class);
c.setAccessible(true);
command = c.newInstance(name, plugin);
} catch (Exception e) {
e.printStackTrace();
}
return command;
}
private static CommandMap getCommandMap() {
CommandMap commandMap = null;
try {
if (Bukkit.getPluginManager() instanceof SimplePluginManager) {
Field f = SimplePluginManager.class.getDeclaredField("commandMap");
f.setAccessible(true);
commandMap = (CommandMap) f.get(Bukkit.getPluginManager());
}
} catch (Exception e) {
e.printStackTrace();
}
return commandMap;
}
}
@@ -1,65 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans;
import java.util.Date;
/**
* @author phaed
*/
public class DamageRecord {
private String victim;
private String attacker;
private Date time;
/**
* @param victim
* @param attacker
*/
public DamageRecord(String victim, String attacker) {
this.victim = victim;
this.attacker = attacker;
this.time = new Date();
}
/**
* @return the victim
*/
public String getVictim() {
return victim;
}
/**
* @param victim the victim to set
*/
public void setVictim(String victim) {
this.victim = victim;
}
/**
* @return the attacker
*/
public String getAttacker() {
return attacker;
}
/**
* @param attacker the attacker to set
*/
public void setAttacker(String attacker) {
this.attacker = attacker;
}
/**
* @return the time
*/
public Date getTime() {
return new Date(time.getTime());
}
/**
* @param time the time to set
*/
public void setTime(Date time) {
this.time = new Date(time.getTime());
}
}
@@ -1,692 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans;
import net.sacredlabyrinth.phaed.simpleclans.uuid.UUIDMigration;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import java.io.IOException;
import java.lang.reflect.Method;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.*;
import java.util.Map.Entry;
import java.util.regex.Matcher;
import net.sacredlabyrinth.phaed.simpleclans.managers.SettingsManager;
/**
* @author phaed
*/
public class Helper {
private Helper() {
}
/**
* Dumps stacktrace to log
*/
public static void dumpStackTrace() {
for (StackTraceElement el : Thread.currentThread().getStackTrace()) {
SimpleClans.debug(el.toString());
}
}
/**
* Get a players full color name if he is online
*
* @param playerName
* @return
*/
public static String getColorName(String playerName) {
List<Player> players = SimpleClans.getInstance().getServer().matchPlayer(playerName);
if (players.size() == 1) {
return SimpleClans.getInstance().getPermissionsManager().getPrefix(players.get(0)) + players.get(0).getName() + SimpleClans.getInstance().getPermissionsManager().getSuffix(players.get(0));
}
return playerName;
}
/**
* Check for integer
*
* @param o
* @return
*/
public static boolean isInteger(Object o) {
return o instanceof java.lang.Integer;
}
/**
* Check for byte
*
* @param input
* @return
*/
public static boolean isByte(String input) {
try {
Byte.parseByte(input);
return true;
} catch (Exception ex) {
return false;
}
}
/**
* Check for short
*
* @param input
* @return
*/
public static boolean isShort(String input) {
try {
Short.parseShort(input);
return true;
} catch (Exception ex) {
return false;
}
}
/**
* Check for integer
*
* @param input
* @return
*/
public static boolean isInteger(String input) {
try {
Integer.parseInt(input);
return true;
} catch (Exception ex) {
return false;
}
}
/**
* Check for float
*
* @param input
* @return
*/
public static boolean isFloat(String input) {
try {
Float.parseFloat(input);
return true;
} catch (Exception ex) {
return false;
}
}
/**
* Check for string
*
* @param o
* @return
*/
public static boolean isString(Object o) {
return o instanceof java.lang.String;
}
/**
* Check for boolean
*
* @param o
* @return
*/
public static boolean isBoolean(Object o) {
return o instanceof java.lang.Boolean;
}
/**
* Remove a character from a string
*
* @param s
* @param c
* @return
*/
public static String removeChar(String s, char c) {
String r = "";
for (int i = 0; i < s.length(); i++) {
if (s.charAt(i) != c) {
r += s.charAt(i);
}
}
return r;
}
/**
* Remove first character from a string
*
* @param s
* @param c
* @return
*/
public static String removeFirstChar(String s, char c) {
String r = "";
for (int i = 0; i < s.length(); i++) {
if (s.charAt(i) != c) {
r += s.charAt(i);
break;
}
}
return r;
}
/**
* Capitalize first word of sentence
*
* @param content
* @return
*/
public static String capitalize(String content) {
if (content.length() < 2) {
return content;
}
String first = content.substring(0, 1).toUpperCase();
return first + content.substring(1);
}
/**
* Return plural word if count is bigger than one
*
* @param count
* @param word
* @param ending
* @return
*/
public static String plural(int count, String word, String ending) {
return count == 1 ? word : word + ending;
}
/**
* Hex value to ChatColor
*
* @param hexValue
* @return
*/
public static String toColor(String hexValue) {
if (hexValue == null) {
return "";
}
return ChatColor.getByChar(hexValue).toString();
}
/**
* Converts string array to ArrayList<String>, remove empty strings
*
* @param values
* @return
*/
public static List<String> fromArray(String... values) {
List<String> results = new ArrayList<>();
Collections.addAll(results, values);
results.remove("");
return results;
}
/**
* Converts string array to HashSet<String>, remove empty strings
*
* @param values
* @return
*/
public static Set<String> fromArray2(String... values) {
HashSet<String> results = new HashSet<>();
Collections.addAll(results, values);
results.remove("");
return results;
}
/**
* Converts a player array to ArrayList<Player>
*
* @param values
* @return
*/
public static List<Player> fromPlayerArray(Player... values) {
List<Player> results = new ArrayList<>();
Collections.addAll(results, values);
return results;
}
/**
* Converts ArrayList<String> to string array
*
* @param list
* @return
*/
public static String[] toArray(List<String> list) {
return list.toArray(new String[list.size()]);
}
/**
* Removes first item from a string array
*
* @param args
* @return
*/
public static String[] removeFirst(String[] args) {
List<String> out = fromArray(args);
if (!out.isEmpty()) {
out.remove(0);
}
return toArray(out);
}
/**
* Converts a string array to a space separated string
*
* @param args
* @return
*/
public static String toMessage(String[] args) {
String out = "";
for (String arg : args) {
out += arg + " ";
}
return out.trim();
}
/**
* Converts a string array to a string with custom separators
*
* @param args
* @param sep
* @return
*/
public static String toMessage(String[] args, String sep) {
String out = "";
for (String arg : args) {
out += arg + ", ";
}
return stripTrailing(out, ", ");
}
/**
* Converts a string array to a string with custom separators
*
* @param args
* @param sep
* @return
*/
public static String toMessage(List<String> args, String sep) {
String out = "";
for (String arg : args) {
out += arg + sep;
}
return stripTrailing(out, sep);
}
/**
* Convert color hex values with ampersand to special character
*
* @param msg
* @return
*/
public static String parseColors(String msg) {
return msg.replace("&", "\u00a7");
}
/**
* Removes color codes from strings
*
* @param msg
* @return
*/
public static String stripColors(String msg) {
String out = msg.replaceAll("[&][0-9a-f]", "");
out = out.replaceAll(String.valueOf((char) 194), "");
return out.replaceAll("[\u00a7][0-9a-f]", "");
}
/*
* Retrieves the last color code @param msg @return
*/
/**
* @param msg
* @return
*/
public static String getLastColorCode(String msg) {
msg = msg.replaceAll(String.valueOf((char) 194), "").trim();
if (msg.length() < 2) {
return "";
}
String one = msg.substring(msg.length() - 2, msg.length() - 1);
String two = msg.substring(msg.length() - 1);
if (one.equals("\u00a7")) {
return one + two;
}
if (one.equals("&")) {
return Helper.toColor(two);
}
return "";
}
/**
* Cleans up the tag from color codes and makes it lowercase
*
* @param tag
* @return
*/
public static String cleanTag(String tag) {
return stripColors(tag).toLowerCase();
}
/**
* Removes trailing separators
*
* @param msg
* @param sep
* @return
*/
public static String stripTrailing(String msg, String sep) {
if (msg.length() < sep.length()) {
return msg;
}
String out = msg;
String first = msg.substring(0, sep.length());
String last = msg.substring(msg.length() - sep.length(), msg.length());
if (first.equals(sep)) {
out = msg.substring(sep.length());
}
if (last.equals(sep)) {
out = msg.substring(0, msg.length() - sep.length());
}
return out;
}
/**
* Generates page separator line
*
* @param sep
* @return
*/
public static String generatePageSeparator(String sep) {
String out = "";
for (int i = 0; i < 320; i++) {
out += sep;
}
return out;
}
/**
* Check whether a player is online
*
* @param playerName
* @return
*/
@Deprecated
public static boolean isOnline(String playerName) {
Collection<Player> online = getOnlinePlayers();
for (Player o : online) {
if (o.getName().equalsIgnoreCase(playerName)) {
return true;
}
}
return false;
}
/**
* Check whether a player is online
*
* @param playerUniqueId
* @return
*/
public static boolean isOnline(UUID playerUniqueId) {
Collection<Player> online = getOnlinePlayers();
for (Player o : online) {
if (o.getUniqueId().equals(playerUniqueId)) {
return true;
}
}
return false;
}
/**
* Remove offline players from a ClanPlayer array
*
* @param in
* @return
*/
public static List<ClanPlayer> stripOffLinePlayers(List<ClanPlayer> in) {
List<ClanPlayer> out = new ArrayList<>();
for (ClanPlayer cp : in) {
if (cp.toPlayer() != null) {
out.add(cp);
}
}
return out;
}
/**
* Test if a url is valid
*
* @param strUrl
* @return
*/
public static boolean testURL(String strUrl) {
try {
URL url = new URL(strUrl);
HttpURLConnection urlConn = (HttpURLConnection) url.openConnection();
urlConn.connect();
if (urlConn.getResponseCode() != HttpURLConnection.HTTP_OK) {
return false;
}
} catch (IOException e) {
return false;
}
return true;
}
/**
* Escapes single quotes
*
* @param str
* @return
*/
public static String escapeQuotes(String str) {
if (str == null) {
return "";
}
return str.replace("'", "''");
}
/**
* Returns a prettier coordinate, does not include world
*
* @param loc
* @return
*/
public static String toLocationString(Location loc) {
return loc.getBlockX() + " " + loc.getBlockY() + " " + loc.getBlockZ() + " " + loc.getWorld().getName();
}
/**
* Whether the two locations refer to the same block
*
* @param loc
* @param loc2
* @return
*/
public static boolean isSameBlock(Location loc, Location loc2) {
return loc.getBlockX() == loc2.getBlockX() && loc.getBlockY() == loc2.getBlockY() && loc.getBlockZ() == loc2.getBlockZ();
}
/**
* Whether the two locations refer to the same location, ignoring pitch and
* yaw
*
* @param loc
* @param loc2
* @return
*/
public static boolean isSameLocation(Location loc, Location loc2) {
return loc.getX() == loc2.getX() && loc.getY() == loc2.getY() && loc.getZ() == loc2.getZ();
}
/**
* Sort hashmap by value
*
* @param map
* @return Map
*/
public static Map sortByValue(Map map) {
List list = new LinkedList(map.entrySet());
Collections.sort(list, new Comparator() {
@Override
public int compare(Object o1, Object o2) {
return ((Comparable) ((Map.Entry) (o2)).getValue()).compareTo(((Map.Entry) (o1)).getValue());
}
});
Map result = new LinkedHashMap();
for (Iterator it = list.iterator(); it.hasNext();) {
Map.Entry entry = (Map.Entry) it.next();
result.put(entry.getKey(), entry.getValue());
}
return result;
}
public static boolean isVanished(Player player) {
if (player != null && player.hasMetadata("vanished") && !player.getMetadata("vanished").isEmpty()) {
return player.getMetadata("vanished").get(0).asBoolean();
}
return false;
}
public static Collection<Player> getOnlinePlayers() {
try {
Method method = Bukkit.class.getDeclaredMethod("getOnlinePlayers");
Object players = method.invoke(null);
if (players instanceof Player[]) {
return new ArrayList<>(Arrays.asList((Player[]) players));
} else {
return (Collection<Player>) players;
}
} catch (Exception e) {
e.printStackTrace();
}
return new ArrayList<>();
}
public static Player getPlayer(String playerName) {
if (SimpleClans.getInstance().hasUUID()) {
return SimpleClans.getInstance().getServer().getPlayer(UUIDMigration.getForcedPlayerUUID(playerName));
}
return SimpleClans.getInstance().getServer().getPlayer(playerName);
}
/**
* Formats the ally chat
*
* @param cp Sender
* @param msg The message
* @param placeholders The placeholders
* @return The formated message
*/
public static String formatAllyChat(ClanPlayer cp, String msg, Map<String, String> placeholders) {
SettingsManager sm = SimpleClans.getInstance().getSettingsManager();
String leaderColor = sm.getAllyChatLeaderColor();
String memberColor = sm.getAllyChatMemberColor();
String rank = cp.getRank().isEmpty() ? null : ChatColor.translateAlternateColorCodes('&', cp.getRank());
String rankFormat = rank != null ? ChatColor.translateAlternateColorCodes('&', sm.getAllyChatRank()).replace("%rank%", rank) : "";
String message = replacePlaceholders(sm.getAllyChatFormat(), cp, leaderColor, memberColor, rankFormat, msg);
if (placeholders != null) {
for (Entry<String, String> e : placeholders.entrySet()) {
message = message.replace("%"+e.getKey()+"%", e.getValue());
}
}
return message;
}
private static String replacePlaceholders(String messageFormat, ClanPlayer cp, String leaderColor, String memberColor, String rankFormat, String msg) {
String message = ChatColor.translateAlternateColorCodes('&', messageFormat)
.replace("%clan%", cp.getClan().getColorTag())
.replace("%nick-color%", (cp.isLeader() ? leaderColor : memberColor))
.replace("%player%", cp.getName())
.replace("%rank%", rankFormat)
.replace("%message%", msg);
return message;
}
/**
* Formats the clan chat
*
* @param cp Sender
* @param msg The message
* @param placeholders The placeholders
* @return The formated message
*/
public static String formatClanChat(ClanPlayer cp, String msg, Map<String, String> placeholders) {
SettingsManager sm = SimpleClans.getInstance().getSettingsManager();
String leaderColor = sm.getClanChatLeaderColor();
String memberColor = sm.getClanChatMemberColor();
String rank = cp.getRank().isEmpty() ? null : ChatColor.translateAlternateColorCodes('&', cp.getRank());
String rankFormat = rank != null ? ChatColor.translateAlternateColorCodes('&', sm.getClanChatRank()).replace("%rank%", rank) : "";
String message = replacePlaceholders(sm.getClanChatFormat(), cp, leaderColor, memberColor, rankFormat, msg);
if (placeholders != null) {
for (Entry<String, String> e : placeholders.entrySet()) {
message = message.replace("%"+e.getKey()+"%", e.getValue());
}
}
return message;
}
/**
* Formats the chat in a way that the Clan Tag is always there, so infractors can be easily identified
*
* @param cp Sender
* @param msg The chat message
* @return The formated message
*/
public static String formatSpyClanChat(ClanPlayer cp, String msg) {
msg = stripColors(msg);
if (msg.contains(stripColors(cp.getClan().getColorTag()))) {
return ChatColor.DARK_GRAY + msg;
} else {
return ChatColor.DARK_GRAY + "[" + cp.getTag() + "] " + msg;
}
}
}
@@ -1,54 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans;
import org.bukkit.ChatColor;
import org.bukkit.OfflinePlayer;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabCompleter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class PlayerNameTabCompleter implements TabCompleter {
private SimpleClans plugin;
public PlayerNameTabCompleter() {
plugin = SimpleClans.getInstance();
}
@Override
public List<String> onTabComplete(CommandSender commandSender, Command command, String s, String[] strings) {
if (command.getName().equalsIgnoreCase(plugin.getSettingsManager().getCommandClan())) {
if (strings.length < 2) {
return null;
}
if (strings[0].equalsIgnoreCase(plugin.getLang("lookup.command")) ||
strings[0].equalsIgnoreCase(plugin.getLang("ban.command")) ||
strings[0].equalsIgnoreCase(plugin.getLang("unban.command")) ||
strings[0].equalsIgnoreCase(plugin.getLang("kick.command")) ||
strings[0].equalsIgnoreCase(plugin.getLang("trust.command")) ||
strings[0].equalsIgnoreCase(plugin.getLang("untrust.command")) ||
strings[0].equalsIgnoreCase(plugin.getLang("promote.command")) ||
strings[0].equalsIgnoreCase(plugin.getLang("demote.command")) ||
strings[0].equalsIgnoreCase(plugin.getLang("setrank.command")) ||
strings[0].equalsIgnoreCase(plugin.getLang("place.command")) ||
strings[0].equalsIgnoreCase(plugin.getLang("invite.command")) ||
strings[0].equalsIgnoreCase(plugin.getLang("kills.command"))) {
List<String> list = new ArrayList<>();
for (OfflinePlayer player : plugin.getServer().getOnlinePlayers()) {
if (player.getName().startsWith(strings[1])) {
list.add(player.getName());
}
}
Collections.sort(list);
return list;
}
}
return null;
}
}
@@ -1,191 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans;
import net.sacredlabyrinth.phaed.simpleclans.executors.*;
import net.sacredlabyrinth.phaed.simpleclans.listeners.SCEntityListener;
import net.sacredlabyrinth.phaed.simpleclans.listeners.SCPlayerListener;
import net.sacredlabyrinth.phaed.simpleclans.managers.*;
import net.sacredlabyrinth.phaed.simpleclans.uuid.UUIDMigration;
import org.bukkit.plugin.java.JavaPlugin;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import net.sacredlabyrinth.phaed.simpleclans.tasks.CollectFeeTask;
/**
* @author Phaed
*/
public class SimpleClans extends JavaPlugin {
private ArrayList<String> messages = new ArrayList<>();
private static SimpleClans instance;
private static final Logger logger = Logger.getLogger("Minecraft");
private ClanManager clanManager;
private RequestManager requestManager;
private StorageManager storageManager;
private SettingsManager settingsManager;
private PermissionsManager permissionsManager;
private TeleportManager teleportManager;
private LanguageManager languageManager;
private ChatFormatMigration chatFormatMigration;
private boolean hasUUID;
/**
* @return the logger
*/
public static Logger getLog() {
return logger;
}
/**
* @param msg
*/
public static void debug(String msg) {
if (getInstance().getSettingsManager().isDebugging()) {
logger.log(Level.INFO, msg);
}
}
/**
* @return the instance
*/
public static SimpleClans getInstance() {
return instance;
}
public static void log(String msg, Object... arg) {
if (arg == null || arg.length == 0) {
logger.log(Level.INFO, msg);
} else {
logger.log(Level.INFO, MessageFormat.format(msg, arg));
}
}
@Override
public void onEnable() {
instance = this;
settingsManager = new SettingsManager();
this.hasUUID = UUIDMigration.canReturnUUID();
languageManager = new LanguageManager();
permissionsManager = new PermissionsManager();
requestManager = new RequestManager();
clanManager = new ClanManager();
storageManager = new StorageManager();
teleportManager = new TeleportManager();
chatFormatMigration = new ChatFormatMigration();
chatFormatMigration.migrateAllyChat();
chatFormatMigration.migrateClanChat();
logger.info(MessageFormat.format(getLang("version.loaded"), getDescription().getName(), getDescription().getVersion()));
getServer().getPluginManager().registerEvents(new SCEntityListener(), this);
getServer().getPluginManager().registerEvents(new SCPlayerListener(), this);
permissionsManager.loadPermissions();
CommandHelper.registerCommand(getSettingsManager().getCommandClan());
CommandHelper.registerCommand(getSettingsManager().getCommandAccept());
CommandHelper.registerCommand(getSettingsManager().getCommandDeny());
CommandHelper.registerCommand(getSettingsManager().getCommandMore());
CommandHelper.registerCommand(getSettingsManager().getCommandAlly());
CommandHelper.registerCommand(getSettingsManager().getCommandGlobal());
getCommand(getSettingsManager().getCommandClan()).setExecutor(new ClanCommandExecutor());
getCommand(getSettingsManager().getCommandAccept()).setExecutor(new AcceptCommandExecutor());
getCommand(getSettingsManager().getCommandDeny()).setExecutor(new DenyCommandExecutor());
getCommand(getSettingsManager().getCommandMore()).setExecutor(new MoreCommandExecutor());
getCommand(getSettingsManager().getCommandAlly()).setExecutor(new AllyCommandExecutor());
getCommand(getSettingsManager().getCommandGlobal()).setExecutor(new GlobalCommandExecutor());
getCommand(getSettingsManager().getCommandClan()).setTabCompleter(new PlayerNameTabCompleter());
logger.info("[SimpleClans] Online Mode: " + hasUUID); //TODO: Is this necessary?
logger.info("[SimpleClans] Modo Multithreading: " + SimpleClans.getInstance().getSettingsManager().getUseThreads());
logger.info("[SimpleClans] Modo BungeeCord: " + SimpleClans.getInstance().getSettingsManager().getUseBungeeCord());
if (getSettingsManager().isMemberFee()) {
new CollectFeeTask().start();
}
}
@Override
public void onDisable() {
getServer().getScheduler().cancelTasks(this);
getStorageManager().closeConnection();
getPermissionsManager().savePermissions();
}
/**
* @return the clanManager
*/
public ClanManager getClanManager() {
return clanManager;
}
/**
* @return the requestManager
*/
public RequestManager getRequestManager() {
return requestManager;
}
/**
* @return the storageManager
*/
public StorageManager getStorageManager() {
return storageManager;
}
/**
* @return the settingsManager
*/
public SettingsManager getSettingsManager() {
return settingsManager;
}
/**
* @return the permissionsManager
*/
public PermissionsManager getPermissionsManager() {
return permissionsManager;
}
/**
* @param msg the path within the language file
* @return the lang
*/
public String getLang(String msg) {
return languageManager.get(msg);
}
public TeleportManager getTeleportManager() {
return teleportManager;
}
public List<String> getMessages() {
return messages;
}
/**
* @return the hasUUID
*/
public boolean hasUUID() {
return this.hasUUID;
}
/**
* @param trueOrFalse
*/
public void setUUID(boolean trueOrFalse) {
this.hasUUID = trueOrFalse;
}
public LanguageManager getLanguageManager() {
return languageManager;
}
}
@@ -1,92 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import java.util.UUID;
public class TeleportState {
private UUID playerUniqueId;
private String playerName;
private Location playerLocation;
private Location destination;
private int counter;
private String clanName;
private boolean processing;
public TeleportState(Player player, Location dest, String clanName) {
this.destination = dest;
this.playerLocation = player.getLocation();
this.playerName = player.getName();
this.clanName = clanName;
this.counter = SimpleClans.getInstance().getSettingsManager().getWaitSecs();
this.playerUniqueId = player.getUniqueId();
}
/**
* @return
*/
public Location getLocation() {
return this.playerLocation;
}
/**
* Whether its time for teleport
*
* @return
*/
public boolean isTeleportTime() {
if (this.counter > 1) {
this.counter--;
return false;
}
return true;
}
/**
* The player that is waiting for teleport
*
* @return
*/
public Player getPlayer() {
if (SimpleClans.getInstance().hasUUID()) {
return SimpleClans.getInstance().getServer().getPlayer(this.playerUniqueId);
} else {
return SimpleClans.getInstance().getServer().getPlayer(this.playerName);
}
}
/**
* Get seconds left before teleport
*
* @return
*/
public int getCounter() {
return this.counter;
}
public void setCounter(int counter) {
this.counter = counter;
}
public String getClanName() {
return this.clanName;
}
public Location getDestination() {
return this.destination;
}
public boolean isProcessing() {
return this.processing;
}
public void setProcessing(boolean processing) {
this.processing = processing;
}
public UUID getUniqueId() {
return this.playerUniqueId;
}
}
@@ -1,13 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans;
/**
* Possible vote values
*/
/**
*
* @author cc_madelg
*/
public enum VoteResult
{
ACCEPT, DENY
}
@@ -1,71 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans.commands;
import net.sacredlabyrinth.phaed.simpleclans.ChatBlock;
import net.sacredlabyrinth.phaed.simpleclans.Clan;
import net.sacredlabyrinth.phaed.simpleclans.Helper;
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import java.text.MessageFormat;
import java.util.List;
/**
* @author phaed
*/
public class AlliancesCommand {
public AlliancesCommand() {
}
/**
* Execute the command
*
* @param player
* @param arg
*/
public void execute(Player player, String[] arg) {
SimpleClans plugin = SimpleClans.getInstance();
String headColor = plugin.getSettingsManager().getPageHeadingsColor();
String subColor = plugin.getSettingsManager().getPageSubTitleColor();
if (arg.length != 0) {
ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("usage.clan.alliances"), plugin.getSettingsManager().getCommandClan()));
return;
}
if (!plugin.getPermissionsManager().has(player, "simpleclans.anyone.alliances")) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
return;
}
List<Clan> clans = plugin.getClanManager().getClans();
plugin.getClanManager().sortClansByKDR(clans);
ChatBlock chatBlock = new ChatBlock();
ChatBlock.sendBlank(player);
ChatBlock.saySingle(player, plugin.getSettingsManager().getServerName() + subColor + " " + plugin.getLang("alliances") + " " + headColor + Helper.generatePageSeparator(plugin.getSettingsManager().getPageSep()));
ChatBlock.sendBlank(player);
chatBlock.setAlignment("l", "l");
chatBlock.addRow(" " + headColor + plugin.getLang("clan"), plugin.getLang("allies"));
for (Clan clan : clans) {
if (!clan.isVerified()) {
continue;
}
chatBlock.addRow(" " + ChatColor.AQUA + clan.getName(), clan.getAllyString(ChatColor.DARK_GRAY + ", "));
}
boolean more = chatBlock.sendBlock(player, plugin.getSettingsManager().getPageSize());
if (more) {
plugin.getStorageManager().addChatBlock(player, chatBlock);
ChatBlock.sendBlank(player);
ChatBlock.sendMessage(player, headColor + MessageFormat.format(plugin.getLang("view.next.page"), plugin.getSettingsManager().getCommandMore()));
}
ChatBlock.sendBlank(player);
}
}
@@ -1,100 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans.commands;
import net.sacredlabyrinth.phaed.simpleclans.*;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import java.text.MessageFormat;
import java.util.List;
/**
* @author phaed
*/
public class AllyCommand {
public AllyCommand() {
}
/**
* Execute the command
*
* @param player
* @param arg
*/
public void execute(Player player, String[] arg) {
SimpleClans plugin = SimpleClans.getInstance();
if (!plugin.getPermissionsManager().has(player, "simpleclans.leader.ally")) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
return;
}
ClanPlayer cp = plugin.getClanManager().getClanPlayer(player);
if (cp == null) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("not.a.member.of.any.clan"));
return;
}
Clan clan = cp.getClan();
if (!clan.isVerified()) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("clan.is.not.verified"));
return;
}
if (!clan.isLeader(player)) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.leader.permissions"));
return;
}
if (arg.length != 2) {
ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("usage.ally"), plugin.getSettingsManager().getCommandClan()));
return;
}
if (clan.getSize() < plugin.getSettingsManager().getClanMinSizeToAlly()) {
ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("minimum.to.make.alliance"), plugin.getSettingsManager().getClanMinSizeToAlly()));
return;
}
String action = arg[0];
Clan ally = plugin.getClanManager().getClan(arg[1]);
if (ally == null) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.clan.matched"));
return;
}
if (!ally.isVerified()) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("cannot.ally.with.an.unverified.clan"));
}
if (action.equals(plugin.getLang("add"))) {
if (clan.isAlly(ally.getTag())) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("your.clans.are.already.allies"));
return;
}
List<ClanPlayer> onlineLeaders = Helper.stripOffLinePlayers(clan.getLeaders());
if (onlineLeaders.isEmpty()) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("at.least.one.leader.accept.the.alliance"));
return;
}
plugin.getRequestManager().addAllyRequest(cp, ally, clan);
ChatBlock.sendMessage(player, ChatColor.AQUA + MessageFormat.format(plugin.getLang("leaders.have.been.asked.for.an.alliance"), Helper.capitalize(ally.getName())));
} else if (action.equals(plugin.getLang("remove"))) {
if (!clan.isAlly(ally.getTag())) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("your.clans.are.not.allies"));
return;
}
clan.removeAlly(ally);
ally.addBb(cp.getName(), ChatColor.AQUA + MessageFormat.format(plugin.getLang("has.broken.the.alliance"), Helper.capitalize(clan.getName()), ally.getName()), false);
clan.addBb(cp.getName(), ChatColor.AQUA + MessageFormat.format(plugin.getLang("has.broken.the.alliance"), Helper.capitalize(cp.getName()), Helper.capitalize(ally.getName())));
} else {
ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("usage.ally"), plugin.getSettingsManager().getCommandClan()));
}
}
}
@@ -1,73 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans.commands;
import net.sacredlabyrinth.phaed.simpleclans.ChatBlock;
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import java.text.MessageFormat;
import java.util.UUID;
import net.sacredlabyrinth.phaed.simpleclans.uuid.UUIDMigration;
/**
* @author phaed
*/
public class BanCommand {
public BanCommand() {
}
/**
* Execute the command
*
* @param player
* @param arg
*/
public void execute(Player player, String[] arg) {
SimpleClans plugin = SimpleClans.getInstance();
if (!plugin.getPermissionsManager().has(player, "simpleclans.mod.ban")) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
return;
}
if (arg.length != 1) {
ChatBlock.sendMessage(player, MessageFormat.format(plugin.getLang("usage.ban.unban"), ChatColor.RED, plugin.getSettingsManager().getCommandClan()));
return;
}
String banned = arg[0];
if (SimpleClans.getInstance().hasUUID()) {
UUID PlayerUniqueId = UUIDMigration.getForcedPlayerUUID(banned);
if (plugin.getSettingsManager().isBanned(PlayerUniqueId)) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("this.player.is.already.banned"));
return;
}
Player pl = SimpleClans.getInstance().getServer().getPlayer(PlayerUniqueId);
if (pl != null) {
ChatBlock.sendMessage(pl, ChatColor.AQUA + plugin.getLang("you.banned"));
}
plugin.getClanManager().ban(banned);
ChatBlock.sendMessage(player, ChatColor.AQUA + plugin.getLang("player.added.to.banned.list"));
} else {
if (plugin.getSettingsManager().isBanned(banned)) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("this.player.is.already.banned"));
return;
}
Player pl = SimpleClans.getInstance().getServer().getPlayerExact(banned);
if (pl != null) {
ChatBlock.sendMessage(pl, ChatColor.AQUA + plugin.getLang("you.banned"));
}
plugin.getClanManager().ban(banned);
ChatBlock.sendMessage(player, ChatColor.AQUA + plugin.getLang("player.added.to.banned.list"));
}
}
}
@@ -1,92 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans.commands;
import net.sacredlabyrinth.phaed.simpleclans.ChatBlock;
import net.sacredlabyrinth.phaed.simpleclans.Clan;
import net.sacredlabyrinth.phaed.simpleclans.ClanPlayer;
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import java.text.MessageFormat;
/**
* @author phaed
*/
public class BankCommand {
public BankCommand() {
}
/**
* Execute the command
*
* @param player
* @param arg
*/
public void execute(Player player, String[] arg) {
SimpleClans plugin = SimpleClans.getInstance();
if (!plugin.getPermissionsManager().has(player, "simpleclans.member.bank")) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
return;
}
ClanPlayer cp = plugin.getClanManager().getClanPlayer(player);
double plmoney = plugin.getPermissionsManager().playerGetMoney(player);
double money = 0;
Clan clan = cp.getClan();
if (clan == null) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("not.a.member.of.any.clan"));
return;
}
double clanbalance = clan.getBalance();
if (clan.isMember(player)) {
if (!clan.isVerified()) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("clan.is.not.verified"));
return;
}
if (!cp.isTrusted()) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("only.trusted.players.can.access.clan.stats"));
return;
}
if (arg.length == 1) {
if (arg[0].equalsIgnoreCase("status")) {
player.sendMessage(ChatColor.AQUA + MessageFormat.format(plugin.getLang("clan.balance"), clanbalance));
}
} else if (arg.length == 2) {
if (arg[1].matches("[0-9]+")) {
money = Double.parseDouble(arg[1]);
}
if (arg[0].equalsIgnoreCase("deposit")) {
if (!cp.getClan().isLeader(player) && !clan.isAllowDeposit()) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.leader.permissions"));
return;
}
if (arg[1].equalsIgnoreCase("all")) {
clan.deposit(plmoney, player);
} else {
clan.deposit(money, player);
}
} else if (arg[0].equalsIgnoreCase("withdraw")) {
if (!cp.getClan().isLeader(player) && !clan.isAllowWithdraw()) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.leader.permissions"));
return;
}
if (arg[1].equalsIgnoreCase("all")) {
clan.withdraw(clanbalance, player);
} else {
clan.withdraw(money, player);
}
} else {
ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("usage.bank"), plugin.getSettingsManager().getCommandClan()));
}
} else {
ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("usage.bank"), plugin.getSettingsManager().getCommandClan()));
}
}
}
}
@@ -1,75 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans.commands;
import net.sacredlabyrinth.phaed.simpleclans.*;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
/**
* @author phaed
*/
public class BbCommand {
public BbCommand() {
}
/**
* Execute the command
*
* @param player
* @param arg
*/
public void execute(Player player, String[] arg) {
SimpleClans plugin = SimpleClans.getInstance();
ClanPlayer cp = plugin.getClanManager().getClanPlayer(player);
if (cp == null) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("not.a.member.of.any.clan"));
return;
}
Clan clan = cp.getClan();
if (!clan.isVerified()) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("clan.is.not.verified"));
return;
}
if (arg.length == 0) {
if (!plugin.getPermissionsManager().has(player, "simpleclans.member.bb")) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
return;
}
clan.displayBb(player);
return;
}
if (arg.length == 1 && arg[0].equalsIgnoreCase("clear")) {
if (!plugin.getPermissionsManager().has(player, "simpleclans.leader.bb-clear")) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
return;
}
if (!cp.isTrusted() || !cp.isLeader()) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.leader.permissions"));
return;
}
cp.getClan().clearBb();
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("cleared.bb"));
return;
}
if (!plugin.getPermissionsManager().has(player, "simpleclans.member.bb-add")) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
return;
}
if (!cp.isTrusted()) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.leader.permissions"));
return;
}
String msg = Helper.toMessage(arg);
clan.addBb(player.getName(), ChatColor.AQUA + player.getName() + ": " + ChatColor.WHITE + msg);
plugin.getStorageManager().updateClan(clan);
}
}
@@ -1,69 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans.commands;
import net.sacredlabyrinth.phaed.simpleclans.ChatBlock;
import net.sacredlabyrinth.phaed.simpleclans.Clan;
import net.sacredlabyrinth.phaed.simpleclans.ClanPlayer;
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import java.text.MessageFormat;
/**
* @author phaed
*/
public class ClanffCommand {
public ClanffCommand() {
}
/**
* Execute the command
*
* @param player
* @param arg
*/
public void execute(Player player, String[] arg) {
SimpleClans plugin = SimpleClans.getInstance();
if (!plugin.getPermissionsManager().has(player, "simpleclans.leader.ff")) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
return;
}
ClanPlayer cp = plugin.getClanManager().getClanPlayer(player);
if (cp == null) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("not.a.member.of.any.clan"));
return;
}
Clan clan = cp.getClan();
if (!clan.isLeader(player)) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.leader.permissions"));
return;
}
if (arg.length != 1) {
ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("usage.clanff"), plugin.getSettingsManager().getCommandClan()));
return;
}
String action = arg[0];
if (action.equalsIgnoreCase(plugin.getLang("allow"))) {
clan.addBb(player.getName(), ChatColor.AQUA + plugin.getLang("clan.wide.friendly.fire.is.allowed"));
clan.setFriendlyFire(true);
plugin.getStorageManager().updateClan(clan);
return;
}
if (!action.equalsIgnoreCase(plugin.getLang("block"))) {
ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("usage.clanff"), plugin.getSettingsManager().getCommandClan()));
return;
}
clan.addBb(player.getName(), ChatColor.AQUA + plugin.getLang("clan.wide.friendly.fire.blocked"));
clan.setFriendlyFire(false);
plugin.getStorageManager().updateClan(clan);
}
}
@@ -1,112 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans.commands;
import net.sacredlabyrinth.phaed.simpleclans.*;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
/**
* @author phaed
*/
public class CoordsCommand {
public CoordsCommand() {
}
/**
* Execute the command
*
* @param player
* @param arg
*/
public void execute(Player player, String[] arg) {
SimpleClans plugin = SimpleClans.getInstance();
String headColor = plugin.getSettingsManager().getPageHeadingsColor();
String subColor = plugin.getSettingsManager().getPageSubTitleColor();
if (!plugin.getPermissionsManager().has(player, "simpleclans.member.coords")) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
return;
}
ClanPlayer cp = plugin.getClanManager().getClanPlayer(player);
if (cp == null) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("not.a.member.of.any.clan"));
return;
}
Clan clan = cp.getClan();
if (!clan.isVerified()) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("clan.is.not.verified"));
return;
}
if (!cp.isTrusted()) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("only.trusted.players.can.access.clan.coords"));
return;
}
if (arg.length != 0) {
ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("usage.0.coords"), plugin.getSettingsManager().getCommandClan()));
return;
}
ChatBlock chatBlock = new ChatBlock();
chatBlock.setFlexibility(true, false, false, false);
chatBlock.setAlignment("l", "c", "c", "c");
chatBlock.addRow(" " + headColor + plugin.getLang("name"), plugin.getLang("distance"), plugin.getLang("coords.upper"), plugin.getLang("world"));
List<ClanPlayer> members = Helper.stripOffLinePlayers(clan.getMembers());
Map<Integer, List<String>> rows = new TreeMap<>();
for (ClanPlayer cpm : members) {
Player p = cpm.toPlayer();
if (p != null) {
String name = (cpm.isLeader() ? plugin.getSettingsManager().getPageLeaderColor() : (cpm.isTrusted() ? plugin.getSettingsManager().getPageTrustedColor() : plugin.getSettingsManager().getPageUnTrustedColor())) + cpm.getName();
Location loc = p.getLocation();
int distance = (int) Math.ceil(loc.toVector().distance(player.getLocation().toVector()));
String coords = loc.getBlockX() + " " + loc.getBlockY() + " " + loc.getBlockZ();
String world = loc.getWorld().getName();
List<String> cols = new ArrayList<>();
cols.add(" " + name);
cols.add(ChatColor.AQUA + "" + distance);
cols.add(ChatColor.WHITE + "" + coords);
cols.add(world);
rows.put(distance, cols);
}
}
if (rows.isEmpty()) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("you.are.the.only.member.online"));
return;
}
for (List<String> col : rows.values()) {
chatBlock.addRow(col.get(0), col.get(1), col.get(2), col.get(3));
}
ChatBlock.sendBlank(player);
ChatBlock.saySingle(player, plugin.getSettingsManager().getPageClanNameColor() + Helper.capitalize(clan.getName()) + subColor + " " + plugin.getLang("coords") + " " + headColor + Helper.generatePageSeparator(plugin.getSettingsManager().getPageSep()));
ChatBlock.sendBlank(player);
boolean more = chatBlock.sendBlock(player, plugin.getSettingsManager().getPageSize());
if (more) {
plugin.getStorageManager().addChatBlock(player, chatBlock);
ChatBlock.sendBlank(player);
ChatBlock.sendMessage(player, headColor + MessageFormat.format(plugin.getLang("view.next.page"), plugin.getSettingsManager().getCommandMore()));
}
ChatBlock.sendBlank(player);
}
}
@@ -1,112 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans.commands;
import net.sacredlabyrinth.phaed.simpleclans.ChatBlock;
import net.sacredlabyrinth.phaed.simpleclans.Clan;
import net.sacredlabyrinth.phaed.simpleclans.ClanPlayer;
import net.sacredlabyrinth.phaed.simpleclans.Helper;
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import java.text.MessageFormat;
/**
* @author phaed
*/
public class CreateCommand {
public CreateCommand() {
}
/**
* Execute the command
*
* @param player
* @param arg
*/
public void execute(Player player, String[] arg) {
SimpleClans plugin = SimpleClans.getInstance();
if (!plugin.getPermissionsManager().has(player, "simpleclans.leader.create")) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
return;
}
if (arg.length < 2) {
ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("usage.create.tag"), plugin.getSettingsManager().getCommandClan()));
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("example.clan.create"));
return;
}
String tag = arg[0];
String cleanTag = Helper.cleanTag(arg[0]);
String name = Helper.toMessage(Helper.removeFirst(arg));
boolean bypass = plugin.getPermissionsManager().has(player, "simpleclans.mod.bypass");
if (!bypass) {
if (cleanTag.length() > plugin.getSettingsManager().getTagMaxLength()) {
ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("your.clan.tag.cannot.be.longer.than.characters"), plugin.getSettingsManager().getTagMaxLength()));
return;
}
if (cleanTag.length() <= plugin.getSettingsManager().getTagMinLength()) {
ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("your.clan.tag.must.be.longer.than.characters"), plugin.getSettingsManager().getTagMinLength()));
return;
}
if (!plugin.getPermissionsManager().has(player, "simpleclans.leader.coloredtag") && tag.contains("&")) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("your.tag.cannot.contain.color.codes"));
return;
}
if (plugin.getSettingsManager().hasDisallowedColor(tag)) {
ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("your.tag.cannot.contain.the.following.colors"), plugin.getSettingsManager().getDisallowedColorString()));
return;
}
if (Helper.stripColors(name).length() > plugin.getSettingsManager().getClanMaxLength()) {
ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("your.clan.name.cannot.be.longer.than.characters"), plugin.getSettingsManager().getClanMaxLength()));
return;
}
if (Helper.stripColors(name).length() <= plugin.getSettingsManager().getClanMinLength()) {
ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("your.clan.name.must.be.longer.than.characters"), plugin.getSettingsManager().getClanMinLength()));
return;
}
if (plugin.getSettingsManager().isDisallowedWord(cleanTag.toLowerCase())) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("that.tag.name.is.disallowed"));
return;
}
}
if (!cleanTag.matches("[0-9a-zA-Z]*")) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("your.clan.tag.can.only.contain.letters.numbers.and.color.codes"));
return;
}
if (name.contains("&")) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("your.clan.name.cannot.contain.color.codes"));
return;
}
ClanPlayer cp = plugin.getClanManager().getClanPlayer(player);
if (cp != null) {
ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("you.must.first.resign"), cp.getClan().getName()));
return;
}
if (plugin.getClanManager().isClan(cleanTag)) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("clan.with.this.tag.already.exists"));
return;
}
if (plugin.getClanManager().purchaseCreation(player)) {
plugin.getClanManager().createClan(player, tag, name);
Clan clan = plugin.getClanManager().getClan(tag);
clan.addBb(player.getName(), ChatColor.AQUA + MessageFormat.format(plugin.getLang("clan.created"), name));
plugin.getStorageManager().updateClan(clan);
if (plugin.getSettingsManager().isRequireVerification()) {
boolean verified = !plugin.getSettingsManager().isRequireVerification() || plugin.getPermissionsManager().has(player, "simpleclans.mod.verify");
if (!verified) {
ChatBlock.sendMessage(player, ChatColor.AQUA + plugin.getLang("get.your.clan.verified.to.access.advanced.features"));
}
}
}
}
}
@@ -1,126 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans.commands;
import net.sacredlabyrinth.phaed.simpleclans.ChatBlock;
import net.sacredlabyrinth.phaed.simpleclans.Clan;
import net.sacredlabyrinth.phaed.simpleclans.ClanPlayer;
import net.sacredlabyrinth.phaed.simpleclans.Helper;
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import java.text.MessageFormat;
import java.util.UUID;
import net.sacredlabyrinth.phaed.simpleclans.uuid.UUIDMigration;
/**
* @author phaed
*/
public class DemoteCommand {
public DemoteCommand() {
}
/**
* Execute the command
*
* @param player
* @param arg
*/
public void execute(Player player, String[] arg) {
SimpleClans plugin = SimpleClans.getInstance();
if (arg.length != 1) {
ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("usage.demote.leader"), plugin.getSettingsManager().getCommandClan()));
return;
}
String demotedName = arg[0];
if (demotedName == null) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.player.matched"));
return;
}
final boolean hasUUID = SimpleClans.getInstance().hasUUID();
ClanPlayer toDemote;
if (hasUUID) {
UUID uuid = UUIDMigration.getForcedPlayerUUID(demotedName);
toDemote = plugin.getClanManager().getAnyClanPlayer(uuid);
} else {
toDemote = plugin.getClanManager().getAnyClanPlayer(demotedName);
}
if (plugin.getPermissionsManager().has(player, "simpleclans.admin.demote")) {
if (!toDemote.isLeader()) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("player.is.not.a.leader.of.any.clan"));
return;
}
final Clan clan = toDemote.getClan();
if (clan.getLeaders().size() == 1) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("you.cannot.demote.the.last.leader"));
return;
}
if (hasUUID) {
clan.demote(toDemote.getUniqueId());
} else {
clan.demote(demotedName);
}
clan.addBb(player.getName(), ChatColor.AQUA + MessageFormat.format(plugin.getLang("demoted.back.to.member"), Helper.capitalize(demotedName)));
ChatBlock.sendMessage(player, ChatColor.AQUA + plugin.getLang("player.successfully.demoted"));
return;
}
if (!plugin.getPermissionsManager().has(player, "simpleclans.leader.demote")) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
return;
}
ClanPlayer cp = plugin.getClanManager().getClanPlayer(player);
if (cp == null) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("not.a.member.of.any.clan"));
return;
}
Clan clan = cp.getClan();
if (!clan.isLeader(player)) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.leader.permissions"));
return;
}
if (!clan.enoughLeadersOnlineToDemote(toDemote)) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("not.enough.leaders.online.to.vote.on.demotion"));
return;
}
if (hasUUID) {
UUID uuid = UUIDMigration.getForcedPlayerUUID(demotedName);
if (!clan.isLeader(uuid)) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("player.is.not.a.leader.of.your.clan"));
return;
}
if (clan.getLeaders().size() != 1 && plugin.getSettingsManager().isConfirmationForDemote()) {
plugin.getRequestManager().addDemoteRequest(cp, demotedName, clan);
ChatBlock.sendMessage(player, ChatColor.AQUA + plugin.getLang("demotion.vote.has.been.requested.from.all.leaders"));
return;
}
clan.addBb(player.getName(), ChatColor.AQUA + MessageFormat.format(plugin.getLang("demoted.back.to.member"), Helper.capitalize(demotedName)));
clan.demote(uuid);
} else {
if (!clan.isLeader(demotedName)) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("player.is.not.a.leader.of.your.clan"));
return;
}
if (clan.getLeaders().size() != 1 && plugin.getSettingsManager().isConfirmationForDemote()) {
plugin.getRequestManager().addDemoteRequest(cp, demotedName, clan);
ChatBlock.sendMessage(player, ChatColor.AQUA + plugin.getLang("demotion.vote.has.been.requested.from.all.leaders"));
return;
}
clan.addBb(player.getName(), ChatColor.AQUA + MessageFormat.format(plugin.getLang("demoted.back.to.member"), Helper.capitalize(demotedName)));
clan.demote(demotedName);
}
}
}
@@ -1,78 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans.commands;
import net.sacredlabyrinth.phaed.simpleclans.ChatBlock;
import net.sacredlabyrinth.phaed.simpleclans.Clan;
import net.sacredlabyrinth.phaed.simpleclans.ClanPlayer;
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import java.text.MessageFormat;
/**
* @author phaed
*/
public class DisbandCommand {
public DisbandCommand() {
}
/**
* Execute the command
*
* @param player
* @param arg
*/
public void execute(Player player, String[] arg) {
SimpleClans plugin = SimpleClans.getInstance();
if (arg.length == 0) {
if (!plugin.getPermissionsManager().has(player, "simpleclans.leader.disband")) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
return;
}
ClanPlayer cp = plugin.getClanManager().getClanPlayer(player);
if (cp == null) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("not.a.member.of.any.clan"));
return;
}
Clan clan = cp.getClan();
if (!clan.isLeader(player)) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.leader.permissions"));
return;
}
if (clan.getLeaders().size() != 1) {
plugin.getRequestManager().addDisbandRequest(cp, clan);
ChatBlock.sendMessage(player, ChatColor.AQUA + plugin.getLang("clan.disband.vote.has.been.requested.from.all.leaders"));
return;
}
clan.clanAnnounce(player.getName(), ChatColor.AQUA + MessageFormat.format(plugin.getLang("clan.has.been.disbanded"), clan.getName()));
clan.disband();
return;
}
if (arg.length > 1) {
ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("usage.0.disband"), plugin.getSettingsManager().getCommandClan()));
return;
}
if (!plugin.getPermissionsManager().has(player, "simpleclans.mod.disband")) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
return;
}
Clan clan = plugin.getClanManager().getClan(arg[0]);
if (clan == null) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.clan.matched"));
return;
}
plugin.getClanManager().serverAnnounce(ChatColor.AQUA + MessageFormat.format(plugin.getLang("clan.has.been.disbanded"), clan.getName()));
clan.disband();
}
}
@@ -1,85 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans.commands;
import java.text.MessageFormat;
import net.sacredlabyrinth.phaed.simpleclans.ChatBlock;
import net.sacredlabyrinth.phaed.simpleclans.Clan;
import net.sacredlabyrinth.phaed.simpleclans.ClanPlayer;
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
/**
*
* @author roinujnosde
*/
public class FeeCommand {
/**
* Executes the command
*
* @param player
* @param args
*/
public void execute(Player player, String[] args) {
SimpleClans plugin = SimpleClans.getInstance();
if (!plugin.getSettingsManager().isMemberFee()) {
return;
}
if (args.length >= 1) {
ClanPlayer cp = plugin.getClanManager().getAnyClanPlayer(player.getUniqueId());
Clan clan = cp.getClan();
if (!clan.isVerified()) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("clan.is.not.verified"));
return;
}
if (args[0].equalsIgnoreCase("check")) {
if (!plugin.getPermissionsManager().has(player, "simpleclans.member.fee-check")) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
return;
}
ChatBlock.sendMessage(player, ChatColor.AQUA
+ MessageFormat.format(
plugin.getLang("the.fee.is.0.and.its.current.value.is.1"),
clan.isMemberFeeEnabled() ? plugin.getLang("fee.enabled") : plugin.getLang("fee.disabled"),
clan.getMemberFee()
));
return;
}
if (args.length == 2 && args[0].equalsIgnoreCase("set")) {
if (!plugin.getPermissionsManager().has(player, "simpleclans.leader.fee")) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
return;
}
if (!cp.isLeader()) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.leader.permissions"));
return;
}
double newFee = 0;
try {
newFee = Double.parseDouble(args[1]);
} catch (NumberFormatException ignored) {
player.sendMessage(ChatColor.RED + plugin.getLang("invalid.fee"));
return;
}
double maxFee = plugin.getSettingsManager().getMaxMemberFee();
if (newFee > maxFee) {
ChatBlock.sendMessage(player, ChatColor.RED
+ MessageFormat.format(plugin.getLang("max.fee.allowed.is.0"), maxFee));
return;
}
if (plugin.getClanManager().purchaseMemberFeeSet(player)) {
clan.setMemberFee(newFee);
clan.addBb(player.getName(), ChatColor.AQUA + MessageFormat.format(plugin.getLang("bb.fee.set"), newFee));
ChatBlock.sendMessage(player, ChatColor.AQUA + plugin.getLang("fee.set"));
plugin.getStorageManager().updateClanAsync(clan);
}
return;
}
}
ChatBlock.sendMessage(player, ChatColor.RED
+ MessageFormat.format(plugin.getLang("usage.fee"), plugin.getSettingsManager().getCommandClan()));
}
}
@@ -1,61 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans.commands;
import net.sacredlabyrinth.phaed.simpleclans.ChatBlock;
import net.sacredlabyrinth.phaed.simpleclans.ClanPlayer;
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import java.text.MessageFormat;
/**
* @author phaed
*/
public class FfCommand {
public FfCommand() {
}
/**
* Execute the command
*
* @param player
* @param arg
*/
public void execute(Player player, String[] arg) {
SimpleClans plugin = SimpleClans.getInstance();
if (!plugin.getPermissionsManager().has(player, "simpleclans.member.ff")) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
return;
}
ClanPlayer cp = plugin.getClanManager().getClanPlayer(player);
if (cp == null) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("not.a.member.of.any.clan"));
return;
}
if (arg.length != 1) {
ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("usage.0.ff.allow.auto"), plugin.getSettingsManager().getCommandClan()));
return;
}
String action = arg[0];
if (action.equalsIgnoreCase(plugin.getLang("allow"))) {
cp.setFriendlyFire(true);
plugin.getStorageManager().updateClanPlayer(cp);
ChatBlock.sendMessage(player, ChatColor.AQUA + plugin.getLang("personal.friendly.fire.is.set.to.allowed"));
return;
}
if (action.equalsIgnoreCase(plugin.getLang("auto"))) {
cp.setFriendlyFire(false);
plugin.getStorageManager().updateClanPlayer(cp);
ChatBlock.sendMessage(player, ChatColor.AQUA + plugin.getLang("friendy.fire.is.now.managed.by.your.clan"));
return;
}
ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("usage.0.ff.allow.auto"), plugin.getSettingsManager().getCommandClan()));
}
}
@@ -1,55 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans.commands;
import net.sacredlabyrinth.phaed.simpleclans.ChatBlock;
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import java.text.MessageFormat;
/**
* @author phaed
*/
public class GlobalffCommand {
public GlobalffCommand() {
}
/**
* Execute the command
*
* @param player
* @param arg
*/
public void execute(CommandSender player, String[] arg) {
SimpleClans plugin = SimpleClans.getInstance();
if (arg.length != 1) {
ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("usage.0.ff.allow.auto"), plugin.getSettingsManager().getCommandClan()));
return;
}
String action = arg[0];
if (action.equalsIgnoreCase(plugin.getLang("allow"))) {
if (plugin.getSettingsManager().isGlobalff()) {
ChatBlock.sendMessage(player, ChatColor.AQUA + plugin.getLang("global.friendly.fire.is.already.being.allowed"));
} else {
plugin.getSettingsManager().setGlobalff(true);
ChatBlock.sendMessage(player, ChatColor.AQUA + plugin.getLang("global.friendly.fire.is.set.to.allowed"));
}
return;
}
if (action.equalsIgnoreCase(plugin.getLang("auto"))) {
if (!plugin.getSettingsManager().isGlobalff()) {
ChatBlock.sendMessage(player, ChatColor.AQUA + plugin.getLang("global.friendy.fire.is.already.being.managed.by.each.clan"));
} else {
plugin.getSettingsManager().setGlobalff(false);
ChatBlock.sendMessage(player, ChatColor.AQUA + plugin.getLang("global.friendy.fire.is.now.managed.by.each.clan"));
}
return;
}
ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("usage.0.globalff.allow.auto"), plugin.getSettingsManager().getCommandClan()));
}
}
@@ -1,209 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans.commands;
import net.sacredlabyrinth.phaed.simpleclans.*;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import java.text.MessageFormat;
import java.util.List;
import java.util.Random;
import net.sacredlabyrinth.phaed.simpleclans.events.HomeRegroupEvent;
import net.sacredlabyrinth.phaed.simpleclans.events.PlayerHomeSetEvent;
/**
* @author phaed
*/
public class HomeCommand {
public HomeCommand() {
}
/**
* Execute the command
*
* @param player
* @param arg
*/
public void execute(Player player, String[] arg) {
SimpleClans plugin = SimpleClans.getInstance();
if (arg.length == 2) {
if (arg[0].equalsIgnoreCase("set") && plugin.getPermissionsManager().has(player, "simpleclans.mod.home")) {
if (!plugin.getClanManager().purchaseHomeTeleportSet(player)) {
return;
}
Location loc = player.getLocation();
Clan clan = plugin.getClanManager().getClan(arg[1]);
if (clan == null) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("the.clan.does.not.exist"));
return;
}
clan.setHomeLocation(loc);
ChatBlock.sendMessage(player, ChatColor.AQUA + MessageFormat.format(plugin.getLang("hombase.mod.set"), clan.getName()) + " " + ChatColor.YELLOW + Helper.toLocationString(loc));
return;
}
if (arg[0].equalsIgnoreCase("tp") && plugin.getPermissionsManager().has(player, "simpleclans.mod.hometp")) {
Clan clan = plugin.getClanManager().getClan(arg[1]);
if (clan == null) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("the.clan.does.not.exist"));
return;
}
Location loc = clan.getHomeLocation();
if (loc == null) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("hombase.not.set"));
return;
}
player.teleport(loc);
ChatBlock.sendMessage(player, ChatColor.AQUA + MessageFormat.format(plugin.getLang("now.at.homebase"), clan.getName()));
return;
}
}
ClanPlayer cp = plugin.getClanManager().getClanPlayer(player);
if (cp == null) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("not.a.member.of.any.clan"));
return;
}
Clan clan = cp.getClan();
if (!clan.isVerified()) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("clan.is.not.verified"));
return;
}
if (!cp.isTrusted()) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("only.trusted.players.can.access.clan.vitals"));
return;
}
if (arg.length == 0) {
if (!plugin.getPermissionsManager().has(player, "simpleclans.member.home")) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
return;
}
Location loc = clan.getHomeLocation();
if (loc == null) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("hombase.not.set"));
return;
}
if (plugin.getClanManager().purchaseHomeTeleport(player)) {
plugin.getTeleportManager().addPlayer(player, clan.getHomeLocation(), clan.getName());
}
return;
}
if (arg[0].equalsIgnoreCase("set")) {
if (!cp.isLeader()) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.leader.permissions"));
return;
}
if (!plugin.getPermissionsManager().has(player, "simpleclans.leader.home-set")) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
return;
}
if (plugin.getSettingsManager().isHomebaseSetOnce() && clan.getHomeLocation() != null && !plugin.getPermissionsManager().has(player, "simpleclans.mod.home")) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("home.base.only.once"));
return;
}
PlayerHomeSetEvent homeSetEvent = new PlayerHomeSetEvent(clan, cp, player.getLocation());
SimpleClans.getInstance().getServer().getPluginManager().callEvent(homeSetEvent);
if (homeSetEvent.isCancelled() || !plugin.getClanManager().purchaseHomeTeleportSet(player)) {
return;
}
clan.setHomeLocation(player.getLocation());
ChatBlock.sendMessage(player, ChatColor.AQUA + MessageFormat.format(plugin.getLang("hombase.set"), ChatColor.YELLOW + Helper.toLocationString(player.getLocation())));
return;
}
if (arg[0].equalsIgnoreCase("clear")) {
if (!cp.isLeader()) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.leader.permissions"));
return;
}
if (!plugin.getPermissionsManager().has(player, "simpleclans.leader.home-set")) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
return;
}
if (plugin.getSettingsManager().isHomebaseSetOnce() && clan.getHomeLocation() != null && !plugin.getPermissionsManager().has(player, "simpleclans.mod.home")) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("home.base.only.once"));
return;
}
clan.setHomeLocation(null);
ChatBlock.sendMessage(player, ChatColor.AQUA + plugin.getLang("hombase.cleared"));
return;
}
if (arg[0].equalsIgnoreCase("regroup")) {
if (!SimpleClans.getInstance().getSettingsManager().getAllowReGroupCommand()) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
return;
}
Location loc;
if (arg.length >= 2 && arg[1].equalsIgnoreCase("me")) {
loc = player.getLocation();
} else {
loc = cp.getClan().getHomeLocation();
}
if (!cp.isLeader()) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.leader.permissions"));
}
if (!plugin.getPermissionsManager().has(player, "simpleclans.leader.home-regroup")) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
}
HomeRegroupEvent homeRegroupEvent = new HomeRegroupEvent(clan, cp, clan.getOnlineMembers(), loc);
SimpleClans.getInstance().getServer().getPluginManager().callEvent(homeRegroupEvent);
if (homeRegroupEvent.isCancelled() || !plugin.getClanManager().purchaseHomeRegroup(player)) {
return;
}
List<ClanPlayer> members = clan.getOnlineMembers();
for (ClanPlayer ccp : members) {
Player pl = ccp.toPlayer();
if (pl == null) {
continue;
}
int x = loc.getBlockX();
int z = loc.getBlockZ();
player.sendBlockChange(new Location(loc.getWorld(), x + 1, loc.getBlockY(), z + 1), Material.GLASS, (byte) 0);
player.sendBlockChange(new Location(loc.getWorld(), x - 1, loc.getBlockY(), z - 1), Material.GLASS, (byte) 0);
player.sendBlockChange(new Location(loc.getWorld(), x + 1, loc.getBlockY(), z - 1), Material.GLASS, (byte) 0);
player.sendBlockChange(new Location(loc.getWorld(), x - 1, loc.getBlockY(), z + 1), Material.GLASS, (byte) 0);
Random r = new Random();
int xx = r.nextInt(2) - 1;
int zz = r.nextInt(2) - 1;
if (xx == 0 && zz == 0) {
xx = 1;
}
x = x + xx;
z = z + zz;
plugin.getTeleportManager().addPlayer(player, new Location(loc.getWorld(), x + .5, loc.getBlockY(), z + .5), clan.getName());
}
ChatBlock.sendMessage(player, ChatColor.AQUA + plugin.getLang("hombase.set") + ChatColor.YELLOW + Helper.toLocationString(loc));
return;
}
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
}
}
@@ -1,85 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans.commands;
import net.sacredlabyrinth.phaed.simpleclans.*;
import net.sacredlabyrinth.phaed.simpleclans.uuid.UUIDMigration;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import java.text.MessageFormat;
/**
* @author phaed
*/
public class InviteCommand {
public InviteCommand() {
}
/**
* Execute the command
*
* @param player
* @param arg
*/
public void execute(Player player, String[] arg) {
SimpleClans plugin = SimpleClans.getInstance();
if (!plugin.getPermissionsManager().has(player, "simpleclans.leader.invite")) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
return;
}
ClanPlayer cp = plugin.getClanManager().getClanPlayer(player);
if (cp == null) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("not.a.member.of.any.clan"));
return;
}
Clan clan = cp.getClan();
if (!clan.isLeader(player)) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.leader.permissions"));
return;
}
if (arg.length != 1) {
ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("usage.0.invite.player"), plugin.getSettingsManager().getCommandClan()));
return;
}
Player invited = Helper.getPlayer(arg[0]);
if (invited == null) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.player.matched"));
return;
}
if (!plugin.getPermissionsManager().has(invited, "simpleclans.member.can-join")) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("the.player.doesn.t.not.have.the.permissions.to.join.clans"));
return;
}
if (invited.getName().equals(player.getName())) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("you.cannot.invite.yourself"));
return;
}
if (plugin.getSettingsManager().isBanned(player.getName())) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("this.player.is.banned.from.using.clan.commands"));
return;
}
ClanPlayer cpInv = plugin.getClanManager().getClanPlayer(invited);
if (cpInv != null) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("the.player.is.already.member.of.another.clan"));
return;
}
if (!plugin.getClanManager().purchaseInvite(player)) {
return;
}
if (clan.getSize() >= plugin.getSettingsManager().getMaxMembers()) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("the.clan.members.reached.limit"));
return;
}
plugin.getRequestManager().addInviteRequest(cp, invited.getName(), clan);
ChatBlock.sendMessage(player, ChatColor.AQUA + MessageFormat.format(plugin.getLang("has.been.asked.to.join"), Helper.capitalize(invited.getName()), clan.getName()));
}
}
@@ -1,81 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans.commands;
import net.sacredlabyrinth.phaed.simpleclans.ChatBlock;
import net.sacredlabyrinth.phaed.simpleclans.Clan;
import net.sacredlabyrinth.phaed.simpleclans.ClanPlayer;
import net.sacredlabyrinth.phaed.simpleclans.Helper;
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import java.text.MessageFormat;
import net.sacredlabyrinth.phaed.simpleclans.uuid.UUIDMigration;
/**
* @author phaed
*/
public class KickCommand {
public KickCommand() {
}
/**
* Execute the command
*
* @param player
* @param arg
*/
public void execute(Player player, String[] arg) {
SimpleClans plugin = SimpleClans.getInstance();
if (!plugin.getPermissionsManager().has(player, "simpleclans.leader.kick")) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
return;
}
ClanPlayer cp = plugin.getClanManager().getClanPlayer(player);
if (cp == null) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("not.a.member.of.any.clan"));
return;
}
Clan clan = cp.getClan();
if (!clan.isLeader(player)) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.leader.permissions"));
return;
}
if (arg.length != 1) {
ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("usage.kick.player"), plugin.getSettingsManager().getCommandClan()));
return;
}
String kicked = arg[0];
if (kicked == null) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.player.matched"));
return;
}
if (kicked.equalsIgnoreCase(player.getName())) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("you.cannot.kick.yourself"));
return;
}
if (!clan.isMember(kicked)) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("the.player.is.not.a.member.of.your.clan"));
return;
}
if (clan.isLeader(kicked)) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("you.cannot.kick.another.leader"));
return;
}
clan.addBb(player.getName(), ChatColor.AQUA + MessageFormat.format(plugin.getLang("has.been.kicked.by"), Helper.capitalize(kicked), player.getName()));
if (SimpleClans.getInstance().hasUUID()) {
clan.removePlayerFromClan(UUIDMigration.getForcedPlayerUUID(kicked));
} else {
clan.removePlayerFromClan(kicked);
}
}
}
@@ -1,90 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans.commands;
import net.sacredlabyrinth.phaed.simpleclans.*;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import java.text.MessageFormat;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
public class KillsCommand {
public KillsCommand() {
}
/**
* Execute the command
*
* @param player
* @param arg
*/
public void execute(Player player, String[] arg) {
SimpleClans plugin = SimpleClans.getInstance();
String headColor = plugin.getSettingsManager().getPageHeadingsColor();
String subColor = plugin.getSettingsManager().getPageSubTitleColor();
if (!plugin.getPermissionsManager().has(player, "simpleclans.member.kills")) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
return;
}
ClanPlayer cp = plugin.getClanManager().getClanPlayer(player);
if (cp == null) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("not.a.member.of.any.clan"));
return;
}
Clan clan = cp.getClan();
if (!clan.isVerified()) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("clan.is.not.verified"));
return;
}
if (!cp.isTrusted()) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("only.trusted.players.can.access.clan.stats"));
return;
}
String polledPlayerName = player.getName();
if (arg.length == 1) {
polledPlayerName = arg[0];
}
ChatBlock chatBlock = new ChatBlock();
chatBlock.setFlexibility(true, false);
chatBlock.setAlignment("l", "c");
chatBlock.addRow(" " + headColor + plugin.getLang("victim"), plugin.getLang("killcount"));
Map<String, Integer> killsPerPlayerUnordered = plugin.getStorageManager().getKillsPerPlayer(polledPlayerName);
if (killsPerPlayerUnordered.isEmpty()) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("nokillsfound"));
return;
}
Map<String, Integer> killsPerPlayer = Helper.sortByValue(killsPerPlayerUnordered);
for (Entry<String, Integer> playerKills : killsPerPlayer.entrySet()) {
int count = playerKills.getValue();
chatBlock.addRow(" " + playerKills.getKey(), ChatColor.AQUA + "" + count);
}
ChatBlock.saySingle(player, plugin.getSettingsManager().getPageClanNameColor() + Helper.capitalize(polledPlayerName) + subColor + " " + plugin.getLang("kills") + " " + headColor + Helper.generatePageSeparator(plugin.getSettingsManager().getPageSep()));
ChatBlock.sendBlank(player);
boolean more = chatBlock.sendBlock(player, plugin.getSettingsManager().getPageSize());
if (more) {
plugin.getStorageManager().addChatBlock(player, chatBlock);
ChatBlock.sendBlank(player);
ChatBlock.sendMessage(player, headColor + MessageFormat.format(plugin.getLang("view.next.page"), plugin.getSettingsManager().getCommandMore()));
}
ChatBlock.sendBlank(player);
}
}
@@ -1,91 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans.commands;
import net.sacredlabyrinth.phaed.simpleclans.ChatBlock;
import net.sacredlabyrinth.phaed.simpleclans.ClanPlayer;
import net.sacredlabyrinth.phaed.simpleclans.Helper;
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import java.text.DecimalFormat;
import java.text.MessageFormat;
import java.text.NumberFormat;
import java.util.List;
/**
* @author phaed
*/
public class LeaderboardCommand {
public LeaderboardCommand() {
}
/**
* Execute the command
*
* @param player
* @param arg
*/
public void execute(Player player, String[] arg) {
SimpleClans plugin = SimpleClans.getInstance();
String headColor = plugin.getSettingsManager().getPageHeadingsColor();
String subColor = plugin.getSettingsManager().getPageSubTitleColor();
NumberFormat formatter = new DecimalFormat("#.#");
if (arg.length != 0) {
ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("usage.0.leaderboard"), plugin.getSettingsManager().getCommandClan()));
return;
}
if (!plugin.getPermissionsManager().has(player, "simpleclans.anyone.leaderboard")) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
return;
}
List<ClanPlayer> clanPlayers = plugin.getClanManager().getAllClanPlayers();
plugin.getClanManager().sortClanPlayersByKDR(clanPlayers);
ChatBlock chatBlock = new ChatBlock();
ChatBlock.sendBlank(player);
ChatBlock.saySingle(player, plugin.getSettingsManager().getServerName() + subColor + " " + plugin.getLang("leaderboard.command") + " " + headColor + Helper.generatePageSeparator(plugin.getSettingsManager().getPageSep()));
ChatBlock.sendBlank(player);
ChatBlock.sendMessage(player, headColor + MessageFormat.format(plugin.getLang("total.clan.players.0"), subColor + clanPlayers.size()));
ChatBlock.sendBlank(player);
chatBlock.setAlignment("c", "l", "c", "c", "c", "c");
chatBlock.addRow(" " + headColor + plugin.getLang("rank"), plugin.getLang("player"), plugin.getLang("kdr"), plugin.getLang("clan"), plugin.getLang("seen"));
int rank = 1;
for (ClanPlayer cp : clanPlayers) {
Player p = cp.toPlayer();
boolean isOnline = false;
if (p != null) {
isOnline = true;
}
String name = (cp.isLeader() ? plugin.getSettingsManager().getPageLeaderColor() : (cp.isTrusted() ? plugin.getSettingsManager().getPageTrustedColor() : plugin.getSettingsManager().getPageUnTrustedColor())) + cp.getName();
String lastSeen = isOnline ? ChatColor.GREEN + plugin.getLang("online") : ChatColor.WHITE + cp.getLastSeenDaysString();
String clanTag = ChatColor.WHITE + plugin.getLang("free.agent");
if (cp.getClan() != null) {
clanTag = cp.getClan().getColorTag();
}
chatBlock.addRow(" " + rank, name, ChatColor.YELLOW + "" + formatter.format(cp.getKDR()), ChatColor.WHITE + clanTag, lastSeen);
rank++;
}
boolean more = chatBlock.sendBlock(player, plugin.getSettingsManager().getPageSize());
if (more) {
plugin.getStorageManager().addChatBlock(player, chatBlock);
ChatBlock.sendBlank(player);
ChatBlock.sendMessage(player, headColor + MessageFormat.format(plugin.getLang("view.next.page"), plugin.getSettingsManager().getCommandMore()));
}
ChatBlock.sendBlank(player);
}
}
@@ -1,92 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans.commands;
import net.sacredlabyrinth.phaed.simpleclans.ChatBlock;
import net.sacredlabyrinth.phaed.simpleclans.Clan;
import net.sacredlabyrinth.phaed.simpleclans.Helper;
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import java.text.DecimalFormat;
import java.text.MessageFormat;
import java.text.NumberFormat;
import java.util.List;
/**
* @author phaed
*/
public class ListCommand {
public ListCommand() {
}
/**
* Execute the command
*
* @param player
* @param arg
*/
public void execute(Player player, String[] arg) {
SimpleClans plugin = SimpleClans.getInstance();
String headColor = plugin.getSettingsManager().getPageHeadingsColor();
String subColor = plugin.getSettingsManager().getPageSubTitleColor();
NumberFormat formatter = new DecimalFormat("#.#");
if (!plugin.getPermissionsManager().has(player, "simpleclans.anyone.list")) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
return;
}
if (arg.length != 0) {
ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("usage.list"), plugin.getSettingsManager().getCommandClan()));
return;
}
List<Clan> clans = plugin.getClanManager().getClans();
plugin.getClanManager().sortClansByKDR(clans);
if (clans.isEmpty()) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.clans.have.been.created"));
return;
}
ChatBlock chatBlock = new ChatBlock();
ChatBlock.sendBlank(player);
ChatBlock.saySingle(player, plugin.getSettingsManager().getServerName() + subColor + " " + plugin.getLang("clans.lower") + " " + headColor + Helper.generatePageSeparator(plugin.getSettingsManager().getPageSep()));
ChatBlock.sendBlank(player);
ChatBlock.sendMessage(player, headColor + plugin.getLang("total.clans") + " " + subColor + clans.size());
ChatBlock.sendBlank(player);
chatBlock.setAlignment("c", "l", "c", "c");
chatBlock.setFlexibility(false, true, false, false);
chatBlock.addRow(" " + headColor + plugin.getLang("rank"), plugin.getLang("name"), plugin.getLang("kdr"), plugin.getLang("members"));
int rank = 1;
for (Clan clan : clans) {
if (!plugin.getSettingsManager().isShowUnverifiedOnList() && !clan.isVerified()) {
continue;
}
String tag = plugin.getSettingsManager().getClanChatBracketColor() + plugin.getSettingsManager().getClanChatTagBracketLeft() + plugin.getSettingsManager().getTagDefaultColor() + clan.getColorTag() + plugin.getSettingsManager().getClanChatBracketColor() + plugin.getSettingsManager().getClanChatTagBracketRight();
String name = (clan.isVerified() ? plugin.getSettingsManager().getPageClanNameColor() : ChatColor.GRAY) + clan.getName();
String fullname = tag + " " + name;
String size = ChatColor.WHITE + "" + clan.getSize();
String kdr = clan.isVerified() ? ChatColor.YELLOW + "" + formatter.format(clan.getTotalKDR()) : "";
chatBlock.addRow(" " + rank, fullname, kdr, size);
rank++;
}
boolean more = chatBlock.sendBlock(player, plugin.getSettingsManager().getPageSize());
if (more) {
plugin.getStorageManager().addChatBlock(player, chatBlock);
ChatBlock.sendBlank(player);
ChatBlock.sendMessage(player, headColor + MessageFormat.format(plugin.getLang("view.next.page"), plugin.getSettingsManager().getCommandMore()));
}
ChatBlock.sendBlank(player);
}
}
@@ -1,111 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans.commands;
import net.sacredlabyrinth.phaed.simpleclans.*;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import java.text.DecimalFormat;
import java.text.MessageFormat;
import java.text.NumberFormat;
/**
* @author phaed
*/
public class LookupCommand {
public LookupCommand() {
}
/**
* Execute the command
*
* @param player
* @param arg
*/
public void execute(Player player, String[] arg) {
SimpleClans plugin = SimpleClans.getInstance();
String headColor = plugin.getSettingsManager().getPageHeadingsColor();
String subColor = plugin.getSettingsManager().getPageSubTitleColor();
NumberFormat formatter = new DecimalFormat("#.#");
String playerName = null;
if (arg.length == 0) {
if (!plugin.getPermissionsManager().has(player, "simpleclans.member.lookup")) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
return;
}
playerName = player.getName();
} else if (arg.length == 1) {
if (!plugin.getPermissionsManager().has(player, "simpleclans.anyone.lookup")) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
return;
}
playerName = arg[0];
} else {
ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("usage.lookup.tag"), plugin.getSettingsManager().getCommandClan()));
return;
}
ClanPlayer targetCp = plugin.getClanManager().getAnyClanPlayer(playerName);
ClanPlayer myCp = plugin.getClanManager().getClanPlayer(player.getName());
Clan myClan = myCp == null ? null : myCp.getClan();
if (targetCp != null) {
Clan targetClan = targetCp.getClan();
ChatBlock.sendBlank(player);
ChatBlock.saySingle(player, MessageFormat.format(plugin.getLang("s.player.info"), plugin.getSettingsManager().getPageClanNameColor() + targetCp.getName() + subColor) + " " + headColor + Helper.generatePageSeparator(plugin.getSettingsManager().getPageSep()));
ChatBlock.sendBlank(player);
String clanName = ChatColor.WHITE + plugin.getLang("none");
if (targetClan != null) {
clanName = plugin.getSettingsManager().getClanChatBracketColor() + plugin.getSettingsManager().getClanChatTagBracketLeft() + plugin.getSettingsManager().getTagDefaultColor() + targetClan.getColorTag() + plugin.getSettingsManager().getClanChatBracketColor() + plugin.getSettingsManager().getClanChatTagBracketRight() + " " + plugin.getSettingsManager().getPageClanNameColor() + targetClan.getName();
}
String status = targetClan == null ? ChatColor.WHITE + plugin.getLang("free.agent") : (targetCp.isLeader() ? plugin.getSettingsManager().getPageLeaderColor() + plugin.getLang("leader") : (targetCp.isTrusted() ? plugin.getSettingsManager().getPageTrustedColor() + plugin.getLang("trusted") : plugin.getSettingsManager().getPageUnTrustedColor() + plugin.getLang("untrusted")));
String rank = ChatColor.WHITE + "" + Helper.parseColors(targetCp.getRank());
String joinDate = ChatColor.WHITE + "" + targetCp.getJoinDateString();
String lastSeen = ChatColor.WHITE + "" + targetCp.getLastSeenString();
String inactive = ChatColor.WHITE + "" + targetCp.getInactiveDays() + subColor + "/" + ChatColor.WHITE + plugin.getSettingsManager().getPurgePlayers() + " days";
String rival = ChatColor.WHITE + "" + targetCp.getRivalKills();
String neutral = ChatColor.WHITE + "" + targetCp.getNeutralKills();
String civilian = ChatColor.WHITE + "" + targetCp.getCivilianKills();
String deaths = ChatColor.WHITE + "" + targetCp.getDeaths();
String kdr = ChatColor.YELLOW + "" + formatter.format(targetCp.getKDR());
String pastClans = ChatColor.WHITE + "" + targetCp.getPastClansString(headColor + ", ");
ChatBlock.sendMessage(player, " " + subColor + MessageFormat.format(plugin.getLang("clan.0"), clanName));
ChatBlock.sendMessage(player, " " + subColor + MessageFormat.format(plugin.getLang("rank.0"), rank));
ChatBlock.sendMessage(player, " " + subColor + MessageFormat.format(plugin.getLang("status.0"), status));
ChatBlock.sendMessage(player, " " + subColor + MessageFormat.format(plugin.getLang("kdr.0"), kdr));
ChatBlock.sendMessage(player, " " + subColor + plugin.getLang("kill.totals") + " " + headColor + "[" + plugin.getLang("rival") + ":" + rival + " " + headColor + "" + plugin.getLang("neutral") + ":" + neutral + " " + headColor + "" + plugin.getLang("civilian") + ":" + civilian + headColor + "]");
ChatBlock.sendMessage(player, " " + subColor + MessageFormat.format(plugin.getLang("deaths.0"), deaths));
ChatBlock.sendMessage(player, " " + subColor + MessageFormat.format(plugin.getLang("join.date.0"), joinDate));
ChatBlock.sendMessage(player, " " + subColor + MessageFormat.format(plugin.getLang("last.seen.0"), lastSeen));
ChatBlock.sendMessage(player, " " + subColor + MessageFormat.format(plugin.getLang("past.clans.0"), pastClans));
ChatBlock.sendMessage(player, " " + subColor + MessageFormat.format(plugin.getLang("inactive.0"), inactive));
if (arg.length == 1 && !targetCp.equals(myCp)) {
String killType = ChatColor.GRAY + plugin.getLang("neutral");
if (targetClan == null) {
killType = ChatColor.DARK_GRAY + plugin.getLang("civilian");
} else if (myClan != null && myClan.isRival(targetClan.getTag())) {
killType = ChatColor.WHITE + plugin.getLang("rival");
}
ChatBlock.sendMessage(player, " " + subColor + MessageFormat.format(plugin.getLang("kill.type.0"), killType));
}
ChatBlock.sendBlank(player);
} else {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.player.data.found"));
if (arg.length == 1 && myClan != null) {
ChatBlock.sendBlank(player);
ChatBlock.sendMessage(player, MessageFormat.format(plugin.getLang("kill.type.civilian"), ChatColor.DARK_GRAY));
}
}
}
}
@@ -1,295 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans.commands;
import net.sacredlabyrinth.phaed.simpleclans.*;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import java.text.MessageFormat;
import java.util.LinkedList;
import java.util.List;
/**
* @author phaed
*/
public class MenuCommand {
private List<String> menuItems = new LinkedList<>();
public MenuCommand() {
}
/**
* Execute the command
*
* @param player
*/
public void execute(Player player) {
SimpleClans plugin = SimpleClans.getInstance();
String headColor = plugin.getSettingsManager().getPageHeadingsColor();
String subColor = plugin.getSettingsManager().getPageSubTitleColor();
ClanPlayer cp = plugin.getClanManager().getClanPlayer(player);
Clan clan = cp == null ? null : cp.getClan();
boolean isLeader = cp != null && cp.isLeader();
boolean isTrusted = cp != null && cp.isTrusted();
boolean isVerified = clan != null && clan.isVerified();
boolean isNonVerified = clan != null && !clan.isVerified();
String clanCommand = plugin.getSettingsManager().getCommandClan();
ChatBlock chatBlock = new ChatBlock();
if (clan == null && plugin.getPermissionsManager().has(player, "simpleclans.leader.create")) {
if (plugin.getSettingsManager().isePurchaseCreation()) {
chatBlock.addRow(ChatColor.AQUA + " " + MessageFormat.format(plugin.getLang("0.create.tag.name.1.purchase.a.new.clan"), clanCommand, ChatColor.WHITE));
} else {
chatBlock.addRow(ChatColor.AQUA + " " + MessageFormat.format(plugin.getLang("0.create.tag.name.1.create.a.new.clan"), clanCommand, ChatColor.WHITE));
}
}
if (isNonVerified && plugin.getSettingsManager().isRequireVerification() && plugin.getSettingsManager().isePurchaseVerification()) {
chatBlock.addRow(ChatColor.DARK_RED + " " + MessageFormat.format(plugin.getLang("0.verify.1.purchase.verification.of.your.clan"), clanCommand, ChatColor.WHITE));
}
if (plugin.getPermissionsManager().has(player, "simpleclans.anyone.list")) {
chatBlock.addRow(ChatColor.AQUA + " " + MessageFormat.format(plugin.getLang("0.list.1.lists.all.clans"), clanCommand, ChatColor.WHITE));
}
if (isVerified && plugin.getPermissionsManager().has(player, "simpleclans.member.profile")) {
chatBlock.addRow(ChatColor.AQUA + " " + MessageFormat.format(plugin.getLang("0.profile.1.view.your.clan.s.profile"), clanCommand, ChatColor.WHITE));
}
if (plugin.getPermissionsManager().has(player, "simpleclans.anyone.profile")) {
chatBlock.addRow(ChatColor.AQUA + " " + MessageFormat.format(plugin.getLang("0.profile.tag.1.view.a.clan.s.profile"), clanCommand, ChatColor.WHITE));
}
if (plugin.getPermissionsManager().has(player, "simpleclans.member.lookup")) {
chatBlock.addRow(ChatColor.AQUA + " " + MessageFormat.format(plugin.getLang("0.lookup.1.lookup.your.info"), clanCommand, ChatColor.WHITE));
}
if (plugin.getPermissionsManager().has(player, "simpleclans.anyone.lookup")) {
chatBlock.addRow(ChatColor.AQUA + " " + MessageFormat.format(plugin.getLang("0.lookup.player.1.lookup.a.player.s.info"), clanCommand, ChatColor.WHITE));
}
if (plugin.getPermissionsManager().has(player, "simpleclans.anyone.leaderboard")) {
chatBlock.addRow(ChatColor.AQUA + " " + MessageFormat.format(plugin.getLang("0.leaderboard.1.view.leaderboard"), clanCommand, ChatColor.WHITE));
}
if (plugin.getPermissionsManager().has(player, "simpleclans.anyone.alliances")) {
chatBlock.addRow(ChatColor.AQUA + " " + MessageFormat.format(plugin.getLang("0.alliances.1.view.all.clan.alliances"), clanCommand, ChatColor.WHITE));
}
if (plugin.getPermissionsManager().has(player, "simpleclans.anyone.rivalries")) {
chatBlock.addRow(ChatColor.AQUA + " " + MessageFormat.format(plugin.getLang("0.rivalries.1.view.all.clan.rivalries"), clanCommand, ChatColor.WHITE));
}
if (isVerified && plugin.getPermissionsManager().has(player, "simpleclans.member.roster")) {
chatBlock.addRow(ChatColor.AQUA + " " + MessageFormat.format(plugin.getLang("0.roster.1.view.your.clan.s.member.list"), clanCommand, ChatColor.WHITE));
}
if (plugin.getPermissionsManager().has(player, "simpleclans.anyone.roster")) {
chatBlock.addRow(ChatColor.AQUA + " " + MessageFormat.format(plugin.getLang("0.roster.tag.1.view.a.clan.s.member.list"), clanCommand, ChatColor.WHITE));
}
if (isVerified && isTrusted && plugin.getPermissionsManager().has(player, "simpleclans.member.vitals")) {
chatBlock.addRow(ChatColor.AQUA + " " + MessageFormat.format(plugin.getLang("0.vitals.1.view.your.clan.member.s.vitals"), clanCommand, ChatColor.WHITE));
}
if (isVerified && isTrusted && plugin.getPermissionsManager().has(player, "simpleclans.member.coords")) {
chatBlock.addRow(ChatColor.AQUA + " " + MessageFormat.format(plugin.getLang("0.coords.1.view.your.clan.member.s.coordinates"), clanCommand, ChatColor.WHITE));
}
if (isVerified && isTrusted && plugin.getPermissionsManager().has(player, "simpleclans.member.stats")) {
chatBlock.addRow(ChatColor.AQUA + " " + MessageFormat.format(plugin.getLang("0.stats.1.view.your.clan.member.s.stats"), clanCommand, ChatColor.WHITE));
}
if (isVerified && isTrusted && plugin.getPermissionsManager().has(player, "simpleclans.member.kills")) {
chatBlock.addRow(ChatColor.AQUA + " " + MessageFormat.format(plugin.getLang("0.kills"), clanCommand, ChatColor.WHITE));
}
if (isVerified && isTrusted && plugin.getPermissionsManager().has(player, "simpleclans.member.kills")) {
chatBlock.addRow(ChatColor.AQUA + " " + MessageFormat.format(plugin.getLang("0.killsplayer"), clanCommand, ChatColor.WHITE));
}
if (isVerified && plugin.getPermissionsManager().has(player, "simpleclans.member.fee-check")) {
chatBlock.addRow(ChatColor.AQUA + " " + MessageFormat.format(plugin.getLang("0.fee.check"), clanCommand, ChatColor.WHITE));
}
if (isVerified && isLeader && plugin.getPermissionsManager().has(player, "simpleclans.leader.fee")) {
chatBlock.addRow(ChatColor.AQUA + " " + MessageFormat.format(plugin.getLang("0.fee.set"), clanCommand, ChatColor.WHITE));
}
if (isVerified && isLeader && plugin.getPermissionsManager().has(player, "simpleclans.leader.ally")) {
chatBlock.addRow(ChatColor.AQUA + " " + MessageFormat.format(plugin.getLang("0.ally.add.remove.tag.1.add.remove.an.ally.clan"), clanCommand, ChatColor.WHITE));
}
if (isVerified && isLeader && plugin.getPermissionsManager().has(player, "simpleclans.leader.rival")) {
chatBlock.addRow(ChatColor.AQUA + " " + MessageFormat.format(plugin.getLang("0.rival.add.remove.tag.1.add.remove.a.rival.clan"), clanCommand, ChatColor.WHITE));
}
if (isVerified && plugin.getPermissionsManager().has(player, "simpleclans.member.home")) {
chatBlock.addRow(ChatColor.AQUA + " " + MessageFormat.format(plugin.getLang("home-menu"), clanCommand, ChatColor.WHITE));
}
if (isVerified && isLeader && plugin.getPermissionsManager().has(player, "simpleclans.leader.home-set")) {
chatBlock.addRow(ChatColor.AQUA + " " + MessageFormat.format(plugin.getLang("home-set-menu"), clanCommand, ChatColor.WHITE));
}
if (isVerified && isLeader && plugin.getPermissionsManager().has(player, "simpleclans.leader.home-set")) {
chatBlock.addRow(ChatColor.AQUA + " " + MessageFormat.format(plugin.getLang("home-clear-menu"), clanCommand, ChatColor.WHITE));
}
if (isVerified && isLeader && plugin.getPermissionsManager().has(player, "simpleclans.leader.home-regroup")) {
chatBlock.addRow(ChatColor.AQUA + " " + MessageFormat.format(plugin.getLang("home-regroup-menu"), clanCommand, ChatColor.WHITE));
}
if (isVerified && isLeader && plugin.getPermissionsManager().has(player, "simpleclans.leader.war")) {
chatBlock.addRow(ChatColor.AQUA + " " + MessageFormat.format(plugin.getLang("0.war"), clanCommand, ChatColor.WHITE));
}
if (plugin.getPermissionsManager().has(player, "simpleclans.member.resetkdr")) {
chatBlock.addRow(ChatColor.AQUA + " " + MessageFormat.format(plugin.getLang("0.resetkdr.1.resets.your.kdr"), clanCommand, ChatColor.WHITE));
}
if (isVerified && plugin.getPermissionsManager().has(player, "simpleclans.member.bb")) {
chatBlock.addRow(ChatColor.AQUA + " " + MessageFormat.format(plugin.getLang("0.bb.1.display.bulletin.board"), clanCommand, ChatColor.WHITE));
}
if (isVerified && isTrusted && plugin.getPermissionsManager().has(player, "simpleclans.member.bb-add")) {
chatBlock.addRow(ChatColor.AQUA + " " + MessageFormat.format(plugin.getLang("0.bb.msg.1.add.a.message.to.the.bulletin.board"), clanCommand, ChatColor.WHITE));
}
if (isVerified && isLeader && plugin.getPermissionsManager().has(player, "simpleclans.leader.modtag")) {
chatBlock.addRow(ChatColor.AQUA + " " + MessageFormat.format(plugin.getLang("0.modtag.tag.1.modify.the.clan.s.tag"), clanCommand, ChatColor.WHITE));
}
String toggles = "";
if (isVerified && isTrusted && plugin.getPermissionsManager().has(player, "simpleclans.member.bb-toggle")) {
toggles += "bb/";
}
if (isVerified && isTrusted && plugin.getPermissionsManager().has(player, "simpleclans.member.tag-toggle")) {
toggles += "tag/";
}
if (isVerified && isLeader && plugin.getPermissionsManager().has(player, "simpleclans.leader.fee")) {
toggles += "fee/";
}
if (!toggles.isEmpty()) {
chatBlock.addRow(ChatColor.AQUA + " " + MessageFormat.format(plugin.getLang("0.toggle.command"), clanCommand, ChatColor.WHITE, Helper.stripTrailing(toggles, "/")));
}
if (isLeader && plugin.getPermissionsManager().has(player, "simpleclans.leader.invite")) {
chatBlock.addRow(ChatColor.AQUA + " " + MessageFormat.format(plugin.getLang("0.invite.player.1.invite.a.player"), clanCommand, ChatColor.WHITE));
}
if (isLeader && plugin.getPermissionsManager().has(player, "simpleclans.leader.kick")) {
chatBlock.addRow(ChatColor.AQUA + " " + MessageFormat.format(plugin.getLang("0.kick.player.1.kick.a.player.from.the.clan"), clanCommand, ChatColor.WHITE));
}
if (isVerified && isLeader && plugin.getPermissionsManager().has(player, "simpleclans.leader.setrank")) {
chatBlock.addRow(ChatColor.AQUA + " " + MessageFormat.format(plugin.getLang("0.trust.setrank"), clanCommand, ChatColor.WHITE));
}
if (isVerified && isLeader && plugin.getPermissionsManager().has(player, "simpleclans.leader.settrust")) {
chatBlock.addRow(ChatColor.AQUA + " " + MessageFormat.format(plugin.getLang("0.trust.untrust.player.1.set.trust.level1"), clanCommand, ChatColor.WHITE));
}
if (isVerified && isLeader && plugin.getPermissionsManager().has(player, "simpleclans.leader.settrust")) {
chatBlock.addRow(ChatColor.AQUA + " " + MessageFormat.format(plugin.getLang("0.trust.untrust.player.1.set.trust.level2"), clanCommand, ChatColor.WHITE));
}
if (isLeader && plugin.getPermissionsManager().has(player, "simpleclans.leader.promote")) {
chatBlock.addRow(ChatColor.AQUA + " " + MessageFormat.format(plugin.getLang("0.promote.member.1.promote.a.member.to.leader"), clanCommand, ChatColor.WHITE));
}
if (isLeader && plugin.getPermissionsManager().has(player, "simpleclans.leader.demote")) {
chatBlock.addRow(ChatColor.AQUA + " " + MessageFormat.format(plugin.getLang("0.demote.leader.1.demote.a.leader.to.member"), clanCommand, ChatColor.WHITE));
}
if (isLeader && plugin.getPermissionsManager().has(player, "simpleclans.leader.ff")) {
chatBlock.addRow(ChatColor.AQUA + " " + MessageFormat.format(plugin.getLang("0.clanff.allow.block.1.toggle.clan.s.friendly.fire"), clanCommand, ChatColor.WHITE));
}
if (isLeader && plugin.getPermissionsManager().has(player, "simpleclans.leader.disband")) {
chatBlock.addRow(ChatColor.AQUA + " " + MessageFormat.format(plugin.getLang("0.disband.1.disband.your.clan"), clanCommand, ChatColor.WHITE));
}
if (plugin.getPermissionsManager().has(player, "simpleclans.member.ff")) {
chatBlock.addRow(ChatColor.AQUA + " " + MessageFormat.format(plugin.getLang("0.ff.allow.auto.1.toggle.personal.friendly.fire"), clanCommand, ChatColor.WHITE));
}
if (plugin.getPermissionsManager().has(player, "simpleclans.member.resign")) {
chatBlock.addRow(ChatColor.AQUA + " " + MessageFormat.format(plugin.getLang("0.resign.1.resign.from.the.clan"), clanCommand, ChatColor.WHITE));
}
for (String item : menuItems) {
chatBlock.addRow(ChatColor.AQUA + " " + item);
}
if (plugin.getPermissionsManager().has(player, "simpleclans.mod.verify") && plugin.getSettingsManager().isRequireVerification()) {
chatBlock.addRow(ChatColor.DARK_RED + " " + MessageFormat.format(plugin.getLang("0.verify.tag.1.verify.an.unverified.clan"), clanCommand, ChatColor.WHITE));
}
if (plugin.getPermissionsManager().has(player, "simpleclans.mod.place")) {
chatBlock.addRow(ChatColor.DARK_RED + " " + MessageFormat.format(plugin.getLang("0.place"), clanCommand, ChatColor.WHITE));
}
if (isVerified && isTrusted && plugin.getPermissionsManager().has(player, "simpleclans.mod.mostkilled")) {
chatBlock.addRow(ChatColor.DARK_RED + " " + MessageFormat.format(plugin.getLang("0.mostkilled"), clanCommand, ChatColor.WHITE));
}
if (plugin.getPermissionsManager().has(player, "simpleclans.mod.disband")) {
chatBlock.addRow(ChatColor.DARK_RED + " " + MessageFormat.format(plugin.getLang("0.disband.tag.1.disband.a.clan"), clanCommand, ChatColor.WHITE));
}
if (plugin.getPermissionsManager().has(player, "simpleclans.mod.ban")) {
chatBlock.addRow(ChatColor.DARK_RED + " " + MessageFormat.format(plugin.getLang("0.ban.unban.player.1.ban.unban.a.player"), clanCommand, ChatColor.WHITE));
}
if (plugin.getPermissionsManager().has(player, "simpleclans.mod.hometp")) {
chatBlock.addRow(ChatColor.DARK_RED + " " + MessageFormat.format(plugin.getLang("0.hometp.clan.1.tp.home.a.clan"), clanCommand, ChatColor.WHITE));
}
if (plugin.getPermissionsManager().has(player, "simpleclans.mod.globalff")) {
chatBlock.addRow(ChatColor.DARK_RED + " " + MessageFormat.format(plugin.getLang("0.globalff.allow.auto.1.set.global.friendly.fire"), clanCommand, ChatColor.WHITE));
}
if (plugin.getPermissionsManager().has(player, "simpleclans.admin.demote")) {
chatBlock.addRow(ChatColor.DARK_RED + " " + MessageFormat.format(plugin.getLang("0.demote.leader.1.demote.a.leader.to.member"), clanCommand, ChatColor.WHITE));
}
if (plugin.getPermissionsManager().has(player, "simpleclans.admin.purge")) {
chatBlock.addRow(ChatColor.DARK_RED + " " + MessageFormat.format(plugin.getLang("0.purge.player.1.purge.a.player"), clanCommand, ChatColor.WHITE));
}
if (plugin.getPermissionsManager().has(player, "simpleclans.admin.resetkdr")) {
chatBlock.addRow(ChatColor.DARK_RED + " " + MessageFormat.format(plugin.getLang("0.resetkdr.1.resets.kdr"), clanCommand, ChatColor.WHITE));
}
if (plugin.getPermissionsManager().has(player, "simpleclans.admin.reload")) {
chatBlock.addRow(ChatColor.DARK_RED + " " + MessageFormat.format(plugin.getLang("0.reload.1.reload.configuration"), clanCommand, ChatColor.WHITE));
}
if (chatBlock.isEmpty()) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
return;
}
ChatBlock.sendBlank(player);
ChatBlock.saySingle(player, plugin.getSettingsManager().getServerName() + subColor + " " + plugin.getLang("clan.commands") + " " + headColor + Helper.generatePageSeparator(plugin.getSettingsManager().getPageSep()));
ChatBlock.sendBlank(player);
boolean more = chatBlock.sendBlock(player, plugin.getSettingsManager().getPageSize());
if (more) {
plugin.getStorageManager().addChatBlock(player, chatBlock);
ChatBlock.sendBlank(player);
ChatBlock.sendMessage(player, headColor + MessageFormat.format(plugin.getLang("view.next.page"), plugin.getSettingsManager().getCommandMore()));
}
ChatBlock.sendBlank(player);
}
/**
* Execute the command
*
* @param sender
*/
public void executeSender(CommandSender sender) {
SimpleClans plugin = SimpleClans.getInstance();
String headColor = plugin.getSettingsManager().getPageHeadingsColor();
String subColor = plugin.getSettingsManager().getPageSubTitleColor();
String clanCommand = plugin.getSettingsManager().getCommandClan();
ChatBlock chatBlock = new ChatBlock();
chatBlock.addRow(ChatColor.DARK_RED + " " + MessageFormat.format(plugin.getLang("0.purge.player.1.purge.a.player"), clanCommand, ChatColor.WHITE));
chatBlock.addRow(ChatColor.DARK_RED + " " + MessageFormat.format(plugin.getLang("0.verify.tag.1.verify.an.unverified.clan"), clanCommand, ChatColor.WHITE));
chatBlock.addRow(ChatColor.DARK_RED + " " + MessageFormat.format(plugin.getLang("0.reload.1.reload.configuration"), clanCommand, ChatColor.WHITE));
ChatBlock.sendBlank(sender);
ChatBlock.saySingle(sender, plugin.getSettingsManager().getServerName() + subColor + " " + plugin.getLang("clan.commands") + " " + headColor + Helper.generatePageSeparator(plugin.getSettingsManager().getPageSep()));
ChatBlock.sendBlank(sender);
chatBlock.sendBlock(sender, plugin.getSettingsManager().getPageSize());
ChatBlock.sendBlank(sender);
}
/**
* Adds a menu item to the /clan menu
*
* @param syntax
* @param description
*/
public void addMenuItem(String syntax, String description) {
addMenuItem(syntax, description, ChatColor.AQUA);
}
/**
* Adds a menu item to the /clan menu, specifying syntax color
* [color] /[syntax] - [description]
*
* @param syntax
* @param description
* @param color
*/
public void addMenuItem(String syntax, String description, ChatColor color) {
menuItems.add(color + "/" + syntax + ChatColor.WHITE + " - " + description);
}
}
@@ -1,85 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans.commands;
import net.sacredlabyrinth.phaed.simpleclans.ChatBlock;
import net.sacredlabyrinth.phaed.simpleclans.Clan;
import net.sacredlabyrinth.phaed.simpleclans.ClanPlayer;
import net.sacredlabyrinth.phaed.simpleclans.Helper;
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import java.text.MessageFormat;
/**
* @author phaed
*/
public class ModtagCommand {
public ModtagCommand() {
}
/**
* Execute the command
*
* @param player
* @param arg
*/
public void execute(Player player, String[] arg) {
SimpleClans plugin = SimpleClans.getInstance();
if (!plugin.getPermissionsManager().has(player, "simpleclans.leader.modtag")) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
return;
}
ClanPlayer cp = plugin.getClanManager().getClanPlayer(player);
if (cp == null) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("not.a.member.of.any.clan"));
return;
}
Clan clan = cp.getClan();
if (!clan.isVerified()) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("clan.is.not.verified"));
return;
}
if (!clan.isLeader(player)) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.leader.permissions"));
return;
}
if (arg.length != 1) {
ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("usage.0.modtag.tag"), plugin.getSettingsManager().getCommandClan()));
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("example.clan.modtag.4kfo.4l"));
return;
}
String newtag = arg[0];
String cleantag = Helper.cleanTag(newtag);
if (!plugin.getPermissionsManager().has(player, "simpleclans.leader.coloredtag") && newtag.contains("&")) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("your.tag.cannot.contain.color.codes"));
return;
}
if (Helper.stripColors(newtag).length() > plugin.getSettingsManager().getTagMaxLength()) {
ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("your.clan.tag.cannot.be.longer.than.characters"), plugin.getSettingsManager().getTagMaxLength()));
return;
}
if (plugin.getSettingsManager().hasDisallowedColor(newtag)) {
ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("your.tag.cannot.contain.the.following.colors"), plugin.getSettingsManager().getDisallowedColorString()));
return;
}
if (!Helper.stripColors(newtag).matches("[0-9a-zA-Z]*")) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("your.clan.tag.can.only.contain.letters.numbers.and.color.codes"));
return;
}
if (!cleantag.equals(clan.getTag())) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("you.can.only.modify.the.color.and.case.of.the.tag"));
return;
}
clan.addBb(player.getName(), ChatColor.AQUA + MessageFormat.format(plugin.getLang("tag.changed.to.0"), Helper.parseColors(newtag)));
clan.changeClanTag(newtag);
plugin.getClanManager().updateDisplayName(player.getPlayer());
}
}
@@ -1,93 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans.commands;
import net.sacredlabyrinth.phaed.simpleclans.*;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import java.text.MessageFormat;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
public class MostKilledCommand {
public MostKilledCommand() {
}
/**
* Execute the command
*
* @param player
* @param arg
*/
public void execute(Player player, String[] arg) {
SimpleClans plugin = SimpleClans.getInstance();
String headColor = plugin.getSettingsManager().getPageHeadingsColor();
String subColor = plugin.getSettingsManager().getPageSubTitleColor();
if (!plugin.getPermissionsManager().has(player, "simpleclans.mod.mostkilled")) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
return;
}
ClanPlayer cp = plugin.getClanManager().getClanPlayer(player);
if (cp == null) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("not.a.member.of.any.clan"));
return;
}
Clan clan = cp.getClan();
if (!clan.isVerified()) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("clan.is.not.verified"));
return;
}
if (!cp.isTrusted()) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("only.trusted.players.can.access.clan.stats"));
return;
}
ChatBlock chatBlock = new ChatBlock();
chatBlock.setFlexibility(true, false, false);
chatBlock.setAlignment("l", "c", "l");
chatBlock.addRow(" " + headColor + plugin.getLang("victim"), headColor + plugin.getLang("killcount"), headColor + plugin.getLang("attacker"));
Map<String, Integer> killsPerPlayerUnordered = plugin.getStorageManager().getMostKilled();
if (killsPerPlayerUnordered.isEmpty()) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("nokillsfound"));
return;
}
Map<String, Integer> killsPerPlayer = Helper.sortByValue(killsPerPlayerUnordered);
for (Entry<String, Integer> attackerVictim : killsPerPlayer.entrySet()) {
String[] split = attackerVictim.getKey().split(" ");
if (split.length < 2) {
continue;
}
int count = attackerVictim.getValue();
String attacker = split[0];
String victim = split[1];
chatBlock.addRow(" " + ChatColor.WHITE + victim, ChatColor.AQUA + "" + count, ChatColor.YELLOW + attacker);
}
ChatBlock.saySingle(player, plugin.getSettingsManager().getServerName() + subColor + " " + plugin.getLang("mostkilled") + " " + headColor + Helper.generatePageSeparator(plugin.getSettingsManager().getPageSep()));
ChatBlock.sendBlank(player);
boolean more = chatBlock.sendBlock(player, plugin.getSettingsManager().getPageSize());
if (more) {
plugin.getStorageManager().addChatBlock(player, chatBlock);
ChatBlock.sendBlank(player);
ChatBlock.sendMessage(player, headColor + MessageFormat.format(plugin.getLang("view.next.page"), plugin.getSettingsManager().getCommandMore()));
}
ChatBlock.sendBlank(player);
}
}
@@ -1,83 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans.commands;
import net.sacredlabyrinth.phaed.simpleclans.*;
import net.sacredlabyrinth.phaed.simpleclans.uuid.UUIDMigration;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import java.text.MessageFormat;
public class PlaceCommand {
public PlaceCommand() {
}
/**
* Execute the command
*
* @param sender
* @param arg
*/
public void execute(CommandSender sender, String[] arg) {
SimpleClans plugin = SimpleClans.getInstance();
if (sender instanceof Player) {
Player player = (Player) sender;
if (!plugin.getPermissionsManager().has(player, "simpleclans.mod.place")) {
ChatBlock.sendMessage(sender, ChatColor.RED + plugin.getLang("insufficient.permissions"));
return;
}
}
if (arg.length != 2) {
ChatBlock.sendMessage(sender, ChatColor.RED + MessageFormat.format(plugin.getLang("usage.0.place"), plugin.getSettingsManager().getCommandClan()));
return;
}
Player player = Helper.getPlayer(arg[0]);
if (player == null) {
ChatBlock.sendMessage(sender, ChatColor.RED + plugin.getLang("no.player.matched"));
return;
}
Clan newClan = plugin.getClanManager().getClan(arg[1]);
if (newClan == null) {
ChatBlock.sendMessage(sender, ChatColor.RED + plugin.getLang("the.clan.does.not.exist"));
return;
}
ClanPlayer oldCp = plugin.getClanManager().getClanPlayer(player);
if (oldCp != null) {
Clan oldClan = oldCp.getClan();
if (oldClan.isLeader(player) && oldClan.getLeaders().size() <= 1) {
oldClan.clanAnnounce(player.getName(), ChatColor.AQUA + MessageFormat.format(plugin.getLang("clan.has.been.disbanded"), oldClan.getName()));
oldClan.disband();
} else {
oldClan.addBb(player.getName(), ChatColor.AQUA + MessageFormat.format(plugin.getLang("0.has.resigned"), Helper.capitalize(player.getName())));
if (SimpleClans.getInstance().hasUUID()) {
oldClan.removePlayerFromClan(player.getUniqueId());
} else {
oldClan.removePlayerFromClan(player.getName());
}
}
}
ClanPlayer cp = plugin.getClanManager().getCreateClanPlayerUUID(player.getName());
if (cp == null) {
return;
}
newClan.addBb(ChatColor.AQUA + MessageFormat.format(plugin.getLang("joined.the.clan"), player.getName()));
plugin.getClanManager().serverAnnounce(MessageFormat.format(plugin.getLang("has.joined"), player.getName(), newClan.getName()));
newClan.addPlayerToClan(cp);
}
}
@@ -1,104 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans.commands;
import net.sacredlabyrinth.phaed.simpleclans.*;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import java.text.DecimalFormat;
import java.text.MessageFormat;
import java.text.NumberFormat;
/**
* @author phaed
*/
public class ProfileCommand {
public ProfileCommand() {
}
/**
* Execute the command
*
* @param player
* @param arg
*/
public void execute(Player player, String[] arg) {
SimpleClans plugin = SimpleClans.getInstance();
String headColor = plugin.getSettingsManager().getPageHeadingsColor();
String subColor = plugin.getSettingsManager().getPageSubTitleColor();
NumberFormat formatter = new DecimalFormat("#.#");
Clan clan = null;
if (arg.length == 0) {
if (plugin.getPermissionsManager().has(player, "simpleclans.member.profile")) {
ClanPlayer cp = plugin.getClanManager().getClanPlayer(player);
if (cp == null) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("not.a.member.of.any.clan"));
} else {
if (cp.getClan().isVerified()) {
clan = cp.getClan();
} else {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("clan.is.not.verified"));
}
}
} else {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
}
} else if (arg.length == 1) {
if (plugin.getPermissionsManager().has(player, "simpleclans.anyone.profile")) {
clan = plugin.getClanManager().getClan(arg[0]);
if (clan == null) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.clan.matched"));
}
} else {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
}
} else {
ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("usage.0.profile.tag"), plugin.getSettingsManager().getCommandClan()));
}
if (clan != null) {
if (clan.isVerified()) {
ChatBlock.sendBlank(player);
ChatBlock.saySingle(player, plugin.getSettingsManager().getPageClanNameColor() + Helper.capitalize(clan.getName()) + subColor + " " + plugin.getLang("profile") + " " + headColor + Helper.generatePageSeparator(plugin.getSettingsManager().getPageSep()));
ChatBlock.sendBlank(player);
String name = plugin.getSettingsManager().getClanChatBracketColor() + plugin.getSettingsManager().getClanChatTagBracketLeft() + plugin.getSettingsManager().getTagDefaultColor() + clan.getColorTag() + plugin.getSettingsManager().getClanChatBracketColor() + plugin.getSettingsManager().getClanChatTagBracketRight() + " " + plugin.getSettingsManager().getPageClanNameColor() + clan.getName();
String leaders = clan.getLeadersString(plugin.getSettingsManager().getPageLeaderColor(), subColor + ", ");
String onlineCount = ChatColor.WHITE + "" + Helper.stripOffLinePlayers(clan.getMembers()).size();
String membersOnline = onlineCount + subColor + "/" + ChatColor.WHITE + clan.getSize();
String inactive = ChatColor.WHITE + "" + clan.getInactiveDays() + subColor + "/" + ChatColor.WHITE + (clan.isVerified() ? plugin.getSettingsManager().getPurgeClan() : plugin.getSettingsManager().getPurgeUnverified()) + " " + plugin.getLang("days");
String founded = ChatColor.WHITE + "" + clan.getFoundedString();
String allies = ChatColor.WHITE + "" + clan.getAllyString(subColor + ", ");
String rivals = ChatColor.WHITE + "" + clan.getRivalString(subColor + ", ");
String kdr = ChatColor.YELLOW + "" + formatter.format(clan.getTotalKDR());
String deaths = ChatColor.WHITE + "" + clan.getTotalDeaths();
String rival = ChatColor.WHITE + "" + clan.getTotalRival();
String neutral = ChatColor.WHITE + "" + clan.getTotalNeutral();
String civ = ChatColor.WHITE + "" + clan.getTotalCivilian();
String status = ChatColor.WHITE + "" + (clan.isVerified() ? plugin.getSettingsManager().getPageTrustedColor() + plugin.getLang("verified") : plugin.getSettingsManager().getPageUnTrustedColor() + plugin.getLang("unverified"));
String feeEnabled = ChatColor.WHITE + (clan.isMemberFeeEnabled() ? plugin.getLang("fee.enabled") : plugin.getLang("fee.disabled"));
String feeValue = ChatColor.WHITE + "" + clan.getMemberFee();
ChatBlock.sendMessage(player, " " + subColor + MessageFormat.format(plugin.getLang("name.0"), name));
ChatBlock.sendMessage(player, " " + subColor + MessageFormat.format(plugin.getLang("status.0"), status));
ChatBlock.sendMessage(player, " " + subColor + MessageFormat.format(plugin.getLang("leaders.0"), leaders));
ChatBlock.sendMessage(player, " " + subColor + MessageFormat.format(plugin.getLang("members.online.0"), membersOnline));
ChatBlock.sendMessage(player, " " + subColor + MessageFormat.format(plugin.getLang("kdr.0"), kdr));
ChatBlock.sendMessage(player, " " + subColor + plugin.getLang("kill.totals") + " " + headColor + "[" + plugin.getLang("rival") + ":" + rival + " " + headColor + "" + plugin.getLang("neutral") + ":" + neutral + " " + headColor + "" + plugin.getLang("civilian") + ":" + civ + headColor + "]");
ChatBlock.sendMessage(player, " " + subColor + MessageFormat.format(plugin.getLang("deaths.0"), deaths));
ChatBlock.sendMessage(player, " " + subColor + MessageFormat.format(plugin.getLang("fee.0.value.1"), feeEnabled, feeValue));
ChatBlock.sendMessage(player, " " + subColor + MessageFormat.format(plugin.getLang("allies.0"), allies));
ChatBlock.sendMessage(player, " " + subColor + MessageFormat.format(plugin.getLang("rivals.0"), rivals));
ChatBlock.sendMessage(player, " " + subColor + MessageFormat.format(plugin.getLang("founded.0"), founded));
ChatBlock.sendMessage(player, " " + subColor + MessageFormat.format(plugin.getLang("inactive.0"), inactive));
ChatBlock.sendBlank(player);
} else {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("clan.is.not.verified"));
}
}
}
}
@@ -1,80 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans.commands;
import net.sacredlabyrinth.phaed.simpleclans.*;
import net.sacredlabyrinth.phaed.simpleclans.uuid.UUIDMigration;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import java.text.MessageFormat;
/**
* @author phaed
*/
public class PromoteCommand {
public PromoteCommand() {
}
/**
* Execute the command
*
* @param player
* @param arg
*/
public void execute(Player player, String[] arg) {
SimpleClans plugin = SimpleClans.getInstance();
if (!plugin.getPermissionsManager().has(player, "simpleclans.leader.promote")) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
return;
}
ClanPlayer cp = plugin.getClanManager().getClanPlayer(player);
if (cp == null) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("not.a.member.of.any.clan"));
return;
}
Clan clan = cp.getClan();
if (!clan.isLeader(player)) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.leader.permissions"));
return;
}
if (arg.length != 1) {
ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("usage.0.promote.member"), plugin.getSettingsManager().getCommandClan()));
return;
}
Player promoted = Helper.getPlayer(arg[0]);
if (promoted == null) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("the.member.to.be.promoted.must.be.online"));
return;
}
if (!plugin.getPermissionsManager().has(promoted, "simpleclans.leader.promotable")) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("the.player.does.not.have.the.permissions.to.lead.a.clan"));
return;
}
if (promoted.getName().equals(player.getName())) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("you.cannot.promote.yourself"));
return;
}
if (!clan.isMember(promoted)) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("the.player.is.not.a.member.of.your.clan"));
return;
}
if (clan.isLeader(promoted) && plugin.getSettingsManager().isConfirmationForPromote()) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("the.player.is.already.a.leader"));
return;
}
clan.addBb(player.getName(), ChatColor.AQUA + MessageFormat.format(plugin.getLang("promoted.to.leader"), Helper.capitalize(promoted.getName())));
if (SimpleClans.getInstance().hasUUID()) {
clan.promote(promoted.getUniqueId());
} else {
clan.promote(promoted.getName());
}
}
}
@@ -1,47 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans.commands;
import java.text.MessageFormat;
import net.sacredlabyrinth.phaed.simpleclans.ChatBlock;
import net.sacredlabyrinth.phaed.simpleclans.ClanPlayer;
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
/**
*
* @author roinujnosde
*/
public class PurgeCommand {
/**
* Executes the command
*
* @param sender
* @param args
*/
public void execute(CommandSender sender, String args[]) {
SimpleClans plugin = SimpleClans.getInstance();
if (sender instanceof Player) {
if (!plugin.getPermissionsManager().has((Player) sender, "simpleclans.admin.purge")) {
ChatBlock.sendMessage(sender, ChatColor.RED + plugin.getLang("insufficient.permissions"));
return;
}
}
if (args.length == 1) {
ClanPlayer cp = plugin.getClanManager().getClanPlayer(args[0]);
if (cp == null) {
ChatBlock.sendMessage(sender, ChatColor.RED + plugin.getLang("no.player.matched"));
return;
}
plugin.getClanManager().deleteClanPlayer(cp);
ChatBlock.sendMessage(sender, ChatColor.AQUA + plugin.getLang("player.purged"));
return;
}
ChatBlock.sendMessage(sender, ChatColor.RED
+ MessageFormat.format(plugin.getLang("usage.purge"), plugin.getSettingsManager().getCommandClan()));
}
}
@@ -1,47 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans.commands;
import net.sacredlabyrinth.phaed.simpleclans.ChatBlock;
import net.sacredlabyrinth.phaed.simpleclans.Clan;
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
/**
* @author phaed
*/
public class ReloadCommand
{
public ReloadCommand()
{
}
/**
* Execute the command
*
* @param sender
* @param arg
*/
public void execute(CommandSender sender, String[] arg)
{
SimpleClans plugin = SimpleClans.getInstance();
if (sender instanceof Player && !plugin.getPermissionsManager().has((Player)sender, "simpleclans.admin.reload"))
{
ChatBlock.sendMessage(sender, ChatColor.RED + "Does not match a clan command");
return;
}
plugin.reloadConfig();
plugin.getSettingsManager().load();
plugin.getLanguageManager().load();
plugin.getStorageManager().importFromDatabase();
SimpleClans.getInstance().getPermissionsManager().loadPermissions();
for (Clan clan : plugin.getClanManager().getClans())
{
SimpleClans.getInstance().getPermissionsManager().updateClanPermissions(clan);
}
ChatBlock.sendMessage(sender, ChatColor.AQUA + plugin.getLang("configuration.reloaded"));
}
}
@@ -1,72 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans.commands;
import java.text.MessageFormat;
import net.sacredlabyrinth.phaed.simpleclans.*;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.OfflinePlayer;
import org.bukkit.entity.Player;
/**
* @author phaed
*/
public class ResetKDRCommand {
public ResetKDRCommand() {
}
/**
* Execute the command
*
* @param player
* @param arg
*/
public void execute(Player player, String[] arg) {
SimpleClans plugin = SimpleClans.getInstance();
if (arg == null || arg.length == 0) {
if (!plugin.getSettingsManager().isAllowResetKdr()) {
ChatBlock.sendMessage(player, ChatColor.RED
+ MessageFormat.format(plugin.getLang("usage.resetkdr"),
plugin.getSettingsManager().getCommandClan()));
return;
}
if (!plugin.getPermissionsManager().has(player, "simpleclans.member.resetkdr")) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
return;
}
ClanPlayer cp = plugin.getClanManager().getClanPlayer(player);
if (cp == null) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("not.a.member.of.any.clan"));
return;
}
if (plugin.getClanManager().purchaseResetKdr(player)) {
plugin.getClanManager().resetKdr(cp);
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("you.have.reseted.your.kdr"));
}
return;
}
if (arg.length == 1 && plugin.getPermissionsManager().has(player, "simpleclans.admin.resetkdr")) {
if (arg[0].equalsIgnoreCase("all")) {
for (ClanPlayer cp : SimpleClans.getInstance().getClanManager().getAllClanPlayers()) {
plugin.getClanManager().resetKdr(cp);
}
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("you.have.reseted.kdr.of.all.players"));
} else {
OfflinePlayer toReset = Bukkit.getOfflinePlayer(arg[0]);
if (toReset == null) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.player.matched"));
return;
}
ClanPlayer trcp = plugin.getClanManager().getClanPlayer(toReset);
if (trcp == null) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.player.data.found"));
return;
}
plugin.getClanManager().resetKdr(trcp);
ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("you.have.reseted.0.kdr"), toReset.getName()));
}
} else {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
}
}
}
@@ -1,45 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans.commands;
import net.sacredlabyrinth.phaed.simpleclans.ChatBlock;
import net.sacredlabyrinth.phaed.simpleclans.ClanPlayer;
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import net.sacredlabyrinth.phaed.simpleclans.conversation.ResignPrompt;
import org.bukkit.conversations.ConversationFactory;
/**
* @author phaed
*/
public class ResignCommand {
public ResignCommand() {
}
/**
* Execute the command
*
* @param player
* @param arg
*/
public void execute(Player player, String[] arg) {
SimpleClans plugin = SimpleClans.getInstance();
if (!plugin.getPermissionsManager().has(player, "simpleclans.member.resign")) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
return;
}
ClanPlayer cp = plugin.getClanManager().getClanPlayer(player);
if (cp == null) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("not.a.member.of.any.clan"));
return;
}
new ConversationFactory(plugin)
.withFirstPrompt(new ResignPrompt())
.withLocalEcho(true)
.withTimeout(10)
.buildConversation(player).begin();
}
}
@@ -1,117 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans.commands;
import net.sacredlabyrinth.phaed.simpleclans.*;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import java.text.MessageFormat;
/**
* @author phaed
*/
public class RivalCommand {
public RivalCommand() {
}
/**
* Execute the command
*
* @param player
* @param arg
*/
public void execute(Player player, String[] arg) {
SimpleClans plugin = SimpleClans.getInstance();
if (!plugin.getPermissionsManager().has(player, "simpleclans.leader.rival")) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
return;
}
ClanPlayer cp = plugin.getClanManager().getClanPlayer(player);
if (cp == null) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("not.a.member.of.any.clan"));
return;
}
Clan clan = cp.getClan();
if (!clan.isVerified()) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("clan.is.not.verified"));
return;
}
if (clan.isUnrivable()) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("your.clan.cannot.create.rivals"));
return;
}
if (!clan.isLeader(player)) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.leader.permissions"));
return;
}
if (arg.length != 2) {
ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("usage.rival"), plugin.getSettingsManager().getCommandClan()));
return;
}
if (clan.getSize() < plugin.getSettingsManager().getClanMinSizeToRival()) {
ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("min.players.rivalries"), plugin.getSettingsManager().getClanMinSizeToRival()));
return;
}
String action = arg[0];
Clan rival = plugin.getClanManager().getClan(arg[1]);
if (rival == null) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.clan.matched"));
return;
}
if (clan.getTag().equals(rival.getTag()))
{
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("you.cannot.rival.your.own.clan"));
return;
}
if (plugin.getSettingsManager().isUnrivable(rival.getTag())) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("the.clan.cannot.be.rivaled"));
return;
}
if (!rival.isVerified()) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("cannot.rival.an.unverified.clan"));
return;
}
if (action.equals(plugin.getLang("add"))) {
if (!clan.reachedRivalLimit()) {
if (!clan.isRival(rival.getTag())) {
clan.addRival(rival);
rival.addBb(player.getName(), ChatColor.AQUA + MessageFormat.format(plugin.getLang("has.initiated.a.rivalry"), Helper.capitalize(clan.getName()), rival.getName()), false);
clan.addBb(player.getName(), ChatColor.AQUA + MessageFormat.format(plugin.getLang("has.initiated.a.rivalry"), Helper.capitalize(player.getName()), Helper.capitalize(rival.getName())));
} else {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("your.clans.are.already.rivals"));
}
} else {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("rival.limit.reached"));
}
return;
}
if (action.equals(plugin.getLang("remove"))) {
if (clan.isRival(rival.getTag())) {
plugin.getRequestManager().addRivalryBreakRequest(cp, rival, clan);
ChatBlock.sendMessage(player, ChatColor.AQUA + MessageFormat.format(plugin.getLang("leaders.asked.to.end.rivalry"), Helper.capitalize(rival.getName())));
} else {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("your.clans.are.not.rivals"));
}
return;
}
ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("usage.rival"), plugin.getSettingsManager().getCommandClan()));
}
}
@@ -1,72 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans.commands;
import net.sacredlabyrinth.phaed.simpleclans.ChatBlock;
import net.sacredlabyrinth.phaed.simpleclans.Clan;
import net.sacredlabyrinth.phaed.simpleclans.Helper;
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import java.text.MessageFormat;
import java.util.List;
/**
* @author phaed
*/
public class RivalriesCommand {
public RivalriesCommand() {
}
/**
* Execute the command
*
* @param player
* @param arg
*/
public void execute(Player player, String[] arg) {
SimpleClans plugin = SimpleClans.getInstance();
String headColor = plugin.getSettingsManager().getPageHeadingsColor();
String subColor = plugin.getSettingsManager().getPageSubTitleColor();
if (arg.length != 0) {
ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("usage.0.rivalries"), plugin.getSettingsManager().getCommandClan()));
return;
}
if (!plugin.getPermissionsManager().has(player, "simpleclans.anyone.rivalries")) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
return;
}
List<Clan> clans = plugin.getClanManager().getClans();
plugin.getClanManager().sortClansByKDR(clans);
ChatBlock chatBlock = new ChatBlock();
ChatBlock.sendBlank(player);
ChatBlock.saySingle(player, plugin.getSettingsManager().getServerName() + subColor + " " + plugin.getLang("rivalries") + " " + headColor + Helper.generatePageSeparator(plugin.getSettingsManager().getPageSep()));
ChatBlock.sendBlank(player);
ChatBlock.sendMessage(player, headColor + plugin.getLang("legend") + ChatColor.DARK_RED + " [" + plugin.getLang("war") + "]");
ChatBlock.sendBlank(player);
chatBlock.setAlignment("l", "l");
chatBlock.addRow(plugin.getLang("clan"), plugin.getLang("rivals"));
for (Clan clan : clans) {
if (!clan.isVerified()) {
continue;
}
chatBlock.addRow(" " + ChatColor.AQUA + clan.getName(), clan.getRivalString(ChatColor.DARK_GRAY + ", "));
}
boolean more = chatBlock.sendBlock(player, plugin.getSettingsManager().getPageSize());
if (more) {
plugin.getStorageManager().addChatBlock(player, chatBlock);
ChatBlock.sendBlank(player);
ChatBlock.sendMessage(player, headColor + MessageFormat.format(plugin.getLang("view.next.page"), plugin.getSettingsManager().getCommandMore()));
}
ChatBlock.sendBlank(player);
}
}
@@ -1,112 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans.commands;
import net.sacredlabyrinth.phaed.simpleclans.*;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import java.text.MessageFormat;
import java.util.List;
/**
* @author phaed
*/
public class RosterCommand {
public RosterCommand() {
}
/**
* Execute the command
*
* @param player
* @param arg
*/
public void execute(Player player, String[] arg) {
SimpleClans plugin = SimpleClans.getInstance();
String headColor = plugin.getSettingsManager().getPageHeadingsColor();
String subColor = plugin.getSettingsManager().getPageSubTitleColor();
Clan clan = null;
if (arg.length == 0) {
if (plugin.getPermissionsManager().has(player, "simpleclans.member.roster")) {
ClanPlayer cp = plugin.getClanManager().getClanPlayer(player);
if (cp == null) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("not.a.member.of.any.clan"));
} else {
clan = cp.getClan();
}
} else {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
}
} else if (arg.length == 1) {
if (plugin.getPermissionsManager().has(player, "simpleclans.anyone.roster")) {
clan = plugin.getClanManager().getClan(arg[0]);
if (clan == null) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.clan.matched"));
}
} else {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
}
} else {
ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("usage.0.roster.tag"), plugin.getSettingsManager().getCommandClan()));
}
if (clan != null) {
if (clan.isVerified()) {
ChatBlock chatBlock = new ChatBlock();
ChatBlock.sendBlank(player);
ChatBlock.saySingle(player, plugin.getSettingsManager().getPageClanNameColor() + Helper.capitalize(clan.getName()) + subColor + " " + plugin.getLang("roster") + " " + headColor + Helper.generatePageSeparator(plugin.getSettingsManager().getPageSep()));
ChatBlock.sendBlank(player);
ChatBlock.sendMessage(player, headColor + plugin.getLang("legend") + " " + plugin.getSettingsManager().getPageLeaderColor() + plugin.getLang("leader") + headColor + ", " + plugin.getSettingsManager().getPageTrustedColor() + plugin.getLang("trusted") + headColor + ", " + plugin.getSettingsManager().getPageUnTrustedColor() + plugin.getLang("untrusted"));
ChatBlock.sendBlank(player);
chatBlock.setFlexibility(false, true, false, true);
chatBlock.addRow(" " + headColor + plugin.getLang("player"), plugin.getLang("rank"), plugin.getLang("seen"));
List<ClanPlayer> leaders = clan.getLeaders();
plugin.getClanManager().sortClanPlayersByLastSeen(leaders);
List<ClanPlayer> members = clan.getNonLeaders();
plugin.getClanManager().sortClanPlayersByLastSeen(members);
for (ClanPlayer cp : leaders) {
Player p = cp.toPlayer();
String name = plugin.getSettingsManager().getPageLeaderColor() + cp.getName();
String lastSeen = p != null && p.isOnline() && !Helper.isVanished(p) ? ChatColor.GREEN + plugin.getLang("online") : ChatColor.WHITE + cp.getLastSeenDaysString();
chatBlock.addRow(" " + name, ChatColor.YELLOW + Helper.parseColors(cp.getRank()), lastSeen);
}
for (ClanPlayer cp : members) {
Player p = cp.toPlayer();
String name = (cp.isTrusted() ? plugin.getSettingsManager().getPageTrustedColor() : plugin.getSettingsManager().getPageUnTrustedColor()) + cp.getName();
String lastSeen = p != null && p.isOnline() && !Helper.isVanished(p) ? ChatColor.GREEN + plugin.getLang("online") : ChatColor.WHITE + cp.getLastSeenDaysString();
chatBlock.addRow(" " + name, ChatColor.YELLOW + Helper.parseColors(cp.getRank()), lastSeen);
}
boolean more = chatBlock.sendBlock(player, plugin.getSettingsManager().getPageSize());
if (more) {
plugin.getStorageManager().addChatBlock(player, chatBlock);
ChatBlock.sendBlank(player);
ChatBlock.sendMessage(player, headColor + MessageFormat.format(plugin.getLang("view.next.page"), plugin.getSettingsManager().getCommandMore()));
}
ChatBlock.sendBlank(player);
} else {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("clan.is.not.verified"));
}
} else {
ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("usage.0.roster.tag"), plugin.getSettingsManager().getCommandClan()));
}
}
}
@@ -1,68 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans.commands;
import net.sacredlabyrinth.phaed.simpleclans.*;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import java.text.MessageFormat;
public class SetRankCommand {
public SetRankCommand() {
}
/**
* Execute the command
*
* @param player
* @param arg
*/
public void execute(Player player, String[] arg) {
SimpleClans plugin = SimpleClans.getInstance();
if (!plugin.getPermissionsManager().has(player, "simpleclans.leader.setrank")) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
return;
}
ClanPlayer cp = plugin.getClanManager().getClanPlayer(player);
if (cp == null) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("not.a.member.of.any.clan"));
return;
}
Clan clan = cp.getClan();
if (!clan.isVerified()) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("clan.is.not.verified"));
return;
}
if (!clan.isLeader(player)) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.leader.permissions"));
return;
}
if (arg.length < 1) {
ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("usage.setrank"), plugin.getSettingsManager().getCommandClan()));
return;
}
String playerName = arg[0];
String rank = Helper.toMessage(Helper.removeFirst(arg));
if (!clan.isMember(playerName) && !clan.isLeader(playerName)) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.player.matched"));
return;
}
ClanPlayer cpm = plugin.getClanManager().getClanPlayer(playerName);
cpm.setRank(rank);
plugin.getStorageManager().updateClanPlayer(cpm);
ChatBlock.sendMessage(player, ChatColor.AQUA + plugin.getLang("player.rank.changed"));
}
}
@@ -1,105 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans.commands;
import java.text.DecimalFormat;
import java.text.MessageFormat;
import java.text.NumberFormat;
import java.util.List;
import net.sacredlabyrinth.phaed.simpleclans.*;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
/**
* @author phaed
*/
public class StatsCommand {
public StatsCommand() {
}
/**
* Execute the command
*
* @param player
* @param arg
*/
public void execute(Player player, String[] arg) {
SimpleClans plugin = SimpleClans.getInstance();
String headColor = plugin.getSettingsManager().getPageHeadingsColor();
String subColor = plugin.getSettingsManager().getPageSubTitleColor();
if (!plugin.getPermissionsManager().has(player, "simpleclans.member.stats")) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
return;
}
ClanPlayer cp = plugin.getClanManager().getClanPlayer(player);
if (cp == null) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("not.a.member.of.any.clan"));
return;
}
Clan clan = cp.getClan();
if (!clan.isVerified()) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("clan.is.not.verified"));
return;
}
if (!cp.isTrusted()) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("only.trusted.players.can.access.clan.stats"));
return;
}
if (arg.length != 0) {
ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("usage.0.stats"), plugin.getSettingsManager().getCommandClan()));
return;
}
ChatBlock chatBlock = new ChatBlock();
ChatBlock.saySingle(player, plugin.getSettingsManager().getPageClanNameColor() + Helper.capitalize(clan.getName()) + subColor + " " + plugin.getLang("stats") + " " + headColor + Helper.generatePageSeparator(plugin.getSettingsManager().getPageSep()));
ChatBlock.sendBlank(player);
ChatBlock.sendMessage(player, headColor + plugin.getLang("kdr") + " = " + subColor + plugin.getLang("kill.death.ratio"));
ChatBlock.sendMessage(player, headColor + plugin.getLang("weights") + " = " + plugin.getLang("rival") + ": " + subColor + plugin.getSettingsManager().getKwRival() + headColor + " " + plugin.getLang("neutral") + ": " + subColor + plugin.getSettingsManager().getKwNeutral() + headColor + " " + plugin.getLang("civilian") + ": " + subColor + plugin.getSettingsManager().getKwCivilian());
ChatBlock.sendBlank(player);
chatBlock.setFlexibility(true, false, false, false, false, false, false);
chatBlock.setAlignment("l", "c", "c", "c", "c", "c", "c");
chatBlock.addRow(" " + headColor + plugin.getLang("name"), plugin.getLang("kdr"), plugin.getLang("rival"), plugin.getLang("neutral"), plugin.getLang("civilian.abbreviation"), plugin.getLang("deaths"));
List<ClanPlayer> leaders = clan.getLeaders();
plugin.getClanManager().sortClanPlayersByKDR(leaders);
List<ClanPlayer> members = clan.getNonLeaders();
plugin.getClanManager().sortClanPlayersByKDR(members);
addRows(leaders, chatBlock);
addRows(members, chatBlock);
boolean more = chatBlock.sendBlock(player, plugin.getSettingsManager().getPageSize());
if (more) {
plugin.getStorageManager().addChatBlock(player, chatBlock);
ChatBlock.sendBlank(player);
ChatBlock.sendMessage(player, headColor + MessageFormat.format(plugin.getLang("view.next.page"), plugin.getSettingsManager().getCommandMore()));
}
ChatBlock.sendBlank(player);
}
private void addRows(List<ClanPlayer> leaders, ChatBlock chatBlock) {
SimpleClans plugin = SimpleClans.getInstance();
NumberFormat formatter = new DecimalFormat("#.#");
for (ClanPlayer cpm : leaders) {
String name = (cpm.isLeader() ? plugin.getSettingsManager().getPageLeaderColor() : (cpm.isTrusted() ? plugin.getSettingsManager().getPageTrustedColor() : plugin.getSettingsManager().getPageUnTrustedColor())) + cpm.getName();
String rival = NumberFormat.getInstance().format(cpm.getRivalKills());
String neutral = NumberFormat.getInstance().format(cpm.getNeutralKills());
String civilian = NumberFormat.getInstance().format(cpm.getCivilianKills());
String deaths = NumberFormat.getInstance().format(cpm.getDeaths());
String kdr = formatter.format(cpm.getKDR());
chatBlock.addRow(" " + name, ChatColor.YELLOW + kdr, ChatColor.WHITE + rival, ChatColor.GRAY + neutral, ChatColor.DARK_GRAY + civilian, ChatColor.DARK_RED + deaths);
}
}
}
@@ -1,159 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans.commands;
import net.sacredlabyrinth.phaed.simpleclans.ChatBlock;
import net.sacredlabyrinth.phaed.simpleclans.Clan;
import net.sacredlabyrinth.phaed.simpleclans.ClanPlayer;
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
/**
* @author phaed
*/
public class ToggleCommand {
public ToggleCommand() {
}
/**
* Execute the command
*
* @param player
* @param arg
*/
public void execute(Player player, String[] arg) {
SimpleClans plugin = SimpleClans.getInstance();
if (arg.length == 0) {
return;
}
String cmd = arg[0];
if (cmd.equalsIgnoreCase("cape")) {
if (plugin.getPermissionsManager().has(player, "simpleclans.member.cape-toggle")) {
ClanPlayer cp = plugin.getClanManager().getClanPlayer(player);
if (cp != null) {
Clan clan = cp.getClan();
if (clan.isVerified()) {
if (cp.isCapeEnabled()) {
ChatBlock.sendMessage(player, ChatColor.AQUA + plugin.getLang("capeoff"));
cp.setCapeEnabled(false);
} else {
ChatBlock.sendMessage(player, ChatColor.AQUA + plugin.getLang("capeon"));
cp.setCapeEnabled(true);
}
} else {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("clan.is.not.verified"));
}
} else {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("not.a.member.of.any.clan"));
}
} else {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
}
}
if (cmd.equalsIgnoreCase("bb") && plugin.getPermissionsManager().has(player, "simpleclans.member.bb-toggle")) {
ClanPlayer cp = plugin.getClanManager().getClanPlayer(player);
if (cp != null) {
Clan clan = cp.getClan();
if (clan.isVerified()) {
if (cp.isBbEnabled()) {
ChatBlock.sendMessage(player, ChatColor.AQUA + plugin.getLang("bboff"));
cp.setBbEnabled(false);
} else {
ChatBlock.sendMessage(player, ChatColor.AQUA + plugin.getLang("bbon"));
cp.setBbEnabled(true);
}
plugin.getStorageManager().updateClanPlayer(cp);
}
}
}
if (cmd.equalsIgnoreCase("tag") && plugin.getPermissionsManager().has(player, "simpleclans.member.tag-toggle")) {
ClanPlayer cp = plugin.getClanManager().getClanPlayer(player);
if (cp != null) {
Clan clan = cp.getClan();
if (clan.isVerified()) {
if (cp.isTagEnabled()) {
ChatBlock.sendMessage(player, ChatColor.AQUA + plugin.getLang("tagoff"));
cp.setTagEnabled(false);
} else {
ChatBlock.sendMessage(player, ChatColor.AQUA + plugin.getLang("tagon"));
cp.setTagEnabled(true);
}
plugin.getStorageManager().updateClanPlayer(cp);
}
}
}
if (cmd.equalsIgnoreCase("deposit") && plugin.getPermissionsManager().has(player, "simpleclans.leader.deposit-toggle")) {
ClanPlayer cp = plugin.getClanManager().getClanPlayer(player);
if (cp != null) {
Clan clan = cp.getClan();
if (clan.isLeader(player)) {
if (clan.isVerified()) {
if (clan.isAllowDeposit()) {
ChatBlock.sendMessage(player, ChatColor.AQUA + plugin.getLang("depositoff"));
clan.setAllowDeposit(false);
} else {
ChatBlock.sendMessage(player, ChatColor.AQUA + plugin.getLang("depositon"));
clan.setAllowDeposit(true);
}
}
} else {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.leader.permissions"));
}
}
}
if (cmd.equalsIgnoreCase("fee") && plugin.getPermissionsManager().has(player, "simpleclans.leader.fee")) {
ClanPlayer cp = plugin.getClanManager().getClanPlayer(player);
if (cp != null) {
Clan clan = cp.getClan();
if (clan.isVerified()) {
if (clan.isLeader(player)) {
if (clan.isMemberFeeEnabled()) {
ChatBlock.sendMessage(player, ChatColor.AQUA + plugin.getLang("feeoff"));
clan.setMemberFeeEnabled(false);
} else {
ChatBlock.sendMessage(player, ChatColor.AQUA + plugin.getLang("feeon"));
clan.setMemberFeeEnabled(true);
}
plugin.getStorageManager().updateClanAsync(clan);
} else {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.leader.permissions"));
}
}
}
}
if (cmd.equalsIgnoreCase("withdraw") && plugin.getPermissionsManager().has(player, "simpleclans.leader.withdraw-toggle")) {
ClanPlayer cp = plugin.getClanManager().getClanPlayer(player);
if (cp != null) {
Clan clan = cp.getClan();
if (clan.isVerified()) {
if (clan.isLeader(player)) {
if (clan.isAllowWithdraw()) {
ChatBlock.sendMessage(player, ChatColor.AQUA + plugin.getLang("withdrawoff"));
clan.setAllowWithdraw(false);
} else {
ChatBlock.sendMessage(player, ChatColor.AQUA + plugin.getLang("withdrawon"));
clan.setAllowWithdraw(true);
}
} else {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.leader.permissions"));
}
}
}
}
}
}
@@ -1,95 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans.commands;
import net.sacredlabyrinth.phaed.simpleclans.ChatBlock;
import net.sacredlabyrinth.phaed.simpleclans.Clan;
import net.sacredlabyrinth.phaed.simpleclans.ClanPlayer;
import net.sacredlabyrinth.phaed.simpleclans.Helper;
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import java.text.MessageFormat;
/**
* @author phaed
*/
public class TrustCommand {
public TrustCommand() {
}
/**
* Execute the command
*
* @param player
* @param arg
*/
public void execute(Player player, String[] arg) {
SimpleClans plugin = SimpleClans.getInstance();
if (!plugin.getPermissionsManager().has(player, "simpleclans.leader.settrust")) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
return;
}
ClanPlayer cp = plugin.getClanManager().getClanPlayer(player);
if (cp == null) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("not.a.member.of.any.clan"));
return;
}
Clan clan = cp.getClan();
if (!clan.isLeader(player)) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.leader.permissions"));
return;
}
if (arg.length != 1) {
ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("usage.0.trust.player"), plugin.getSettingsManager().getCommandClan()));
return;
}
String trusted = arg[0];
if (trusted == null) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.player.matched"));
return;
}
if (trusted.equals(player.getName())) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("you.cannot.trust.yourself"));
return;
}
if (!clan.isMember(trusted)) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("the.player.is.not.a.member.of.your.clan"));
return;
}
if (clan.isLeader(trusted)) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("leaders.are.already.trusted"));
return;
}
ClanPlayer tcp = plugin.getClanManager().getClanPlayer(trusted);
if (tcp == null) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.player.matched"));
return;
}
if (tcp.isTrusted()) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("this.player.is.already.trusted"));
return;
}
clan.addBb(player.getName(), ChatColor.AQUA + MessageFormat.format(plugin.getLang("has.been.given.trusted.status.by"), Helper.capitalize(trusted), player.getName()));
tcp.setTrusted(true);
plugin.getStorageManager().updateClanPlayer(tcp);
}
}
@@ -1,56 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans.commands;
import net.sacredlabyrinth.phaed.simpleclans.ChatBlock;
import net.sacredlabyrinth.phaed.simpleclans.Helper;
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
import net.sacredlabyrinth.phaed.simpleclans.uuid.UUIDMigration;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import java.text.MessageFormat;
/**
* @author phaed
*/
public class UnbanCommand {
public UnbanCommand() {
}
/**
* Execute the command
*
* @param player
* @param arg
*/
public void execute(Player player, String[] arg) {
SimpleClans plugin = SimpleClans.getInstance();
if (!plugin.getPermissionsManager().has(player, "simpleclans.mod.ban")) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
return;
}
if (arg.length != 1) {
ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("usage.ban.unban"), plugin.getSettingsManager().getCommandClan()));
return;
}
String banned = arg[0];
if (!plugin.getSettingsManager().isBanned(banned)) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("this.player.is.not.banned"));
return;
}
Player pl = Helper.getPlayer(banned);
if (pl != null) {
ChatBlock.sendMessage(pl, ChatColor.AQUA + plugin.getLang("you.have.been.unbanned.from.clan.commands"));
}
plugin.getSettingsManager().removeBanned(banned);
ChatBlock.sendMessage(player, ChatColor.AQUA + plugin.getLang("player.removed.from.the.banned.list"));
}
}
@@ -1,93 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans.commands;
import net.sacredlabyrinth.phaed.simpleclans.ChatBlock;
import net.sacredlabyrinth.phaed.simpleclans.Clan;
import net.sacredlabyrinth.phaed.simpleclans.ClanPlayer;
import net.sacredlabyrinth.phaed.simpleclans.Helper;
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import java.text.MessageFormat;
/**
* @author phaed
*/
public class UntrustCommand {
public UntrustCommand() {
}
/**
* Execute the command
*
* @param player
* @param arg
*/
public void execute(Player player, String[] arg) {
SimpleClans plugin = SimpleClans.getInstance();
if (!plugin.getPermissionsManager().has(player, "simpleclans.leader.settrust")) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
return;
}
ClanPlayer cp = plugin.getClanManager().getClanPlayer(player);
if (cp == null) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("not.a.member.of.any.clan"));
return;
}
Clan clan = cp.getClan();
if (!clan.isLeader(player)) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.leader.permissions"));
return;
}
if (arg.length != 1) {
ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("usage.0.untrust.player"), plugin.getSettingsManager().getCommandClan()));
return;
}
String trusted = arg[0];
if (trusted == null) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.player.matched"));
return;
}
if (trusted.equals(player.getName())) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("you.cannot.untrust.yourself"));
return;
}
if (!clan.isMember(trusted)) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("the.player.is.not.a.member.of.your.clan"));
return;
}
if (clan.isLeader(trusted)) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("leaders.cannot.be.untrusted"));
return;
}
ClanPlayer tcp = plugin.getClanManager().getClanPlayer(trusted);
if (tcp == null) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.player.matched"));
return;
}
if (!tcp.isTrusted()) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("this.player.is.already.untrusted"));
return;
}
clan.addBb(player.getName(), ChatColor.AQUA + MessageFormat.format(plugin.getLang("has.been.given.untrusted.status.by"), Helper.capitalize(trusted), player.getName()));
tcp.setTrusted(false);
plugin.getStorageManager().updateClanPlayer(tcp);
}
}
@@ -1,85 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans.commands;
import net.sacredlabyrinth.phaed.simpleclans.ChatBlock;
import net.sacredlabyrinth.phaed.simpleclans.Clan;
import net.sacredlabyrinth.phaed.simpleclans.ClanPlayer;
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import java.text.MessageFormat;
/**
* @author phaed
*/
public class VerifyCommand {
public VerifyCommand() {
}
/**
* Execute the command
*
* @param sender
* @param arg
*/
public void execute(CommandSender sender, String[] arg) {
SimpleClans plugin = SimpleClans.getInstance();
if (sender instanceof Player) {
Player player = (Player) sender;
ClanPlayer cp = plugin.getClanManager().getClanPlayer(player);
Clan clan = cp == null ? null : cp.getClan();
boolean isNonVerified = clan != null && !clan.isVerified();
boolean isBuyer = isNonVerified && plugin.getSettingsManager().isRequireVerification() && plugin.getSettingsManager().isePurchaseVerification();
if (!plugin.getPermissionsManager().has(player, "simpleclans.mod.verify")) {
//if the player does specify a tag, but does not have mod permission to verify
//if the player does not specify a tag, but does not have leader permission to verify
if (arg.length != 0 || !plugin.getPermissionsManager().has(player, "simpleclans.leader.verify")) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
return;
}
if (isBuyer) {
if (arg.length == 0 && plugin.getClanManager().purchaseVerification(player)) {
clan.verifyClan();
clan.addBb(player.getName(), ChatColor.AQUA + MessageFormat.format(plugin.getLang("clan.0.has.been.verified"), clan.getName()));
ChatBlock.sendMessage(player, ChatColor.AQUA + plugin.getLang("the.clan.has.been.verified"));
}
}
} else {
if (arg.length != 1) {
ChatBlock.sendMessage(sender, ChatColor.RED + MessageFormat.format(plugin.getLang("usage.0.verify.tag"), plugin.getSettingsManager().getCommandClan()));
return;
}
verify(player, arg[0]);
}
} else {
if (arg.length != 1) {
ChatBlock.sendMessage(sender, ChatColor.RED + MessageFormat.format(plugin.getLang("usage.0.verify.tag"), plugin.getSettingsManager().getCommandClan()));
return;
}
verify(sender, arg[0]);
}
}
private void verify(CommandSender player, String clanName) {
SimpleClans plugin = SimpleClans.getInstance();
Clan clan = plugin.getClanManager().getClan(clanName);
if (clan != null) {
if (!clan.isVerified()) {
clan.verifyClan();
clan.addBb(player.getName(), ChatColor.AQUA + MessageFormat.format(plugin.getLang("clan.0.has.been.verified"), clan.getName()));
ChatBlock.sendMessage(player, ChatColor.AQUA + plugin.getLang("the.clan.has.been.verified"));
} else {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("the.clan.is.already.verified"));
}
} else {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("the.clan.does.not.exist"));
}
}
}
@@ -1,105 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans.commands;
import net.sacredlabyrinth.phaed.simpleclans.*;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import java.text.MessageFormat;
import java.util.Collection;
import java.util.List;
import java.util.Set;
/**
* @author phaed
*/
public class VitalsCommand {
public VitalsCommand() {
}
/**
* Execute the command
*
* @param player
* @param arg
*/
public void execute(Player player, String[] arg) {
SimpleClans plugin = SimpleClans.getInstance();
String headColor = plugin.getSettingsManager().getPageHeadingsColor();
String subColor = plugin.getSettingsManager().getPageSubTitleColor();
if (!plugin.getPermissionsManager().has(player, "simpleclans.member.vitals")) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
return;
}
ClanPlayer cp = plugin.getClanManager().getClanPlayer(player);
if (cp == null) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("not.a.member.of.any.clan"));
return;
}
Clan clan = cp.getClan();
if (!clan.isVerified()) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("clan.is.not.verified"));
return;
}
if (!cp.isTrusted()) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("only.trusted.players.can.access.clan.vitals"));
return;
}
if (arg.length != 0) {
ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("usage.0.vitals"), plugin.getSettingsManager().getCommandClan()));
return;
}
ChatBlock chatBlock = new ChatBlock();
ChatBlock.sendBlank(player);
ChatBlock.saySingle(player, plugin.getSettingsManager().getPageClanNameColor() + Helper.capitalize(clan.getName()) + subColor + " " + plugin.getLang("vitals") + " " + headColor + Helper.generatePageSeparator(plugin.getSettingsManager().getPageSep()));
ChatBlock.sendBlank(player);
ChatBlock.sendMessage(player, headColor + plugin.getLang("weapons") + ": " + MessageFormat.format(plugin.getLang("0.s.sword.1.2.b.bow.3.4.a.arrow"), ChatColor.WHITE, ChatColor.DARK_GRAY, ChatColor.WHITE, ChatColor.DARK_GRAY, ChatColor.WHITE));
ChatBlock.sendMessage(player, headColor + plugin.getLang("materials") + ": " + ChatColor.AQUA + plugin.getLang("diamond") + ChatColor.DARK_GRAY + ", " + ChatColor.YELLOW + plugin.getLang("gold") + ChatColor.DARK_GRAY + ", " + ChatColor.GRAY + plugin.getLang("stone") + ChatColor.DARK_GRAY + ", " + ChatColor.WHITE + plugin.getLang("iron") + ChatColor.DARK_GRAY + ", " + ChatColor.GOLD + plugin.getLang("wood"));
ChatBlock.sendBlank(player);
chatBlock.setFlexibility(true, false, false, false, false, false);
chatBlock.setAlignment("l", "l", "l", "c", "c", "c");
chatBlock.addRow(" " + headColor + plugin.getLang("name"), plugin.getLang("health"), plugin.getLang("hunger"), plugin.getLang("food"), plugin.getLang("armor"), plugin.getLang("weapons"));
List<ClanPlayer> members = Helper.stripOffLinePlayers(clan.getLeaders());
members.addAll(Helper.stripOffLinePlayers(clan.getNonLeaders()));
addRows(members, chatBlock);
chatBlock.addRow(" -- Allies -- ", "", "", "", "", "");
addRows(clan.getAllAllyMembers(), chatBlock);
boolean more = chatBlock.sendBlock(player, plugin.getSettingsManager().getPageSize());
if (more) {
plugin.getStorageManager().addChatBlock(player, chatBlock);
ChatBlock.sendBlank(player);
ChatBlock.sendMessage(player, headColor + MessageFormat.format(plugin.getLang("view.next.page"), plugin.getSettingsManager().getCommandMore()));
}
ChatBlock.sendBlank(player);
}
private void addRows(Collection<ClanPlayer> players, ChatBlock chatBlock){
SimpleClans plugin = SimpleClans.getInstance();
for (ClanPlayer cpm : players) {
Player p = cpm.toPlayer();
if (p != null) {
String name = (cpm.isLeader() ? plugin.getSettingsManager().getPageLeaderColor() : (cpm.isTrusted() ? plugin.getSettingsManager().getPageTrustedColor() : plugin.getSettingsManager().getPageUnTrustedColor())) + cpm.getName();
String health = plugin.getClanManager().getHealthString(p.getHealth());
String hunger = plugin.getClanManager().getHungerString(p.getFoodLevel());
String armor = plugin.getClanManager().getArmorString(p.getInventory());
String weapons = plugin.getClanManager().getWeaponString(p.getInventory());
String food = plugin.getClanManager().getFoodString(p.getInventory());
chatBlock.addRow(" " + name, ChatColor.RED + health, hunger, ChatColor.WHITE + food, armor, weapons);
}
}
}
}
@@ -1,94 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans.commands;
import net.sacredlabyrinth.phaed.simpleclans.*;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import java.text.MessageFormat;
import java.util.List;
/**
* @author phaed
*/
public class WarCommand {
public WarCommand() {
}
/**
* Execute the command
*
* @param player
* @param arg
*/
public void execute(Player player, String[] arg) {
SimpleClans plugin = SimpleClans.getInstance();
if (!plugin.getPermissionsManager().has(player, "simpleclans.leader.war")) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
return;
}
ClanPlayer cp = plugin.getClanManager().getClanPlayer(player);
if (cp == null) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("not.a.member.of.any.clan"));
return;
}
Clan clan = cp.getClan();
if (!clan.isVerified()) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("clan.is.not.verified"));
return;
}
if (!clan.isLeader(player)) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.leader.permissions"));
return;
}
if (arg.length != 2) {
ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("usage.war"), plugin.getSettingsManager().getCommandClan()));
return;
}
String action = arg[0];
Clan war = plugin.getClanManager().getClan(arg[1]);
if (war == null) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.clan.matched"));
return;
}
if (!clan.isRival(war.getTag())) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("you.can.only.start.war.with.rivals"));
return;
}
if (action.equals(plugin.getLang("start"))) {
if (!clan.isWarring(war.getTag())) {
List<ClanPlayer> onlineLeaders = Helper.stripOffLinePlayers(clan.getLeaders());
if (!onlineLeaders.isEmpty()) {
plugin.getRequestManager().addWarStartRequest(cp, war, clan);
ChatBlock.sendMessage(player, ChatColor.AQUA + MessageFormat.format(plugin.getLang("leaders.have.been.asked.to.accept.the.war.request"), Helper.capitalize(war.getName())));
} else {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("at.least.one.leader.accept.the.alliance"));
}
} else {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("clans.already.at.war"));
}
return;
}
if (action.equals(plugin.getLang("end"))) {
if (clan.isWarring(war.getTag())) {
plugin.getRequestManager().addWarEndRequest(cp, war, clan);
ChatBlock.sendMessage(player, ChatColor.AQUA + MessageFormat.format(plugin.getLang("leaders.asked.to.end.rivalry"), Helper.capitalize(war.getName())));
} else {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("clans.not.at.war"));
}
return;
}
ChatBlock.sendMessage(player, ChatColor.RED + MessageFormat.format(plugin.getLang("usage.war"), plugin.getSettingsManager().getCommandClan()));
}
}
@@ -1,28 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans.conversation;
import org.bukkit.conversations.ConversationContext;
import org.bukkit.conversations.Prompt;
/**
*
* @author roinujnosde
*/
public class MessagePromptImpl extends org.bukkit.conversations.MessagePrompt {
private final String message;
public MessagePromptImpl(String message) {
this.message = message;
}
@Override
protected Prompt getNextPrompt(ConversationContext cc) {
return END_OF_CONVERSATION;
}
@Override
public String getPromptText(ConversationContext cc) {
return message;
}
}
@@ -1,62 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans.conversation;
import java.text.MessageFormat;
import java.util.Arrays;
import net.sacredlabyrinth.phaed.simpleclans.Clan;
import net.sacredlabyrinth.phaed.simpleclans.ClanPlayer;
import net.sacredlabyrinth.phaed.simpleclans.Helper;
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
import net.sacredlabyrinth.phaed.simpleclans.managers.ClanManager;
import org.bukkit.ChatColor;
import org.bukkit.conversations.ConversationContext;
import org.bukkit.conversations.Prompt;
import static org.bukkit.conversations.Prompt.END_OF_CONVERSATION;
import org.bukkit.conversations.StringPrompt;
import org.bukkit.entity.Player;
/**
*
* @author roinujnosde
*/
public class ResignPrompt extends StringPrompt {
@Override
public Prompt acceptInput(ConversationContext cc, String input) {
final SimpleClans plugin = (SimpleClans) cc.getPlugin();
String yes = plugin.getLang("resign.yes");
Player player = (Player) cc.getForWhom();
ClanManager cm = plugin.getClanManager();
ClanPlayer cp = cm.getClanPlayer(player);
Clan clan = cp.getClan();
if (yes.equalsIgnoreCase(input)) {
if (!clan.isLeader(player) || clan.getLeaders().size() > 1) {
clan.addBb(player.getName(), ChatColor.AQUA + MessageFormat.format(plugin.getLang("0.has.resigned"), Helper.capitalize(player.getName())));
if (SimpleClans.getInstance().hasUUID()) {
clan.removePlayerFromClan(player.getUniqueId());
} else {
clan.removePlayerFromClan(player.getName());
}
return new MessagePromptImpl(ChatColor.AQUA + plugin.getLang("resign.success"));
} else if (clan.isLeader(player) && clan.getLeaders().size() == 1) {
plugin.getClanManager().serverAnnounce(ChatColor.AQUA + MessageFormat.format(plugin.getLang("clan.has.been.disbanded"), clan.getName()));
clan.disband();
} else {
return new MessagePromptImpl(ChatColor.RED + plugin.getLang("last.leader.cannot.resign.you.must.appoint.another.leader.or.disband.the.clan"));
}
}
return END_OF_CONVERSATION;
}
@Override
public String getPromptText(ConversationContext cc) {
final SimpleClans plugin = (SimpleClans) cc.getPlugin();
return ChatColor.RED + MessageFormat.format(
plugin.getLang("resign.confirmation"), Arrays.asList(
plugin.getLang("resign.yes"), plugin.getLang("resign.no")));
}
}
@@ -1,38 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans.events;
import net.sacredlabyrinth.phaed.simpleclans.Clan;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
/**
*
* @author NeT32
*/
public class AllyClanAddEvent extends Event {
private static final HandlerList handlers = new HandlerList();
private final Clan clanFirst;
private final Clan clanSecond;
public AllyClanAddEvent(Clan clanFirst, Clan clanSecond) {
this.clanFirst = clanFirst;
this.clanSecond = clanSecond;
}
public Clan getClanFirst() {
return this.clanFirst;
}
public Clan getClanSecond() {
return this.clanSecond;
}
@Override
public HandlerList getHandlers() {
return handlers;
}
public static HandlerList getHandlerList() {
return handlers;
}
}
@@ -1,38 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans.events;
import net.sacredlabyrinth.phaed.simpleclans.Clan;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
/**
*
* @author NeT32
*/
public class AllyClanRemoveEvent extends Event {
private static final HandlerList handlers = new HandlerList();
private final Clan clanFirst;
private final Clan clanSecond;
public AllyClanRemoveEvent(Clan clanFirst, Clan clanSecond) {
this.clanFirst = clanFirst;
this.clanSecond = clanSecond;
}
public Clan getClanFirst() {
return this.clanFirst;
}
public Clan getClanSecond() {
return this.clanSecond;
}
@Override
public HandlerList getHandlers() {
return handlers;
}
public static HandlerList getHandlerList() {
return handlers;
}
}
@@ -1,32 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans.events;
import net.sacredlabyrinth.phaed.simpleclans.Clan;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
/**
*
* @author NeT32
*/
public class DisbandClanEvent extends Event {
private static final HandlerList handlers = new HandlerList();
private final Clan clan;
public DisbandClanEvent(Clan clan) {
this.clan = clan;
}
public Clan getClan() {
return this.clan;
}
@Override
public HandlerList getHandlers() {
return handlers;
}
public static HandlerList getHandlerList() {
return handlers;
}
}
@@ -1,39 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans.events;
import net.sacredlabyrinth.phaed.simpleclans.Clan;
import net.sacredlabyrinth.phaed.simpleclans.ClanPlayer;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
/**
*
* @author NeT32
*/
public class PlayerDemoteEvent extends Event {
private static final HandlerList handlers = new HandlerList();
private final Clan clan;
private final ClanPlayer target;
public PlayerDemoteEvent(Clan clan, ClanPlayer target) {
this.clan = clan;
this.target = target;
}
public Clan getClan() {
return this.clan;
}
public ClanPlayer getClanPlayer() {
return this.target;
}
@Override
public HandlerList getHandlers() {
return handlers;
}
public static HandlerList getHandlerList() {
return handlers;
}
}
@@ -1,39 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans.events;
import net.sacredlabyrinth.phaed.simpleclans.Clan;
import net.sacredlabyrinth.phaed.simpleclans.ClanPlayer;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
/**
*
* @author NeT32
*/
public class PlayerJoinedClanEvent extends Event {
private static final HandlerList handlers = new HandlerList();
private final Clan clan;
private final ClanPlayer target;
public PlayerJoinedClanEvent(Clan clan, ClanPlayer target) {
this.clan = clan;
this.target = target;
}
public Clan getClan() {
return this.clan;
}
public ClanPlayer getClanPlayer() {
return this.target;
}
@Override
public HandlerList getHandlers() {
return handlers;
}
public static HandlerList getHandlerList() {
return handlers;
}
}
@@ -1,39 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans.events;
import net.sacredlabyrinth.phaed.simpleclans.Clan;
import net.sacredlabyrinth.phaed.simpleclans.ClanPlayer;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
/**
*
* @author NeT32
*/
public class PlayerKickedClanEvent extends Event {
private static final HandlerList handlers = new HandlerList();
private final Clan clan;
private final ClanPlayer target;
public PlayerKickedClanEvent(Clan clan, ClanPlayer target) {
this.clan = clan;
this.target = target;
}
public Clan getClan() {
return this.clan;
}
public ClanPlayer getClanPlayer() {
return this.target;
}
@Override
public HandlerList getHandlers() {
return handlers;
}
public static HandlerList getHandlerList() {
return handlers;
}
}
@@ -1,39 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans.events;
import net.sacredlabyrinth.phaed.simpleclans.Clan;
import net.sacredlabyrinth.phaed.simpleclans.ClanPlayer;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
/**
*
* @author NeT32
*/
public class PlayerPromoteEvent extends Event {
private static final HandlerList handlers = new HandlerList();
private final Clan clan;
private final ClanPlayer target;
public PlayerPromoteEvent(Clan clan, ClanPlayer target) {
this.clan = clan;
this.target = target;
}
public Clan getClan() {
return this.clan;
}
public ClanPlayer getClanPlayer() {
return this.target;
}
@Override
public HandlerList getHandlers() {
return handlers;
}
public static HandlerList getHandlerList() {
return handlers;
}
}
@@ -1,38 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans.events;
import net.sacredlabyrinth.phaed.simpleclans.Clan;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
/**
*
* @author NeT32
*/
public class RivalClanAddEvent extends Event {
private static final HandlerList handlers = new HandlerList();
private final Clan clanFirst;
private final Clan clanSecond;
public RivalClanAddEvent(Clan clanFirst, Clan clanSecond) {
this.clanFirst = clanFirst;
this.clanSecond = clanSecond;
}
public Clan getClanFirst() {
return this.clanFirst;
}
public Clan getClanSecond() {
return this.clanSecond;
}
@Override
public HandlerList getHandlers() {
return handlers;
}
public static HandlerList getHandlerList() {
return handlers;
}
}
@@ -1,38 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans.events;
import net.sacredlabyrinth.phaed.simpleclans.Clan;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
/**
*
* @author NeT32
*/
public class RivalClanRemoveEvent extends Event {
private static final HandlerList handlers = new HandlerList();
private final Clan clanFirst;
private final Clan clanSecond;
public RivalClanRemoveEvent(Clan clanFirst, Clan clanSecond) {
this.clanFirst = clanFirst;
this.clanSecond = clanSecond;
}
public Clan getClanFirst() {
return this.clanFirst;
}
public Clan getClanSecond() {
return this.clanSecond;
}
@Override
public HandlerList getHandlers() {
return handlers;
}
public static HandlerList getHandlerList() {
return handlers;
}
}
@@ -1,63 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans.executors;
import net.sacredlabyrinth.phaed.simpleclans.*;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import java.text.MessageFormat;
public class AcceptCommandExecutor implements CommandExecutor {
SimpleClans plugin;
public AcceptCommandExecutor() {
plugin = SimpleClans.getInstance();
}
@Override
public boolean onCommand(CommandSender commandSender, Command command, String s, String[] strings) {
Player player = (Player) commandSender;
if (plugin.getSettingsManager().isBanned(player.getName())) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("banned"));
return false;
}
ClanPlayer cp = plugin.getClanManager().getClanPlayer(player);
if (cp != null) {
Clan clan = cp.getClan();
if (!clan.isLeader(player)) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.leader.permissions"));
return false;
}
if (!plugin.getRequestManager().hasRequest(clan.getTag())) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("nothing.to.accept"));
return false;
}
if (cp.getVote() != null) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("you.have.already.voted"));
return false;
}
plugin.getRequestManager().accept(cp);
clan.leaderAnnounce(ChatColor.GREEN + MessageFormat.format(plugin.getLang("voted.to.accept"), Helper.capitalize(player.getName())));
} else {
if (!plugin.getRequestManager().hasRequest(player.getName().toLowerCase())) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("nothing.to.accept"));
return false;
}
if (SimpleClans.getInstance().hasUUID()) {
cp = plugin.getClanManager().getCreateClanPlayer(player.getUniqueId());
cp.setName(player.getName());
} else {
cp = plugin.getClanManager().getCreateClanPlayer(player.getName());
}
plugin.getRequestManager().accept(cp);
}
return true;
}
}
@@ -1,37 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans.executors;
import net.sacredlabyrinth.phaed.simpleclans.ChatBlock;
import net.sacredlabyrinth.phaed.simpleclans.Helper;
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class AllyCommandExecutor implements CommandExecutor {
private final SimpleClans plugin;
public AllyCommandExecutor() {
plugin = SimpleClans.getInstance();
}
@Override
public boolean onCommand(CommandSender commandSender, Command command, String s, String[] strings) {
Player player = (Player) commandSender;
if (!plugin.getSettingsManager().isAllyChatEnable()) {
return false;
}
if (!plugin.getPermissionsManager().has(player, "simpleclans.member.ally")) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("insufficient.permissions"));
return true;
}
plugin.getClanManager().processAllyChat(player, Helper.toMessage(strings));
return false;
}
}
@@ -1,246 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans.executors;
import net.sacredlabyrinth.phaed.simpleclans.*;
import net.sacredlabyrinth.phaed.simpleclans.commands.*;
import org.bukkit.ChatColor;
import org.bukkit.command.*;
import org.bukkit.entity.Player;
import java.text.MessageFormat;
/**
* @author phaed
*/
public final class ClanCommandExecutor implements CommandExecutor {
private final SimpleClans plugin;
private final CreateCommand createCommand;
private final ListCommand listCommand;
private final ProfileCommand profileCommand;
private final RosterCommand rosterCommand;
private final LookupCommand lookupCommand;
private final LeaderboardCommand leaderboardCommand;
private final AlliancesCommand alliancesCommand;
private final RivalriesCommand rivalriesCommand;
private final VitalsCommand vitalsCommand;
private final CoordsCommand coordsCommand;
private final StatsCommand statsCommand;
private final AllyCommand allyCommand;
private final RivalCommand rivalCommand;
private final BbCommand bbCommand;
private final ModtagCommand modtagCommand;
private final ToggleCommand toggleCommand;
private final InviteCommand inviteCommand;
private final KickCommand kickCommand;
private final TrustCommand trustCommand;
private final UntrustCommand untrustCommand;
private final PromoteCommand promoteCommand;
private final DemoteCommand demoteCommand;
private final ClanffCommand clanffCommand;
private final FfCommand ffCommand;
private final ResignCommand resignCommand;
private final DisbandCommand disbandCommand;
private final VerifyCommand verifyCommand;
private final BanCommand banCommand;
private final FeeCommand feeCommand;
private final UnbanCommand unbanCommand;
private final ReloadCommand reloadCommand;
private final GlobalffCommand globalffCommand;
private final MenuCommand menuCommand;
private final WarCommand warCommand;
private final HomeCommand homeCommand;
private final KillsCommand killsCommand;
private final MostKilledCommand mostKilledCommand;
private final SetRankCommand setRankCommand;
private final BankCommand bankCommand;
private final PlaceCommand placeCommand;
private final ResetKDRCommand resetKDRCommand;
private final PurgeCommand purgeCommand;
/**
*
*/
public ClanCommandExecutor() {
plugin = SimpleClans.getInstance();
menuCommand = new MenuCommand();
createCommand = new CreateCommand();
listCommand = new ListCommand();
profileCommand = new ProfileCommand();
rosterCommand = new RosterCommand();
lookupCommand = new LookupCommand();
leaderboardCommand = new LeaderboardCommand();
alliancesCommand = new AlliancesCommand();
rivalriesCommand = new RivalriesCommand();
vitalsCommand = new VitalsCommand();
coordsCommand = new CoordsCommand();
statsCommand = new StatsCommand();
allyCommand = new AllyCommand();
rivalCommand = new RivalCommand();
bbCommand = new BbCommand();
modtagCommand = new ModtagCommand();
toggleCommand = new ToggleCommand();
inviteCommand = new InviteCommand();
kickCommand = new KickCommand();
trustCommand = new TrustCommand();
untrustCommand = new UntrustCommand();
promoteCommand = new PromoteCommand();
demoteCommand = new DemoteCommand();
clanffCommand = new ClanffCommand();
ffCommand = new FfCommand();
resignCommand = new ResignCommand();
disbandCommand = new DisbandCommand();
verifyCommand = new VerifyCommand();
banCommand = new BanCommand();
unbanCommand = new UnbanCommand();
reloadCommand = new ReloadCommand();
globalffCommand = new GlobalffCommand();
warCommand = new WarCommand();
homeCommand = new HomeCommand();
killsCommand = new KillsCommand();
mostKilledCommand = new MostKilledCommand();
setRankCommand = new SetRankCommand();
bankCommand = new BankCommand();
placeCommand = new PlaceCommand();
resetKDRCommand = new ResetKDRCommand();
feeCommand = new FeeCommand();
purgeCommand = new PurgeCommand();
}
@Override
public boolean onCommand(CommandSender sender, Command command, String s, String[] args) {
try {
if (sender instanceof Player) {
Player player = (Player) sender;
if (plugin.getSettingsManager().isBlacklistedWorld(player.getLocation().getWorld().getName())) {
return false;
}
if (plugin.getSettingsManager().isBanned(player.getName())) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("banned"));
return false;
}
if (args.length == 0) {
menuCommand.execute(player);
} else {
String subcommand = args[0];
String[] subargs = Helper.removeFirst(args);
if (subcommand.equalsIgnoreCase(plugin.getLang("create.command"))) {
createCommand.execute(player, subargs);
} else if (subcommand.equalsIgnoreCase(plugin.getLang("list.command")) || subcommand.equalsIgnoreCase("list")) {
listCommand.execute(player, subargs);
} else if (subcommand.equalsIgnoreCase(plugin.getLang("bank.command")) || subcommand.equalsIgnoreCase("bank")) {
bankCommand.execute(player, subargs);
} else if (subcommand.equalsIgnoreCase(plugin.getLang("profile.command")) || subcommand.equalsIgnoreCase("profile")) {
profileCommand.execute(player, subargs);
} else if (subcommand.equalsIgnoreCase(plugin.getLang("roster.command")) || subcommand.equalsIgnoreCase("roster")) {
rosterCommand.execute(player, subargs);
} else if (subcommand.equalsIgnoreCase(plugin.getLang("lookup.command")) || subcommand.equalsIgnoreCase("lookup")) {
lookupCommand.execute(player, subargs);
} else if (subcommand.equalsIgnoreCase(plugin.getLang("home.command")) || subcommand.equalsIgnoreCase("home")) {
homeCommand.execute(player, subargs);
} else if (subcommand.equalsIgnoreCase(plugin.getLang("leaderboard.command")) || subcommand.equalsIgnoreCase("leaderboard")) {
leaderboardCommand.execute(player, subargs);
} else if (subcommand.equalsIgnoreCase(plugin.getLang("alliances.command")) || subcommand.equalsIgnoreCase("alliances")) {
alliancesCommand.execute(player, subargs);
} else if (subcommand.equalsIgnoreCase(plugin.getLang("rivalries.command")) || subcommand.equalsIgnoreCase("rivalries")) {
rivalriesCommand.execute(player, subargs);
} else if (subcommand.equalsIgnoreCase(plugin.getLang("vitals.command")) || subcommand.equalsIgnoreCase("vitals")) {
vitalsCommand.execute(player, subargs);
} else if (subcommand.equalsIgnoreCase(plugin.getLang("coords.command")) || subcommand.equalsIgnoreCase("coords")) {
coordsCommand.execute(player, subargs);
} else if (subcommand.equalsIgnoreCase(plugin.getLang("stats.command")) || subcommand.equalsIgnoreCase("stats")) {
statsCommand.execute(player, subargs);
} else if (subcommand.equalsIgnoreCase(plugin.getLang("ally.command")) || subcommand.equalsIgnoreCase("ally")) {
allyCommand.execute(player, subargs);
} else if (subcommand.equalsIgnoreCase(plugin.getLang("rival.command")) || subcommand.equalsIgnoreCase("rival")) {
rivalCommand.execute(player, subargs);
} else if (subcommand.equalsIgnoreCase(plugin.getLang("bb.command")) || subcommand.equalsIgnoreCase("bb")) {
bbCommand.execute(player, subargs);
} else if (subcommand.equalsIgnoreCase(plugin.getLang("modtag.command")) || subcommand.equalsIgnoreCase("modtag")) {
modtagCommand.execute(player, subargs);
} else if (subcommand.equalsIgnoreCase(plugin.getLang("toggle.command")) || subcommand.equalsIgnoreCase("toggle")) {
toggleCommand.execute(player, subargs);
} else if (subcommand.equalsIgnoreCase(plugin.getLang("invite.command")) || subcommand.equalsIgnoreCase("invite")) {
inviteCommand.execute(player, subargs);
} else if (subcommand.equalsIgnoreCase(plugin.getLang("kick.command")) || subcommand.equalsIgnoreCase("kick")) {
kickCommand.execute(player, subargs);
} else if (subcommand.equalsIgnoreCase(plugin.getLang("trust.command")) || subcommand.equalsIgnoreCase("trust")) {
trustCommand.execute(player, subargs);
} else if (subcommand.equalsIgnoreCase(plugin.getLang("untrust.command")) || subcommand.equalsIgnoreCase("unstrust")) {
untrustCommand.execute(player, subargs);
} else if (subcommand.equalsIgnoreCase(plugin.getLang("promote.command")) || subcommand.equalsIgnoreCase("promote")) {
promoteCommand.execute(player, subargs);
} else if (subcommand.equalsIgnoreCase(plugin.getLang("demote.command")) || subcommand.equalsIgnoreCase("demote")) {
demoteCommand.execute(player, subargs);
} else if (subcommand.equalsIgnoreCase(plugin.getLang("clanff.command")) || subcommand.equalsIgnoreCase("canff")) {
clanffCommand.execute(player, subargs);
} else if (subcommand.equalsIgnoreCase(plugin.getLang("ff.command")) || subcommand.equalsIgnoreCase("ff")) {
ffCommand.execute(player, subargs);
} else if (subcommand.equalsIgnoreCase(plugin.getLang("resign.command")) || subcommand.equalsIgnoreCase("resign")) {
resignCommand.execute(player, subargs);
} else if (subcommand.equalsIgnoreCase(plugin.getLang("disband.command")) || subcommand.equalsIgnoreCase("disband")) {
disbandCommand.execute(player, subargs);
} else if (subcommand.equalsIgnoreCase(plugin.getLang("verify.command")) || subcommand.equalsIgnoreCase("verify")) {
verifyCommand.execute(player, subargs);
} else if (subcommand.equalsIgnoreCase(plugin.getLang("ban.command")) || subcommand.equalsIgnoreCase("ban")) {
banCommand.execute(player, subargs);
} else if (subcommand.equalsIgnoreCase(plugin.getLang("unban.command")) || subcommand.equalsIgnoreCase("unban")) {
unbanCommand.execute(player, subargs);
} else if (subcommand.equalsIgnoreCase(plugin.getLang("reload.command")) || subcommand.equalsIgnoreCase("reload")) {
reloadCommand.execute(player, subargs);
} else if (subcommand.equalsIgnoreCase(plugin.getLang("globalff.command")) || subcommand.equalsIgnoreCase("globalff")) {
globalffCommand.execute(player, subargs);
} else if (subcommand.equalsIgnoreCase(plugin.getLang("war.command")) || subcommand.equalsIgnoreCase("war")) {
warCommand.execute(player, subargs);
} else if (subcommand.equalsIgnoreCase(plugin.getLang("kills.command")) || subcommand.equalsIgnoreCase("kills")) {
killsCommand.execute(player, subargs);
} else if (subcommand.equalsIgnoreCase(plugin.getLang("mostkilled.command")) || subcommand.equalsIgnoreCase("mostkilled")) {
mostKilledCommand.execute(player, subargs);
} else if (subcommand.equalsIgnoreCase(plugin.getLang("setrank.command")) || subcommand.equalsIgnoreCase("setrank")) {
setRankCommand.execute(player, subargs);
} else if (subcommand.equalsIgnoreCase(plugin.getLang("place.command")) || subcommand.equalsIgnoreCase("place")) {
placeCommand.execute(player, subargs);
} else if (subcommand.equalsIgnoreCase(plugin.getLang("resetkdr.command")) || subcommand.equalsIgnoreCase("resetkdr")) {
resetKDRCommand.execute(player, subargs);
} else if (subcommand.equalsIgnoreCase(plugin.getLang("fee.command")) || subcommand.equalsIgnoreCase("fee")) {
feeCommand.execute(player, subargs);
} else if (subcommand.equalsIgnoreCase(plugin.getLang("purge.command")) || subcommand.equalsIgnoreCase("purge")){
purgeCommand.execute(player, subargs);
} else {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("does.not.match"));
}
}
} else {
if (args.length == 0) {
menuCommand.executeSender(sender);
} else {
String subcommand = args[0];
String[] subargs = Helper.removeFirst(args);
if (subcommand.equalsIgnoreCase(plugin.getLang("verify.command")) || subcommand.equalsIgnoreCase("verify")) {
verifyCommand.execute(sender, subargs);
} else if (subcommand.equalsIgnoreCase(plugin.getLang("reload.command")) || subcommand.equalsIgnoreCase("reload")) {
reloadCommand.execute(sender, subargs);
} else if (subcommand.equalsIgnoreCase(plugin.getLang("place.command")) || subcommand.equalsIgnoreCase("place")) {
placeCommand.execute(sender, subargs);
} else if (subcommand.equalsIgnoreCase(plugin.getLang("globalff.command")) || subcommand.equalsIgnoreCase("globalff")) {
globalffCommand.execute(sender, subargs);
} else if (subcommand.equalsIgnoreCase(plugin.getLang("purge.command")) || subcommand.equalsIgnoreCase("purge")) {
purgeCommand.execute(sender, subargs);
} else {
ChatBlock.sendMessage(sender, ChatColor.RED + plugin.getLang("does.not.match"));
}
}
}
} catch (Exception ex) {
SimpleClans.getInstance().getServer().getConsoleSender().sendMessage(ChatColor.RED + MessageFormat.format(plugin.getLang("simpleclans.command.failure"), ex.getMessage()));
for (StackTraceElement el : ex.getStackTrace()) {
System.out.print(el.toString());
}
}
return false;
}
}
@@ -1,63 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans.executors;
import net.sacredlabyrinth.phaed.simpleclans.*;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import java.text.MessageFormat;
public class DenyCommandExecutor implements CommandExecutor {
SimpleClans plugin;
public DenyCommandExecutor() {
plugin = SimpleClans.getInstance();
}
@Override
public boolean onCommand(CommandSender commandSender, Command command, String s, String[] strings) {
Player player = (Player) commandSender;
if (plugin.getSettingsManager().isBanned(player.getName())) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("banned"));
return false;
}
ClanPlayer cp = plugin.getClanManager().getClanPlayer(player);
if (cp != null) {
Clan clan = cp.getClan();
if (!clan.isLeader(player)) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("no.leader.permissions"));
return false;
}
if (!plugin.getRequestManager().hasRequest(clan.getTag())) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("nothing.to.deny"));
return false;
}
if (cp.getVote() != null) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("you.have.already.voted"));
return false;
}
plugin.getRequestManager().deny(cp);
clan.leaderAnnounce(ChatColor.RED + MessageFormat.format(plugin.getLang("has.voted.to.deny"), Helper.capitalize(player.getName())));
} else {
if (!plugin.getRequestManager().hasRequest(player.getName().toLowerCase())) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("nothing.to.deny"));
return false;
}
if (SimpleClans.getInstance().hasUUID()) {
cp = plugin.getClanManager().getCreateClanPlayer(player.getUniqueId());
} else {
cp = plugin.getClanManager().getCreateClanPlayer(player.getName());
}
plugin.getRequestManager().deny(cp);
}
return true;
}
}
@@ -1,30 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans.executors;
import net.sacredlabyrinth.phaed.simpleclans.ChatBlock;
import net.sacredlabyrinth.phaed.simpleclans.ClanPlayer;
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class GlobalCommandExecutor implements CommandExecutor {
SimpleClans plugin;
public GlobalCommandExecutor() {
plugin = SimpleClans.getInstance();
}
@Override
public boolean onCommand(CommandSender commandSender, Command command, String s, String[] strings) {
Player player = (Player) commandSender;
if (strings.length == 0) {
return false;
}
String subCommand = strings[0];
return plugin.getClanManager().processGlobalChat(player, subCommand);
}
}
@@ -1,45 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans.executors;
import net.sacredlabyrinth.phaed.simpleclans.ChatBlock;
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import java.text.MessageFormat;
public class MoreCommandExecutor implements CommandExecutor {
SimpleClans plugin;
public MoreCommandExecutor() {
plugin = SimpleClans.getInstance();
}
@Override
public boolean onCommand(CommandSender commandSender, Command command, String s, String[] strings) {
Player player = (Player) commandSender;
if (plugin.getSettingsManager().isBanned(player.getName())) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("banned"));
return false;
}
ChatBlock chatBlock = plugin.getStorageManager().getChatBlock(player);
if (chatBlock == null || chatBlock.size() <= 0) {
ChatBlock.sendMessage(player, ChatColor.RED + plugin.getLang("nothing.more.to.see"));
return false;
}
chatBlock.sendBlock(player, plugin.getSettingsManager().getPageSize());
if (chatBlock.size() > 0) {
ChatBlock.sendBlank(player);
ChatBlock.sendMessage(player, plugin.getSettingsManager().getPageHeadingsColor() + MessageFormat.format(plugin.getLang("view.next.page"), plugin.getSettingsManager().getCommandMore()));
}
ChatBlock.sendBlank(player);
return true;
}
}
@@ -1,359 +0,0 @@
package net.sacredlabyrinth.phaed.simpleclans.listeners;
import net.sacredlabyrinth.phaed.simpleclans.Clan;
import net.sacredlabyrinth.phaed.simpleclans.ClanPlayer;
import net.sacredlabyrinth.phaed.simpleclans.SimpleClans;
import org.bukkit.ChatColor;
import org.bukkit.entity.*;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.entity.EntityDeathEvent;
import org.bukkit.event.entity.EntityTargetLivingEntityEvent;
import org.bukkit.event.player.PlayerInteractEntityEvent;
import java.text.MessageFormat;
import java.util.logging.Level;
/**
* @author phaed
*/
public class SCEntityListener implements Listener
{
private SimpleClans plugin;
/**
*
*/
public SCEntityListener()
{
plugin = SimpleClans.getInstance();
}
/**
* @param event
*/
@EventHandler(priority = EventPriority.LOW)
public void onEntityDeath(EntityDeathEvent event)
{
if (event.getEntity() instanceof Player)
{
Player victim = (Player) event.getEntity();
if (plugin.getSettingsManager().isBlacklistedWorld(victim.getLocation().getWorld().getName()))
{
return;
}
if (victim.hasMetadata("NPC"))
{
return;
}
Player attacker = null;
// find attacker
EntityDamageEvent lastDamageCause = victim.getLastDamageCause();
if (lastDamageCause instanceof EntityDamageByEntityEvent)
{
EntityDamageByEntityEvent entityEvent = (EntityDamageByEntityEvent) lastDamageCause;
if (entityEvent.getDamager() instanceof Player)
{
attacker = (Player) entityEvent.getDamager();
} else if (entityEvent.getDamager() instanceof Arrow)
{
Arrow arrow = (Arrow) entityEvent.getDamager();
if (arrow.getShooter() instanceof Player)
{
attacker = (Player) arrow.getShooter();
}
}
}
if (attacker != null && victim != null)
{
if (SimpleClans.getInstance().getSettingsManager().isDenySameIPKills())
{
if (attacker.getAddress().getHostString().equals(victim.getAddress().getHostString()))
{
plugin.getLogger().log(Level.INFO, "Blocked same IP kill calculating: {0} killed {1}. IP: {2}", new Object[]{
attacker.getDisplayName(), victim.getDisplayName(), attacker.getAddress().getHostString()
});
return;
}
}
ClanPlayer acp;
ClanPlayer vcp;
if (SimpleClans.getInstance().hasUUID())
{
acp = plugin.getClanManager().getCreateClanPlayer(attacker.getUniqueId());
vcp = plugin.getClanManager().getCreateClanPlayer(victim.getUniqueId());
} else
{
acp = plugin.getClanManager().getCreateClanPlayer(attacker.getName());
vcp = plugin.getClanManager().getCreateClanPlayer(victim.getName());
}
double reward = 0;
double multipier = plugin.getSettingsManager().getKDRMultipliesPerKill();
float kdr = acp.getKDR();
if (vcp.getClan() == null || acp.getClan() == null || !vcp.getClan().isVerified() || !acp.getClan().isVerified())
{
acp.addCivilianKill();
//TODO: Is this slowing down the server?
plugin.getStorageManager().insertKill(attacker, acp.getTag(), victim, "", "c");
} else if (acp.getClan().isRival(vcp.getTag()))
{
if (acp.getClan().isWarring(vcp.getClan()))
{
reward = (double) kdr * multipier * 4;
} else
{
reward = (double) kdr * multipier * 2;
}
acp.addRivalKill();
plugin.getStorageManager().insertKill(attacker, acp.getTag(), victim, vcp.getTag(), "r");
} else if (acp.getClan().isAlly(vcp.getTag()))
{
reward = (double) kdr * multipier * -1;
} else
{
reward = (double) kdr * multipier;
acp.addNeutralKill();
plugin.getStorageManager().insertKill(attacker, acp.getTag(), victim, vcp.getTag(), "n");
}
if (reward != 0 && plugin.getSettingsManager().isMoneyPerKill())
{
for (ClanPlayer cp : acp.getClan().getOnlineMembers())
{
double money = Math.round((reward / acp.getClan().getOnlineMembers().size()) * 100D) / 100D;
cp.toPlayer().sendMessage(ChatColor.AQUA + MessageFormat.format(plugin.getLang("player.got.money"), money, victim.getName(), kdr));
plugin.getPermissionsManager().playerGrantMoney(cp.getName(), money);
}
}
// record death for victim
vcp.addDeath();
plugin.getStorageManager().updateClanPlayerAsync(vcp);
}
}
}
/**
* @param event
*/
@EventHandler(priority = EventPriority.LOW)
public void onPlayerInteract(PlayerInteractEntityEvent event)
{
if (event.isCancelled())
{
return;
}
if (plugin.getSettingsManager().isTamableMobsSharing() && event.getRightClicked() instanceof Tameable)
{
Entity entity = event.getRightClicked();
Player player = event.getPlayer();
ClanPlayer cp = plugin.getClanManager().getClanPlayer(player);
Tameable tamed = (Tameable) entity;
if (tamed.isTamed())
{
if(entity instanceof Wolf && !((Wolf) entity).isSitting())
{
return;
}
if (cp.getClan().isMember((Player) tamed.getOwner()))
{
tamed.setOwner(player);
}
}
}
}
/**
* @param event
*/
@EventHandler(priority = EventPriority.LOW)
public void onEntityTarget(EntityTargetLivingEntityEvent event)
{
if (plugin.getSettingsManager().isTamableMobsSharing())
{
if (event.getEntity() instanceof Tameable && event.getTarget() instanceof Player)
{
ClanPlayer cp = plugin.getClanManager().getClanPlayer((Player) event.getTarget());
Tameable wolf = (Tameable) event.getEntity();
if (wolf.isTamed() && cp.getClan().isMember((Player) wolf.getOwner()))
{
// cancels the event if the attacker is one out of his clan
event.setCancelled(true);
}
}
}
}
/**
* @param event
*/
@EventHandler(priority = EventPriority.LOW)
public void onEntityDamage(EntityDamageEvent event)
{
if (event.isCancelled())
{
return;
}
Player attacker = null;
Player victim = null;
if (event instanceof EntityDamageByEntityEvent)
{
EntityDamageByEntityEvent sub = (EntityDamageByEntityEvent) event;
if (sub.getEntity() instanceof Player && sub.getDamager() instanceof Player)
{
attacker = (Player) sub.getDamager();
victim = (Player) sub.getEntity();
}
if (plugin.getSettingsManager().isTamableMobsSharing())
{
if (sub.getEntity() instanceof Wolf && sub.getDamager() instanceof Player)
{
attacker = (Player) sub.getDamager();
Wolf wolf = (Wolf) sub.getEntity();
ClanPlayer cp = plugin.getClanManager().getClanPlayer(attacker);
if (wolf.isTamed() && cp.getClan().isMember((Player) wolf.getOwner()))
{
// Sets the wolf to friendly if the attacker is one out of his clan
wolf.setAngry(false);
}
}
}
if (sub.getEntity() instanceof Player && sub.getDamager() instanceof Arrow)
{
Arrow arrow = (Arrow) sub.getDamager();
if (arrow.getShooter() instanceof Player)
{
attacker = (Player) arrow.getShooter();
victim = (Player) sub.getEntity();
}
}
}
if (victim != null && plugin.getSettingsManager().isBlacklistedWorld(victim.getLocation().getWorld().getName()))
{
return;
}
if (attacker != null && victim != null)
{
ClanPlayer acp = plugin.getClanManager().getClanPlayer(attacker);
ClanPlayer vcp = plugin.getClanManager().getClanPlayer(victim);
Clan vclan = vcp == null ? null : vcp.getClan();
Clan aclan = acp == null ? null : acp.getClan();
if (plugin.getSettingsManager().isPvpOnlywhileInWar())
{
// if one doesn't have clan then they cant be at war
if (aclan == null || vclan == null)
{
event.setCancelled(true);
return;
}
if (plugin.getPermissionsManager().has(victim, "simpleclans.mod.nopvpinwar")
&& attacker != null && victim != null)
{
event.setCancelled(true);
return;
}
// if not warring no pvp
if (!aclan.isWarring(vclan))
{
event.setCancelled(true);
return;
}
}
if (vclan != null)
{
if (aclan != null)
{
// personal ff enabled, allow damage
if (vcp.isFriendlyFire())
{
return;
}
// clan ff enabled, allow damage
if (vclan.isFriendlyFire())
{
return;
}
// global ff enabled, allow damage
if (plugin.getSettingsManager().isGlobalff())
{
return;
}
// same clan, deny damage
if (vclan.equals(aclan))
{
event.setCancelled(true);
return;
}
// ally clan, deny damage
if (vclan.isAlly(aclan.getTag()))
{
event.setCancelled(true);
}
} else
{
// not part of a clan - check if safeCivilians is set
if (plugin.getSettingsManager().getSafeCivilians())
{
event.setCancelled(true);
}
}
} else
{
// not part of a clan - check if safeCivilians is set
if (plugin.getSettingsManager().getSafeCivilians())
{
event.setCancelled(true);
}
}
}
}
}
Loaded 100 of 455 files, more files were not shown because too many files have changed in this diff. Show more