-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
Reset breaking block state when sneak status changes #810
Comments
Not sure I can do much about it. When you break the tree, a "block broken event" is sent by fabric/forge. When this happens the player's state is checked https://github.com/RakambdaOrg/FallingTree/blob/minecraft/1.21.4/common/src/main/java/fr/rakambda/fallingtree/common/tree/TreeHandler.java#L58 -> https://github.com/RakambdaOrg/FallingTree/blob/minecraft/1.21.4/common/src/main/java/fr/rakambda/fallingtree/common/FallingTreeCommon.java#L87 The crouching state is whatever is reported by the server at that moment. If it is falsly recognized then I dunno... If the sever says your crouching (but your're not) then I won't be able to guess it. |
I think you misunderstood, if you stop pressing shift after it starts to break the tree, that happens |
What happens? I'm not too sure to understand. Maybe a little video would help seeing the issue. |
Steps to reproduce:
|
However your point is maybe more that in that case it doesn;t respect the "breaking speed" that is configured ? |
Kinda, you can break a hugeeee tree under 1 second using this bug |
Not really sure if I wanna "fix"that edge case. The thing is the way it is implemented in Minecraft is a bit wanky. When you start breaking a block, the client will calculate how long it will take based on the tool + block. What fallingtree do is just add its part into it and say "okay it'll take 5x longer" for example. The same thing happens on the server side, and when the breaking time is over then the block is broken (on the client is disappears, and on the server lots of things happens). But, this thing is just done once when the block starts to be broken. It'd require lots more hooking into the client to handle this based on the change of the crouching state. And FallingTree tries to be as much server-sided as possible, I don't want to require it too much on clients. I'll keep the issue open as a possible enhacement, but honestly I probably won't invest much time on it ; seems a bit hacky to perform this with the way MC works. (If people wanna make PRs for this i'm open to integrate it ofc). |
Understood, thanks for minding to leave it open anyway. Have a nice day ❤ |
Edit
When a block stats breaking, if the player is in a wrong state (ie mod disabled) then the mod doesn;t activates and the block is broken at normal speed. If, before the block breaks, the player gets into a valid state (mod enabled), then the mod activates and the whole tree falls. This leads to bypassing the settings for the custom break speed when it is set to something else than 0.
The idea here is to be able to stop the current breaking progress when the mod reactivates so the proper breaking duration is applied.
Describe the bug
Same issue in Tree Harvester, check this issue for more explanation:
Serilum/.issue-tracker#2126
He tried to fix that, and he did. But this introduced another bug which is a issue i opened:
Serilum/.issue-tracker#2659
Minecraft version
1.20.1
Fabric API version
0.92.2
Mod version
4.3.4
Configuration
All default
Relevant log output
The text was updated successfully, but these errors were encountered: