Compare commits

..
366 Commits
Author SHA1 Message Date
Aleks Kuznetsov 866086fa87 Fix Fabric placeholders throwing when resolved without a player (#4321) 2026-11-01 14:42:10 +00:00
tahodev e1ff15217a Make the first-time setup suggested command clickable to copy (#4337) 2026-11-01 14:23:57 +00:00
Luck b93a4d7b24 Update to Hytale Update 7 2026-10-20 21:28:14 +01:00
Rishabh Venu 5fc3d583c4 Update Group getWeight javadoc comment (#4325) 2026-10-04 16:51:35 +01:00
Luck aeaab669ab Fix NeoForge NoClassDefFoundError (#4327) 2026-10-04 16:49:40 +01:00
Luck 25f223317a Update to Minecraft 26.3 2026-09-19 08:23:26 +01:00
Luck a81c095f83 Fix grammar/spelling in API javadocs 2026-09-12 21:54:32 +01:00
Luck e794facb05 Use JSpecify annotations (#4312) 2026-09-12 21:26:39 +01:00
Luck 24a25458d6 Increase cleanup delay for users mid-login (#4268) 2026-09-10 19:18:23 +01:00
Luck 32494e9f0a Update to Hytale Update 6 (#4311) 2026-08-27 18:14:09 +01:00
Luck 79770b0dc1 Update InheritanceTest (#4306) 2026-08-27 18:11:25 +01:00
Drex c1c85762a1 Fabric Permission API v1 replace / with . (#4310) 2026-08-26 20:50:07 +01:00
Luck d98a3954fa Remove then add when applying Difference (#4287) 2026-08-25 22:38:55 +01:00
Luck 9b4fe67791 Fix NodeJsonSerializer on older Gson versions (#4301) 2026-08-15 20:39:06 +01:00
Luck 48c652b387 Fix issue on Bukkit with missing Player#locale method (#4295) 2026-08-15 08:33:16 +01:00
Luck 79a269a6b4 Fix shorthand parser int overflow (#4300) 2026-08-15 08:23:04 +01:00
Luck 5a9c096c66 Improve /lp applyedits chat output 2026-08-15 08:11:29 +01:00
Emir f6bcb1676e Fix page number validation in log commands (#4296) 2026-08-13 21:18:50 +01:00
AndyOctopus 2dfd387882 Fix inverted Audience check in PaperAdventureBridge (#4297) 2026-08-13 21:14:56 +01:00
BlockException_ 8fa4c24492 Prevent ClassCastException when estimating dimension-type contexts (#4294) 2026-08-05 22:15:55 +01:00
Luck 461fb34005 Use connection uri database if set for Mongo (#4289) 2026-08-05 21:52:13 +01:00
Luck 7fbb6869f5 Add extra listener for server stopped event (#4281) 2026-08-05 20:22:23 +01:00
Luck aeaf1b9c8a Ignore errors when creating Mongo indexes 2026-08-05 20:12:24 +01:00
Luck c3fd3f7eb8 Use native adventure methods on Paper (#4292) 2026-08-05 20:06:50 +01:00
Luck f25279813e Add limit to shorthand parser (#4293) 2026-08-05 17:56:40 +01:00
Luck 24894df140 Improve Mongo bulk user load implementation 2026-07-23 20:28:47 +01:00
Mason Camara c06039b0dc Add MongoDB Indexes (#4280) 2026-07-23 20:16:53 +01:00
lucko 7b8f8ccb97 Update MongoStorage to use exportChanges (#4286) 2026-07-23 20:15:39 +01:00
Warrior d07dcacab4 Add API bulk user lookup method (#4285) 2026-07-23 20:15:01 +01:00
lucko cb77ed09be Update NodeMap#setContent to avoid clear (#4284) 2026-07-22 22:14:41 +01:00
Luck f19f605650 Add some more unit tests 2026-07-17 21:49:30 +01:00
Luck cd61d05b53 Add some unit tests 2026-06-30 21:39:39 +01:00
Luck 3c1b4d53ea Add abstract listeners for autoop and command list update 2026-06-29 20:53:09 +01:00
lucko 1324c229fd Update to Minecraft 26.2 (#4277) 2026-06-18 21:54:08 +01:00
Luck 16173dd0b7 Fix Hytale maven repo 2026-06-18 21:41:06 +01:00
Luck cd0f009e0f Call ConfigurationTask callback sync (#4272) 2026-06-03 18:05:35 +01:00
Luck 3087cfc494 Fix Fabric placeholder text parsing 2026-05-29 08:15:17 +01:00
Luck 00ed0a0e77 Show logo in Hytale mod menu 2026-05-27 08:00:57 +01:00
lucko 3fb939b416 Support for Hytale Update 5 (#4247) 2026-05-26 18:02:58 +01:00
Luck d01106c6ad Fix Fabric PermissionSet mixin level handling (#4269) 2026-05-25 19:17:10 +01:00
Luck 9ea747c848 Fix Fabric perm API v1 default handling (#4269) 2026-05-23 09:08:14 +01:00
lucko fe3078e5d0 Folia support (#3615) 2026-05-21 22:16:56 +01:00
lucko a97bdba0a0 Implement fabric-permission-api v1 (#4248) 2026-05-21 21:43:28 +01:00
Luck d90b3dbf11 Add Fabric placeholder-api integration 2026-05-21 19:10:02 +01:00
lucko 417989aea1 Add common placeholders module (#4267) 2026-05-21 18:50:01 +01:00
masel.io 441ab5769f Add Redis Sentinel support for messaging (#4244) 2026-05-16 20:23:42 +01:00
Dominik 6f5a8e1cd8 Add context argument to group listmembers command (#4252) 2026-05-11 21:17:53 +01:00
Yannick Schinko 090f218e12 Add index to time column in SQL Messenger (#4255) 2026-05-11 21:17:18 +01:00
Luck 8b3e990106 Fix Fabric shadowJar config 2026-03-26 22:32:50 +00:00
Luck c0005fa070 Update to Minecraft 26.1 2026-03-26 22:12:21 +00:00
Luck cfd1aa276c Update Hytale to target 2026.03.26-89796e57b 2026-03-26 21:46:16 +00:00
Luck 5db9ecb689 Update Gradle to v9.4 2026-03-26 21:38:08 +00:00
powercas_gamer 691a87b5ea Add support for NATS token authentication (#4238) 2026-03-17 21:10:56 +00:00
Luck fc26521594 Update bytebin/bytesocks custom config settings 2026-03-13 07:59:23 +00:00
Luck b25c335b7b Add rate limit for verbose chat output 2026-02-21 09:29:14 +00:00
Luck 6292d2d3e6 Improve debug logging for Hytale login handling 2026-02-21 08:55:33 +00:00
Luck a75643c1e4 Remove Hytale chat formatter and update deps 2026-02-17 18:14:38 +00:00
Luck e148e8e9fa Fix duplicate readNode call in SqlStorage 2026-02-15 13:56:00 +00:00
Luck 053148a9c5 Add inheritance origin metadata for Hytale virtual groups 2026-02-05 20:50:21 +00:00
Luck 71035d96ea Attempt to fix slf4j classloading issue on Hytale 2026-02-05 19:37:24 +00:00
Luck 8c22dd7159 Refactor PermissionProcessors 2026-02-05 18:55:26 +00:00
Luck f944fc0770 Relocate guava and gson in Hytale jar 2026-02-03 19:06:14 +00:00
Luck 1932d0cd5d Fix yaml dependency issue in Hytale jar (#4229) 2026-01-30 18:21:06 +00:00
Luck 38a8f63d86 Add Hytale with-deps Gradle buildscript 2026-01-30 18:19:44 +00:00
Luck e7e7997750 Improve Hytale PermissionProvider compatibility 2026-01-24 21:17:14 +00:00
lucko a60d3f1a4b Hytale (#4213) 2026-01-24 12:49:30 +00:00
John 840ac52f83 Add UUID mismatch warning suppression setting (#4194) 2026-01-10 12:37:19 +00:00
Drex a6382773f0 Fix shared module context keys (#4206) 2026-01-06 08:36:47 +00:00
Luck 2f77191875 Add shared module for Fabric, NeoForge and Forge 2025-12-22 22:14:08 +00:00
lucko 2adb058e96 Update to Minecraft 1.21.11 2025-12-10 12:12:57 +00:00
Luck 61ce546a04 Fix compile/test error with HostAndPort 2025-11-09 13:13:50 +00:00
Luck 10378e882b Support IPv6 addresses (#3753) 2025-11-09 12:36:03 +00:00
Luck 2a1dfb5112 Increase User Housekeeper timeout (#4081) 2025-11-02 12:49:45 +00:00
Luck 40a39c9381 Update to Minecraft 1.21.10 2025-10-11 11:17:59 +01:00
Luck 198e2d6f4b Update Forge module to Minecraft 1.21.9 2025-10-05 10:54:02 +01:00
Luck 1058cb11e8 Update to Minecraft 1.21.9 2025-10-01 18:22:21 +01:00
蒟蒻 0b91732cd3 Prevent handleDisconnect after stopped server on Fabric (#4160) 2025-09-21 11:04:58 +01:00
An5w1r a087f14aa2 Fix classExists checks to handle NoClassDefFoundError (#4136) 2025-09-21 11:03:07 +01:00
Luck d666a2a798 Fix command rate limit for command blocks (#4094) 2025-09-21 10:58:24 +01:00
Luck 65c42b9b09 Micro-optimize temporary node audit (#4155) 2025-08-23 15:39:49 +01:00
Luck 73d710a89e Update to Minecraft 1.21.8 2025-07-21 22:08:21 +01:00
Luck ed863b275d Update to Minecraft 1.21.7 2025-06-30 19:41:56 +01:00
Luck c20776d6aa Remove Forge capability attachment 2025-06-19 19:53:09 +01:00
Luck 3aca721f96 Rollback bytebuddy dependency version upgrade 2025-06-19 19:35:04 +01:00
Luck 8d9c5bf401 Add workaround for Forge eventbus limitation 2025-06-19 19:09:40 +01:00
Luck 0af1038d81 Update to Minecraft 1.21.6 2025-06-19 18:48:44 +01:00
Luck 51fe574a51 Move config load earlier in startup process (#4083) 2025-06-14 09:31:56 +01:00
Max Barrass bac0edd90e Fix missing closing brackets in .conf files (#4109) 2025-06-14 09:24:52 +01:00
Luck 8ab9910ef8 Downgrade jedis and h2 2025-06-01 19:32:26 +01:00
Luck 9538cb9dad Upgrade dependencies and require Java 11 2025-06-01 16:41:39 +01:00
Luck 0486bc885b Release API v5.5 2025-05-25 08:59:47 +01:00
Luck 27e7551e2b Fix adventure package relocations 2025-05-23 08:10:55 +01:00
Luck b77d5759d3 Upgrade adventure dependencies for 1.21.5 support 2025-05-22 21:15:24 +01:00
Luck 96abc0d4fe Update setup-gradle GitHub action 2025-05-10 15:04:42 +01:00
lucko 1a24a6a155 Add REST storage backend (#3939) 2025-05-10 15:01:08 +01:00
𝑩𝒊𝒒𝒖𝒂𝒕𝒆𝒓𝒏𝒊𝒐𝒏𝒔 95ea491787 Support plugins that 'provide' Vault (#4075) 2025-05-10 14:47:32 +01:00
Remigio 626d08431e Add missing IllegalArgumentExceptions to Javadocs (#4015) 2025-05-10 14:33:38 +01:00
lucko 94e7e11183 Add configurable read-only mode for commands (#4031) 2025-05-10 14:32:47 +01:00
Luck f64bf04ba4 Update mod loader dependencies 2025-05-08 19:45:14 +01:00
Luck 7744913df2 Update to Minecraft 1.21.5 2025-03-27 19:46:43 +00:00
lucko 6b7283ac83 Improve context manager caching (#4050) 2025-03-20 19:20:16 +00:00
Luck 9bc8a61e2d Add file secret config adapter (#3913) 2025-02-22 15:57:44 +00:00
Luck 5e24a7068c Mark plugin msg channel as optional on Forge (#3954) 2025-02-22 15:28:18 +00:00
Luck f351369a51 Update CI action versions 2025-02-13 09:59:59 +00:00
Luck 1bf0deb5a5 Add unit tests for messaging service messages 2025-01-20 22:46:52 +00:00
Luck 5b82837b80 Update Sponge module to API 12 2025-01-05 14:38:15 +00:00
Luck 0fef481d48 Add more unit tests 2024-12-22 09:51:11 +00:00
Luck f2040ab815 Update to Minecraft 1.21.4 2024-12-07 16:21:26 +00:00
Luck b18717edef Remove NeoForge capability attachment 2024-12-04 20:39:55 +00:00
Luck 29c93fac4f Add note about shading LuckPerms API into plugin jars 2024-12-04 11:27:14 +00:00
Luck 2e67011f45 Refactor some unit tests 2024-12-04 11:25:06 +00:00
Luck a92e04f605 Recreate individual sql tables if they are missing (#3995) 2024-11-09 12:09:23 +00:00
Luck 8d65693d9a Update to Minecraft 1.21.3 2024-10-26 10:07:03 +01:00
Luck 8973abd7f1 Support older signature alg if running on Java 8 2024-10-23 23:19:05 +01:00
Luck 9420efd3ac Switch to ECDSA keys for web editor socket 2024-10-23 22:52:20 +01:00
Alex c773126a0f Simplify ExpiringSet implementation (#3969) 2024-10-21 21:09:40 +01:00
Luck 9d80de5d5c Fix MongoStorage nodeFromDoc integer cast (#3846) 2024-08-24 09:55:32 +01:00
3TUSK 9bf30fc839 Fix login configuration phase on NeoForge (#3961) 2024-08-22 22:27:29 +01:00
Luck 136a4859f3 Update to Minecraft 1.21.1 2024-08-12 19:45:38 +01:00
Jason Penilla 642f1d3019 Port to NeoForge (#3950) 2024-08-12 19:11:27 +01:00
Luck b21753f5e9 Use builtin Fabric world change event 2024-07-07 21:31:34 +01:00
Luck 9cc129466b Init VerboseHandler earlier (#3932) 2024-07-07 21:22:40 +01:00
Drex 55440cac01 Fix memory leak in Fabric MixinUser (#3931) 2024-07-07 21:15:41 +01:00
lucko 9e7a3d26e4 Improve efficiency of action log queries (#3917) 2024-06-16 21:11:23 +01:00
Luck d748817351 Update Forge to MC 1.21 2024-06-16 10:45:47 +01:00
Wolfdv1andWolfdv1 f984ebbb46 Update Fabric to MC 1.21 (#3918)
Co-authored-by: Wolfdv1 <Wolfdv1@github.com>
2024-06-16 10:45:09 +01:00
Luck 9805f8b2c4 Bump adventure-platform to 4.3.3 2024-06-02 22:17:12 +01:00
Luckandpowercas_gamer c3802c2a5a Fix Forge plugin msg messenger (#3894)
Co-authored-by: powercas_gamer <cas@mizule.dev>
2024-05-26 14:19:36 +01:00
Ossi Erkkilä b5400f885b Add support for Sponge API 11 (#3896) 2024-05-26 13:58:39 +01:00
bloodmc 5c1ea5633e Update Forge to MC 1.20.6 (#3883) 2024-05-08 23:09:02 +01:00
bloodmc 484b04c17b Add support for Sponge API 9+ (#3885) 2024-05-06 18:20:47 +01:00
Jason Penilla d74a4dcb7e Set mappings namespace to skip remapping on Paper 1.20.5+ (#3881) 2024-04-30 10:31:16 +01:00
Luck 2361ea43ee Update Fabric to MC 1.20.6 2024-04-29 20:05:54 +01:00
Luck f86585c3cc Update Dockerfile to use Java 21 2024-04-25 22:57:03 +01:00
Drex 7cb60f59fe Update Fabric to MC 1.20.5 (#3824) 2024-04-23 21:57:20 +01:00
Luck a43f4a11b0 Update Fabric dependencies 2024-04-17 21:25:15 +01:00
powercas_gamer 1dffd462a5 Fix mongodb secrets being logged (#3850, #3851) 2024-03-15 20:23:32 +00:00
lucko 8c6586f008 Add custom payload message to API (#3840) 2024-03-06 21:12:33 +00:00
Luck 79273a8bcc Add PostNetworkSyncEvent 2024-02-18 22:40:58 +00:00
Gilberto Garcia 7d89c97907 Don't read nodes twice in SqlStorage (#3836) 2024-02-15 20:03:02 +00:00
Emilia Kond 96008f6338 Add modifyTrack method to TrackManager (#3823) 2024-01-23 17:44:20 +00:00
powercas_gamer e6599a2662 Fix MongoDB uri showing in logs if set using system property (#3808) 2024-01-06 11:31:59 +00:00
AoElite 0703b9856f Small performance optimization in BukkitPlatformListener (#3806) 2024-01-06 11:24:44 +00:00
Luck 5f95b386cb Update adventure-platform for MC 1.20.4 support 2024-01-06 11:23:43 +00:00
Luck 754283c053 Fix Fabric command manager mixin (#3791) 2023-12-12 18:57:44 +00:00
Luck 5f87de3569 Upgrade Fabric/Forge to MC 1.20.4 2023-12-11 19:29:39 +00:00
Luck 43f4d490bb Upgrade Fabric to MC 1.20.3 2023-12-06 20:55:25 +00:00
Luck f14798b368 Upgrade gradle version 2023-12-06 20:35:01 +00:00
bloodmc 00ed76cfc0 Update Forge to 1.20.2 (#3787) 2023-12-06 08:27:08 +00:00
Misode f78e2d6c52 Update Minecraft wiki links in config file comments (#3758) 2023-11-06 22:00:47 +00:00
huanmeng_qwq f999f9f234 Fix duplicate UUID delete with Mongo storage (#3777) 2023-11-06 21:57:08 +00:00
Luck 84fce987d5 Change healthcheck details return type 2023-10-22 21:08:45 +01:00
Luck 3707d2f03c Add healthcheck functionality to API 2023-10-22 20:17:37 +01:00
Luck 822c796e1c Update adventure-platform for MC 1.20.2 support 2023-10-02 19:30:17 +01:00
Luck 331a328771 Upgrade Fabric to MC 1.20.2 2023-10-02 19:28:19 +01:00
Luck f12d3cd8ba Fix race error in bulk update integration test 2023-08-05 10:49:57 +01:00
Luck 71416baff2 Use driver class instead of datasource for Postgres (#3705) 2023-08-05 10:28:01 +01:00
Luck b8d1f52d7d Use ansi component serializer 2023-08-05 10:09:30 +01:00
Luck 6d8b6bd3fe Add jacoco report gradle plugin 2023-08-05 09:49:56 +01:00
Luck 8fbd79139d Add missing future join call to storage test 2023-06-25 22:36:31 +01:00
Luck 9f4082ca0b Add more unit/integration tests 2023-06-25 22:25:42 +01:00
Luck 77a5a7b41f Print test output when ran through Gradle 2023-06-25 14:47:37 +01:00
Luck f788088a69 Delete temporary H2 v1 to v2 migration script if exists (#3693) 2023-06-25 14:26:06 +01:00
powercas_gamer 7297fb862c whoops (#3691) 2023-06-24 09:12:06 +01:00
powercas_gamer 35dfc2c8f5 Render minimessage in prefix/suffix/meta values (#3672) 2023-06-24 00:24:16 +01:00
powercas_gamer 86cc90f48a Refactor gradle plugin version handling (#3665) 2023-06-24 00:15:03 +01:00
Mart feef08a256 Update GitHub URLs to new location (#3686) 2023-06-23 23:34:11 +01:00
Dominik 7a59536450 Add support for redis cluster (#3670) 2023-06-23 23:30:22 +01:00
Luck 9f1e74fa7c Fix user deletion not being correctly processed on SQL backends (#3664) 2023-06-18 21:38:19 +01:00
Luck 5dd808752c Update Forge/Fabric to 1.20.1 2023-06-14 21:28:21 +01:00
Drex 3542a6cc75 Improve console detection on Fabric/Forge (#3673) 2023-06-14 21:25:25 +01:00
powercas_gamer acd8d6e5a1 Include standalone data directory in gitignore (#3671) 2023-06-14 21:19:22 +01:00
Luck 081a4f8651 Fix Forge reobf shadowjar (#3675) 2023-06-14 21:18:24 +01:00
Luck 2e5a1d79a4 Switch back to official Postgres JDBC driver 2023-06-11 14:36:00 +01:00
LuckandAurelien d859085056 Update Fabric/Forge to Minecraft 1.20
Co-authored-by: Aurelien <aurelien.domino@gmail.com>
2023-06-11 11:17:17 +01:00
Luck da08be0b20 Fix github action to fetch repo with tags 2023-06-08 22:16:16 +01:00
Luck 8048427b38 Tag docker images with LP version 2023-06-08 22:01:21 +01:00
Luck 6d2a5a6317 Fix issues with postgres storage backend (#3647) 2023-06-08 21:28:15 +01:00
Luck 84bd2ee52a Add more tests 2023-05-02 00:07:48 +01:00
Luck bd08507150 Add automated tests for commands 2023-05-01 15:07:20 +01:00
Kamillaova 6d4ed224c8 Update mariadb driver (#3583) 2023-05-01 10:00:19 +01:00
Luck 9640271260 Reattempt RabbitMQ connection on first attempt 2023-05-01 10:00:05 +01:00
Josh cfe0d806a1 Add date on hover to actionlog (#3597) 2023-05-01 09:32:18 +01:00
Luck ef85fa8941 Fix docker tests 2023-05-01 09:31:39 +01:00
Luck 0ae751b533 Reformat import statements 2023-04-30 21:27:42 +01:00
lucko 90392511ef Implement messenger using Postgres listen/notify (#3641) 2023-04-30 21:09:43 +01:00
Luck 4068c71d5a Add integration tests for storage and messaging 2023-04-01 21:39:08 +01:00
Luck 6523e708a1 Add more tests 2023-04-01 17:35:50 +01:00
Luck e61ac8bef6 Add tests for messages/components/translations 2023-03-29 23:03:28 +01:00
Emily 85a49f0f44 Handle invalid empty command inputs (#3606) 2023-03-29 23:01:25 +01:00
Emily 1fb62d2616 Cleanup classloaders on shutdown (#3605) 2023-03-19 21:35:09 +00:00
Luck 5631a8be43 Compile forge/fabric against MC 1.19.4 2023-03-15 18:56:08 +00:00
bloodmc 62f2fc9714 Fix Forge player data corrupted on respawn (#3557, #3584, #3596, #3601) 2023-03-13 08:58:39 +00:00
Luck 536c9183fe Fix Nukkit maven repo 2023-03-07 22:18:22 +00:00
Glare 4037570fbb Add 'paste' to verbose command tab completions (#3598) 2023-03-01 23:29:35 +00:00
Emily 1f8b66cfe3 Fix suffix.duplicates config setting being ignored (#3592, #3590) 2023-02-19 18:00:11 +00:00
Luck ce6031ad52 Fix obtaining UserCapability on Forge for respawned players 2023-02-12 14:29:08 +00:00
Luck 1bfbd27701 Update fabric/forge versions 2023-01-29 11:01:00 +00:00
nikijaz a5ba53d765 Restore offline mode support for Fabric servers (#3576) 2023-01-29 10:41:38 +00:00
lucko 3ecdeacaf8 Add more unit tests (#3555) 2023-01-05 21:32:50 +00:00
J.T. McQuigg 4d726f4e8b Update Forge and Fabric to 1.19.3 (#3550) 2023-01-01 22:14:07 +00:00
Luck ed9dd031cb Add basic rate-limit for commands (#3546) 2022-12-28 22:49:41 +00:00
Luck 8e1553c0ed Use unix domain socket for Docker commands 2022-12-10 23:41:33 +00:00
Luck 5555cdac89 Update nukkit maven repository 2022-11-27 14:22:09 +00:00
Kacper Krzychała 0193c06f16 Add Nats messenger (#3525) 2022-11-26 18:06:15 +00:00
Luck 5ff9a12a72 Preload dependencies in Docker image 2022-10-22 00:07:49 +01:00
Drex dc22847fa3 Fabric offline permission check event (#3504) 2022-10-16 14:50:23 +01:00
Luck e35f46798b Upgrade h2 database engine to v2 (#3458) 2022-10-16 14:28:59 +01:00
Luck 495d951556 Declare module name for API (#3482) 2022-09-30 21:10:15 +01:00
maxcom1 8bbb6994b6 Don't pretty-print '/lp export' json (#3489) 2022-09-30 20:32:37 +01:00
Luck 44470c8843 Fix yaml usage on Forge/Fabric (#3381) 2022-09-30 20:20:57 +01:00
OOP-778 1790c0ad47 Fix concurrent errors in URLClassLoaderAccess (#3403) 2022-09-05 21:39:52 +01:00
BlockyTheDev a2e4a81e29 Update Paper maven repo (#3393) 2022-09-05 21:38:31 +01:00
Luck afc69046ad Fabric 1.19.2 2022-09-05 21:37:39 +01:00
Luck b6b3788f14 Change socket is verified check 2022-09-05 21:37:39 +01:00
CDAGaming 6e0e0e8ae9 Forge 1.19.2 (#3477) 2022-09-05 21:30:12 +01:00
Luck b1953632c5 Add healthcheck for standalone app 2022-08-05 20:33:33 +01:00
Luck fe0cb2df25 Fix Bukkit tab complete (#3449) 2022-08-03 22:14:11 +01:00
IzzelAliz 8ebdbdbf0b Fix Forge user data sometimes missing after switching worlds (#3447) 2022-08-03 20:46:22 +01:00
Potatoboy9999 106455a311 Fabric 1.19.1 (#3437) 2022-08-03 20:45:34 +01:00
Luck 55d291f975 Update dependencies for 1.19.1 support (#3440) 2022-08-03 20:14:14 +01:00
Alex Thomson ad08b158f7 Forge 1.19 (#3397) 2022-07-24 16:06:32 +01:00
Luck 48e5f428b5 Change standalone image name 2022-07-20 23:29:01 +01:00
Luck d36341c139 Implement standalone/cli app 2022-07-20 23:14:40 +01:00
Luck 8b0d6fd5d2 Fix compile 2022-07-18 21:38:44 +01:00
Luck fbc0787a1e Implement Fabric meta/options API 2022-07-17 11:54:14 +01:00
Luck bf93077474 MetaCache refactoring 2022-07-17 11:53:52 +01:00
Luck 016f35a6f0 Update Bukkit dependencies for full 1.19 support 2022-06-12 20:54:33 +01:00
Luck 9b2bbb3e53 Bump adventure version 2022-06-12 17:48:29 +01:00
lucko 79a08610e0 Increase memory allocation for Gradle 2022-06-12 10:55:51 +01:00
Aurélien 7824566ce5 Fabric 1.19 (#3394) 2022-06-11 21:14:14 +01:00
IzzelAliz a368509520 Use Forge default resolver when result is undefined (#3390) 2022-06-06 18:39:13 +01:00
Luck 62a8891b48 Fix buildscript 2022-05-20 20:12:56 +01:00
Alex Thomson 6421525f3a LuckPerms for Forge (#3262) 2022-05-20 20:09:04 +01:00
Luck 65a4c67745 Fix bug in Sponge PermissionServiceProxy 2022-05-19 18:12:42 +01:00
Luck e6cc817436 Update nexus mirror url 2022-05-15 18:22:21 +01:00
Luck c35958b88e Fix plugin message string encoding inconsistency (#3364) 2022-04-24 11:41:02 +01:00
Emily e0ee2c3b5f Resolve command entity selectors on Fabric (#3363) 2022-04-24 09:44:24 +01:00
Luck b3cdf67c4f Add error logging for failed plugin message parse (#3364) 2022-04-24 09:33:33 +01:00
Luck 207e4aa9f8 Show table prefix in a different colour 2022-04-08 21:02:31 +01:00
Zeromaniac 34873914bd Show sql table prefix if set in '/lp info' (#3360) 2022-04-08 20:35:40 +01:00
Luck 126631fce8 Load configuration from env or system props (#3294) 2022-04-03 15:21:18 +01:00
Luck 2e0a4d71a5 Fix redis close (#3353) 2022-03-27 16:50:31 +01:00
Luck 5647b2e5c6 Shutdown okhttp on plugin disable (#3347) 2022-03-23 20:15:03 +00:00
Luck eece15d415 Close web editor sockets on plugin disable (#3326) 2022-03-20 10:45:59 +00:00
Luck fb56189f0a Improve AbstractJavaScheduler (#3326) 2022-03-19 23:30:39 +00:00
Marton Schneider 405c5c3cf9 Fix typo with env var reading (#3345)
* resolves LuckPerms/LuckPerms#3339

* change server name from env var => add to a separate option for this

* fix missing variable assignment
2022-03-18 21:01:01 +00:00
Marton Schneider eeec818286 Allow server name to be specified with an env var (#3341) 2022-03-16 21:01:21 +00:00
Luck 138f2c1b3e Provide snakeyaml for Fabric (#3325) 2022-02-28 20:45:15 +00:00
Luck f840c76e44 Don't pretty-print exporter json (#3329) 2022-02-28 20:33:00 +00:00
Luck 775f1adf36 Support for command completions on Bukkit 1.18.2 2022-02-28 20:20:30 +00:00
Luck 8ed63159ce Set mongodb uuid representation (#3324) 2022-02-27 13:17:12 +00:00
Luck 4bdcca6566 Update mongodb driver 2022-02-20 22:41:58 +00:00
lucko b235234633 Sponge use jar-in-jar loader 2022-02-17 00:22:46 +00:00
Luck 5c8b0a604e Maintain order in editor users/groups collection 2022-02-16 19:53:33 +00:00
Luck 86d2523d33 Fix SpongePlayerCalculator errors 2022-02-11 23:25:31 +00:00
Luck 3eca6205ab Fix API buildscript 2022-02-09 22:15:09 +00:00
Luck 99c3d68d3a API 5.4 2022-02-09 21:39:45 +00:00
Luck 59f3866e36 Warn if the API was classloaded by another plugin 2022-02-09 21:08:18 +00:00
Sxtanna d45d9a295b Optimize parent resolution in info commands (#3309) 2022-02-09 20:15:18 +00:00
Luck b13a74c61e Pre-generate web editor keypair to speed up initial session init 2022-02-09 20:08:16 +00:00
Luck 0fe85ed6ff Ignore http 503 error from socket server 2022-02-09 19:59:01 +00:00
Luck bc15e348f5 Optimize bulk user loading for editor command (#3273) 2022-02-08 22:45:00 +00:00
Luck 1b3b9b5c62 Update commodore to fix running LP commands from a Forge client (#3299) 2022-02-07 22:35:52 +00:00
Luck fe80ba6cc4 Shutdown ForkJoinPool worker on disable (#3247) 2022-02-07 21:27:26 +00:00
Luck 65751cd56b Velocity world context use ServerConnectedEvent (#3245) 2022-02-07 21:25:43 +00:00
lucko ee79f53612 SpongeAPI 8 (#2728) 2022-02-07 21:10:01 +00:00
lucko d3029a8467 Web editor socket connection (#3303) 2022-02-07 19:13:09 +00:00
Luck f61d9ff9f0 Fix NPE from permission holder initialisation order (#3263) 2022-01-02 16:58:15 +00:00
Luck a53c9fad00 Reuse the same InheritanceOrigin object where possible 2022-01-01 20:49:12 +00:00
Luck 4de7448394 Include whether a node is normal/transient in InheritanceOriginMetadata 2022-01-01 19:33:48 +00:00
Luck 6781c1fb51 Provide API access to cached data result info (#3243) 2022-01-01 14:38:46 +00:00
Luck acdc259771 Fix MetaValueSelector NPE 2021-12-31 17:50:42 +00:00
Luck d319d8dc52 Fix TristateResult NPE 2021-12-31 17:24:38 +00:00
Andrew 419d711fb6 Add full support for transient permissions through Vault API (#3258) 2021-12-31 16:16:06 +00:00
lucko 2d662cbab9 Retain cause node information for cached permission/meta data (#3250) 2021-12-31 16:03:00 +00:00
OmegaWeaponDev ae93c9768b Add default file name for export command (#3248) 2021-12-31 16:02:24 +00:00
Luck 664cad21a9 Clarify uuid type in user info command (#3233) 2021-12-10 23:47:06 +00:00
Luck 8cc126f711 Add config option to disable bulkupdate functionality 2021-12-09 21:32:02 +00:00
Luck 9c0874162b Fix cast to long in MongoStorage 2021-12-04 10:41:12 +00:00
Luck f35a9b6a09 Update dependencies for 1.18 2021-12-02 13:24:02 +00:00
Luck fa17404133 Fabric 1.18 2021-11-30 20:03:16 +00:00
Tadhg Boyle 64bd8b5eaf Add pagination to listgroups command (#3226) 2021-11-30 19:52:43 +00:00
Luck e227d96cbf Fix sql insert player query (#3225) 2021-11-28 10:46:48 +00:00
Luck 6e07d6ad36 Revert "Fix player insert duplicate key issue with PSQL (#3223)"
This reverts commit d6c810aa71.
2021-11-28 10:29:55 +00:00
Tadhg Boyle d6c810aa71 Fix player insert duplicate key issue with PSQL (#3223) 2021-11-27 22:48:22 +00:00
Luck 10f698b70f Add warning for common editor mistakes 2021-11-27 17:58:10 +00:00
Luck 594f50bee7 Add config option to disable context calculators 2021-11-27 09:49:01 +00:00
Luck 9204848ffb Fix username lookup returning "null" instead of null (#3220) 2021-11-27 09:43:47 +00:00
Luck 272d289d4a More context performance improvements (#3209) 2021-11-18 18:21:30 +00:00
Luck c9d4c7dac7 ContextSet performance improvements (#3209)
A bit experimental, should be stable enough though.
2021-11-17 23:18:11 +00:00
Eduard Wayland 848fc353d4 Added redis authentication with username (#3201) 2021-11-12 22:49:46 +00:00
Luck f896ed723d Edit issue templates (again) 2021-10-22 20:03:33 +01:00
Luck 00b62d7cd9 Edit issue templates 2021-10-22 20:01:46 +01:00
Larry f84f425817 Better issue templates (#3184) 2021-10-22 19:58:12 +01:00
Luck 9c5a43b487 Allow meta/prefix/suffix nodes to be negated to cancel inheritance (#3020) 2021-10-18 22:10:20 +01:00
Luck b2c76aca7d Improve translations handling (#3166) 2021-10-10 13:26:33 +01:00
RedstoneFuture 04bb035a83 Add warning nore about enable-ops to config files (#3170) 2021-10-03 18:55:38 +01:00
Luck 2cf77db8b6 TranslationManager fixes and improvements (#3165) 2021-09-18 17:30:17 +01:00
Luck d1cb644712 Fix empty prefix/suffix strings in YAML storage (#3139, #3160) 2021-09-10 19:14:47 +01:00
Luck 4e2807cff5 Refactor mod container retrieval in Fabric mod 2021-09-10 18:32:43 +01:00
Emily 5735e0ef44 Fix fabric/build.gradle placeholder replacement (#3153) 2021-09-04 22:15:13 +01:00
Luck 9cd33d26f2 Fix toLowerCase/toUpperCase locale sensitivity 2021-08-25 20:09:20 +01:00
Luck 062fca3f75 Fix Fabric version placeholder in metadata file (#3141) 2021-08-25 19:36:53 +01:00
Luck a182768cfa Change user housekeeper to be more lenient towards API usage (#3143) 2021-08-25 19:30:46 +01:00
Luck 93683c3a2f Update Fabric to 1.17, fix version placeholder filtering 2021-08-20 18:46:39 +01:00
Callum Seabrook ba522597a8 Update to Gradle 7 (#3051) 2021-08-20 18:16:39 +01:00
Luck b232cb94b4 ReflectionClassPathAppender on Java 16+ 2021-08-17 21:29:10 +01:00
Luck ee6aa47d99 Listen for ServerPostConnectEvent in Velocity context listener (#3133) 2021-08-14 09:08:14 +01:00
Luck b3ebf202fd Update adventure-platform for 1.17 (#3127) 2021-08-06 14:35:23 +01:00
Emily 0fa3095241 Save renamed group before syncing with storage (#3129) 2021-08-06 09:59:38 +01:00
Luck 433272518f Fix bad Continuation usage in Velocity listener 2021-07-31 08:29:32 +01:00
Luck 26de6d3a78 Update Velocity to 3.0.0, use a Continuation for permissions setup event 2021-07-30 13:07:54 +01:00
Luck 5ea2aee2f4 More helpful error message when user is null in API PlayerAdapter (#3104) 2021-07-18 20:38:06 +01:00
Luck 5a377e713e Fix NPE from null primary group in Vault hook (#3103) 2021-07-18 20:35:31 +01:00
Luck cfb298f69b Use different classifier for dependency files with Bukkit-Legacy remappings 2021-07-08 22:54:04 +01:00
Emily 563b5be9b2 Implement enable-ops and auto-op on Fabric (#3069) 2021-07-04 10:01:47 +01:00
Emily fb36bd0ced Bulk update triggers for group related commands (#3073) 2021-07-04 10:00:18 +01:00
Luck 979c80d9ee Clarify config comments for mongodb-connection-uri option (#3062) 2021-06-15 20:41:36 +01:00
Luck 4598435dd4 Fix extension loading causing whole plugin to error 2021-06-13 12:46:02 +01:00
Luck 51202924af Update commodore for MC 1.17 support 2021-06-12 17:57:43 +01:00
Jacob C 8ae70990ad Generify SqlStorage shutdown exception message (#3039) 2021-06-10 21:16:23 +01:00
Tjeu Kayim a63be102cf Implement command list updater for Fabric (#3060) 2021-06-10 21:15:33 +01:00
Tjeu Kayim 044deccd22 Fabric, fix GameMode.NOT_SET removed in 1.17 (#3053) 2021-06-10 21:12:03 +01:00
Luck ad49508b74 Some misc tidying up 2021-05-23 11:29:22 +01:00
Luck 05c9ca5951 Properly cleanup JarInJarClassLoader when plugin disables 2021-05-23 11:27:45 +01:00
Luck f5cdb98b01 Fix ExpiringSet not really working & causing memory leaks (#3027) 2021-05-19 12:31:48 +01:00
Luck 228687b741 Fix Nukkit PermissionAttachments always throwing NPEs 2021-05-10 17:39:08 +01:00
lucko 7ebbfcf0d2 Update banner in readme 2021-05-10 14:30:09 +01:00
Luck 49c17c4a18 Clarify message in API NotLoadedException 2021-05-06 13:38:49 +01:00
Luck 7c42b9aeca Revert "Add extra check to ensure RedisBungee is loaded (#2981)"
This reverts commit a68a5d91c4.
2021-05-06 13:25:23 +01:00
Luck 1511193e58 Add Bukkit child permissions to the PermissionRegistry 2021-05-06 12:23:09 +01:00
Luck 528d668bc6 API User#setPrimaryGroup should care about stored value only (#3008) 2021-05-03 23:10:57 +01:00
Luck 71896a75bf Warn users with multiple permissions plugins installed (#3006) 2021-05-02 16:14:23 +01:00
Luck 931d61e2ed Include more information about targets in verbose payloads 2021-05-02 15:50:38 +01:00
Luck b87b1c7123 Improve structure of LuckPermsSubscriptionMap 2021-05-02 15:26:44 +01:00
Luck fed5a0fd87 Fix potential race condition in LuckPermsProvider#get 2021-04-23 20:17:48 +01:00
Luck 9d4f278117 Remove redundant CommandResult enum 2021-04-22 21:01:57 +01:00
Luck 1d465aa800 Fix track editor command for empty tracks (£2997) 2021-04-22 20:32:43 +01:00
Luck 8741e8259f Fix commodore not working after dependency update 2021-04-18 18:42:57 +01:00
Luck 98adb046ee Update lots of dependencies 2021-04-18 18:20:54 +01:00
Luck a68a5d91c4 Add extra check to ensure RedisBungee is loaded (#2981) 2021-04-18 13:48:45 +01:00
Luck 0808392353 Update adventure 2021-04-18 13:33:22 +01:00
Luck 07f672ae1f Add 'skip-bulkupdate-confirmation' config option (#2980) 2021-04-18 11:55:06 +01:00
Federico López e219237e44 API Javadoc gen fixes (#2977) 2021-04-18 11:37:46 +01:00
Luck c533446ab0 Fabric fix compat with fake players
https://github.com/lucko/fabric-permissions-api/issues/3
2021-04-07 20:56:51 +01:00
Luck 82488140ee Parallelize user data load in web editor request (#2973) 2021-04-07 08:32:02 +01:00
Luck 327ccec02f Use the correct config file location on Fabric and Sponge (#2972) 2021-04-07 08:24:38 +01:00
Federico López 46efe0ef93 Give default group if needed on UserManager#modifyUser (#2971) 2021-04-07 08:11:19 +01:00
Luck c2231bcc2e Disallow empty permission node (#2966) 2021-04-05 18:30:12 +01:00
Luck d150bd39a5 Send messaging service ping for creategroup command (#2956) 2021-03-25 22:28:52 +00:00
Federico López f813122468 Fix 'meta settemp' ignoring temporary modifier (#2958) 2021-03-24 21:28:00 +00:00
Luck 2e62c98c45 Avoid blocking worker pool for command timeout check (#2951)
3rd time lucky...
2021-03-24 12:40:24 +00:00
Luck f0e1a8f092 Remove some BungeeCord/Velocity command aliases 2021-03-23 13:45:34 +00:00
Luck 2dc6902001 Fix deadlock when lots of commands are executed at the same time (#2951) 2021-03-23 11:10:18 +00:00
Luck 21f5c24847 Optimize Bukkit/Nukkit ChildProcessor refresh (#2952) 2021-03-20 18:17:17 +00:00
Luck 6b2c4bca58 Change command manager lock handling to avoid non-fair tryLock call 2021-03-20 15:28:45 +00:00
Luck 4564a97371 Update fabric-loop, explicitly set archivesBaseName to 'luckperms' (#2880) 2021-03-19 20:39:42 +00:00
Luck 1df66255e4 Fix RCON permission checking for LP commands on Bukkit (#2948) 2021-03-19 20:03:21 +00:00
Luck 1c7e2dfb8c Fix very lenient duration parsing (#2940) 2021-03-19 19:59:15 +00:00
Luck ad1ba3c126 Fix player locale retrieval on Bukkit 1.8 (#2930) 2021-03-19 19:33:18 +00:00
lucko 0f63b024e4 Update readme to clarify build output dirs 2021-03-15 12:17:02 +00:00
Daniil a17b441165 Don't rely on getPackage to determine generated class name (#2937) 2021-03-15 12:12:02 +00:00
Luck e3138eb94c Make console detection more resilient against spoofed UUIDs 2021-03-13 14:25:33 +00:00
Luck 53bb61f9b2 Allow server name to be specified by a system property 2021-03-13 14:16:02 +00:00
Luck 370e2aed0d Add some missing null annotations 2021-03-13 14:14:59 +00:00
1087 changed files with 47345 additions and 11588 deletions

No files matched your search

+5
View File
@@ -0,0 +1,5 @@
#
# https://help.github.com/articles/dealing-with-line-endings/
#
# These are explicitly windows files and should use crlf
*.bat text eol=crlf
-40
View File
@@ -1,40 +0,0 @@
---
name: 🐛 ​ Bug report
about: Report an issue or problem with the way LuckPerms is functioning.
title: ''
labels: 'type: issue'
assignees: ''
---
<!-- Before going any further, please check to see if your problem is fixed by updating to a newer version. The latest development builds can be obtained from https://luckperms.net/download -->
### Description
<!-- Please provide a short description of the issue in the space below. -->
### Reproduction steps
<!-- Please provide a clear list of steps we should follow in order to reproduce your issue in the space below. -->
1. Open the config.yml file and set example to true.
2. Restart the server
3. Run /lp user example permission set x from the console
4. See error
### Expected behaviour
<!-- Please provide a description of what you expected to happen. -->
### Environment details
<!-- Please provide details of your server environment in the space below. -->
* Server type/version: `ExampleSpigot` running version `1.12.2` build `???`
* LuckPerms version: `v???`
<!-- If you think it would be helpful, please also include a "pastebin" of any relevant config files or log output. You should use https://gist.github.com/ to upload, then include the link below. -->
### Any other relevant details
<!-- Please include any other relevant details in the space below. -->
+63
View File
@@ -0,0 +1,63 @@
name: 🐛 ​ Bug report
description: Report an issue or problem with the way LuckPerms is functioning.
labels: ["type: issue"]
body:
- type: markdown
attributes:
value: "Before going any further, please check to see if your problem is fixed by updating to a newer version. The latest development builds can be obtained from https://luckperms.net/download"
- type: textarea
id: description
attributes:
label: Description
description: Please provide a short description of the issue in the space below.
placeholder: Description goes here!
validations:
required: true
- type: textarea
id: reproduction-steps
attributes:
label: Reproduction Steps
description: Please provide a clear list of steps we should follow in order to reproduce your issue in the space below.
placeholder: List reproduction steps here, please!
validations:
required: true
- type: textarea
id: expected-behaviour
attributes:
label: Expected Behaviour
description: Please provide a description of what you expected to happen.
placeholder: Describe what you expected to happen here.
validations:
required: true
- type: input
id: server-info
attributes:
label: Server Details
description: Please provide a description of the server details, including type and specific version number.
placeholder: 'git-Paper-124 (MC: 1.17.1)'
validations:
required: true
- type: input
id: luckperms-version
attributes:
label: LuckPerms Version
description: Please provide the specific, precise version number of LuckPerms you are using to reproduce this bug.
placeholder: v5.3.70
validations:
required: true
- type: textarea
id: logs
attributes:
label: Logs and Configs
description: If you think it would be helpful, please also include a pastebin of any relevant config files or log output. You should use https://gist.github.com/ to upload, then include the link below.
placeholder: https://gist.github.com/HelpfulBugReporter/ThisIsAVeryUsefulLogOutput
validations:
required: false
- type: textarea
id: extra-info
attributes:
label: Extra Details
description: Please include any other relevant details in the space below.
placeholder: I was able to reproduce this only at the end of a rainbow.
validations:
required: false
-16
View File
@@ -1,16 +0,0 @@
---
name: 💡 ​ Suggestion
about: Suggest an idea for an improvement or change to LuckPerms.
title: ''
labels: 'type: suggestion'
assignees: ''
---
### Description
<!-- Please provide a short description of the suggestion in the space below. -->
### Proposed behaviour
<!-- Please provide a short explanation of how the feature should work / be changed, and how this will effect the project. -->
+31
View File
@@ -0,0 +1,31 @@
name: 💡 ​ Suggestion
description: Suggest an idea for an improvement or change to LuckPerms.
labels: ["type: suggestion"]
body:
- type: markdown
attributes:
value: "Before going any further, please check to see if your suggestion has already been added by checking the [wiki](https://luckperms.net/wiki/Home). The latest development builds can be obtained from https://luckperms.net/download"
- type: textarea
id: description
attributes:
label: Description
description: Please provide a short description of your suggestion in the space below.
placeholder: Hello, perhaps you should...
validations:
required: true
- type: textarea
id: proposed-behaviour
attributes:
label: Proposed Behaviour
description: Please provide a short explanation of how the feature should work / be changed, and how this will affect the project.
placeholder: It would...
validations:
required: true
- type: textarea
id: extra-info
attributes:
label: Extra Details
description: Please include any other relevant details in the space below.
placeholder: I think this should only function at the end of a rainbow.
validations:
required: false
+128
View File
@@ -0,0 +1,128 @@
name: Build Gradle and Publish Docker image
on:
push:
branches:
- 'master'
tags:
- 'v*'
pull_request:
branches:
- 'master'
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build-gradle:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '25'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Run build and tests with Gradle wrapper
run: ./gradlew test build -PdockerTests
- name: Publish test report
uses: mikepenz/action-junit-report@v5
if: success() || failure()
with:
report_paths: '**/build/test-results/test/TEST-*.xml'
annotate_notice: true
detailed_summary: true
- name: Upload all artifacts
uses: actions/upload-artifact@v4
with:
name: jars
path: |
bukkit/loader/build/libs/LuckPerms-Bukkit-*.jar
bukkit-legacy/loader/build/libs/LuckPerms-Bukkit-Legacy-*.jar
bungee/loader/build/libs/LuckPerms-Bungee-*.jar
sponge/loader/build/libs/LuckPerms-Sponge-*.jar
nukkit/loader/build/libs/LuckPerms-Nukkit-*.jar
velocity/build/libs/LuckPerms-Velocity-*.jar
fabric/build/libs/LuckPerms-Fabric-*.jar
forge/loader/build/libs/LuckPerms-Forge-*.jar
standalone/loader/build/libs/LuckPerms-Standalone-*.jar
- name: Upload standalone artifact
uses: actions/upload-artifact@v4
with:
name: standalone-binary
path: standalone/loader/build/libs/LuckPerms-Standalone-*.jar
build-docker:
needs: build-gradle
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Retrieve saved standalone jar artifact
uses: actions/download-artifact@v4
with:
name: standalone-binary
path: standalone/docker/
- name: Remove version number from jar artifact name
run: mv standalone/docker/LuckPerms-Standalone-*.jar standalone/docker/luckperms-standalone.jar
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Determine the LuckPerms version
run: |
echo "luckperms_version=$(git describe --tags | awk -F "-" '{print $1 "." $2}')" >> "$GITHUB_ENV"
- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
flavor: |
latest=${{ github.ref == 'refs/heads/master' }}
tags: |
type=schedule
type=ref,event=branch
type=ref,event=tag
type=ref,event=pr
type=raw,enable=${{ github.ref == 'refs/heads/master' }},value=${{ env.luckperms_version }}
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: standalone/docker/
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
+3
View File
@@ -1,3 +1,6 @@
### LuckPerms Standalone ###
standalone/loader/data/
### Gradle & IntelliJ ###
.gradle/
/.idea/
+2 -2
View File
@@ -8,7 +8,7 @@ Before reporting a bug or issue, please make sure that the issue is actually bei
If you're unsure, feel free to ask using the above resources BEFORE making a report.
Bugs or issues should be reported using the [GitHub Issues tab](https://github.com/lucko/LuckPerms/issues).
Bugs or issues should be reported using the [GitHub Issues tab](https://github.com/LuckPerms/LuckPerms/issues).
### :pencil: Want to contribute code?
#### Pull Requests
@@ -23,4 +23,4 @@ The project is split up into a few separate modules.
* **API** - The public, semantically versioned API used by other plugins wishing to integrate with and retrieve data from LuckPerms. This module (for the most part) does not contain any implementation itself, and is provided by the plugin.
* **Common** - The common module contains most of the code which implements the respective LuckPerms plugins. This abstract module reduces duplicated code throughout the project.
* **Bukkit, BungeeCord, Sponge, Nukkit, Velocity & Fabric** - Each use the common module to implement plugins on the respective server platforms.
* **Bukkit, BungeeCord, Fabric, Forge, Nukkit, Sponge & Velocity** - Each use the common module to implement plugins on the respective server platforms.
+12 -6
View File
@@ -1,4 +1,4 @@
![](https://i.imgur.com/ToguFkQ.png "Banner")
![](https://raw.githubusercontent.com/LuckPerms/branding/master/banner/banner.png "Banner")
# LuckPerms
[![Build Status](https://ci.lucko.me/job/LuckPerms/badge/icon)](https://ci.lucko.me/job/LuckPerms/)
[![javadoc](https://javadoc.io/badge2/net.luckperms/api/javadoc.svg)](https://javadoc.io/doc/net.luckperms/api)
@@ -24,17 +24,23 @@ For more information, see the wiki article on [Why LuckPerms?](https://luckperms
LuckPerms uses Gradle to handle dependencies & building.
#### Requirements
* Java 8 JDK or newer
* Java 21 JDK or newer
* Git
#### Compiling from source
```sh
git clone https://github.com/lucko/LuckPerms.git
git clone https://github.com/LuckPerms/LuckPerms.git
cd LuckPerms/
./gradlew build
```
You can find the output jars in the `build/libs` directories.
You can find the output jars in the `loader/build/libs` or `build/libs` directories.
## Tests
There are some automated tests which run during each build.
* Unit tests are defined in [`common/src/test`](https://github.com/LuckPerms/LuckPerms/tree/master/common/src/test)
* Integration tests are defined in [`standalone/src/test`](https://github.com/LuckPerms/LuckPerms/tree/master/standalone/src/test).
## Contributing
#### Pull Requests
@@ -47,7 +53,7 @@ The project is split up into a few separate modules.
* **API** - The public, semantically versioned API used by other plugins wishing to integrate with and retrieve data from LuckPerms. This module (for the most part) does not contain any implementation itself, and is provided by the plugin.
* **Common** - The common module contains most of the code which implements the respective LuckPerms plugins. This abstract module reduces duplicated code throughout the project.
* **Bukkit, BungeeCord, Sponge, Fabric, Nukkit & Velocity** - Each use the common module to implement plugins on the respective server platforms.
* **Bukkit, BungeeCord, Fabric, Forge, Nukkit, Sponge & Velocity** - Each use the common module to implement plugins on the respective server platforms.
## License
LuckPerms is licensed under the permissive MIT license. Please see [`LICENSE.txt`](https://github.com/lucko/LuckPerms/blob/master/LICENSE.txt) for more info.
LuckPerms is licensed under the permissive MIT license. Please see [`LICENSE.txt`](https://github.com/LuckPerms/LuckPerms/blob/master/LICENSE.txt) for more info.
+71 -62
View File
@@ -1,9 +1,21 @@
apply plugin: 'java-library'
group = 'net.luckperms'
project.version = '5.3'
project.version = '5.5'
tasks.withType(JavaCompile).configureEach {
options.release = 8
}
jar {
manifest {
attributes('Automatic-Module-Name': 'net.luckperms.api')
}
}
dependencies {
compileOnly 'org.checkerframework:checker-qual:3.8.0'
compileOnly 'org.jetbrains:annotations:20.1.0'
api 'org.jspecify:jspecify:1.0.0'
compileOnlyApi 'org.jetbrains:annotations:26.1.0'
}
// Only used occasionally for deployment - not needed for normal builds.
@@ -17,87 +29,84 @@ if (project.hasProperty('sonatypeUsername') && project.hasProperty('sonatypePass
options.encoding = 'UTF-8'
options.charSet = 'UTF-8'
options.links(
'https://docs.oracle.com/javase/8/docs/api/',
'https://checkerframework.org/api/',
'https://javadoc.io/static/org.jetbrains/annotations/20.1.0/'
'https://jspecify.dev/docs/api/',
'https://javadoc.io/static/org.jetbrains/annotations/26.0.2/'
)
options.addStringOption('Xdoclint:none', '-quiet')
options.addStringOption('-since', '5.0,5.1,5.2,5.3,5.4,5.5')
if (JavaVersion.current() > JavaVersion.VERSION_1_8) {
options.links.add('https://docs.oracle.com/en/java/javase/21/docs/api/')
} else {
options.links.add('https://docs.oracle.com/javase/8/docs/api/')
}
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier 'javadoc'
from javadoc.destinationDir
java {
withJavadocJar()
withSourcesJar()
}
task sourcesJar(type: Jar) {
classifier 'sources'
from sourceSets.main.allSource
}
artifacts {
archives javadocJar
archives sourcesJar
}
signing {
useGpgCmd()
sign configurations.archives
}
uploadArchives {
publishing {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
maven {
def releasesRepoUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
def snapshotsRepoUrl = 'https://oss.sonatype.org/content/repositories/snapshots/'
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
repository(url: 'https://oss.sonatype.org/service/local/staging/deploy/maven2/') {
authentication(userName: sonatypeUsername, password: sonatypePassword)
credentials {
username sonatypeUsername
password sonatypePassword
}
}
}
snapshotRepository(url: 'https://oss.sonatype.org/content/repositories/snapshots/') {
authentication(userName: sonatypeUsername, password: sonatypePassword)
}
publications {
mavenJava(MavenPublication) {
artifactId = 'api'
from components.java
pom {
project {
name 'LuckPerms API'
description 'A permissions plugin for Minecraft servers.'
url 'https://luckperms.net'
name = 'LuckPerms API'
description = 'A permissions manager for Minecraft servers.'
url = 'https://luckperms.net'
licenses {
license {
name 'MIT'
url 'https://opensource.org/licenses/MIT'
}
licenses {
license {
name = 'MIT'
url = 'https://opensource.org/licenses/MIT'
}
}
developers {
developer {
id 'lucko'
name 'Luck'
url 'https://lucko.me'
email 'git@lucko.me'
}
developers {
developer {
id = 'lucko'
name = 'Luck'
url = 'https://lucko.me'
email = 'git@lucko.me'
}
}
scm {
connection 'scm:git:https://github.com/lucko/LuckPerms.git'
developerConnection 'scm:git:git@github.com:lucko/LuckPerms.git'
url 'https://github.com/lucko/LuckPerms'
}
scm {
connection = 'scm:git:https://github.com/LuckPerms/LuckPerms.git'
developerConnection = 'scm:git:git@github.com:LuckPerms/LuckPerms.git'
url = 'https://github.com/LuckPerms/LuckPerms'
}
ciManagement {
system 'Jenkins'
url 'https://ci.lucko.me/job/LuckPerms'
}
issueManagement {
system 'GitHub'
url 'https://github.com/lucko/LuckPerms/issues'
}
issueManagement {
system = 'GitHub'
url = 'https://github.com/LuckPerms/LuckPerms/issues'
}
}
}
}
}
signing {
useGpgCmd()
sign publishing.publications.mavenJava
required = true
}
}
*/
+3 -2
View File
@@ -1,6 +1,6 @@
<body>
<p>
LuckPerms is a permissions plugin for Minecraft servers. It allows server admins to control what
LuckPerms is a permissions manager for Minecraft servers. It allows server admins to control what
features players can use by creating groups and assigning permissions.
</p>
<h4>Useful Links</h4>
@@ -8,10 +8,11 @@
<li><a target="_top" href="https://luckperms.net">Project Website</a></li>
<li><a target="_top" href="https://luckperms.net/wiki/Developer-API">Wiki - API Introduction</a></li>
<li><a target="_top" href="https://luckperms.net/wiki/Developer-API-Usage">Wiki - API Usage</a></li>
<li><a target="_top" href="https://github.com/LuckPerms/LuckPerms">Source Code</a></li>
</ul>
<h4>Maven</h4>
<p>
The API artifact is deployed to Maven Central under
The API artifact is deployed to Maven Central with
<a target="_top" href="https://search.maven.org/artifact/net.luckperms/api">
group id: <b><code>net.luckperms</code></b>, artifact id: <b><code>api</code></b>.
</a>
@@ -26,6 +26,7 @@
package net.luckperms.api;
import net.luckperms.api.actionlog.ActionLogger;
import net.luckperms.api.actionlog.filter.ActionFilterFactory;
import net.luckperms.api.context.ContextCalculator;
import net.luckperms.api.context.ContextManager;
import net.luckperms.api.event.EventBus;
@@ -40,14 +41,13 @@ import net.luckperms.api.model.user.User;
import net.luckperms.api.model.user.UserManager;
import net.luckperms.api.node.NodeBuilderRegistry;
import net.luckperms.api.node.matcher.NodeMatcherFactory;
import net.luckperms.api.platform.Health;
import net.luckperms.api.platform.Platform;
import net.luckperms.api.platform.PlayerAdapter;
import net.luckperms.api.platform.PluginMetadata;
import net.luckperms.api.query.QueryOptionsRegistry;
import net.luckperms.api.track.Track;
import net.luckperms.api.track.TrackManager;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.jetbrains.annotations.ApiStatus.Internal;
import java.util.Optional;
@@ -83,18 +83,18 @@ public interface LuckPerms {
*
* @return the server name
*/
@NonNull String getServerName();
String getServerName();
/**
* Gets the {@link UserManager}, responsible for managing
* {@link User} instances.
*
* <p>This manager can be used to retrieve instances of {@link User} by uuid
* <p>This manager can be used to retrieve instances of {@link User} by UUID
* or name, or query all loaded users.</p>
*
* @return the user manager
*/
@NonNull UserManager getUserManager();
UserManager getUserManager();
/**
* Gets the {@link GroupManager}, responsible for managing
@@ -105,7 +105,7 @@ public interface LuckPerms {
*
* @return the group manager
*/
@NonNull GroupManager getGroupManager();
GroupManager getGroupManager();
/**
* Gets the {@link TrackManager}, responsible for managing
@@ -116,7 +116,7 @@ public interface LuckPerms {
*
* @return the track manager
*/
@NonNull TrackManager getTrackManager();
TrackManager getTrackManager();
/**
* Gets the {@link PlayerAdapter} instance, a utility class for adapting platform Player
@@ -143,7 +143,7 @@ public interface LuckPerms {
* @throws IllegalArgumentException if the player class is not correct
* @since 5.1
*/
<T> @NonNull PlayerAdapter<T> getPlayerAdapter(@NonNull Class<T> playerClass);
<T> PlayerAdapter<T> getPlayerAdapter(Class<T> playerClass);
/**
* Gets the {@link Platform}, which represents the server platform the
@@ -151,7 +151,7 @@ public interface LuckPerms {
*
* @return the platform
*/
@NonNull Platform getPlatform();
Platform getPlatform();
/**
* Gets the {@link PluginMetadata}, responsible for providing metadata about
@@ -159,7 +159,7 @@ public interface LuckPerms {
*
* @return the plugin metadata
*/
@NonNull PluginMetadata getPluginMetadata();
PluginMetadata getPluginMetadata();
/**
* Gets the {@link EventBus}, used for subscribing to internal LuckPerms
@@ -167,7 +167,7 @@ public interface LuckPerms {
*
* @return the event bus
*/
@NonNull EventBus getEventBus();
EventBus getEventBus();
/**
* Gets the {@link MessagingService}, used to dispatch updates throughout a
@@ -178,7 +178,7 @@ public interface LuckPerms {
*
* @return the messaging service instance, if present.
*/
@NonNull Optional<MessagingService> getMessagingService();
Optional<MessagingService> getMessagingService();
/**
* Gets the {@link ActionLogger}, responsible for saving and broadcasting
@@ -186,7 +186,7 @@ public interface LuckPerms {
*
* @return the action logger
*/
@NonNull ActionLogger getActionLogger();
ActionLogger getActionLogger();
/**
* Gets the {@link ContextManager}, responsible for managing
@@ -194,7 +194,7 @@ public interface LuckPerms {
*
* @return the context manager
*/
@NonNull ContextManager getContextManager();
ContextManager getContextManager();
/**
* Gets the {@link MetaStackFactory}.
@@ -205,7 +205,7 @@ public interface LuckPerms {
*
* @return the meta stack factory
*/
@NonNull MetaStackFactory getMetaStackFactory();
MetaStackFactory getMetaStackFactory();
/**
* Schedules the execution of an update task, and returns an encapsulation
@@ -218,7 +218,18 @@ public interface LuckPerms {
*
* @return a future
*/
@NonNull CompletableFuture<Void> runUpdateTask();
CompletableFuture<Void> runUpdateTask();
/**
* Executes a health check.
*
* <p>This task checks if the LuckPerms implementation is running and
* whether it has a connection to the database (if applicable).</p>
*
* @return the health status
* @since 5.5
*/
Health runHealthCheck();
/**
* Registers a {@link MessengerProvider} for use by the platform.
@@ -228,7 +239,7 @@ public interface LuckPerms {
*
* @param messengerProvider the messenger provider.
*/
void registerMessengerProvider(@NonNull MessengerProvider messengerProvider);
void registerMessengerProvider(MessengerProvider messengerProvider);
/**
* Gets the {@link NodeBuilderRegistry}.
@@ -236,7 +247,7 @@ public interface LuckPerms {
* @return the node builder registry
*/
@Internal
@NonNull NodeBuilderRegistry getNodeBuilderRegistry();
NodeBuilderRegistry getNodeBuilderRegistry();
/**
* Gets the {@link QueryOptionsRegistry}.
@@ -245,7 +256,7 @@ public interface LuckPerms {
* @since 5.1
*/
@Internal
@NonNull QueryOptionsRegistry getQueryOptionsRegistry();
QueryOptionsRegistry getQueryOptionsRegistry();
/**
* Gets the {@link NodeMatcherFactory}.
@@ -254,6 +265,15 @@ public interface LuckPerms {
* @since 5.1
*/
@Internal
@NonNull NodeMatcherFactory getNodeMatcherFactory();
NodeMatcherFactory getNodeMatcherFactory();
/**
* Gets the {@link ActionFilterFactory}.
*
* @return the action filter factory
* @since 5.5
*/
@Internal
ActionFilterFactory getActionFilterFactory();
}
@@ -25,7 +25,7 @@
package net.luckperms.api;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.jspecify.annotations.Nullable;
import static org.jetbrains.annotations.ApiStatus.Internal;
@@ -36,7 +36,7 @@ import static org.jetbrains.annotations.ApiStatus.Internal;
* instance, however, this provider can be used if this is not viable.</p>
*/
public final class LuckPermsProvider {
private static LuckPerms instance = null;
private static @Nullable LuckPerms instance = null;
/**
* Gets an instance of the {@link LuckPerms} API,
@@ -47,7 +47,8 @@ public final class LuckPermsProvider {
* @return an instance of the LuckPerms API
* @throws IllegalStateException if the API is not loaded yet
*/
public static @NonNull LuckPerms get() {
public static LuckPerms get() {
LuckPerms instance = LuckPermsProvider.instance;
if (instance == null) {
throw new NotLoadedException();
}
@@ -76,9 +77,10 @@ public final class LuckPermsProvider {
private static final String MESSAGE = "The LuckPerms API isn't loaded yet!\n" +
"This could be because:\n" +
" a) the LuckPerms plugin is not installed or it failed to enable\n" +
" b) your plugin does not declare a dependency on LuckPerms\n" +
" c) you are attempting to use the API before plugins reach the 'enable' phase\n" +
" (call the #get method in onEnable, not in your plugin constructor!)\n";
" b) the plugin in the stacktrace does not declare a dependency on LuckPerms\n" +
" c) the plugin in the stacktrace is retrieving the API before the plugin 'enable' phase\n" +
" (call the #get method in onEnable, not the constructor!)\n" +
" d) the plugin in the stacktrace is incorrectly 'shading' the LuckPerms API into its jar\n";
NotLoadedException() {
super(MESSAGE);
@@ -26,9 +26,8 @@
package net.luckperms.api.actionlog;
import net.luckperms.api.LuckPermsProvider;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jetbrains.annotations.ApiStatus.NonExtendable;
import org.jspecify.annotations.Nullable;
import java.time.Instant;
import java.util.Optional;
@@ -36,7 +35,10 @@ import java.util.UUID;
/**
* Represents a logged action.
*
* <p>API users should not implement this interface directly.</p>
*/
@NonExtendable
public interface Action extends Comparable<Action> {
/**
@@ -44,7 +46,7 @@ public interface Action extends Comparable<Action> {
*
* @return a new builder
*/
static @NonNull Builder builder() {
static Builder builder() {
return LuckPermsProvider.get().getActionLogger().actionBuilder();
}
@@ -53,21 +55,21 @@ public interface Action extends Comparable<Action> {
*
* @return the timestamp
*/
@NonNull Instant getTimestamp();
Instant getTimestamp();
/**
* Gets the source of the action.
*
* @return the source
*/
@NonNull Source getSource();
Source getSource();
/**
* Gets the target of the action.
*
* @return the target
*/
@NonNull Target getTarget();
Target getTarget();
/**
* Returns a string describing the action which took place.
@@ -77,11 +79,12 @@ public interface Action extends Comparable<Action> {
*
* @return the action
*/
@NonNull String getDescription();
String getDescription();
/**
* Represents the source of an action.
*/
@NonExtendable
interface Source {
/**
@@ -89,20 +92,21 @@ public interface Action extends Comparable<Action> {
*
* @return the source unique id
*/
@NonNull UUID getUniqueId();
UUID getUniqueId();
/**
* Gets the source name.
*
* @return the source name
*/
@NonNull String getName();
String getName();
}
/**
* Represents the target of an action.
*/
@NonExtendable
interface Target {
/**
@@ -110,24 +114,24 @@ public interface Action extends Comparable<Action> {
*
* @return the target unique id
*/
@NonNull Optional<UUID> getUniqueId();
Optional<UUID> getUniqueId();
/**
* Gets the target name.
*
* @return the target name
*/
@NonNull String getName();
String getName();
/**
* Gets the target type.
*
* @return the target type
*/
@NonNull Type getType();
Type getType();
/**
* Represents the type of a {@link Target}.
* Represents the type of {@link Target}.
*/
enum Type {
USER, GROUP, TRACK
@@ -146,7 +150,7 @@ public interface Action extends Comparable<Action> {
* @return the builder
* @see Action#getTimestamp()
*/
@NonNull Builder timestamp(@NonNull Instant timestamp);
Builder timestamp(Instant timestamp);
/**
* Sets the actor of the entry.
@@ -154,7 +158,7 @@ public interface Action extends Comparable<Action> {
* @param actor the actor
* @return the builder
*/
@NonNull Builder source(@NonNull UUID actor);
Builder source(UUID actor);
/**
* Sets the actor name of the entry.
@@ -162,7 +166,7 @@ public interface Action extends Comparable<Action> {
* @param actorName the actor name
* @return the builder
*/
@NonNull Builder sourceName(@NonNull String actorName);
Builder sourceName(String actorName);
/**
* Sets the type of the entry.
@@ -170,7 +174,7 @@ public interface Action extends Comparable<Action> {
* @param type the type
* @return the builder
*/
@NonNull Builder targetType(Action.Target.Type type);
Builder targetType(Target.Type type);
/**
* Sets the acted object for the entry.
@@ -178,7 +182,7 @@ public interface Action extends Comparable<Action> {
* @param acted the acted object
* @return the builder
*/
@NonNull Builder target(@Nullable UUID acted);
Builder target(@Nullable UUID acted);
/**
* Sets the acted name for the entry.
@@ -186,7 +190,7 @@ public interface Action extends Comparable<Action> {
* @param actedName the acted name
* @return the builder
*/
@NonNull Builder targetName(@NonNull String actedName);
Builder targetName(String actedName);
/**
* Sets the action of the entry.
@@ -194,14 +198,14 @@ public interface Action extends Comparable<Action> {
* @param action the action
* @return the builder
*/
@NonNull Builder description(@NonNull String action);
Builder description(String action);
/**
* Creates a {@link Action} instance from the builder.
*
* @return a new log entry instance
*/
@NonNull Action build();
Action build();
}
@@ -25,7 +25,7 @@
package net.luckperms.api.actionlog;
import org.checkerframework.checker.nullness.qual.NonNull;
import net.luckperms.api.actionlog.filter.ActionFilter;
import org.jetbrains.annotations.Unmodifiable;
import java.util.SortedSet;
@@ -40,7 +40,11 @@ import java.util.UUID;
* You can add to the log using the {@link ActionLogger}, and then request an updated copy.</p>
*
* <p>All methods are thread safe, and return immutable and thread safe collections.</p>
*
* @deprecated Use {@link ActionLogger#queryActions(ActionFilter)} or
* {@link ActionLogger#queryActions(ActionFilter, int, int)} instead.
*/
@Deprecated
public interface ActionLog {
/**
@@ -48,23 +52,23 @@ public interface ActionLog {
*
* @return the content
*/
@NonNull @Unmodifiable SortedSet<Action> getContent();
@Unmodifiable SortedSet<Action> getContent();
/**
* Gets the entries in the log performed by the given actor.
*
* @param actor the uuid of the actor to filter by
* @param actor the UUID of the actor to filter by
* @return the content for the given actor
*/
@NonNull @Unmodifiable SortedSet<Action> getContent(@NonNull UUID actor);
@Unmodifiable SortedSet<Action> getContent(UUID actor);
/**
* Gets the log content for a given user
*
* @param uniqueId the uuid to filter by
* @return all content in this log where the user = uuid
* @param uniqueId the UUID to filter by
* @return all content in this log where the user = UUID
*/
@NonNull @Unmodifiable SortedSet<Action> getUserHistory(@NonNull UUID uniqueId);
@Unmodifiable SortedSet<Action> getUserHistory(UUID uniqueId);
/**
* Gets the log content for a given group
@@ -72,7 +76,7 @@ public interface ActionLog {
* @param name the name to filter by
* @return all content in this log where the group = name
*/
@NonNull @Unmodifiable SortedSet<Action> getGroupHistory(@NonNull String name);
@Unmodifiable SortedSet<Action> getGroupHistory(String name);
/**
* Gets the log content for a given track
@@ -80,6 +84,6 @@ public interface ActionLog {
* @param name the name to filter by
* @return all content in this log where the track = name
*/
@NonNull @Unmodifiable SortedSet<Action> getTrackHistory(@NonNull String name);
@Unmodifiable SortedSet<Action> getTrackHistory(String name);
}
@@ -25,10 +25,10 @@
package net.luckperms.api.actionlog;
import net.luckperms.api.messaging.MessagingService;
import org.checkerframework.checker.nullness.qual.NonNull;
import net.luckperms.api.actionlog.filter.ActionFilter;
import net.luckperms.api.util.Page;
import java.util.List;
import java.util.concurrent.CompletableFuture;
/**
@@ -41,50 +41,85 @@ public interface ActionLogger {
*
* @return a new builder
*/
Action.@NonNull Builder actionBuilder();
Action.Builder actionBuilder();
/**
* Gets a {@link ActionLog} instance from the plugin storage.
*
* @return a log instance
* @deprecated Use {@link #queryActions(ActionFilter)} or {@link #queryActions(ActionFilter, int, int)} instead. These methods
* are more efficient (they don't load the full action log into memory) and allow for pagination.
*/
@NonNull CompletableFuture<ActionLog> getLog();
@Deprecated
CompletableFuture<ActionLog> getLog();
/**
* Submits a log entry to the plugin to be handled.
* Gets all actions from the action log matching the given {@code filter}.
*
* <p>This method submits the log to the storage provider and broadcasts
* it.</p>
* <p>If the filter is {@code null}, all actions will be returned.</p>
*
* <p>It is therefore roughly equivalent to calling
* {@link #submitToStorage(Action)} and {@link #broadcastAction(Action)},
* however, using this method is preferred to making the calls individually.</p>
* <p>Unlike {@link #queryActions(ActionFilter, int, int)}, this method does not implement any pagination and will return
* all entries at once.</p>
*
* <p>If you want to submit a log entry but don't know which method to pick,
* @param filter the filter, optional
* @return the actions
* @since 5.5
*/
CompletableFuture<List<Action>> queryActions(ActionFilter filter);
/**
* Gets a page of actions from the action log matching the given {@code filter}.
*
* <p>If the filter is {@code null}, all actions will be returned.</p>
*
* @param filter the filter, optional
* @param pageSize the size of the page
* @param pageNumber the page number
* @return the page of actions
* @since 5.5
*/
CompletableFuture<Page<Action>> queryActions(ActionFilter filter, int pageSize, int pageNumber);
/**
* Submits a logged action to LuckPerms.
*
* <p>This method submits the action to the storage provider to be persisted in the action log.
* It also broadcasts it to administrator players on the current instance and to admins on other
* connected servers if a messaging service is configured.</p>
*
* <p>It is roughly equivalent to calling
* {@link #submitToStorage(Action)} followed by {@link #broadcastAction(Action)},
* however using this method is preferred to making the calls individually.</p>
*
* <p>If you want to submit an action log entry but don't know which method to pick,
* use this one.</p>
*
* @param entry the entry to submit
* @return a future which will complete when the action is done
* @return a future which will complete when the action is submitted
*/
@NonNull CompletableFuture<Void> submit(@NonNull Action entry);
CompletableFuture<Void> submit(Action entry);
/**
* Submits a log entry to the plugins storage handler.
* Submits a logged action to LuckPerms and persists it in the storage backend.
*
* <p>This method does not broadcast the action or send it through the messaging service.</p>
*
* @param entry the entry to submit
* @return a future which will complete when the action is done
* @return a future which will complete when the action is submitted
*/
@NonNull CompletableFuture<Void> submitToStorage(@NonNull Action entry);
CompletableFuture<Void> submitToStorage(Action entry);
/**
* Submits a log entry to the plugins log broadcasting handler.
* Submits a logged action to LuckPerms and broadcasts it to administrators.
*
* <p>If enabled, this method will also dispatch the log entry via the
* plugins {@link MessagingService}.</p>
* <p>The broadcast is made to administrator players on the current instance
* and to admins on other connected servers if a messaging service is configured.</p>
*
* <p>This method does not save the action to the plugin storage backend.</p>
*
* @param entry the entry to submit
* @return a future which will complete when the action is done
* @return a future which will complete when the action is broadcasted
*/
@NonNull CompletableFuture<Void> broadcastAction(@NonNull Action entry);
CompletableFuture<Void> broadcastAction(Action entry);
}
@@ -0,0 +1,114 @@
/*
* This file is part of LuckPerms, licensed under the MIT License.
*
* Copyright (c) lucko (Luck) <luck@lucko.me>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package net.luckperms.api.actionlog.filter;
import net.luckperms.api.LuckPermsProvider;
import net.luckperms.api.actionlog.Action;
import org.jetbrains.annotations.ApiStatus.NonExtendable;
import java.util.UUID;
import java.util.function.Predicate;
/**
* A predicate filter which matches certain {@link Action}s.
*
* <p>API users should not implement this interface directly.</p>
*
* @since 5.5
*/
@NonExtendable
public interface ActionFilter extends Predicate<Action> {
/**
* Gets an {@link ActionFilter} which matches any action.
*
* @return the matcher
*/
static ActionFilter any() {
return LuckPermsProvider.get().getActionFilterFactory().any();
}
/**
* Gets an {@link ActionFilter} which matches actions with a specific source user.
*
* @param uniqueId the source user unique id
* @return the matcher
*/
static ActionFilter source(UUID uniqueId) {
return LuckPermsProvider.get().getActionFilterFactory().source(uniqueId);
}
/**
* Gets an {@link ActionFilter} which matches actions which target a specific user.
*
* @param uniqueId the target user unique id
* @return the matcher
*/
static ActionFilter user(UUID uniqueId) {
return LuckPermsProvider.get().getActionFilterFactory().user(uniqueId);
}
/**
* Gets an {@link ActionFilter} which matches actions which target a specific group.
*
* @param name the target group name
* @return the matcher
*/
static ActionFilter group(String name) {
return LuckPermsProvider.get().getActionFilterFactory().group(name);
}
/**
* Gets an {@link ActionFilter} which matches actions which target a specific track.
*
* @param name the target track name
* @return the matcher
*/
static ActionFilter track(String name) {
return LuckPermsProvider.get().getActionFilterFactory().track(name);
}
/**
* Gets an {@link ActionFilter} which matches actions which contain a specific search query in the source name,
* target name or description.
*
* @param query the search query
* @return the matcher
*/
static ActionFilter search(String query) {
return LuckPermsProvider.get().getActionFilterFactory().search(query);
}
/**
* Tests to see if the given {@link Action} matches the filter.
*
* @param action the action to test
* @return true if the action matched
*/
@Override
boolean test(Action action);
}
@@ -0,0 +1,88 @@
/*
* This file is part of LuckPerms, licensed under the MIT License.
*
* Copyright (c) lucko (Luck) <luck@lucko.me>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package net.luckperms.api.actionlog.filter;
import org.jetbrains.annotations.ApiStatus.Internal;
import java.util.UUID;
/**
* A factory which creates {@link ActionFilter}s.
*
* @since 5.5
*/
@Internal
public interface ActionFilterFactory {
/**
* Gets an {@link ActionFilter} which matches any action.
*
* @return the matcher
*/
ActionFilter any();
/**
* Gets an {@link ActionFilter} which matches actions with a specific source user.
*
* @param uniqueId the source user unique id
* @return the matcher
*/
ActionFilter source(UUID uniqueId);
/**
* Gets an {@link ActionFilter} which matches actions which target a specific user.
*
* @param uniqueId the target user unique id
* @return the matcher
*/
ActionFilter user(UUID uniqueId);
/**
* Gets an {@link ActionFilter} which matches actions which target a specific group.
*
* @param name the target group name
* @return the matcher
*/
ActionFilter group(String name);
/**
* Gets an {@link ActionFilter} which matches actions which target a specific track.
*
* @param name the target track name
* @return the matcher
*/
ActionFilter track(String name);
/**
* Gets an {@link ActionFilter} which matches actions which contain a specific search query in the source name,
* target name or description.
*
* @param query the search query
* @return the matcher
*/
ActionFilter search(String query);
}
@@ -0,0 +1,30 @@
/*
* This file is part of LuckPerms, licensed under the MIT License.
*
* Copyright (c) lucko (Luck) <luck@lucko.me>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
/**
* {@link net.luckperms.api.actionlog.Action} filters.
*/
@org.jspecify.annotations.NullMarked
package net.luckperms.api.actionlog.filter;
@@ -24,6 +24,7 @@
*/
/**
* {@link net.luckperms.api.actionlog.ActionLog} related functionality.
* {@link net.luckperms.api.actionlog.ActionLogger} related functionality.
*/
@org.jspecify.annotations.NullMarked
package net.luckperms.api.actionlog;
@@ -27,10 +27,12 @@ package net.luckperms.api.cacheddata;
import net.luckperms.api.query.QueryOptions;
import org.checkerframework.checker.nullness.qual.NonNull;
/**
* Holds cached lookup data for a given set of query options.
*
* <p>All calls will account for inheritance, as well as any default data
* provided by the platform. These calls are heavily cached and are therefore
* fast.</p>
*/
public interface CachedData {
@@ -39,6 +41,6 @@ public interface CachedData {
*
* @return the query options this container is caching
*/
@NonNull QueryOptions getQueryOptions();
QueryOptions getQueryOptions();
}
@@ -31,15 +31,13 @@ import net.luckperms.api.model.group.Group;
import net.luckperms.api.model.user.User;
import net.luckperms.api.query.QueryOptions;
import org.checkerframework.checker.nullness.qual.NonNull;
import java.util.concurrent.CompletableFuture;
/**
* Holds cached permission and meta lookup data for a {@link PermissionHolder}.
*
* <p>All calls will account for inheritance, as well as any default data
* provided by the platform. This calls are heavily cached and are therefore
* provided by the platform. These calls are heavily cached and are therefore
* fast.</p>
*/
public interface CachedDataManager {
@@ -49,14 +47,14 @@ public interface CachedDataManager {
*
* @return the permission data manager
*/
@NonNull Container<CachedPermissionData> permissionData();
Container<CachedPermissionData> permissionData();
/**
* Gets the manager for {@link CachedMetaData}.
*
* @return the meta data manager
*/
@NonNull Container<CachedMetaData> metaData();
Container<CachedMetaData> metaData();
/**
* Gets PermissionData from the cache, using the given query options.
@@ -64,7 +62,7 @@ public interface CachedDataManager {
* @param queryOptions the query options
* @return a permission data instance
*/
@NonNull CachedPermissionData getPermissionData(@NonNull QueryOptions queryOptions);
CachedPermissionData getPermissionData(QueryOptions queryOptions);
/**
* Gets MetaData from the cache, using the given query options.
@@ -72,7 +70,7 @@ public interface CachedDataManager {
* @param queryOptions the query options
* @return a meta data instance
*/
@NonNull CachedMetaData getMetaData(@NonNull QueryOptions queryOptions);
CachedMetaData getMetaData(QueryOptions queryOptions);
/**
* Gets PermissionData from the cache, using the most appropriate query options
@@ -80,17 +78,16 @@ public interface CachedDataManager {
*
* <p>For {@link User}s, the most appropriate query options will be their
* {@link ContextManager#getQueryOptions(User) current active query options} if the
* corresponding player is online, and otherwise, will fallback to
* {@link ContextManager#getStaticQueryOptions() the current static query options}
* if they are offline.</p>
* corresponding player is online, and otherwise, will fall back to
* {@link ContextManager#getStaticQueryOptions() the current static query options}.</p>
*
* <p>For {@link Group}s, the most appropriate query options will always be
* {@link ContextManager#getStaticQueryOptions()} the current static query options.</p>
* {@link ContextManager#getStaticQueryOptions() the current static query options}.</p>
*
* @return a permission data instance
* @since 5.1
*/
@NonNull CachedPermissionData getPermissionData();
CachedPermissionData getPermissionData();
/**
* Gets MetaData from the cache, using the most appropriate query options
@@ -98,18 +95,17 @@ public interface CachedDataManager {
*
* <p>For {@link User}s, the most appropriate query options will be their
* {@link ContextManager#getQueryOptions(User) current active query options} if the
* corresponding player is online, and otherwise, will fallback to
* {@link ContextManager#getStaticQueryOptions() the current static query options}
* if they are offline.</p>
* corresponding player is online, and otherwise, will fall back to
* {@link ContextManager#getStaticQueryOptions() the current static query options}.</p>
*
* <p>For {@link Group}s, the most appropriate query options will always be
* {@link ContextManager#getStaticQueryOptions()} the current static query options.</p>
* {@link ContextManager#getStaticQueryOptions() the current static query options}.</p>
*
* @return a meta data instance
* @since 5.1
* @see PermissionHolder#getQueryOptions()
*/
@NonNull CachedMetaData getMetaData();
CachedMetaData getMetaData();
/**
* Invalidates all cached {@link CachedPermissionData} and {@link CachedMetaData}
@@ -118,7 +114,7 @@ public interface CachedDataManager {
void invalidate();
/**
* Invalidates all of the underlying Permission calculators.
* Invalidates all underlying permission calculators.
*
* <p>Can be called to allow for an update in defaults.</p>
*/
@@ -139,7 +135,7 @@ public interface CachedDataManager {
* @return a data instance
* @throws NullPointerException if contexts is null
*/
@NonNull T get(@NonNull QueryOptions queryOptions);
T get(QueryOptions queryOptions);
/**
* Calculates {@link T data}, bypassing the cache.
@@ -156,7 +152,7 @@ public interface CachedDataManager {
* @return a data instance
* @throws NullPointerException if contexts is null
*/
@NonNull T calculate(@NonNull QueryOptions queryOptions);
T calculate(QueryOptions queryOptions);
/**
* (Re)calculates data for a given context.
@@ -174,7 +170,7 @@ public interface CachedDataManager {
* @param queryOptions the query options
* @throws NullPointerException if contexts is null
*/
void recalculate(@NonNull QueryOptions queryOptions);
void recalculate(QueryOptions queryOptions);
/**
* (Re)loads permission data for a given context.
@@ -200,7 +196,7 @@ public interface CachedDataManager {
* @return a future
* @throws NullPointerException if contexts is null
*/
@NonNull CompletableFuture<? extends T> reload(@NonNull QueryOptions queryOptions);
CompletableFuture<? extends T> reload(QueryOptions queryOptions);
/**
* Recalculates data for all known contexts.
@@ -232,14 +228,14 @@ public interface CachedDataManager {
*
* @return a future
*/
@NonNull CompletableFuture<Void> reload();
CompletableFuture<Void> reload();
/**
* Invalidates any cached data instances mapped to the given context.
*
* @param queryOptions the queryOptions to invalidate for
*/
void invalidate(@NonNull QueryOptions queryOptions);
void invalidate(QueryOptions queryOptions);
/**
* Invalidates all cached data instances.
@@ -26,10 +26,12 @@
package net.luckperms.api.cacheddata;
import net.luckperms.api.metastacking.MetaStackDefinition;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable;
import net.luckperms.api.node.types.MetaNode;
import net.luckperms.api.node.types.PrefixNode;
import net.luckperms.api.node.types.SuffixNode;
import net.luckperms.api.node.types.WeightNode;
import org.jetbrains.annotations.Unmodifiable;
import org.jspecify.annotations.Nullable;
import java.util.List;
import java.util.Map;
@@ -39,16 +41,40 @@ import java.util.function.Function;
/**
* Holds cached meta lookup data for a specific set of contexts.
*
* <p>Meta data refers to {@link PrefixNode prefixes}, {@link SuffixNode suffixes} and
* {@link MetaNode meta (options)} held by a permission holder.</p>
*
* <p>All calls will account for inheritance, as well as any default data
* provided by the platform. These calls are heavily cached and are therefore
* fast.</p>
*/
public interface CachedMetaData extends CachedData {
/**
* Query a meta value for the given {@code key}.
*
* <p>This method will always return a {@link Result}, but the
* {@link Result#result() inner result} {@link String} will be null if a value
* for the given key was not found.</p>
*
* @param key the key
* @return a result containing the value
* @since 5.4
*/
Result<String, MetaNode> queryMetaValue(String key);
/**
* Gets a value for the given meta key.
*
* <p>If no such meta value exists for the given key, {@code null} is returned.</p>
*
* @param key the key
* @return the value
*/
@Nullable String getMetaValue(@NonNull String key);
default @Nullable String getMetaValue(String key) {
return queryMetaValue(key).result();
}
/**
* Gets a value for the given meta key, and runs it through the given {@code transformer}.
@@ -70,7 +96,7 @@ public interface CachedMetaData extends CachedData {
* @return the meta value
* @since 5.3
*/
default <T> @NonNull Optional<T> getMetaValue(@NonNull String key, @NonNull Function<String, ? extends T> valueTransformer) {
default <T> Optional<T> getMetaValue(String key, Function<String, ? extends T> valueTransformer) {
return Optional.ofNullable(getMetaValue(key)).map(value -> {
try {
return valueTransformer.apply(value);
@@ -81,41 +107,125 @@ public interface CachedMetaData extends CachedData {
}
/**
* Gets the holder's highest priority prefix, or null if the holder has no prefixes
* Query for a prefix.
*
* <p>This method uses the rules defined by the {@link #getPrefixStackDefinition() prefix stack}
* to produce a {@link String} output.</p>
*
* <p>Assuming the default configuration is used, this will usually be the value of the
* holder's highest priority prefix node.</p>
*
* <p>This method will always return a {@link Result}, but the
* {@link Result#result() inner result} {@link String} will be null if
* the resultant prefix stack contained no elements.</p>
*
* @return a result containing the prefix
* @since 5.4
*/
Result<String, PrefixNode> queryPrefix();
/**
* Gets the prefix.
*
* <p>This method uses the rules defined by the {@link #getPrefixStackDefinition() prefix stack}
* to produce a {@link String} output.</p>
*
* <p>Assuming the default configuration is used, this will usually be the value of the
* holder's highest priority prefix node.</p>
*
* <p>If the resultant prefix stack contained no elements, {@code null} is returned.</p>
*
* @return a prefix string, or null
*/
@Nullable String getPrefix();
default @Nullable String getPrefix() {
return queryPrefix().result();
}
/**
* Gets the holder's highest priority suffix, or null if the holder has no suffixes
* Query for a suffix.
*
* <p>This method uses the rules defined by the {@link #getSuffixStackDefinition() suffix stack}
* to produce a {@link String} output.</p>
*
* <p>Assuming the default configuration is used, this will usually be the value of the
* holder's highest priority suffix node.</p>
*
* <p>This method will always return a {@link Result}, but the
* {@link Result#result() inner result} {@link String} will be null if
* the resultant suffix stack contained no elements.</p>
*
* @return a result containing the suffix
* @since 5.4
*/
Result<String, SuffixNode> querySuffix();
/**
* Gets the suffix.
*
* <p>This method uses the rules defined by the {@link #getSuffixStackDefinition() suffix stack}
* to produce a {@link String} output.</p>
*
* <p>Assuming the default configuration is used, this will usually be the value of the
* holder's highest priority suffix node.</p>
*
* <p>If the resultant suffix stack contained no elements, {@code null} is returned.</p>
*
* @return a suffix string, or null
*/
@Nullable String getSuffix();
default @Nullable String getSuffix() {
return querySuffix().result();
}
/**
* Gets an immutable copy of the meta this holder has.
* Query for a weight.
*
* @return an immutable map of meta
* <p>This method will always return a {@link Result}, and the
* {@link Result#result() inner result} {@link Integer} will never be null.
* A value of {@code 0} is equivalent to null.</p>
*
* @return a result containing the weight
* @since 5.5
*/
@NonNull @Unmodifiable Map<String, List<String>> getMeta();
Result<Integer, WeightNode> queryWeight();
/**
* Gets an immutable sorted map of all of the prefixes the holder has, whereby the first
* value is the highest priority prefix.
* Gets the weight.
*
* <p>If the there is no defined weight, {@code 0} is returned.</p>
*
* @return the weight
* @since 5.5
*/
default int getWeight() {
return queryWeight().result();
}
/**
* Gets a map of all accumulated {@link MetaNode meta}.
*
* <p>Prefer using the {@link #getMetaValue(String)} method for querying values.</p>
*
* @return a map of meta
*/
@Unmodifiable Map<String, List<String>> getMeta();
/**
* Gets a sorted map of all accumulated {@link PrefixNode prefixes}.
*
* <p>Prefer using the {@link #getPrefix()} method for querying.</p>
*
* @return a sorted map of prefixes
*/
@NonNull @Unmodifiable SortedMap<Integer, String> getPrefixes();
@Unmodifiable SortedMap<Integer, String> getPrefixes();
/**
* Gets an immutable sorted map of all of the suffixes the holder has, whereby the first
* value is the highest priority suffix.
* Gets a sorted map of all accumulated {@link SuffixNode suffixes}.
*
* <p>Prefer using the {@link #getSuffix()} method for querying.</p>
*
* @return a sorted map of suffixes
*/
@NonNull @Unmodifiable SortedMap<Integer, String> getSuffixes();
@Unmodifiable SortedMap<Integer, String> getSuffixes();
/**
* Gets the name of the holders primary group.
@@ -128,17 +238,17 @@ public interface CachedMetaData extends CachedData {
@Nullable String getPrimaryGroup();
/**
* Gets the definition used for the prefix stack
* Gets the definition used for the prefix stack.
*
* @return the definition used for the prefix stack
*/
@NonNull MetaStackDefinition getPrefixStackDefinition();
MetaStackDefinition getPrefixStackDefinition();
/**
* Gets the definition used for the suffix stack
* Gets the definition used for the suffix stack.
*
* @return the definition used for the suffix stack
*/
@NonNull MetaStackDefinition getSuffixStackDefinition();
MetaStackDefinition getSuffixStackDefinition();
}
@@ -25,26 +25,47 @@
package net.luckperms.api.cacheddata;
import net.luckperms.api.node.Node;
import net.luckperms.api.util.Tristate;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.jetbrains.annotations.Unmodifiable;
import java.util.Map;
/**
* Holds cached permission lookup data for a specific set of contexts.
*
* <p>All calls will account for inheritance, as well as any default data
* provided by the platform. These calls are heavily cached and are therefore
* fast.</p>
*/
public interface CachedPermissionData extends CachedData {
/**
* Gets a permission check result for the given permission node.
* Performs a permission check for the given {@code permission} node.
*
* <p>This check is equivalent to the "hasPermission" method call on most platforms.
* You can use {@link Tristate#asBoolean()} if you need a truthy result.</p>
*
* @param permission the permission node
* @return a result containing the tristate
* @throws NullPointerException if permission is null
* @since 5.4
*/
Result<Tristate, Node> queryPermission(String permission);
/**
* Performs a permission check for the given {@code permission} node.
*
* <p>This check is equivalent to the "hasPermission" method call on most platforms.
* You can use {@link Tristate#asBoolean()} if you need a truthy result.</p>
*
* @param permission the permission node
* @return a tristate result
* @throws NullPointerException if permission is null
*/
@NonNull Tristate checkPermission(@NonNull String permission);
default Tristate checkPermission(String permission) {
return queryPermission(permission).result();
}
/**
* Invalidates the underlying permission calculator cache.
@@ -58,6 +79,6 @@ public interface CachedPermissionData extends CachedData {
*
* @return an immutable set of permissions
*/
@NonNull @Unmodifiable Map<String, Boolean> getPermissionMap();
@Unmodifiable Map<String, Boolean> getPermissionMap();
}
@@ -0,0 +1,81 @@
/*
* This file is part of LuckPerms, licensed under the MIT License.
*
* Copyright (c) lucko (Luck) <luck@lucko.me>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package net.luckperms.api.cacheddata;
import net.luckperms.api.node.Node;
import org.jspecify.annotations.Nullable;
/**
* Represents the result of a cached data lookup.
*
* <p>You can find "the holder that has the node that caused this result"
* using the following code:</p>
* <p></p>
* <blockquote>
* <pre>
* public static {@link net.luckperms.api.model.PermissionHolder.Identifier} holderThatHasTheNodeThatCausedTheResult(Result&lt;?, ?&gt; result) {
* {@link Node} node = result.node();
* if (node == null) {
* return null;
* }
* {@link net.luckperms.api.node.metadata.types.InheritanceOriginMetadata} origin = node.getMetadata(InheritanceOriginMetadata.KEY).orElse(null);
* if (origin == null) {
* return null;
* }
* return origin.getOrigin();
* }
* </pre>
*
* <p>Combined with the node itself, this is all the information needed to determine
* the root cause of the result.</p>
* </blockquote>
*
* <p>The nullability of {@link #result()} is purposely undefined to allow the
* flexibility for methods using {@link Result} to declare it. In general, if the {@code T} type
* has a nullable/undefined value, then the return of {@link #result()} will be non-null,
* and if not, it will be nullable.</p>
*
* @param <T> the result type
* @param <N> the node type
* @since 5.4
*/
public interface Result<T, N extends Node> {
/**
* Gets the underlying result.
*
* @return the underlying result
*/
T result();
/**
* Gets the node that caused the result.
*
* @return the causing node
*/
@Nullable N node();
}
@@ -24,7 +24,8 @@
*/
/**
* CachedData lookup API for {@link net.luckperms.api.model.user.User}s and
* Caches permission checks and meta lookups for {@link net.luckperms.api.model.user.User}s and
* {@link net.luckperms.api.model.group.Group}s.
*/
@org.jspecify.annotations.NullMarked
package net.luckperms.api.cacheddata;
@@ -25,8 +25,7 @@
package net.luckperms.api.context;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jspecify.annotations.Nullable;
/**
* Represents an individual context pair.
@@ -89,13 +88,13 @@ public interface Context {
*
* @return the key
*/
@NonNull String getKey();
String getKey();
/**
* Gets the context value
*
* @return the value
*/
@NonNull String getValue();
String getValue();
}
@@ -25,7 +25,7 @@
package net.luckperms.api.context;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.jspecify.annotations.Nullable;
import java.util.Objects;
import java.util.function.Function;
@@ -38,8 +38,8 @@ import java.util.function.Function;
* <ul>
* <li>Context lookups should be <i>fast</i>: lookup methods are likely to
* be invoked frequently, and should therefore be fast to execute. If
* determining the current contexts involves a particularly time consuming
* lookup (database queries, network requests, etc), then such results
* determining the current contexts involves a particularly time-consuming
* lookup (database queries, network requests, etc.), then such results
* should be cached ahead of time.</li>
*
* <li>Context lookups should be <i>thread-safe</i>: lookups will sometimes
@@ -70,7 +70,7 @@ public interface ContextCalculator<T> {
* @param <T> the contextual type
* @return the resultant calculator
*/
static <T> @NonNull ContextCalculator<T> forSingleContext(@NonNull String key, @NonNull Function<T, String> valueFunction) {
static <T> ContextCalculator<T> forSingleContext(String key, Function<T, @Nullable String> valueFunction) {
Objects.requireNonNull(key, "key");
Objects.requireNonNull(valueFunction, "valueFunction");
return (target, consumer) -> {
@@ -92,7 +92,7 @@ public interface ContextCalculator<T> {
* @param target the target contextual subject for this operation
* @param consumer the {@link ContextConsumer} to submit contexts to
*/
void calculate(@NonNull T target, @NonNull ContextConsumer consumer);
void calculate(T target, ContextConsumer consumer);
/**
* Gets a {@link ContextSet}, containing some/all of the contexts this
@@ -25,8 +25,6 @@
package net.luckperms.api.context;
import org.checkerframework.checker.nullness.qual.NonNull;
/**
* Functional interface that accepts context key value pairs.
*/
@@ -39,14 +37,14 @@ public interface ContextConsumer {
* @param key the key
* @param value the value
*/
void accept(@NonNull String key, @NonNull String value);
void accept(String key, String value);
/**
* Accepts a context pair.
*
* @param context the context
*/
default void accept(@NonNull Context context) {
default void accept(Context context) {
accept(context.getKey(), context.getValue());
}
@@ -55,7 +53,7 @@ public interface ContextConsumer {
*
* @param contextSet the context set
*/
default void accept(@NonNull ContextSet contextSet) {
default void accept(ContextSet contextSet) {
for (Context entry : contextSet) {
accept(entry);
}
@@ -28,8 +28,6 @@ package net.luckperms.api.context;
import net.luckperms.api.model.user.User;
import net.luckperms.api.query.QueryMode;
import net.luckperms.api.query.QueryOptions;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.jetbrains.annotations.ApiStatus.Internal;
import java.util.Optional;
@@ -62,7 +60,7 @@ public interface ContextManager {
* @param subject the subject
* @return the applicable context for the subject
*/
@NonNull ImmutableContextSet getContext(@NonNull Object subject);
ImmutableContextSet getContext(Object subject);
/**
* Queries the ContextManager for current context values for the given User.
@@ -77,7 +75,7 @@ public interface ContextManager {
* @param user the user
* @return the applicable context for the subject
*/
@NonNull Optional<ImmutableContextSet> getContext(@NonNull User user);
Optional<ImmutableContextSet> getContext(User user);
/**
* Gets the contexts from the static calculators in this manager.
@@ -87,7 +85,7 @@ public interface ContextManager {
*
* @return the current active static contexts
*/
@NonNull ImmutableContextSet getStaticContext();
ImmutableContextSet getStaticContext();
/**
* Creates a new {@link QueryOptions.Builder}.
@@ -95,7 +93,7 @@ public interface ContextManager {
* @param mode the mode
* @return a new query options builder
*/
QueryOptions.@NonNull Builder queryOptionsBuilder(@NonNull QueryMode mode);
QueryOptions.Builder queryOptionsBuilder(QueryMode mode);
/**
* Obtains current {@link QueryOptions} for the subject.
@@ -103,7 +101,7 @@ public interface ContextManager {
* @param subject the subject
* @return the query options for the subject
*/
@NonNull QueryOptions getQueryOptions(@NonNull Object subject);
QueryOptions getQueryOptions(Object subject);
/**
* Obtains current {@link QueryOptions} for the given User.
@@ -117,28 +115,28 @@ public interface ContextManager {
* @param user the user
* @return the query options for the subject
*/
@NonNull Optional<QueryOptions> getQueryOptions(@NonNull User user);
Optional<QueryOptions> getQueryOptions(User user);
/**
* Gets the static query options, using the registered static context calculators.
*
* @return the current static query options
*/
@NonNull QueryOptions getStaticQueryOptions();
QueryOptions getStaticQueryOptions();
/**
* Registers a context calculator with the manager.
*
* @param calculator the calculator
*/
void registerCalculator(@NonNull ContextCalculator<?> calculator);
void registerCalculator(ContextCalculator<?> calculator);
/**
* Unregisters a context calculator with the manager.
*
* @param calculator the calculator
*/
void unregisterCalculator(@NonNull ContextCalculator<?> calculator);
void unregisterCalculator(ContextCalculator<?> calculator);
/**
* Signal to the {@link ContextManager} that a {@code subject}s
@@ -150,7 +148,7 @@ public interface ContextManager {
* @param subject the subject
* @since 5.2
*/
void signalContextUpdate(@NonNull Object subject);
void signalContextUpdate(Object subject);
/**
* Gets the {@link ContextSetFactory}, responsible for creating
@@ -159,7 +157,7 @@ public interface ContextManager {
* @return the context set factory
*/
@Internal
@NonNull ContextSetFactory getContextSetFactory();
ContextSetFactory getContextSetFactory();
/**
* Invalidates the lookup cache for a given subject
@@ -168,7 +166,7 @@ public interface ContextManager {
* @deprecated Use {@link #signalContextUpdate(Object)} instead
*/
@Deprecated
default void invalidateCache(@NonNull Object subject) {
default void invalidateCache(Object subject) {
signalContextUpdate(subject);
}
@@ -25,7 +25,6 @@
package net.luckperms.api.context;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.jetbrains.annotations.Unmodifiable;
import java.util.Iterator;
@@ -65,7 +64,7 @@ import java.util.Set;
* the '{@code :}' character. (e.g. "{@code worldguard:region}" for WorldGuard
* regions)</p>
*
* <p>Contexts can be combined with each other to form so called
* <p>Contexts can be combined with each other to form so-called
* "context sets" - simply a collection of context pairs.</p>
*
* <p>Two default ContextSet implementations are provided.
@@ -91,7 +90,7 @@ public interface ContextSet extends Iterable<Context> {
*
* @return an immutable representation of this set
*/
@NonNull ImmutableContextSet immutableCopy();
ImmutableContextSet immutableCopy();
/**
* Creates a mutable copy of this {@link ContextSet}.
@@ -101,7 +100,7 @@ public interface ContextSet extends Iterable<Context> {
*
* @return a mutable ContextSet
*/
@NonNull MutableContextSet mutableCopy();
MutableContextSet mutableCopy();
/**
* Returns a {@link Set} of {@link Context}s representing the current
@@ -112,7 +111,7 @@ public interface ContextSet extends Iterable<Context> {
*
* @return an immutable set
*/
@NonNull @Unmodifiable Set<Context> toSet();
@Unmodifiable Set<Context> toSet();
/**
* Returns a {@link Map} representing the current state of this
@@ -123,7 +122,7 @@ public interface ContextSet extends Iterable<Context> {
*
* @return a map
*/
@NonNull @Unmodifiable Map<String, Set<String>> toMap();
@Unmodifiable Map<String, Set<String>> toMap();
/**
* Returns a {@link Map} <b>loosely</b> representing the current state of
@@ -139,7 +138,7 @@ public interface ContextSet extends Iterable<Context> {
* @deprecated Deprecated because the returned map may not contain all data in the ContextSet
*/
@Deprecated
@NonNull @Unmodifiable Map<String, String> toFlattenedMap();
@Unmodifiable Map<String, String> toFlattenedMap();
/**
* Returns an {@link Iterator} over each of the context pairs in this set.
@@ -152,7 +151,7 @@ public interface ContextSet extends Iterable<Context> {
* @return an iterator
*/
@Override
@NonNull @Unmodifiable Iterator<Context> iterator();
@Unmodifiable Iterator<Context> iterator();
/**
* Returns if the {@link ContextSet} contains at least one value for the
@@ -162,7 +161,7 @@ public interface ContextSet extends Iterable<Context> {
* @return true if the set contains a value for the key
* @throws NullPointerException if the key is null
*/
boolean containsKey(@NonNull String key);
boolean containsKey(String key);
/**
* Returns a {@link Set} of the values mapped to the given key.
@@ -174,7 +173,7 @@ public interface ContextSet extends Iterable<Context> {
* @return a set of values
* @throws NullPointerException if the key is null
*/
@NonNull @Unmodifiable Set<String> getValues(@NonNull String key);
@Unmodifiable Set<String> getValues(String key);
/**
* Returns any value from this {@link ContextSet} matching the key, if present.
@@ -185,7 +184,7 @@ public interface ContextSet extends Iterable<Context> {
* @param key the key to find values for
* @return an optional containing any match
*/
default @NonNull Optional<String> getAnyValue(@NonNull String key) {
default Optional<String> getAnyValue(String key) {
return getValues(key).stream().findAny();
}
@@ -197,7 +196,7 @@ public interface ContextSet extends Iterable<Context> {
* @return true if the set contains the context pair
* @throws NullPointerException if the key or value is null
*/
boolean contains(@NonNull String key, @NonNull String value);
boolean contains(String key, String value);
/**
* Returns if the {@link ContextSet} contains a given context pairing.
@@ -206,7 +205,7 @@ public interface ContextSet extends Iterable<Context> {
* @return true if the set contains the context pair
* @throws NullPointerException if the key or value is null
*/
default boolean contains(@NonNull Context entry) {
default boolean contains(Context entry) {
Objects.requireNonNull(entry, "entry");
return contains(entry.getKey(), entry.getValue());
}
@@ -219,7 +218,7 @@ public interface ContextSet extends Iterable<Context> {
* @return true if the set contains any of the pairs
* @since 5.2
*/
default boolean containsAny(@NonNull String key, @NonNull Iterable<String> values) {
default boolean containsAny(String key, Iterable<String> values) {
Objects.requireNonNull(key, "key");
Objects.requireNonNull(values, "values");
@@ -239,7 +238,7 @@ public interface ContextSet extends Iterable<Context> {
* @param other the other set
* @return true if this context set is satisfied by the other
*/
default boolean isSatisfiedBy(@NonNull ContextSet other) {
default boolean isSatisfiedBy(ContextSet other) {
return isSatisfiedBy(other, ContextSatisfyMode.AT_LEAST_ONE_VALUE_PER_KEY);
}
@@ -252,7 +251,7 @@ public interface ContextSet extends Iterable<Context> {
* @return true if this context set is satisfied by the other
* @since 5.2
*/
boolean isSatisfiedBy(@NonNull ContextSet other, @NonNull ContextSatisfyMode mode);
boolean isSatisfiedBy(ContextSet other, ContextSatisfyMode mode);
/**
* Returns if the {@link ContextSet} is empty.
@@ -25,7 +25,6 @@
package net.luckperms.api.context;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.jetbrains.annotations.ApiStatus.Internal;
/**
@@ -40,10 +39,10 @@ public interface ContextSetFactory {
/**
* Prefer using {@link ImmutableContextSet#builder()}.
*
* @return a immutable context set builder
* @return an immutable context set builder
* @see ImmutableContextSet#builder()
*/
ImmutableContextSet.@NonNull Builder immutableBuilder();
ImmutableContextSet.Builder immutableBuilder();
/**
* Prefer using {@link ImmutableContextSet#of(String, String)}.
@@ -53,7 +52,7 @@ public interface ContextSetFactory {
* @return an immutable context set
* @see ImmutableContextSet#of(String, String)
*/
@NonNull ImmutableContextSet immutableOf(@NonNull String key, @NonNull String value);
ImmutableContextSet immutableOf(String key, String value);
/**
* Prefer using {@link ImmutableContextSet#empty()}.
@@ -61,7 +60,7 @@ public interface ContextSetFactory {
* @return an empty immutable context set
* @see ImmutableContextSet#empty()
*/
@NonNull ImmutableContextSet immutableEmpty();
ImmutableContextSet immutableEmpty();
/**
* Prefer using {@link MutableContextSet#create()}.
@@ -69,6 +68,6 @@ public interface ContextSetFactory {
* @return a new mutable context set
* @see MutableContextSet#create()
*/
@NonNull MutableContextSet mutable();
MutableContextSet mutable();
}
@@ -34,17 +34,17 @@ public final class DefaultContextKeys {
}
/**
* The context key used to denote the name of the subjects server.
* The context key used to denote the name of the subject's server.
*/
public static final String SERVER_KEY = "server";
/**
* The context key used to denote the name of the subjects world.
* The context key used to denote the name of the subject's world.
*/
public static final String WORLD_KEY = "world";
/**
* The context key used to denote the dimension type of the subjects world.
* The context key used to denote the dimension type of the subject's world.
*
* <p>Possible values: overworld, the_nether, the_end</p>
*
@@ -53,7 +53,7 @@ public final class DefaultContextKeys {
public static final String DIMENSION_TYPE_KEY = "dimension-type";
/**
* The context key used to denote the subjects gamemode.
* The context key used to denote the subject's gamemode.
*
* <p>Possible values: survival, creative, adventure, spectator</p>
*
@@ -27,8 +27,6 @@ package net.luckperms.api.context;
import net.luckperms.api.LuckPermsProvider;
import org.checkerframework.checker.nullness.qual.NonNull;
import java.util.Objects;
/**
@@ -41,7 +39,7 @@ public interface ImmutableContextSet extends ContextSet {
*
* @return a new ImmutableContextSet builder
*/
static @NonNull Builder builder() {
static Builder builder() {
return LuckPermsProvider.get().getContextManager().getContextSetFactory().immutableBuilder();
}
@@ -50,7 +48,7 @@ public interface ImmutableContextSet extends ContextSet {
*
* @return an empty ImmutableContextSet
*/
static @NonNull ImmutableContextSet empty() {
static ImmutableContextSet empty() {
return LuckPermsProvider.get().getContextManager().getContextSetFactory().immutableEmpty();
}
@@ -62,7 +60,7 @@ public interface ImmutableContextSet extends ContextSet {
* @return a new ImmutableContextSet containing one context pair
* @throws NullPointerException if key or value is null
*/
static @NonNull ImmutableContextSet of(@NonNull String key, @NonNull String value) {
static ImmutableContextSet of(String key, String value) {
return LuckPermsProvider.get().getContextManager().getContextSetFactory().immutableOf(key, value);
}
@@ -71,7 +69,7 @@ public interface ImmutableContextSet extends ContextSet {
*/
@Override
@Deprecated
@NonNull ImmutableContextSet immutableCopy();
ImmutableContextSet immutableCopy();
/**
* A builder for {@link ImmutableContextSet}.
@@ -87,7 +85,7 @@ public interface ImmutableContextSet extends ContextSet {
* @throws NullPointerException if the key or value is null
* @see MutableContextSet#add(String, String)
*/
@NonNull Builder add(@NonNull String key, @NonNull String value);
Builder add(String key, String value);
/**
* Adds a context to the set.
@@ -97,7 +95,7 @@ public interface ImmutableContextSet extends ContextSet {
* @throws NullPointerException if the entry is null
* @see MutableContextSet#add(Context)
*/
default @NonNull Builder add(@NonNull Context entry) {
default Builder add(Context entry) {
Objects.requireNonNull(entry, "entry");
add(entry.getKey(), entry.getValue());
return this;
@@ -111,7 +109,7 @@ public interface ImmutableContextSet extends ContextSet {
* @throws NullPointerException if iterable is null
* @see MutableContextSet#addAll(Iterable)
*/
default @NonNull Builder addAll(@NonNull Iterable<Context> iterable) {
default Builder addAll(Iterable<Context> iterable) {
for (Context e : Objects.requireNonNull(iterable, "iterable")) {
add(e);
}
@@ -119,14 +117,14 @@ public interface ImmutableContextSet extends ContextSet {
}
/**
* Adds of of the contexts in another {@link ContextSet} to the set.
* Adds all the contexts in another {@link ContextSet} to the set.
*
* @param contextSet the set to add from
* @return the builder
* @throws NullPointerException if the contextSet is null
* @see MutableContextSet#addAll(ContextSet)
*/
@NonNull Builder addAll(@NonNull ContextSet contextSet);
Builder addAll(ContextSet contextSet);
/**
* Creates a {@link ImmutableContextSet} from the values previously
@@ -134,6 +132,6 @@ public interface ImmutableContextSet extends ContextSet {
*
* @return an {@link ImmutableContextSet} from the builder
*/
@NonNull ImmutableContextSet build();
ImmutableContextSet build();
}
}
@@ -27,8 +27,6 @@ package net.luckperms.api.context;
import net.luckperms.api.LuckPermsProvider;
import org.checkerframework.checker.nullness.qual.NonNull;
import java.util.Objects;
/**
@@ -41,7 +39,7 @@ public interface MutableContextSet extends ContextSet {
*
* @return a new MutableContextSet
*/
static @NonNull MutableContextSet create() {
static MutableContextSet create() {
return LuckPermsProvider.get().getContextManager().getContextSetFactory().mutable();
}
@@ -53,7 +51,7 @@ public interface MutableContextSet extends ContextSet {
* @return a new MutableContextSet containing one context pair
* @throws NullPointerException if key or value is null
*/
static @NonNull MutableContextSet of(@NonNull String key, @NonNull String value) {
static MutableContextSet of(String key, String value) {
Objects.requireNonNull(key, "key");
Objects.requireNonNull(value, "value");
MutableContextSet set = create();
@@ -68,7 +66,7 @@ public interface MutableContextSet extends ContextSet {
* @param value the value to add
* @throws NullPointerException if the key or value is null
*/
void add(@NonNull String key, @NonNull String value);
void add(String key, String value);
/**
* Adds a context to this set.
@@ -76,7 +74,7 @@ public interface MutableContextSet extends ContextSet {
* @param entry the entry to add
* @throws NullPointerException if the entry is null
*/
default void add(@NonNull Context entry) {
default void add(Context entry) {
Objects.requireNonNull(entry, "entry");
add(entry.getKey(), entry.getValue());
}
@@ -87,19 +85,19 @@ public interface MutableContextSet extends ContextSet {
* @param iterable an iterable of key value context pairs
* @throws NullPointerException if iterable is null
*/
default void addAll(@NonNull Iterable<Context> iterable) {
default void addAll(Iterable<Context> iterable) {
for (Context e : Objects.requireNonNull(iterable, "iterable")) {
add(e);
}
}
/**
* Adds of of the contexts in another {@link ContextSet} to this set.
* Adds all the contexts in another {@link ContextSet} to this set.
*
* @param contextSet the set to add from
* @throws NullPointerException if the contextSet is null
*/
void addAll(@NonNull ContextSet contextSet);
void addAll(ContextSet contextSet);
/**
* Removes a context from this set.
@@ -108,7 +106,7 @@ public interface MutableContextSet extends ContextSet {
* @param value the value to remove
* @throws NullPointerException if the key or value is null
*/
void remove(@NonNull String key, @NonNull String value);
void remove(String key, String value);
/**
* Removes all contexts from this set with the given key.
@@ -116,7 +114,7 @@ public interface MutableContextSet extends ContextSet {
* @param key the key to remove
* @throws NullPointerException if the key is null
*/
void removeAll(@NonNull String key);
void removeAll(String key);
/**
* Removes all contexts from the set.
@@ -25,7 +25,7 @@
package net.luckperms.api.context;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.jspecify.annotations.Nullable;
import java.util.Objects;
import java.util.function.Supplier;
@@ -46,7 +46,7 @@ public interface StaticContextCalculator extends ContextCalculator<Object> {
* if the value returned is null.
* @return the resultant calculator
*/
static StaticContextCalculator forSingleContext(String key, Supplier<String> valueFunction) {
static StaticContextCalculator forSingleContext(String key, Supplier<@Nullable String> valueFunction) {
Objects.requireNonNull(key, "key");
Objects.requireNonNull(valueFunction, "valueFunction");
return consumer -> {
@@ -66,10 +66,10 @@ public interface StaticContextCalculator extends ContextCalculator<Object> {
*
* @param consumer the {@link ContextConsumer} to submit contexts to
*/
void calculate(@NonNull ContextConsumer consumer);
void calculate(ContextConsumer consumer);
@Override
default void calculate(@NonNull Object target, @NonNull ContextConsumer consumer) {
default void calculate(Object target, ContextConsumer consumer) {
calculate(consumer);
}
}
@@ -27,4 +27,5 @@
* Context functionality, including {@link net.luckperms.api.context.ContextSet}s and
* {@link net.luckperms.api.context.ContextCalculator}s.
*/
@org.jspecify.annotations.NullMarked
package net.luckperms.api.context;
@@ -25,7 +25,6 @@
package net.luckperms.api.event;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.jetbrains.annotations.Unmodifiable;
import java.util.Set;
@@ -50,7 +49,7 @@ public interface EventBus {
* @param <T> the event class
* @return an event handler instance representing this subscription
*/
<T extends LuckPermsEvent> @NonNull EventSubscription<T> subscribe(@NonNull Class<T> eventClass, @NonNull Consumer<? super T> handler);
<T extends LuckPermsEvent> EventSubscription<T> subscribe(Class<T> eventClass, Consumer<? super T> handler);
/**
* Registers a new subscription to the given event.
@@ -70,7 +69,7 @@ public interface EventBus {
* @param handler the event handler
* @return an event handler instance representing this subscription
*/
<T extends LuckPermsEvent> @NonNull EventSubscription<T> subscribe(Object plugin, @NonNull Class<T> eventClass, @NonNull Consumer<? super T> handler);
<T extends LuckPermsEvent> EventSubscription<T> subscribe(Object plugin, Class<T> eventClass, Consumer<? super T> handler);
/**
* Gets a set of all registered handlers for a given event.
@@ -79,6 +78,6 @@ public interface EventBus {
* @param <T> the event class
* @return an immutable set of event handlers
*/
<T extends LuckPermsEvent> @NonNull @Unmodifiable Set<EventSubscription<T>> getSubscriptions(@NonNull Class<T> eventClass);
<T extends LuckPermsEvent> @Unmodifiable Set<EventSubscription<T>> getSubscriptions(Class<T> eventClass);
}
@@ -25,8 +25,6 @@
package net.luckperms.api.event;
import org.checkerframework.checker.nullness.qual.NonNull;
import java.util.function.Consumer;
/**
@@ -41,7 +39,7 @@ public interface EventSubscription<T extends LuckPermsEvent> extends AutoCloseab
*
* @return the event class
*/
@NonNull Class<T> getEventClass();
Class<T> getEventClass();
/**
* Returns true if this handler is active
@@ -61,5 +59,5 @@ public interface EventSubscription<T extends LuckPermsEvent> extends AutoCloseab
*
* @return the event consumer
*/
@NonNull Consumer<? super T> getHandler();
Consumer<? super T> getHandler();
}
@@ -27,8 +27,6 @@ package net.luckperms.api.event;
import net.luckperms.api.LuckPerms;
import org.checkerframework.checker.nullness.qual.NonNull;
/**
* A superinterface for all LuckPerms events.
*/
@@ -39,13 +37,13 @@ public interface LuckPermsEvent {
*
* @return the api instance
*/
@NonNull LuckPerms getLuckPerms();
LuckPerms getLuckPerms();
/**
* Gets the type of the event.
*
* @return the type of the event
*/
@NonNull Class<? extends LuckPermsEvent> getEventType();
Class<? extends LuckPermsEvent> getEventType();
}
@@ -26,4 +26,5 @@
/**
* Event causes.
*/
@org.jspecify.annotations.NullMarked
package net.luckperms.api.event.cause;
@@ -29,8 +29,6 @@ import net.luckperms.api.context.ContextManager;
import net.luckperms.api.event.LuckPermsEvent;
import net.luckperms.api.event.util.Param;
import org.checkerframework.checker.nullness.qual.NonNull;
import java.util.Optional;
/**
@@ -59,16 +57,16 @@ public interface ContextUpdateEvent extends LuckPermsEvent {
* @return the subject
*/
@Param(0)
@NonNull Object getSubject();
Object getSubject();
/**
* Gets the subject whose contexts were updated, casted to a given type.
* Gets the subject whose contexts were updated, cast to a given type.
*
* @param subjectClass the type to cast to
* @param <T> the subject type
* @return the casted subject
* @return the cast subject
*/
default <T> @NonNull Optional<T> getSubject(@NonNull Class<T> subjectClass) {
default <T> Optional<T> getSubject(Class<T> subjectClass) {
Object subject = getSubject();
return subjectClass.isInstance(subject) ? Optional.of(subjectClass.cast(subject)) : Optional.empty();
}
@@ -26,4 +26,5 @@
/**
* Events relating to {@link net.luckperms.api.context.Context}s.
*/
@org.jspecify.annotations.NullMarked
package net.luckperms.api.event.context;
@@ -29,8 +29,6 @@ import net.luckperms.api.event.LuckPermsEvent;
import net.luckperms.api.event.util.Param;
import net.luckperms.api.extension.Extension;
import org.checkerframework.checker.nullness.qual.NonNull;
/**
* Called when an {@link Extension} is loaded.
*/
@@ -42,6 +40,6 @@ public interface ExtensionLoadEvent extends LuckPermsEvent {
* @return the extension
*/
@Param(0)
@NonNull Extension getExtension();
Extension getExtension();
}
@@ -26,4 +26,5 @@
/**
* Events relating to {@link net.luckperms.api.extension.Extension}s.
*/
@org.jspecify.annotations.NullMarked
package net.luckperms.api.event.extension;
@@ -30,8 +30,6 @@ import net.luckperms.api.event.LuckPermsEvent;
import net.luckperms.api.event.util.Param;
import net.luckperms.api.model.group.Group;
import org.checkerframework.checker.nullness.qual.NonNull;
/**
* Called when a groups {@link CachedDataManager} is loaded.
*/
@@ -43,7 +41,7 @@ public interface GroupCacheLoadEvent extends LuckPermsEvent {
* @return the group
*/
@Param(0)
@NonNull Group getGroup();
Group getGroup();
/**
* Gets the data that was loaded
@@ -51,6 +49,6 @@ public interface GroupCacheLoadEvent extends LuckPermsEvent {
* @return the loaded data
*/
@Param(1)
@NonNull CachedDataManager getLoadedData();
CachedDataManager getLoadedData();
}
@@ -30,8 +30,6 @@ import net.luckperms.api.event.cause.CreationCause;
import net.luckperms.api.event.util.Param;
import net.luckperms.api.model.group.Group;
import org.checkerframework.checker.nullness.qual.NonNull;
/**
* Called when a group is created
*/
@@ -43,7 +41,7 @@ public interface GroupCreateEvent extends LuckPermsEvent {
* @return the new group
*/
@Param(0)
@NonNull Group getGroup();
Group getGroup();
/**
* Gets the cause of the creation
@@ -51,6 +49,6 @@ public interface GroupCreateEvent extends LuckPermsEvent {
* @return the cause of the creation
*/
@Param(1)
@NonNull CreationCause getCause();
CreationCause getCause();
}
@@ -30,8 +30,6 @@ import net.luckperms.api.event.LuckPermsEvent;
import net.luckperms.api.event.util.Param;
import net.luckperms.api.model.group.Group;
import org.checkerframework.checker.nullness.qual.NonNull;
/**
* Called when a groups cached data is refreshed
*/
@@ -43,7 +41,7 @@ public interface GroupDataRecalculateEvent extends LuckPermsEvent {
* @return the group
*/
@Param(0)
@NonNull Group getGroup();
Group getGroup();
/**
* Gets the data that was recalculated
@@ -51,6 +49,6 @@ public interface GroupDataRecalculateEvent extends LuckPermsEvent {
* @return the data
*/
@Param(1)
@NonNull CachedDataManager getData();
CachedDataManager getData();
}
@@ -30,8 +30,6 @@ import net.luckperms.api.event.cause.DeletionCause;
import net.luckperms.api.event.util.Param;
import net.luckperms.api.node.Node;
import org.checkerframework.checker.nullness.qual.NonNull;
import java.util.Set;
/**
@@ -45,7 +43,7 @@ public interface GroupDeleteEvent extends LuckPermsEvent {
* @return the name of the deleted group
*/
@Param(0)
@NonNull String getGroupName();
String getGroupName();
/**
* Gets an immutable copy of the groups existing data
@@ -53,7 +51,7 @@ public interface GroupDeleteEvent extends LuckPermsEvent {
* @return a copy of the groups existing data
*/
@Param(1)
@NonNull Set<Node> getExistingData();
Set<Node> getExistingData();
/**
* Gets the cause of the deletion
@@ -61,6 +59,6 @@ public interface GroupDeleteEvent extends LuckPermsEvent {
* @return the cause of the deletion
*/
@Param(2)
@NonNull DeletionCause getCause();
DeletionCause getCause();
}
@@ -29,12 +29,10 @@ import net.luckperms.api.event.LuckPermsEvent;
import net.luckperms.api.event.util.Param;
import net.luckperms.api.model.group.Group;
import org.checkerframework.checker.nullness.qual.NonNull;
/**
* Called when a group is loaded into memory from the storage.
*
* Note that this event is not the same as {@link GroupCreateEvent}
* <p>Note that this event is not the same as {@link GroupCreateEvent}.</p>
*/
public interface GroupLoadEvent extends LuckPermsEvent {
@@ -44,6 +42,6 @@ public interface GroupLoadEvent extends LuckPermsEvent {
* @return the group that was loaded
*/
@Param(0)
@NonNull Group getGroup();
Group getGroup();
}
@@ -26,4 +26,5 @@
/**
* Events relating to {@link net.luckperms.api.model.group.Group}s.
*/
@org.jspecify.annotations.NullMarked
package net.luckperms.api.event.group;
@@ -30,8 +30,6 @@ import net.luckperms.api.event.LuckPermsEvent;
import net.luckperms.api.event.type.Cancellable;
import net.luckperms.api.event.util.Param;
import org.checkerframework.checker.nullness.qual.NonNull;
/**
* Called when a log entry is about to be sent to notifiable players on the platform
*/
@@ -43,7 +41,7 @@ public interface LogBroadcastEvent extends LuckPermsEvent, Cancellable {
* @return the log entry to be broadcasted
*/
@Param(0)
@NonNull Action getEntry();
Action getEntry();
/**
* Gets where the log entry originated from.
@@ -51,7 +49,7 @@ public interface LogBroadcastEvent extends LuckPermsEvent, Cancellable {
* @return the origin of the log
*/
@Param(1)
@NonNull Origin getOrigin();
Origin getOrigin();
/**
* Represents where a log entry is from
@@ -30,8 +30,6 @@ import net.luckperms.api.event.LuckPermsEvent;
import net.luckperms.api.event.type.Cancellable;
import net.luckperms.api.event.util.Param;
import org.checkerframework.checker.nullness.qual.NonNull;
import java.util.UUID;
/**
@@ -45,7 +43,7 @@ public interface LogNetworkPublishEvent extends LuckPermsEvent, Cancellable {
* @return the id of the log entry being published
*/
@Param(0)
@NonNull UUID getLogId();
UUID getLogId();
/**
* Gets the log entry to be published
@@ -53,6 +51,6 @@ public interface LogNetworkPublishEvent extends LuckPermsEvent, Cancellable {
* @return the log entry to be published
*/
@Param(1)
@NonNull Action getEntry();
Action getEntry();
}
@@ -31,8 +31,6 @@ import net.luckperms.api.event.type.Cancellable;
import net.luckperms.api.event.util.Param;
import net.luckperms.api.platform.PlatformEntity;
import org.checkerframework.checker.nullness.qual.NonNull;
/**
* Called when a log entry is about to be sent to specific notifiable object on
* the platform.
@@ -49,7 +47,7 @@ public interface LogNotifyEvent extends LuckPermsEvent, Cancellable {
* @return the log entry to be sent
*/
@Param(0)
@NonNull Action getEntry();
Action getEntry();
/**
* Gets where the log entry originated from.
@@ -57,7 +55,7 @@ public interface LogNotifyEvent extends LuckPermsEvent, Cancellable {
* @return the origin of the log
*/
@Param(1)
@NonNull Origin getOrigin();
Origin getOrigin();
/**
* Gets the object to be notified.
@@ -65,7 +63,7 @@ public interface LogNotifyEvent extends LuckPermsEvent, Cancellable {
* @return the object to notify
*/
@Param(2)
@NonNull PlatformEntity getNotifiable();
PlatformEntity getNotifiable();
/**
* Represents where a log entry is from
@@ -30,8 +30,6 @@ import net.luckperms.api.event.LuckPermsEvent;
import net.luckperms.api.event.type.Cancellable;
import net.luckperms.api.event.util.Param;
import org.checkerframework.checker.nullness.qual.NonNull;
/**
* Called when a log is about to be published to the storage file/table
*/
@@ -43,6 +41,6 @@ public interface LogPublishEvent extends LuckPermsEvent, Cancellable {
* @return the log entry to be published
*/
@Param(0)
@NonNull Action getEntry();
Action getEntry();
}
@@ -29,12 +29,14 @@ import net.luckperms.api.actionlog.Action;
import net.luckperms.api.event.LuckPermsEvent;
import net.luckperms.api.event.util.Param;
import org.checkerframework.checker.nullness.qual.NonNull;
import java.util.UUID;
/**
* Called when a log entry is received via the MessagingService
* Called when a log entry is received via the MessagingService.
*
* <p>Note: listening to this event is the same as listening to the {@link LogBroadcastEvent}
* and filtering for {@link LogBroadcastEvent#getOrigin() origin} =
* {@link net.luckperms.api.event.log.LogBroadcastEvent.Origin#REMOTE REMOTE}.</p>
*/
public interface LogReceiveEvent extends LuckPermsEvent {
@@ -44,7 +46,7 @@ public interface LogReceiveEvent extends LuckPermsEvent {
* @return the id of the log entry being received
*/
@Param(0)
@NonNull UUID getLogId();
UUID getLogId();
/**
* Gets the log entry being received
@@ -52,6 +54,6 @@ public interface LogReceiveEvent extends LuckPermsEvent {
* @return the log entry being received
*/
@Param(1)
@NonNull Action getEntry();
Action getEntry();
}
@@ -24,6 +24,7 @@
*/
/**
* Events relating to the {@link net.luckperms.api.actionlog.ActionLog}.
* Events relating to the {@link net.luckperms.api.actionlog.ActionLogger}.
*/
@org.jspecify.annotations.NullMarked
package net.luckperms.api.event.log;
@@ -0,0 +1,58 @@
/*
* This file is part of LuckPerms, licensed under the MIT License.
*
* Copyright (c) lucko (Luck) <luck@lucko.me>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package net.luckperms.api.event.messaging;
import net.luckperms.api.event.LuckPermsEvent;
import net.luckperms.api.event.util.Param;
import net.luckperms.api.messaging.MessagingService;
/**
* Called when a custom payload message is received via the {@link MessagingService}.
*
* <p>This event is effectively the 'other end' of
* {@link MessagingService#sendCustomMessage(String, String)}.</p>
*
* @since 5.5
*/
public interface CustomMessageReceiveEvent extends LuckPermsEvent {
/**
* Gets the channel id.
*
* @return the channel id
*/
@Param(0)
String getChannelId();
/**
* Gets the custom payload that was sent.
*
* @return the custom payload
*/
@Param(1)
String getPayload();
}
@@ -0,0 +1,30 @@
/*
* This file is part of LuckPerms, licensed under the MIT License.
*
* Copyright (c) lucko (Luck) <luck@lucko.me>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
/**
* Events relating to the {@link net.luckperms.api.messaging.MessagingService}.
*/
@org.jspecify.annotations.NullMarked
package net.luckperms.api.event.messaging;
@@ -27,8 +27,6 @@ package net.luckperms.api.event.node;
import net.luckperms.api.event.util.Param;
import net.luckperms.api.node.Node;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.jetbrains.annotations.Unmodifiable;
import java.util.Collections;
@@ -46,10 +44,10 @@ public interface NodeAddEvent extends NodeMutateEvent {
* @return the node that was added
*/
@Param(3)
@NonNull Node getNode();
Node getNode();
@Override
default @NonNull @Unmodifiable Set<Node> getDataBefore() {
default @Unmodifiable Set<Node> getDataBefore() {
// Get data after, then reverse the action
Set<Node> nodes = new HashSet<>(this.getDataAfter());
nodes.remove(this.getNode());
@@ -27,8 +27,6 @@ package net.luckperms.api.event.node;
import net.luckperms.api.event.util.Param;
import net.luckperms.api.node.Node;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.jetbrains.annotations.Unmodifiable;
import java.util.Collections;
@@ -47,10 +45,10 @@ public interface NodeClearEvent extends NodeMutateEvent {
* @since 5.3
*/
@Param(3)
@NonNull @Unmodifiable Set<Node> getNodes();
@Unmodifiable Set<Node> getNodes();
@Override
default @NonNull @Unmodifiable Set<Node> getDataBefore() {
default @Unmodifiable Set<Node> getDataBefore() {
// Get data after, then reverse the action
Set<Node> nodes = new HashSet<>(this.getDataAfter());
nodes.addAll(this.getNodes());
@@ -32,8 +32,6 @@ import net.luckperms.api.model.data.DataType;
import net.luckperms.api.model.group.Group;
import net.luckperms.api.model.user.User;
import net.luckperms.api.node.Node;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.jetbrains.annotations.Unmodifiable;
import java.util.Set;
@@ -49,7 +47,7 @@ public interface NodeMutateEvent extends LuckPermsEvent {
* @return the event target
*/
@Param(0)
@NonNull PermissionHolder getTarget();
PermissionHolder getTarget();
/**
* Gets the data type that was mutated.
@@ -57,14 +55,14 @@ public interface NodeMutateEvent extends LuckPermsEvent {
* @return the data type
*/
@Param(1)
@NonNull DataType getDataType();
DataType getDataType();
/**
* Gets an immutable copy of the holders data before the change
*
* @return the data before the change
*/
@NonNull @Unmodifiable Set<Node> getDataBefore();
@Unmodifiable Set<Node> getDataBefore();
/**
* Gets an immutable copy of the holders data after the change
@@ -72,7 +70,7 @@ public interface NodeMutateEvent extends LuckPermsEvent {
* @return the data after the change
*/
@Param(2)
@NonNull @Unmodifiable Set<Node> getDataAfter();
@Unmodifiable Set<Node> getDataAfter();
/**
* Gets whether the target of this event is a {@link User}
@@ -27,8 +27,6 @@ package net.luckperms.api.event.node;
import net.luckperms.api.event.util.Param;
import net.luckperms.api.node.Node;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.jetbrains.annotations.Unmodifiable;
import java.util.Collections;
@@ -46,10 +44,10 @@ public interface NodeRemoveEvent extends NodeMutateEvent {
* @return the node that was removed
*/
@Param(3)
@NonNull Node getNode();
Node getNode();
@Override
default @NonNull @Unmodifiable Set<Node> getDataBefore() {
default @Unmodifiable Set<Node> getDataBefore() {
// Get data after, then reverse the action
Set<Node> nodes = new HashSet<>(this.getDataAfter());
nodes.add(this.getNode());
@@ -27,4 +27,5 @@
* Events relating to changes to a {@link net.luckperms.api.model.user.User} or
* {@link net.luckperms.api.model.group.Group}s {@link net.luckperms.api.model.data.NodeMap}.
*/
@org.jspecify.annotations.NullMarked
package net.luckperms.api.event.node;
@@ -26,4 +26,5 @@
/**
* Main events package.
*/
@org.jspecify.annotations.NullMarked
package net.luckperms.api.event;
@@ -30,8 +30,6 @@ import net.luckperms.api.event.util.Param;
import net.luckperms.api.model.PlayerSaveResult;
import net.luckperms.api.model.user.UserManager;
import org.checkerframework.checker.nullness.qual.NonNull;
import java.util.UUID;
/**
@@ -44,10 +42,10 @@ public interface PlayerDataSaveEvent extends LuckPermsEvent {
/**
* Gets the unique ID that was saved.
*
* @return the uuid
* @return the UUID
*/
@Param(0)
@NonNull UUID getUniqueId();
UUID getUniqueId();
/**
* Gets the username that was saved.
@@ -55,7 +53,7 @@ public interface PlayerDataSaveEvent extends LuckPermsEvent {
* @return the username
*/
@Param(1)
@NonNull String getUsername();
String getUsername();
/**
* Gets the result of the operation.
@@ -63,6 +61,6 @@ public interface PlayerDataSaveEvent extends LuckPermsEvent {
* @return the result
*/
@Param(2)
@NonNull PlayerSaveResult getResult();
PlayerSaveResult getResult();
}
@@ -29,9 +29,7 @@ import net.luckperms.api.event.LuckPermsEvent;
import net.luckperms.api.event.util.Param;
import net.luckperms.api.model.user.User;
import net.luckperms.api.util.Result;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jspecify.annotations.Nullable;
import java.util.UUID;
@@ -56,10 +54,10 @@ public interface PlayerLoginProcessEvent extends LuckPermsEvent, Result {
/**
* Gets the UUID of the connection which was processed
*
* @return the uuid of the connection which was processed
* @return the UUID of the connection which was processed
*/
@Param(0)
@NonNull UUID getUniqueId();
UUID getUniqueId();
/**
* Gets the username of the connection which was processed
@@ -67,7 +65,7 @@ public interface PlayerLoginProcessEvent extends LuckPermsEvent, Result {
* @return the username of the connection which was processed
*/
@Param(1)
@NonNull String getUsername();
String getUsername();
/**
* Gets if the login was processed successfully.
@@ -29,47 +29,61 @@ import net.luckperms.api.event.LuckPermsEvent;
import net.luckperms.api.event.type.ResultEvent;
import net.luckperms.api.event.util.Param;
import org.checkerframework.checker.nullness.qual.NonNull;
import java.util.Objects;
import java.util.UUID;
/**
* Called when the platform needs to determine the type of a player's {@link UUID unique id}.
* Called when the platform needs to determine a player's {@link UUID unique id} type.
*
* @since 5.3
*/
public interface UniqueIdDetermineTypeEvent extends LuckPermsEvent, ResultEvent<String> {
/**
* The players UUID has been obtained by authenticating with the Mojang session servers.
* The player's UUID has been obtained by authenticating with the Mojang session servers.
*
* <p>Usually indicated by the UUID being {@link UUID#version() version} 4.</p>
*/
String TYPE_AUTHENTICATED = "authenticated";
/**
* The players UUID has not been obtained through authentication, and instead is likely based
* The player's UUID has not been obtained through authentication, and instead is likely based
* on the username they connected with.
*
* <p>Usually indicated by the UUID being {@link UUID#version() version} 3.</p>
*/
String TYPE_UNAUTHENTICATED = "unauthenticated";
/**
* The player's UUID most likely belongs to a NPC (non-player character).
*
* <p>Usually indicated by the UUID being {@link UUID#version() version} 2.</p>
*
* @since 5.4
*/
String TYPE_NPC = "npc";
/**
* Unknown UUID type.
*
* @since 5.4
*/
String TYPE_UNKNOWN = "unknown";
/**
* Gets the {@link UUID unique id} being queried.
*
* @return the unique id
*/
@Param(0)
@NonNull UUID getUniqueId();
UUID getUniqueId();
/**
* Gets the current result unique id type.
*
* @return the type
*/
default @NonNull String getType() {
default String getType() {
return result().get();
}
@@ -78,7 +92,7 @@ public interface UniqueIdDetermineTypeEvent extends LuckPermsEvent, ResultEvent<
*
* @param type the type
*/
default void setType(@NonNull String type) {
default void setType(String type) {
Objects.requireNonNull(type, "type");
result().set(type);
}
@@ -28,9 +28,7 @@ package net.luckperms.api.event.player.lookup;
import net.luckperms.api.event.LuckPermsEvent;
import net.luckperms.api.event.type.ResultEvent;
import net.luckperms.api.event.util.Param;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jspecify.annotations.Nullable;
import java.util.UUID;
@@ -39,7 +37,7 @@ import java.util.UUID;
*
* @since 5.3
*/
public interface UniqueIdLookupEvent extends LuckPermsEvent, ResultEvent<UUID> {
public interface UniqueIdLookupEvent extends LuckPermsEvent, ResultEvent<@Nullable UUID> {
/**
* Gets the username being looked up.
@@ -47,7 +45,7 @@ public interface UniqueIdLookupEvent extends LuckPermsEvent, ResultEvent<UUID> {
* @return the username
*/
@Param(0)
@NonNull String getUsername();
String getUsername();
/**
* Sets the result unique id.
@@ -28,9 +28,7 @@ package net.luckperms.api.event.player.lookup;
import net.luckperms.api.event.LuckPermsEvent;
import net.luckperms.api.event.type.ResultEvent;
import net.luckperms.api.event.util.Param;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jspecify.annotations.Nullable;
import java.util.UUID;
@@ -39,7 +37,7 @@ import java.util.UUID;
*
* @since 5.3
*/
public interface UsernameLookupEvent extends LuckPermsEvent, ResultEvent<String> {
public interface UsernameLookupEvent extends LuckPermsEvent, ResultEvent<@Nullable String> {
/**
* Gets the {@link UUID unique id} being looked up.
@@ -47,7 +45,7 @@ public interface UsernameLookupEvent extends LuckPermsEvent, ResultEvent<String>
* @return the unique id
*/
@Param(0)
@NonNull UUID getUniqueId();
UUID getUniqueId();
/**
* Sets the result username.
@@ -28,8 +28,6 @@ package net.luckperms.api.event.player.lookup;
import net.luckperms.api.event.LuckPermsEvent;
import net.luckperms.api.event.util.Param;
import org.checkerframework.checker.nullness.qual.NonNull;
import java.util.concurrent.atomic.AtomicBoolean;
/**
@@ -45,7 +43,7 @@ public interface UsernameValidityCheckEvent extends LuckPermsEvent {
* @return the username
*/
@Param(0)
@NonNull String getUsername();
String getUsername();
/**
* Gets the current validity state for the username.
@@ -53,7 +51,7 @@ public interface UsernameValidityCheckEvent extends LuckPermsEvent {
* @return the validity state
*/
@Param(1)
@NonNull AtomicBoolean validityState();
AtomicBoolean validityState();
/**
* Gets if the username is currently considered to be valid.
@@ -26,4 +26,5 @@
/**
* Events relating to a player {@link java.util.UUID unique id} or username lookup.
*/
@org.jspecify.annotations.NullMarked
package net.luckperms.api.event.player.lookup;
@@ -26,4 +26,5 @@
/**
* Events relating to a player.
*/
@org.jspecify.annotations.NullMarked
package net.luckperms.api.event.player;
@@ -27,8 +27,6 @@ package net.luckperms.api.event.source;
import net.luckperms.api.platform.PlatformEntity;
import org.checkerframework.checker.nullness.qual.NonNull;
/**
* Represents an {@link PlatformEntity} which was the {@link Source} of something.
*/
@@ -39,6 +37,6 @@ public interface EntitySource extends Source {
*
* @return the entity
*/
@NonNull PlatformEntity getEntity();
PlatformEntity getEntity();
}
@@ -27,8 +27,6 @@ package net.luckperms.api.event.source;
import net.luckperms.api.platform.PlatformEntity;
import org.checkerframework.checker.nullness.qual.NonNull;
/**
* Represents the source of an event.
*
@@ -41,7 +39,7 @@ public interface Source {
*
* @return the type
*/
@NonNull Type getType();
Type getType();
/**
* Represents a type of source
@@ -26,4 +26,5 @@
/**
* Event sources.
*/
@org.jspecify.annotations.NullMarked
package net.luckperms.api.event.source;
@@ -0,0 +1,80 @@
/*
* This file is part of LuckPerms, licensed under the MIT License.
*
* Copyright (c) lucko (Luck) <luck@lucko.me>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package net.luckperms.api.event.sync;
import net.luckperms.api.event.LuckPermsEvent;
import net.luckperms.api.event.util.Param;
import org.jspecify.annotations.Nullable;
import java.util.UUID;
/**
* Called after a network synchronisation task has been completed.
*
* <p>Note: the generic {@link PostSyncEvent} will also be called for {@link SyncType#FULL full syncs}.</p>
*
* @since 5.5
*/
public interface PostNetworkSyncEvent extends LuckPermsEvent {
/**
* Gets the ID of the sync request
*
* @return the id of the sync request
*/
@Param(0)
UUID getSyncId();
/**
* Gets the sync type.
*
* @return the sync type
*/
@Param(1)
SyncType getType();
/**
* Gets if a sync occurred.
*
* <p>For {@link SyncType} = {@link SyncType#FULL FULL}, this method always returns true.</p>
*
* <p>For {@link SyncType} = {@link SyncType#SPECIFIC_USER SPECIFIC_USER}, this method returns true if the
* user in question was online/loaded in memory at the time, and false otherwise.</p>
*
* @return if a sync occurred
*/
@Param(2)
boolean didSyncOccur();
/**
* Gets the unique id of the specific user that has been synced, if applicable.
*
* @return the unique id of the specific user
*/
@Param(3)
@Nullable UUID getSpecificUserUniqueId();
}
@@ -28,7 +28,10 @@ package net.luckperms.api.event.sync;
import net.luckperms.api.event.LuckPermsEvent;
/**
* Called when an sync task has been completed
* Called after a full synchronisation task has been completed.
*
* <p>Note: this event is also called after synchronisations that were triggered over the network.
* In other words, this event will be called in addition to {@link PostNetworkSyncEvent}.</p>
*/
public interface PostSyncEvent extends LuckPermsEvent {
@@ -28,13 +28,15 @@ package net.luckperms.api.event.sync;
import net.luckperms.api.event.LuckPermsEvent;
import net.luckperms.api.event.type.Cancellable;
import net.luckperms.api.event.util.Param;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.jspecify.annotations.Nullable;
import java.util.UUID;
/**
* Called before a received network sync task runs
* Called after a request for synchronisation has been received via the messaging service,
* but before it has actually been completed.
*
* <p>Note: the generic {@link PreSyncEvent} will also be called for {@link SyncType#FULL full syncs}.</p>
*/
public interface PreNetworkSyncEvent extends LuckPermsEvent, Cancellable {
@@ -44,6 +46,24 @@ public interface PreNetworkSyncEvent extends LuckPermsEvent, Cancellable {
* @return the id of the sync request
*/
@Param(0)
@NonNull UUID getSyncId();
UUID getSyncId();
/**
* Gets the sync type.
*
* @return the sync type
* @since 5.5
*/
@Param(1)
SyncType getType();
/**
* Gets the unique id of the specific user that will be synced, if applicable.
*
* @return the unique id of the specific user
* @since 5.5
*/
@Param(2)
@Nullable UUID getSpecificUserUniqueId();
}
@@ -29,7 +29,10 @@ import net.luckperms.api.event.LuckPermsEvent;
import net.luckperms.api.event.type.Cancellable;
/**
* Called before a sync task runs
* Called just before a full synchronisation task runs.
*
* <p>Note: this event is also called before synchronisations that were triggered over the network.
* In other words, this event will be called in addition to {@link PreNetworkSyncEvent}.</p>
*/
public interface PreSyncEvent extends LuckPermsEvent, Cancellable {
@@ -23,20 +23,23 @@
* SOFTWARE.
*/
package org.spongepowered.api.service.permission;
import java.util.concurrent.CompletableFuture;
package net.luckperms.api.event.sync;
/**
* This is included, as the interface didn't exist in API6.
* We just shade it into the LP jar so we can still implement it. :)
* Represents the type of synchronisation task.
*
* @since 5.5
*/
public interface SubjectReference {
public enum SyncType {
String getCollectionIdentifier();
/**
* A full sync will be performed - all groups, users and tracks
*/
FULL,
String getSubjectIdentifier();
/**
* Only a specific user will be synced
*/
SPECIFIC_USER
CompletableFuture<Subject> resolve();
}
}
@@ -26,4 +26,5 @@
/**
* Events relating to {@link net.luckperms.api.LuckPerms#runUpdateTask() sync/update task}s.
*/
@org.jspecify.annotations.NullMarked
package net.luckperms.api.event.sync;
@@ -30,8 +30,6 @@ import net.luckperms.api.event.cause.CreationCause;
import net.luckperms.api.event.util.Param;
import net.luckperms.api.track.Track;
import org.checkerframework.checker.nullness.qual.NonNull;
/**
* Called when a track is created
*/
@@ -43,7 +41,7 @@ public interface TrackCreateEvent extends LuckPermsEvent {
* @return the new track
*/
@Param(0)
@NonNull Track getTrack();
Track getTrack();
/**
* Gets the cause of the creation
@@ -51,6 +49,6 @@ public interface TrackCreateEvent extends LuckPermsEvent {
* @return the cause of the creation
*/
@Param(1)
@NonNull CreationCause getCause();
CreationCause getCause();
}
@@ -29,8 +29,6 @@ import net.luckperms.api.event.LuckPermsEvent;
import net.luckperms.api.event.cause.DeletionCause;
import net.luckperms.api.event.util.Param;
import org.checkerframework.checker.nullness.qual.NonNull;
import java.util.List;
/**
@@ -44,7 +42,7 @@ public interface TrackDeleteEvent extends LuckPermsEvent {
* @return the name of the deleted track
*/
@Param(0)
@NonNull String getTrackName();
String getTrackName();
/**
* Gets an immutable copy of the tracks existing data
@@ -52,7 +50,7 @@ public interface TrackDeleteEvent extends LuckPermsEvent {
* @return a copy of the tracks existing data
*/
@Param(1)
@NonNull List<String> getExistingData();
List<String> getExistingData();
/**
* Gets the cause of the deletion
@@ -60,6 +58,6 @@ public interface TrackDeleteEvent extends LuckPermsEvent {
* @return the cause of the deletion
*/
@Param(2)
@NonNull DeletionCause getCause();
DeletionCause getCause();
}
@@ -29,12 +29,10 @@ import net.luckperms.api.event.LuckPermsEvent;
import net.luckperms.api.event.util.Param;
import net.luckperms.api.track.Track;
import org.checkerframework.checker.nullness.qual.NonNull;
/**
* Called when a track is loaded into memory from the storage.
*
* Note that this event is not the same as {@link TrackCreateEvent}
* <p>Note that this event is not the same as {@link TrackCreateEvent}.</p>
*/
public interface TrackLoadEvent extends LuckPermsEvent {
@@ -44,6 +42,6 @@ public interface TrackLoadEvent extends LuckPermsEvent {
* @return the track that was loaded
*/
@Param(0)
@NonNull Track getTrack();
Track getTrack();
}
@@ -27,8 +27,6 @@ package net.luckperms.api.event.track.mutate;
import net.luckperms.api.event.util.Param;
import org.checkerframework.checker.nullness.qual.NonNull;
/**
* Called when a group is added to a track
*/
@@ -40,6 +38,6 @@ public interface TrackAddGroupEvent extends TrackMutateEvent {
* @return the group that was added
*/
@Param(3)
@NonNull String getGroup();
String getGroup();
}
@@ -28,8 +28,6 @@ package net.luckperms.api.event.track.mutate;
import net.luckperms.api.event.LuckPermsEvent;
import net.luckperms.api.event.util.Param;
import net.luckperms.api.track.Track;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.jetbrains.annotations.Unmodifiable;
import java.util.List;
@@ -45,7 +43,7 @@ public interface TrackMutateEvent extends LuckPermsEvent {
* @return the track that was mutated
*/
@Param(0)
@NonNull Track getTrack();
Track getTrack();
/**
* Gets an immutable copy of the tracks data before the change
@@ -53,7 +51,7 @@ public interface TrackMutateEvent extends LuckPermsEvent {
* @return the data before the change
*/
@Param(1)
@NonNull @Unmodifiable List<String> getStateBefore();
@Unmodifiable List<String> getStateBefore();
/**
* Gets an immutable copy of the tracks data after the change
@@ -61,6 +59,6 @@ public interface TrackMutateEvent extends LuckPermsEvent {
* @return the data after the change
*/
@Param(2)
@NonNull @Unmodifiable List<String> getStateAfter();
@Unmodifiable List<String> getStateAfter();
}
@@ -27,8 +27,6 @@ package net.luckperms.api.event.track.mutate;
import net.luckperms.api.event.util.Param;
import org.checkerframework.checker.nullness.qual.NonNull;
/**
* Called when a group is removed from a track
*/
@@ -40,6 +38,6 @@ public interface TrackRemoveGroupEvent extends TrackMutateEvent {
* @return the group that was removed
*/
@Param(3)
@NonNull String getGroup();
String getGroup();
}
@@ -26,4 +26,5 @@
/**
* Events relating to changes to a {@link net.luckperms.api.track.Track}s contents.
*/
@org.jspecify.annotations.NullMarked
package net.luckperms.api.event.track.mutate;
@@ -26,4 +26,5 @@
/**
* Events relating to {@link net.luckperms.api.track.Track}s.
*/
@org.jspecify.annotations.NullMarked
package net.luckperms.api.event.track;
@@ -27,8 +27,6 @@ package net.luckperms.api.event.type;
import net.luckperms.api.event.util.Param;
import org.checkerframework.checker.nullness.qual.NonNull;
import java.util.concurrent.atomic.AtomicBoolean;
/**
@@ -42,7 +40,7 @@ public interface Cancellable {
* @return the cancellation
*/
@Param(-1)
@NonNull AtomicBoolean cancellationState();
AtomicBoolean cancellationState();
/**
* Returns true if the event is currently cancelled.
@@ -26,8 +26,7 @@
package net.luckperms.api.event.type;
import net.luckperms.api.event.util.Param;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.jspecify.annotations.Nullable;
import java.util.concurrent.atomic.AtomicReference;
@@ -37,7 +36,7 @@ import java.util.concurrent.atomic.AtomicReference;
* @param <T> the type of the result
* @since 5.3
*/
public interface ResultEvent<T> {
public interface ResultEvent<T extends @Nullable Object> {
/**
* Gets an {@link AtomicReference} containing the result.
@@ -45,7 +44,7 @@ public interface ResultEvent<T> {
* @return the result
*/
@Param(-1)
@NonNull AtomicReference<T> result();
AtomicReference<T> result();
/**
* Gets if a result has been set for the event.
@@ -28,8 +28,6 @@ package net.luckperms.api.event.type;
import net.luckperms.api.event.source.Source;
import net.luckperms.api.event.util.Param;
import org.checkerframework.checker.nullness.qual.NonNull;
/**
* Represents an event with a {@link Source}.
*/
@@ -43,6 +41,6 @@ public interface Sourced {
*
* @return the source
*/
@NonNull @Param(-1) Source getSource();
@Param(-1) Source getSource();
}
@@ -26,4 +26,5 @@
/**
* Event abstract types.
*/
@org.jspecify.annotations.NullMarked
package net.luckperms.api.event.type;
@@ -30,8 +30,6 @@ import net.luckperms.api.event.LuckPermsEvent;
import net.luckperms.api.event.util.Param;
import net.luckperms.api.model.user.User;
import org.checkerframework.checker.nullness.qual.NonNull;
/**
* Called when a users {@link CachedDataManager} is loaded.
*/
@@ -43,7 +41,7 @@ public interface UserCacheLoadEvent extends LuckPermsEvent {
* @return the user
*/
@Param(0)
@NonNull User getUser();
User getUser();
/**
* Gets the data that was loaded
@@ -51,6 +49,6 @@ public interface UserCacheLoadEvent extends LuckPermsEvent {
* @return the loaded data
*/
@Param(1)
@NonNull CachedDataManager getLoadedData();
CachedDataManager getLoadedData();
}
@@ -30,8 +30,6 @@ import net.luckperms.api.event.LuckPermsEvent;
import net.luckperms.api.event.util.Param;
import net.luckperms.api.model.user.User;
import org.checkerframework.checker.nullness.qual.NonNull;
/**
* Called when a users cached data is refreshed
*/
@@ -43,7 +41,7 @@ public interface UserDataRecalculateEvent extends LuckPermsEvent {
* @return the user
*/
@Param(0)
@NonNull User getUser();
User getUser();
/**
* Gets the data that was recalculated
@@ -51,6 +49,6 @@ public interface UserDataRecalculateEvent extends LuckPermsEvent {
* @return the data
*/
@Param(1)
@NonNull CachedDataManager getData();
CachedDataManager getData();
}
@@ -28,8 +28,6 @@ package net.luckperms.api.event.user;
import net.luckperms.api.event.LuckPermsEvent;
import net.luckperms.api.event.util.Param;
import org.checkerframework.checker.nullness.qual.NonNull;
import java.util.UUID;
/**
@@ -48,10 +46,10 @@ public interface UserFirstLoginEvent extends LuckPermsEvent {
/**
* Gets the UUID of the user
*
* @return the uuid of the user
* @return the UUID of the user
*/
@Param(0)
@NonNull UUID getUniqueId();
UUID getUniqueId();
/**
* Gets the username of the user
@@ -59,6 +57,6 @@ public interface UserFirstLoginEvent extends LuckPermsEvent {
* @return the username of the user
*/
@Param(1)
@NonNull String getUsername();
String getUsername();
}
@@ -29,8 +29,6 @@ import net.luckperms.api.event.LuckPermsEvent;
import net.luckperms.api.event.util.Param;
import net.luckperms.api.model.user.User;
import org.checkerframework.checker.nullness.qual.NonNull;
/**
* Called when a user is loaded into memory from the storage.
*/
@@ -42,6 +40,6 @@ public interface UserLoadEvent extends LuckPermsEvent {
* @return the user that was loaded
*/
@Param(0)
@NonNull User getUser();
User getUser();
}
@@ -30,8 +30,6 @@ import net.luckperms.api.event.type.Cancellable;
import net.luckperms.api.event.util.Param;
import net.luckperms.api.model.user.User;
import org.checkerframework.checker.nullness.qual.NonNull;
/**
* Called when a user is about to be unloaded from memory.
*
@@ -45,6 +43,6 @@ public interface UserUnloadEvent extends LuckPermsEvent, Cancellable {
* @return the user that is being unloaded
*/
@Param(0)
@NonNull User getUser();
User getUser();
}
@@ -26,4 +26,5 @@
/**
* Events relating to {@link net.luckperms.api.model.user.User}s.
*/
@org.jspecify.annotations.NullMarked
package net.luckperms.api.event.user;
Loaded 100 of 1087 files, more files were not shown because too many files have changed in this diff. Show more