Caltinor / Project-MMO-2.0

A continuation of Harmony's Project MMO project
37 stars 21 forks source link

Crash with Dynamic Trees #554

Closed Groupix05 closed 16 hours ago

Groupix05 commented 1 week ago

Describe the bug Crashing when cutting trees with Addons for Dynamic Trees. PMMO return a null level to Dynamic Trees so everything crash On Forge 1.20.1 47.1.3 and 47.3.1

Paste your crash log here https://github.com/InvictusSlayer/DynamicTrees-Slayers-Beasts/issues/1

Groupix05 commented 1 week ago

Nyfaria ( a Dynamic Trees Dev) Said "basically theyre passing null into the getDestroySpeed when they shouldn't https://github.com/Caltinor/Project-MMO-2.0/blob/cdb8961349b8a1997f10662b4f05dc0185be2d12/src/main/java/harmonised/pmmo/features/autovalues/AutoBlock.java#L42 "

Groupix05 commented 6 days ago

Changing the "null" to "EmptyBlockGetter.INSTANCE" seems to fix the crash. float breakSpeed = block.defaultBlockState().getDestroySpeed(EmptyBlockGetter.INSTANCE, null); Instead of adding every addon in the WORLD_SENSITIVE_MOD_IDS, changing the null by something else could be more interesting. Just hovering a branch in the inventory, the game crash. I don't know if something has changed in the gameplay with these changes, I would like to know. I'm learning JAVA.

Thanks !

BrowkTheRock commented 18 hours ago

also happens in 1.19.2

Groupix05 commented 5 hours ago

With the latest version you Can maybe remove Dynamic Trees and DTBOP from the WORLD_SENSITIVE_MOD_IDS so we Can get XP from Dynamic Trees and Dynamic Trees BOP

Caltinor commented 5 hours ago

you still not going to get dynamic values even if i remove them. EmtpyBlockGetter.INSTANCE returns a null block entity always, which will cause them to be skipped. all this fix does is prevent the crash. you will always have to manually configure dynamic blocks and items like this.