Skip to content
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

Make the *_block_use power types consistent with the *_entity_use power types #231

Merged
merged 2 commits into from
May 20, 2024

Conversation

eggohito
Copy link
Collaborator

@eggohito eggohito commented May 19, 2024

This PR changes the implementation of the *_block_use power types to be consistent with the behavior of the *_entity_use power types. It seems that this was already partially implemented (only on the client-side), so I decided to complete the implementation with this PR.

This also changes the behavior of edible_item power type slightly, where the items that can be used on blocks are no longer prevented from being used. To accommodate for such use-cases (and some QoL stuff), this PR adds these new fields to the *_block_use power types:

Note

Powers with a priority value of equal or greater than 1 will be executed and will override the result of the interaction while powers with a priority value of equal or less than -1 will only be executed if the interaction results in a pass.

Powers with a priority value of 0 will be executed alongside the interaction and will not override the end result.

Field Type Default Description
usage_phases Array of Block Usage Phases ["block", "item"] Determines at which point the actions should be executed/prevented.

A block usage phase is a string that determines the phase when interacting with a block.

Note

The listed values are ordered by priority, with "block" being first and "item" being last.

Name Description
"block" Determines that the player interacts with a block.
"item" Determines that the player used an item to interact with a block.

* The behavior has been changed to be consistent with the `*_entity_use` power types
* The actions of using items on blocks are no longer prevented if the items are modified to be edible
+ Added a new `usage_phases` field; an array of strings which determines at which phase the action should be executed/prevented. It accepts these values:
    * `"block"`; the phase at which the player has interacted with a block (happens first)
    * `"item"`; the phase at which the player is using an item on a block (happens last)
@eggohito eggohito added the to merge This will be merged soon label May 19, 2024
@eggohito eggohito added this to the 2.12.x milestone May 19, 2024
@eggohito eggohito merged commit d4c4472 into 1.20.4/dev May 20, 2024
@eggohito eggohito deleted the feat/power_types/block_use_changes branch May 20, 2024 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
to merge This will be merged soon
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant