-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement actions and triggers! #1016
Conversation
Signed-off-by: Pablete1234 <pabloherrerapalacio@gmail.com>
core/src/main/java/tc/oc/pgm/trigger/modifier/TriggerModifiers.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Pablete1234 <pabloherrerapalacio@gmail.com>
Implemented bound inference, so specifying the scope of a trigger isn't required if it can be infered from the parent, the biggest effect is switch-scope only requires Example where it can be infered: <actions>
<actionid="trigger-id" scope="player">
<switch-scope inner="match">
<message text="This is match scoped! Converted from player to match"/>
</switch-scope>
</action>
</actions> Example where it can NOT be inferred (outer is required here, or else it won't work): <action>
<switch-scope id="scope-switch" outer="player" inner="match">
<message text="This is match scoped! Converted from player to match"/>
</switch-scope>
<action id="trigger-id" scope="player">
<action id="scope-switch"/> <!-- This references the trigger defined above -->
</action>
</actions> Additionally, now the Kit interface fully implements Trigger, because at the end, kits are just a trigger that is scoped to a player. This means you can just define a kit inside a trigger instead of being forced to reference one. <action>
<kit id="a-kit">
<item>diamond</item>
</kit>
<trigger filter="some-filter" action="a-kit" scope="player">
</action> In this situation, the Also, Actions now support triggering and untriggering, in the same way removable kits work. |
core/src/main/java/tc/oc/pgm/trigger/triggers/AbstractTrigger.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Pablete1234 <pabloherrerapalacio@gmail.com>
Signed-off-by: Pablete1234 <pabloherrerapalacio@gmail.com>
What are actions? Actions are the next generation of kits. Kits in fact, are a type of action.
Why not just use kits? Kits are always player-scoped, this is not ideal for all features, there's alot of interoperability between kits and actions so this shouldn't be an issue (kits can have player-scoped actions, and kits themselves are a type of player-scoped action), and actions can be scoped-out or scoped-in.
This is mainly a stepping stone towards #881, it is also laying down the ground for #1001, as those will no longer be kits, and will just be actions instead.
Currently the only implemented actions are action (an action with other actions inside), message, switch-scope, and kit
Update:
triggers have been renamed to actions
when has been renamed to trigger
It makes more sense that "actions" are "triggered" by triggers. The triggers listen for dynamic filters. this was feedback from @Pugzy