FTBTeams: Commands refactor, pre-PR RFC #1783
Replies: 3 comments 3 replies
-
Beta Was this translation helpful? Give feedback.
-
|
I'm not at all opposed to a more comprehensive review of how the FTB Teams command system is set up. It's old and janky, and does need a bit of attention. The reason it's never had an overhaul is (as you pointed out) it works in the majority of cases, and there's only so many hours in the day 🤣 So yeah, totally open to a refactor pass. If you have any questions about internals, feel free to ask... |
Beta Was this translation helpful? Give feedback.
-
|
My vision for command re-organization is more/less as follows:
This'll collapse the top level nodes to just I think this is pretty succinct, but suggestions/different directions are welcome! Command-interface semanticsI've got one semantics question for you. Currently,
We could either:
Thoughts? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello!
Background
I've been using packs with the ftb suite of mods for some time now. The functionality of some of the commands are a bit wonky when it comes to configuring team settings. In specific, when trying to run a command like
ftbteams party settings_for <team> ..., in some cases, the command returns a typical user-feedback message, and in other cases[1], it causes an internal exception & chokes out a 400ms tick.What I'd like to do
I'd like to submit a PR that just fixes the bugs, but the code between FTBTeamsCommands.java and & its related files has some quirks. There's some interesting coupling going on[2] that confuses control/data-flow between classes, so I'd really like to make a refactor pass over it. Furthermore, I'd like to pose some suggestions for changes in the functionality that would probably benefit from the refactor being in place first.
TL;DR, I'd like to take a refactor pass over the FTBTeams command code to make it more concise, and extend/condense parts of its functionality.
Concession
I recognize that I'm poking a bear here- that is, the mod works for the majority of what it needs to, and obviously hasn't caused too many problems since the inception of the code I'm referencing (~99% 2-4 years old). So, if consensus was "yeah, that sounds like a looot of potential new instability", I'd totally understand.
Otherwise, please throw me input! If this sounds like something that could potentially be merged, I'd love to get started on it.
References
[x] references.
[0]: Attempt to execute `ftbteams party settings_for (...)`:[1]: One I've confirmed so far is using a server-party name as an argument to
ftbteams party settings_for. I recognize theftbteams server settingscommand is intended for server-party settings as of now, but throwing an unhandled exception & causing a couple of 300ms ticks seems improper.[2]: E.g. Why are we creating static methods in (e.g.) FTBTeamsArgument.java to extract data from a Command context, when those methods are only used in FTBTeamsCommands.java. It seems like this should really just be done in the FTBTeamsCommands.java class.
Beta Was this translation helpful? Give feedback.
All reactions