Fix ban sync module + add option to sync to role
- Fixed Paper/Bukkit ban listeners
- Fixed NPE causing resync to silently fail
- Made .gitignore properly ignore the files generated by runServer (for me at least)
- Rearranged ban sync config
- Added option to add a role when a player is banned
There still needs to be a solution to detect unbans/bans of offline players but this will likely require a bit of a refactor so some thinking is required and I'm just going to put it on the project board for now.
Implements https://github.com/DiscordSRV/DiscordSRV/issues/334
Further todo:
- [x] Config option for whether gaining the role means you are "banned" for the purposes of discord->minecraft sync and vice versa
- [x] Listen to role add/remove to cause resync (if the above is enabled)
- [x] Improve logging of ban sync causes
- [x] Verify that banning on discord with role enabled doesn't cause errors
- [ added to board ] Ensure that timed resync also affects offline players - necessary since we've no reliable way of detecting offline players being banned
- [x] Fix order annotations
- [x] Test everything again with new config options
- [x] Fix punisher format
- [x] Banned Role: Fix banning a user in game causing a verbose error when member not in server
- [ Added to board ] Discord to minecraft sync messed up (cache??)
Placeholders seem to not be replaced at all in the punisher format for discord bans. Unsure what's causing it as I'm not too familiar with how the PlaceholderService works.
https://github.com/DiscordSRV/Ascension/blob/3bff3610c905ded29f394ac7af9aaa3140181bc9/common/src/main/java/com/discordsrv/common/feature/bansync/BanSyncModule.java#L190 https://github.com/DiscordSRV/Ascension/blob/3bff3610c905ded29f394ac7af9aaa3140181bc9/common/src/main/java/com/discordsrv/common/feature/bansync/BanSyncModule.java#L391
It's used in two different places, with two entirely different sets of contexts