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

Should SE try to restore blocks broken while selecting a position? #79

Open
altrisi opened this issue Mar 28, 2021 · 2 comments
Open

Should SE try to restore blocks broken while selecting a position? #79

altrisi opened this issue Mar 28, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@altrisi
Copy link
Collaborator

altrisi commented Mar 28, 2021

Currently, when you have a wand different than a sword, or are not in creative mode, you can (unwillingly) break blocks while selecting an area. That behaviour is prevented in WorldEdit, although it's easier in there than here.

As a Scarpet app, currently we can't really "cancel" the break event programmatically, as much we can try to place the exact block that was broken, although any side effects, such as other blocks breaking due to lack of support or updates being sent, would not be restored.

In order to do this properly, it would require the implementation of something like gnembon/fabric-carpet#455, where the app could just state that the event has been "cancelled" (fail?/consumed?/not sure if I got that correctly or it would be another request), and nothing would be triggered from there.

Would it be ok to implement the workaround, should we wait until the language allows us to properly cancel the propagation too, or should we keep it as is?

@altrisi altrisi added the enhancement New feature or request label Mar 28, 2021
@altrisi
Copy link
Collaborator Author

altrisi commented Mar 28, 2021

Actually, an even better* workaround could be disabling Carpet's interactionUpdates rule when the event is fired, then turning it back on at the end of the tick (supposing the event is launched right at the starts, which I think is the case? not checked).

However, that could break horribly, mostly in multiplayer, if other players break things in the same tick where the wand is used, or if the player breaks more than a block a tick, although I think that's not possible without autoclickers? (and would probably use the wand anyway, I guess?).

@Firigion
Copy link
Collaborator

I agree we should hackfix this until the scarpet language suppports cancelling events (if). I also think that doing it through interactionUpdates is risky, I'd just replace the broken block (if any), and let it be an imperfect solution for stuff like blocks with no support breaking and such.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants