Speed multiplicand doesn't work with mod Project MMO.
Mihail001 opened this issue ยท 2 comments
Describe the bug
Speed multiplicand doesn't work with mod Project MMO installed.
If I want to cut all tree I cut it down in just 3 seconds. And I change the speed multiplicand to: 0.4
To Reproduce
Steps to reproduce the behavior:
- Install: Project_MMO-1.16.4-3.49.2 and FallingTree-Forge-1.16.5-2.11.0.
- Join the world.
- Cut the tree with any axe.
Problems.with.mod.Project.MMO.mp4
Infos:
- Minecraft version: [1.16.5]
- Mod loader: [Forge-36.1.2]
- Mod version: [FallingTree-Forge-1.16.5-2.11.0]
Honestly I'm not really sure if I can do anything about it.
What happens:
- FallingTree will handle the breakSpeed event as it have a priority
NORMAL
(ref: https://github.com/RakSrinaNa/FallingTree/blob/1.16.5-forge/src/main/java/fr/raksrinana/fallingtree/ForgeEventSubscriber.java#L45-L62)- In your case this will set the break speed as being
0.4 * <time to break one log> * log_count
- In your case this will set the break speed as being
- Then Project MMO will handle the event on its side as it have a priority
LOWEST
(will always be executed last) (ref: https://github.com/Harmonised7/project_mmo/blob/master/src/main/java/harmonised/pmmo/events/EventHandler.java#L109-L113)- This will calculate the breaking speed based on your tool xp? (idk how MMO works i'm just guessing). But by doing that it'll overwrite what FallingTree defined.
As MMO will always be executed last due to its priority I see only 2 ways this could be fixed:
- Project MMO adds an option to activate/deactivate the speed change (so that it lets FallingTree decide the new speed)
- Instead of calculating the speed from
originalSpeed
, it calculates it fromnewSpeed
. This would make it so that if any other mod first modified the speed, it'll make its changes based on that new speed. So for example falling tree applies the 0.4 speed multiplicand, and then MMO may adapt that speed based on your tool xp. (https://github.com/Harmonised7/project_mmo/blob/master/src/main/java/harmonised/pmmo/events/BreakSpeedHandler.java#L64-L101)
If people see any other options I'm open to hearing them.
To be coherent I'll do the same in FallingTree, use originalSpeed
as a source of "truth" so that it takes into account other mods modifications. But that will only apply only to mods that changes speed BEFORE it. So in the case of project MMO I can't do much more, it'll have the last word.