Exploded piston calling Block#playerWillDestroy crashes game when installed with Vanilla Degus #6550
Labels
status: confirmed
Issue's details are known, it is consistently reproducible, and it needs a fix
type: crash
Issue where the game crashes
Describe the Bug
While looking at a bug on 1.20.1 between Create Big Cannons and this mod https://www.curseforge.com/minecraft/mc-mods/vanilla-degus, I have noticed that when Vanilla Degus is installed with Create it crashes if the piston is blown up to disassemble (a rare case, but analogous to Create Big Cannons' disassembly on cannon failure, that is, an explosion.) I specifically point to the Mechanical Piston as some of the Cannon Mount's disassembly code is modeled after the Mechanical Piston.
This appears to be due to the Mechanical Piston block entity code calling
Block#playerWillDestroy
with anull
player argument (the Cannon Mount also follows this), but mixins seem to assume thatBlock#playerWillDestroy
is notnull
. Vanilla Degus has a mixin into this method which assumes the player is notnull
.This could be fixed by passing a FakePlayer similar to the DeployerFakePlayer, but I am not sure how resource intensive that would be. More feasibly, the code for handling piston destruction could just be duplicated or moved into another method that the
dissassemble
method uses.Reproduction Steps
Expected Result
The explosion should have blown up the piston with no issue instead of crashing the game.
Screenshots and Videos
Exploding piston setup. Degu not necessary, just there to demonstrate the mod which this game crashes with.
Crash Report or Log
https://pastebin.com/29vCy5HK
Operating System
Windows 10
Mod Version
0.5.1f
Minecraft Version
1.20.1
Forge Version
47.2.32
Other Mods
Vanilla Degus, Create Big Cannons (similar bug, will fix on my end)
Additional Context
N/A
The text was updated successfully, but these errors were encountered: