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

Add Viewer#sendBlockProgress #2513

Merged
merged 6 commits into from
Jun 23, 2024
Merged

Conversation

MrHell228
Copy link
Contributor

@MrHell228 MrHell228 commented Jun 2, 2024

SpongeAPI | Sponge

* @param y The y position
* @param z The z position
*/
void resetBlockProgress(int x, int y, int z);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is leaking impl details, please remove this method

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wdym it's impl detail. It's must have method if we make limits (from 0 to 1) for progress arg in sendBlockProgress

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The server doesn't need any knowledge of the current progress. This is leaking impl details by forcing implmentations to track the progress

Copy link
Contributor Author

@MrHell228 MrHell228 Jun 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Server doesn't have any knowledge of the current progress. It resets only progress that was sent by sendBlockProgress() so the only knowledge server has is that some plugins used sendBlockProgress()

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think resetBlockProgress is necessary because we need a way to remove the crack.
Notes:

  1. setting progress to 0 does not remove, it just means you began cracking the block.
  2. as discussed on discord, we will not track progress, however we need to keep somewhere a map of blockpos to destruction id

src/main/java/org/spongepowered/api/effect/Viewer.java Outdated Show resolved Hide resolved
@Faithcaio Faithcaio merged commit eea04ca into SpongePowered:api-11 Jun 23, 2024
4 checks passed
@MrHell228 MrHell228 deleted the api-11-cracks branch June 23, 2024 22:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants