breakinblocks / Plonk

A Minecraft mod that lets you place items down anywhere https://www.curseforge.com/minecraft/mc-mods/plonk https://modrinth.com/mod/plonk
MIT License
3 stars 4 forks source link

[1.16.5 Forge 36.1.16] Crash on placing items, maybe caused by incompat with Adventure Tools #15

Closed ChromaPIE closed 3 years ago

ChromaPIE commented 3 years ago

Adventure Tools' CurseForge page: https://www.curseforge.com/minecraft/mc-mods/adventure-tools

Crash report: https://paste.ubuntu.com/p/Ztjkzc6MDx/

Placing blocks won't cause crashes but items. The Mining Helmet provided by Adventure Tools actually works by automatically placing light sources on surface honoring where the players are looking at, and when placing items over those light sources, a crash would happen. The crash has been fowarded to Adventure Tools' side too: https://github.com/syntacticsplenda/adventurepack/issues/20

syntacticsplenda commented 3 years ago

Haven't looked extensively into it but I think this is probably due to some weird interaction with the RayTrace method. A possibility is the RayTrace returns coordinates currently occupied by a BlockLight, which Plonk freaks out when it tries to use. This might be generalized to placing any tile entity on top of a light block.

The Plonk mod is way more complex than my mod, so I would appreciate the author's insight here.

BlueAgent commented 3 years ago

Very strange, for some reason Block#getCollisionShape (overriden in BlockPlacedItems#getCollisionShape) is being called on a position that doesn't have a TilePlacedItems which it expects, but there is a BlockPlacedItems at that location with tile TileEntityLight afaict? :(

This does seem like a bad assumption on my end though so I will add a check to make sure that it is a TilePlacedItems there.

BlueAgent commented 3 years ago

Fixed in Plonk v9.0.8 (mc 1.16.5).

Let me know if it didn't fix it and we can re-open.

If it is fixed you can probably close https://github.com/syntacticsplenda/adventurepack/issues/20 as well I think.