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

disable-physics doesn't work for all events #11

Open
Sproki opened this issue Aug 18, 2021 · 3 comments
Open

disable-physics doesn't work for all events #11

Sproki opened this issue Aug 18, 2021 · 3 comments
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@Sproki
Copy link

Sproki commented Aug 18, 2021

Hey!
I am actively using the BuilderUtilities plugin in version 1.17. I noticed that the gravity of the blocks "Anvil, Water" and probably others is sometimes not 100% off.
For example:
You place an Anvil that floats and next to it another one then both Anvils fall down.

@TehBrian TehBrian self-assigned this Aug 19, 2021
@TehBrian TehBrian added the bug Something isn't working label Aug 19, 2021
@TehBrian
Copy link
Owner

Hmm, odd! I'll look into this when I next get the chance :)

@TehBrian TehBrian changed the title Gravity bug: Disable-physics sometimes not working Sep 2, 2021
@TehBrian
Copy link
Owner

TehBrian commented Sep 2, 2021

After testing this out, it seems that this issue is simply a limitation of Bukkit. Even when cancelling all BlockPhysicsEvents — which is the only physics-related event that we have access to via the API — some physics-related behavior still occurs, just like what you were saying. In the documentation for BlockPhysicsEvent:

Plugins should also note that where possible this event may only called for the "root" block of physics updates in order to limit event spam.

It doesn't seem like there's anything that I can do about this, sorry :( For now, I'll remove disable-physics and add smaller options that do work, like disabling redstone.

I'll leave this issue open, though, because someone else might have a good idea on how to fix this.

@TehBrian TehBrian added the help wanted Extra attention is needed label Sep 2, 2021
@TehBrian
Copy link
Owner

TehBrian commented Oct 23, 2021

After tinkering around with this issue some more, I've discovered that trying to disable physics of any kind is inherently buggy. Because of the limitation I mentioned in the previous comment, Bukkit doesn't give plugin developers full control over physics, including trying to disable redstone.

I took a look at the original plugin and tested its physics-disabling features, and they have the same issues discussed here. Although that plugin has additional config values such as disable-redstone and disable-gravity, these function just as poorly because, at their core, all that these features are doing is cancelling BlockPhysicsEvent.

Honestly, I would just recommend not using this feature for the time being.

@TehBrian TehBrian changed the title bug: Disable-physics sometimes not working disable-physics doesn't work for all events Dec 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants