Commit graph

584 commits

Author SHA1 Message Date
Norbi Peti 7996426d63 Test sender conversion for players
Also refactored stuff I deprecated
2024-03-16 01:24:43 +01:00
Norbi Peti a39539ea6e Order tests 2024-03-16 00:35:52 +01:00
Norbi Peti 702655cf9f
Improve and extend command tests
- Added param converter tests
- Refactored test functions to have more descriptive names and have documentation and to make their behaviour more predictable (at a glance)
- Implement separation of user error in the command system and make tests for it more specific
- Improve handling of testing messages received from commands (like the help text)
2024-03-04 02:20:35 +01:00
Norbi Peti 2787c280f5
Remove 'main command' and test empty command to improve coverage 2023-07-31 20:43:20 +02:00
Norbi Peti 7e511c169b
Organize tests a bit and sort command list and add gamer test 2023-07-31 20:06:12 +02:00
Norbi Peti d16a6a742c
Param converter and command list with permission check
- Displaying and testing error message for param converters
- Improved crash testing
- Using has permission check for listing (sub)commands
- Implemented and tested command list
2023-07-31 17:19:05 +02:00
Norbi Peti 401a54b078
Handle wrong param type and similar errors and improve things
- Improved help text
- Improved tests
2023-07-28 00:56:13 +02:00
Norbi Peti 79c1cc47f7
Add param type test for primitive types and fix things
- Made subcommand list sorted
- Simplified test command registration and running commands
- Fixed primitive type handling where I missed it
2023-07-28 00:10:51 +02:00
Norbi Peti f18c5483d8
Move test command classes to another file 2023-07-27 21:37:20 +02:00
Norbi Peti 9dff03c18e
Fix and improve help text code, add subcommand list 2023-07-24 21:59:33 +02:00
Norbi Peti d42a4a8a70
Remove custom Color class and other legacy classes 2023-07-24 18:03:17 +02:00
Norbi Peti cfa9f14b52
Implement param converter and add tests 2023-07-24 17:16:08 +02:00
Norbi Peti 0e39cd38e3
Fix optional argument handling
- That was almost too easy
2023-07-24 16:23:07 +02:00
Norbi Peti 82d43e5b09
Fix no argument and multiple argument handling
- Added a bunch more command tests
- Fixed no arg command handling
- Fixed multiarg command handling (with data propagation)
- Fixed exception reporting in the command system
2023-07-24 15:39:28 +02:00
Norbi Peti 19362cfe5f
Basic command execution implemented and fixed!
- Added check for errors that are sent for the sender and other test checks
- Fixed getting argument nodes
- Changed setting subcommand data for arguments so that the order of the registration allows finalising a node before adding it to another (that's why I needed to swap the order)
- Implemented basic command execution (invoking the method)
2023-07-22 01:52:39 +02:00
Norbi Peti 84062fee7c
Command system fixes based on TEEESTS
- Fixed unregistering commands
- Fixed command registration
- Fixed command argument handling
- Fixed command handling async task not implemented
2023-07-21 22:29:47 +02:00
Norbi Peti f05305cb0a
Add command test and fix command path handling
- It feels so good to be able to debug this code
2023-07-21 01:01:32 +02:00
Norbi Peti 29f7883f9b
Fix number conversion in configs
- java.lang.Integer could not be cast to java.lang.Long and it was so confusing for so long
- Int::class.java is int.class instead of Integer.class like I thought
2023-07-20 01:45:52 +02:00
Norbi Peti 822b2a5a67
Switch to Paper and fix some things 2023-07-01 20:09:29 +02:00
Norbi Peti 05fe1c261c
Fix Scala compiler freaking out on ListConfigData
- Moved the custom list's class to the top level
2023-06-30 03:18:07 +02:00
Norbi Peti ddd24a73f6
Fix player config stuff and test event stuff
- The chat tests work!
2023-06-27 01:31:55 +02:00
Norbi Peti 4f0e05892a
Fix test issues and command issues
- Fixed test config loading (it loaded it twice, probably would've on a regular server too)
- Fixed missing permission plugin when testing
- Fixed command node casting errors
- Fixed event handler lists not being JVM static
2023-06-27 01:07:22 +02:00
Norbi Peti 529fef1c5f
Fix config lateinit errors and fix testing 2023-06-26 23:03:19 +02:00
Norbi Peti 5e39b6ef57
Rename .java to .kt 2023-06-26 23:03:17 +02:00
Norbi Peti 58729ab885
Config delegation & reload improvements
- Added a class and an interface to make using list config data easier
- Made everything config-related reusable and reloadable because delegated properties don't update automatically when reassigned
- This also means that the original ConfigData instance should also properly update now when reloading, although now we return the delegate
2023-06-18 20:16:12 +02:00
Norbi Peti a26c16565f
Add support for delegating config properties
- Changed the return value of all getData() methods to allow using the result for property delegation
- This allows using the config properties like any other property in Kotlin
- Also delegating the underlying ConfigData object to the delegate (heh) so that the result can still be used from Java normally
- It does require one notable change though: using the IConfigData interface *everywhere*
- One problematic part for this is ListConfigData, as a much more elaborate IConfigData<ListConfigData<T>.List> needs to be used for list configs
- Also using the display name for MC users heh
2023-06-12 22:56:39 +02:00
Norbi Peti cd108dc787
Implement channel handling for Chroma users
- This allows properly implementing Minecraft chat for Discord users instead of creating fake CommandSenders
- Channel access needs to be implemented on all platforms - this could allow automatically managing who has access to a Discord channel for example
- In the future custom commands could be supported without having to connect accounts
- Also any information can be retrieved about the user when they chat, not just their name
2023-06-09 00:11:53 +02:00
Norbi Peti 291fc068fd
Only use Chroma users for chat messages
- Don't use Command2Sender for getting Chroma users
- The CommandSender interface is a Minecraft-specific concept and using Command2Sender just adds unnecessary complexity
- Added convenience methods for getting TBMC players and the console
2023-05-23 00:49:52 +02:00
Norbi Peti b57420c72a
Command sender and config improvements
- Use Command2Sender for getting Chroma users
- Throw exception if a proper converter doesn't exist
- Make ConfigData non-nullable altogether, but allow for nullable type + documentation
- Converter stuff is older, config stuff is from earlier today
- Command2 stuff isn't really worked out yet
2023-05-14 03:03:51 +02:00
Norbi Peti aabc2cd48c
Remove ComponentData, convert two components
- The new way of replacing configs doesn't actually support having ConfigData fields as they can become obsolete
- Fixed KDoc formatting (new lines)
2023-05-05 02:48:06 +02:00
Norbi Peti e610dbc0f6
Rename .java to .kt 2023-05-05 02:48:01 +02:00
Norbi Peti 6c70e8707d
Fix config/plugin lateinit error, convert API, color codes
- The MainPlugin.instance field wasn't initialized when the MainPlugin was being initialized (config), so delayed the config saving until it's actually running
- Also added library to support Kotlin coroutines in Bukkit but not using it yet
2023-05-03 00:26:24 +02:00
Norbi Peti d4aeb198a8
Rename .java to .kt 2023-05-03 00:26:20 +02:00
Norbi Peti 260a67506a
Fixes for Java/Scala compatibility bugs 2023-04-25 23:58:57 +02:00
Norbi Peti 5e1f378ec7
It compiles! Finished MC tab completion
- Custom tab complete methods are now case-sensitive
- Custom tab complete methods are also not supported for now
2023-04-21 04:05:04 +02:00
Norbi Peti ee7e531dc0
Rename .java to .kt 2023-04-21 04:04:57 +02:00
Norbi Peti 17758bb54e
Using ChatColors and convert remresidents command that we don't need anymore 2023-04-19 02:55:41 +02:00
Norbi Peti 6d0d9adef5
Rename .java to .kt 2023-04-19 02:55:38 +02:00
Norbi Peti 8616ecbefc
Fixed getSubcommands() and other command fixes
- Command2MC tab completion still awaits - but then that might be all that's left before testing
2023-04-18 01:52:40 +02:00
Norbi Peti 30a2fe0b68
Finished Kotlin conversion, Command2MC stuff remains 2023-04-17 21:04:00 +02:00
Norbi Peti 1d88d3e859
Rename .java to .kt 2023-04-17 21:03:57 +02:00
Norbi Peti 42fd0dfeac
Player, config and player data improvements 2023-04-17 03:11:36 +02:00
Norbi Peti 8104b1a8d4
Rename .java to .kt 2023-04-17 03:11:33 +02:00
Norbi Peti 39424fa92b
Fix and improve user class, convert player class
And other stuff
Reworked ChromaGamerBase.connectWith()
Converted other stuff too
2023-04-16 03:18:03 +02:00
Norbi Peti 113d975986
Rename .java to .kt 2023-04-16 03:18:00 +02:00
Norbi Peti 4ed001cb54
More conversions, user classes, some configs
Removed writePluginList config option
2023-04-14 03:07:25 +02:00
Norbi Peti 85efc873d6
Rename .java to .kt 2023-04-14 03:07:22 +02:00
Norbi Peti 56d1f0c2a2
A bunch of changes and improvements - and Kotlin
- Tried to reduce usage of MainPlugin.Instance, ended up refactoring more Component/ButtonPlugin things
- Config fixes, among other things
2023-04-14 00:48:18 +02:00
Norbi Peti d6fba6a495
Rename .java to .kt 2023-04-14 00:48:14 +02:00
Norbi Peti 7b7ad18818 Config improvements
- Added component wrapper to ensure null safety
- Plugin/config properties can no longer be null
2023-04-05 15:19:28 +02:00