Skip to content

Conditions now can be used by other plugins#210

Merged
Bishbash777 merged 3 commits intoTorchAPI:masterfrom
slimeradio:master
Jun 11, 2023
Merged

Conditions now can be used by other plugins#210
Bishbash777 merged 3 commits intoTorchAPI:masterfrom
slimeradio:master

Conversation

@slimeradio
Copy link
Copy Markdown
Contributor

To make other plugins to be able extend you need

  1. Define class that is marked [ConditionModule]

  2. Add method in that class is marked by [Condition("name", helpText: "tooltip")]

  3. Method should return bool, and accept MyCubeGrid. It may also accept 1 extra param (string, double, int ...)

To make other plugins to be able extend you need 

1) Define class that is marked [ConditionModule]

2) Add method in that class is marked by [Condition("name", helpText: "tooltip")]

3) Method should return bool, and accept MyCubeGrid. It may also accept 1 extra param (string, double, int ...)
@slimeradio
Copy link
Copy Markdown
Contributor Author

Commands.zip
To test add this plugin, and type commands:
!cleanup list notype beacon show-gps
!cleanup list notype beacon show-gps2 Test

hastype-fast/notype-fast
hassubtype-fast/nosubtype-fast

Same as without "-fast", but also support multiple types/subtypes
@dorimanx
Copy link
Copy Markdown

This looks great! fresh code, much more organized, but.. is it production ready?

If i will send command, and server crash, that is not acceptable, is it tested for all possible bugs?
I dont see try/catch, so if something goes wrong, can be unpleasant during prime time.

I am offering my help to test commands, on our test server, i will try all of them, and report findings.

Thank you!

@slimeradio
Copy link
Copy Markdown
Contributor Author

Try executing it with errors.
All commands are wrapped with try/catch

@Bishbash777 Bishbash777 merged commit db89b39 into TorchAPI:master Jun 11, 2023
dorimanx pushed a commit to dorimanx/Essentials that referenced this pull request Nov 7, 2024
* Conditions now can be used by other plugins

To make other plugins to be able extend you need

1) Define class that is marked [ConditionModule]

2) Add method in that class is marked by [Condition("name", helpText: "tooltip")]

3) Method should return bool, and accept MyCubeGrid. It may also accept 1 extra param (string, double, int ...)

* Added new commands (optimization)

hastype-fast/notype-fast
hassubtype-fast/nosubtype-fast

Same as without "-fast", but also support multiple types/subtypes

* Parallel iterate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants