[BUG] canSurvive method takes as argument its own blockstate not the block below
MehVahdJukaar opened 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.
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