Commit Graph

109 Commits

Author SHA1 Message Date
AlexDev_
d72ad289ec
feat: Improve placeholder system, add luck_perms_meta placeholder (#125) 2023-12-14 22:41:00 +00:00
AlexDev_
3b1be4142f
Improved serializer system for packet adapters & fixed bugs with nametags (#123) 2023-11-30 15:15:18 +00:00
William
4d6621c3c1
Tidy up bits of logic, use class for Nametags (#122)
* Tidy up bits of logic, use record for Nametags

* Few more bits of cleanup

* Some feedback

* More feedback

* Fix `#prefix()` and `#suffix()` record calls

* Fixup logical error

* `nameTag` -> `nametag`

* Make TabPlayer#getNametag returns TabPlayer.Nametag

---------

Co-authored-by: AlexDev_ <alessandrodalfovo2003@gmail.com>
2023-11-20 14:36:04 +00:00
AlexDev_
2becf43845
Fix for various problems (#119)
* Fixed logic problems with vanish + added tab recalculate system when luckperms fires UserDataRecalculateEvent

* Fix for https://github.com/WiIIiam278/Velocitab/issues/120 .
Fix for rgb nametags with legacy formatter.
Fix for players with escape characters in their name.
Fix for when a player is kicked from a server while staying online, tablist wasn't updated for that player.
Fix for vanish, wrong variable used.
Fix for negative values as input for tab sorting, min value is now 0.
2023-11-14 16:58:33 +00:00
AlexDev_
7eb8f2dbd1 Fix wrong access modifier 2023-11-09 16:16:51 +01:00
AlexDev_
3d3f3a3bfa
Changed PlayerAddedToTabEvent from record to normal class (#117) 2023-11-09 12:04:42 +01:00
AlexDev_
938ce9e077 Added VelocitabAPI#getServerGroup and fixed problem while un-vanishing 2023-11-08 16:59:40 +01:00
AlexDev_
83195d0e72
Fixed vanish problem (#116) 2023-11-08 10:00:59 +01:00
AlexDev_
c36e17b75e
Added PlayerAddedToTabEvent, improved PlayerTabList performance and more (#114)
Added PlayerAddedToTabEvent, improved PlayerTabList performance and added the possibility to reload the plugin without breaking the tab list. This is only for dev purposes. Bumped version to 1.5.2
Fixed a few problems.
2023-11-05 21:15:23 +01:00
AlexDev_
7005ceccd7
Added a team exists check when vanishing/unvanishing a player (#110) 2023-10-25 19:54:01 +02:00
AlexDev_
f03b8f1819
Added an option to remove name tags if prefix & suffix are empty (#108) 2023-10-21 12:58:38 +01:00
AlexDev_
b128f36efa
Added VelocitabAPI, Vanish integration system (#106)
* Added support for VanishIntegration

* Merged

* Added API and improved vanish system

* Fixed problem with API

* Fixed import problem

* Commit with requested changes

* first test

* Added NotNull missing annotations

* Fixed all requested changes

* Fixed logic problem

* Revert "first test"

This reverts commit 1be3c47d9c.

* Hide nametag if the prefix & suffix are empty.

* Fixes for conversations.

* Added missing @NotNull

* Adjust repo order; use `elytrium` over `exceptionflug`

---------

Co-authored-by: William <will27528@gmail.com>
2023-10-18 18:43:03 +01:00
AlexDev_
1e2aff4cf0
Added Sorting Manager (#105)
* Added SortingManager.

* Fixed initialization problem + added cache for team name

* Improved code readability

* Commit with the requested changes.

* Update src/main/java/net/william278/velocitab/Velocitab.java

Co-authored-by: William <will27528@gmail.com>

---------

Co-authored-by: William <will27528@gmail.com>
2023-10-15 13:04:10 +01:00
AlexDev_
a79404a530
Improved sorting logic to handle both high and low values. (#103) 2023-10-13 10:08:30 +01:00
Katherine
9090631677
Add all possible protocols to Protocol403Adapter (#102)
Fixes 1.19.2 clients being instantly kicked

Signed-off-by: unilock <unilock@fennet.rentals>
2023-10-12 17:09:11 +01:00
William
8224cd0ff1
Fixes, logic simplification, update docs for nametags (#101) 2023-10-12 11:44:27 +01:00
William
1f1e69ebca
Add support for Minecraft 1.20.2 (#99)
* Add protocol mappings for 1.20.2

* Cleanup some exception handling

* ci: Mark 1.20.2 as supported

* Minor code formatting tweaks
2023-10-11 17:10:29 +01:00
William278
5ad41e041f Use text block instead of concat in Settings 2023-09-25 15:21:54 +01:00
William278
7a558d4072 Fix trailing comma in Protocol403Adapter 2023-09-25 15:21:11 +01:00
William278
6c8b1b8147 Update config file with new sorting key 2023-09-25 15:20:34 +01:00
William278
2afbf38ee1 Add %server_group% and %server_group_index% placeholders 2023-09-25 15:19:32 +01:00
AlexDev_
cb8a50c24f
Sorting System with Placeholders (#94)
* Added regex check for placeholders to avoid useless requests.
Added support for custom nametags. Due to minecraft limit only legacy chatcolor are supported.
Team names now are unique, so 1 team can have max 1 player.
Fixed problem with luckperms event bus while reloading the plugin.

* Update src/main/java/net/william278/velocitab/config/Placeholder.java

Co-authored-by: William <will27528@gmail.com>

* Update src/main/java/net/william278/velocitab/hook/LuckPermsHook.java

Co-authored-by: William <will27528@gmail.com>

* Update src/main/java/net/william278/velocitab/config/Formatter.java

Co-authored-by: William <will27528@gmail.com>

* Update src/main/java/net/william278/velocitab/packet/UpdateTeamsPacket.java

Co-authored-by: William <will27528@gmail.com>

* Fixed problem while updating display names. Changed a few method signature as requested in pr. Applied changes of pr.

* Added support for placeholders as sorting system

* Code reformat

* Update logging, task scheduling and player rosters

Modified logging in the ScoreboardManager to represent playerNames as an array for readability. Ensured all tasks scheduled by Velocitab are canceled on proxy shutdown to prevent unwanted behavior. Reworked player roster management in PlayerTabList to correctly update player roles and decrease asynchronicity, enhancing performance and preventing possible race conditions.

* Fixed problems after merging with upstream, fixed problem with player team color on join.

* Fixed problems with pr-merge. Added sorting system with placeholders.

* Update src/main/java/net/william278/velocitab/packet/UpdateTeamsPacket.java

Co-authored-by: William <will27528@gmail.com>

* Update src/main/java/net/william278/velocitab/packet/ScoreboardManager.java

Co-authored-by: William <will27528@gmail.com>

* Update src/main/java/net/william278/velocitab/packet/ScoreboardManager.java

Co-authored-by: William <will27528@gmail.com>

* Update src/main/java/net/william278/velocitab/packet/ScoreboardManager.java

Co-authored-by: William <will27528@gmail.com>

* Update src/main/java/net/william278/velocitab/config/Formatter.java

Co-authored-by: William <will27528@gmail.com>

* Update src/main/java/net/william278/velocitab/player/TabPlayer.java

Co-authored-by: William <will27528@gmail.com>

* Fix username replacement in scoreboard and code typo

This commit resolves two issues. Firstly, changed the variable that we split the nametag on in `ScoreboardManager` from a hardcoded string to the player's specific username. This rectifies an issue where incorrect splitting occurred if the username wasn't exactly "%username%". Secondly, fixed a miswritten method call in `Formatter` from '..legacySection()' to '.legacySection()', correcting a syntax error. Lastly, removed superfluous replacement in `TabPlayer's` getNametag method as it was already handled in `ScoreboardManager`.

* Reformat code

* Changed logic with only one plugin message request.

* Update src/main/java/net/william278/velocitab/sorting/SortingManager.java

Co-authored-by: William <will27528@gmail.com>

* Update src/main/java/net/william278/velocitab/hook/LuckPermsHook.java

Co-authored-by: William <will27528@gmail.com>

* Update src/main/java/net/william278/velocitab/packet/ScoreboardManager.java

Co-authored-by: William <will27528@gmail.com>

* Fixed requested changes

* Changed docs

---------

Co-authored-by: William <will27528@gmail.com>
2023-09-25 15:10:45 +01:00
AlexDev_
75d9f32010
Added support for nametags and fixed a few problems (#84)
* Added regex check for placeholders to avoid useless requests.
Added support for custom nametags. Due to minecraft limit only legacy chatcolor are supported.
Team names now are unique, so 1 team can have max 1 player.
Fixed problem with luckperms event bus while reloading the plugin.

* Update src/main/java/net/william278/velocitab/config/Placeholder.java

Co-authored-by: William <will27528@gmail.com>

* Update src/main/java/net/william278/velocitab/hook/LuckPermsHook.java

Co-authored-by: William <will27528@gmail.com>

* Update src/main/java/net/william278/velocitab/config/Formatter.java

Co-authored-by: William <will27528@gmail.com>

* Update src/main/java/net/william278/velocitab/packet/UpdateTeamsPacket.java

Co-authored-by: William <will27528@gmail.com>

* Fixed problem while updating display names. Changed a few method signature as requested in pr. Applied changes of pr.

* Fixed problems after merging with upstream, fixed problem with player team color on join.

* Update src/main/java/net/william278/velocitab/packet/UpdateTeamsPacket.java

Co-authored-by: William <will27528@gmail.com>

* Update src/main/java/net/william278/velocitab/packet/ScoreboardManager.java

Co-authored-by: William <will27528@gmail.com>

* Update src/main/java/net/william278/velocitab/packet/ScoreboardManager.java

Co-authored-by: William <will27528@gmail.com>

* Update src/main/java/net/william278/velocitab/packet/ScoreboardManager.java

Co-authored-by: William <will27528@gmail.com>

* Update src/main/java/net/william278/velocitab/config/Formatter.java

Co-authored-by: William <will27528@gmail.com>

* Update src/main/java/net/william278/velocitab/player/TabPlayer.java

Co-authored-by: William <will27528@gmail.com>

* Fix username replacement in scoreboard and code typo

This commit resolves two issues. Firstly, changed the variable that we split the nametag on in `ScoreboardManager` from a hardcoded string to the player's specific username. This rectifies an issue where incorrect splitting occurred if the username wasn't exactly "%username%". Secondly, fixed a miswritten method call in `Formatter` from '..legacySection()' to '.legacySection()', correcting a syntax error. Lastly, removed superfluous replacement in `TabPlayer's` getNametag method as it was already handled in `ScoreboardManager`.

---------

Co-authored-by: William <will27528@gmail.com>
2023-09-22 17:57:51 +01:00
AlexDev_
8ae25521dd
Fix encode error on 1.20.1 (#90)
* Added test debug

* Fix issue https://github.com/WiIIiam278/Velocitab/issues/89

* Removed ViaVersion problem message

* Re-Added final keyword on plugin parameter in UpdateTeamsPacket
2023-09-16 10:53:50 +01:00
Nikita Obrekht
90a26f15eb
Add sorting by server group (#88)
* Add sorting by group order and group name

* Fix sorting by server group

* Use order of groups instead of config option

* Remove redundant getServerGroup in SERVER_GROUP

* Update Sorting in docs
2023-09-15 17:54:25 +01:00
William278
c1682aeda9 Update about menu, minor code cleanup 2023-09-13 10:06:44 +03:00
AlexDev_
8d654d6b26
Added support for 1.8.x and 1.12.2 clients (#87)
* Added support for 1.12.2 players

* Added support for 1.8.x & fixed code style

* Moved VersionManager inside ScoreboardManager

* Code refactor

* Update src/main/java/net/william278/velocitab/packet/UpdateTeamsPacket.java

Co-authored-by: William <will27528@gmail.com>

* Update src/main/java/net/william278/velocitab/packet/UpdateTeamsPacket.java

Co-authored-by: William <will27528@gmail.com>

* Update src/main/java/net/william278/velocitab/packet/ProtocolAbstractAdapter.java

Co-authored-by: William <will27528@gmail.com>

* Added requested changes

* Code refactoring

---------

Co-authored-by: William <will27528@gmail.com>
2023-09-12 17:30:55 +03:00
AlexDev_
8349d7eb51
Added function to unregister packets on plugin disable. [Dev System Only] (#83)
* Added function to unregister packets on plugin disable.

* Update src/main/java/net/william278/velocitab/packet/PacketRegistration.java

Co-authored-by: William <will27528@gmail.com>

* Added null check + changed style

* Update src/main/java/net/william278/velocitab/Velocitab.java

Co-authored-by: William <will27528@gmail.com>

* Fix indentation problem

---------

Co-authored-by: William <will27528@gmail.com>
2023-08-27 17:06:43 +01:00
Apehum
14482fd43e
Handle DisconnectEvent only if login status is SUCCESSFUL_LOGIN (#80) 2023-08-19 13:55:22 +01:00
William
0ca8d5185b
Fix wrong comment in config file 2023-07-25 12:27:38 +01:00
William
71efba9139
Fix wrong PAPI cache time 2023-06-12 14:25:18 +01:00
William
4a0895cc8b
Add a bit more validation to the PAPI cache time option 2023-06-12 13:17:01 +01:00
William
a55eda8e52
Add option to configure the PAPIProxyBridge cache time 2023-06-12 13:16:12 +01:00
William
07fd9c306a
Add role_display_name placeholder, add docs for sorting 2023-06-12 12:02:33 +01:00
ironboundred
3c1a980e25
set minimal update rate (#52) 2023-05-01 20:50:59 +01:00
William
8e7ba474ae
Remove redundant removeIf log when a player cannot be removed 2023-04-21 21:48:56 +01:00
Adrian
548e47f85a
fix: Fixed NullPointerException in Player Join Listener (#47) 2023-04-21 09:30:02 +01:00
William
e422bf0840
Add plugin metrics and update checker (#46) 2023-04-21 00:22:07 +01:00
Adrian
d3d67cb613
Implement native packets handling and remove Protocolize dependency (#44) 2023-04-19 10:31:37 +01:00
William
4d586d28c3
Remove unneeded log when player remove does not occur 2023-04-18 15:24:57 +01:00
William
3c630dcc50
Remove unnecessary if check 2023-04-18 15:23:37 +01:00
William
5da7da8514
Add new contributors to credits 2023-04-17 21:06:40 +01:00
William
7e349d3393
Add option to disable sorting players, close #39 2023-04-17 20:38:24 +01:00
William
adcdef358b
Update modrinth icon character 2023-04-17 16:30:39 +01:00
ironboundred
7712eaaf15
Check against offline users during permission recalc TAB update (#43) 2023-04-17 16:28:03 +01:00
William
1e3f163f2d
Bump minimessage, fix empty string used for concatenation 2023-04-17 16:06:57 +01:00
William
c6603da50a
Add license header, tweak build scripts 2023-04-17 16:04:53 +01:00
ironboundred
dad64098b2
More checkes for offline players (#42) 2023-04-14 17:36:33 +01:00
FreeMonoid
99ce4e3f54
Handle ProtocolizePlayer absence before sending packets (#40) 2023-04-11 00:27:10 +01:00
FreeMonoid
3c7187cca0
Support legacy RGB color codes (#37) 2023-04-06 18:11:00 +01:00