McJtyMods / RFTools

A set of blocks and items to help with RF in general. Currently contains a Dimension Builder, Teleportation System, Shield System, RF monitor, an RF network debug tool and an automatic crafter
MIT License
226 stars 88 forks source link

Crash when mining dimensional ore #1980

Open CritFlaw opened 5 years ago

CritFlaw commented 5 years ago

Issue description: When mining with a diamond hammer (Thermal), the game freezes and when hard crashing produces the following crash log. I think it might be caused by breaking the dimensional ore.

Relevant logs, if any: https://pastebin.com/sC2ZngQ3 - crash log

McJty commented 5 years ago

It's actually crashing in Actually Additions. Can you please submit a ticket to them too?

josephcsible commented 5 years ago

Looks to me like it's at least partially Actually Additions' fault. What's happening is that we're registering oredict entries with OreDictionary.WILDCARD_VALUE as the metadata, and it's then using that value as a real metadata value in a call to getStateForPlacement.

CritFlaw commented 5 years ago

Left more info in your discord about this, but Shadows said:

"its a crash on rft's end from a failure to properly handle the wildcard meta to convert from an oredict entry back to a "real" thing you have to get a state from the item when the item has the meta wildcard (32767) and the state doesn't handle it properly, stuff like that happens specifically he's accessing an array without clamping a value"

I don't know what any of that means but maybe you'll find it useful.

MichaelHillcox commented 5 years ago

https://github.com/McJtyMods/RFTools/blob/81265abccbcd9e8f4c6644c5a59d883494f43b15/src/main/java/mcjty/rftools/blocks/ores/DimensionalShardBlock.java#L145 offending line.

Recommended fix would be to clamp the int back to a valid value or return the default state and log an internal error.