StrikerRockers-Mods/VanillaTweaks

[BUG] canSurvive method takes as argument its own blockstate not the block below

Closed this issue · 5 comments

as you can see in BlockStateBase::canSurvive as well as most block member method all take as first arguments their own blockstate. You cant just give it another block as stateholder checks will fail as its violating a contract

Infact you should never call Block member function directly and call the Blockstate ones instead

Fixed the crashes for Minecraft 1.19.4 versions. Fixed by using FakePlayer API provided by the loaders.

No fix for the 1.19.2 Versions?

No as FakePlayer for fabric isn't available in 1.19.2 so can't fix it.

while using fake player api is definitely the most compatible way to do such a thing, old issue was bad not because it didnt work in some cases but because it was using some vanilla methods incorrectly resulting in crashes so the fix for that just required to not pass those invalid parameters there while keeping the old implementation for 1.19 / just using fake player for forge