Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exploded piston calling Block#playerWillDestroy crashes game when installed with Vanilla Degus #6550

Open
rbasamoyai opened this issue Jun 1, 2024 · 2 comments
Labels
status: confirmed Issue's details are known, it is consistently reproducible, and it needs a fix type: crash Issue where the game crashes

Comments

@rbasamoyai
Copy link
Contributor

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 a null player argument (the Cannon Mount also follows this), but mixins seem to assume that Block#playerWillDestroy is not null. Vanilla Degus has a mixin into this method which assumes the player is not null.

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

  1. Run Minecraft Forge 1.20.1 with Create and Vanilla Degus installed.
  2. Assemble a Mechanical Piston.
  3. Blow up the piston, such as by using TNT, while the contraption is assembled and running.

Expected Result

The explosion should have blown up the piston with no issue instead of crashing the game.

Screenshots and Videos

image
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

@rbasamoyai rbasamoyai added the type: bug Issue where something isn't working label Jun 1, 2024
@rbasamoyai rbasamoyai changed the title Minue Exploded piston calling Block#playerWillDestroy crashes game when installed with Vanilla Degus Jun 1, 2024
@rbasamoyai
Copy link
Contributor Author

I seem to have pasted part of the Vanilla Degus mod creator name as the issue title. I have edited it to be more clear on what the issue is.

@rbasamoyai
Copy link
Contributor Author

Bump: has this been addressed?

@IThundxr IThundxr added status: confirmed Issue's details are known, it is consistently reproducible, and it needs a fix type: crash Issue where the game crashes and removed type: bug Issue where something isn't working labels Sep 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: confirmed Issue's details are known, it is consistently reproducible, and it needs a fix type: crash Issue where the game crashes
Projects
None yet
Development

No branches or pull requests

2 participants