Bedrock Ores

Bedrock Ores

541k Downloads

Crash when other mod tries to interact with HarvestDropsEvent from ore

Thutmose opened this issue ยท 1 comments

commented

the TileEntityBedrockOre passes an immutable list to HarvestDropsEvent, so if another mod tries to add to it, it crashes due to UnsupportedOperationException.

Here is crash report:

https://gist.github.com/Thutmose/2c2bf44f45a8764867ab5fbc64f52c10

Here is the relevant method in nuclearcraft:

https://github.com/turbodiesel4598/NuclearCraft/blob/master/src/main/java/nc/handler/DropHandler.java#L43-L60

It tries to add more drops by calling event.getDrops().add(stack), but since the event has an immutable list, this crashes.

https://github.com/MightyPirates/BedrockOres/blob/master-MC1.11/src/main/java/li/cil/bedrockores/common/tileentity/TileEntityBedrockOre.java#L122-L153

commented

Gah, that's what happens when you try to optimize without checking internals... thanks for the info!