Tfarcenim / RandomEnchantments

random enchants

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Server crash

RageQuitAmy opened this issue · comments

Ok so I help with a minecraft server and the server crashes quite a lot, usually because of a different mod but sometimes this one causes it. Here is a pastebin link for the crash, if it doesn't give enough information please let me know and I will try to give you more information :). Crash Report

Thanks in advance.

From my analysis the cause is Additional Events assuming BlockState#getDrops return is mutable and consequently passing that collection through into its DropLootEvent to be modified by event consumers, such as Random Enchantments. In vanilla code it is a typical case for an unmodifiable list to be returned such as for an empty loot table and modded blocks widen those cases.

I would new ArrayList wrap the return list on this line:

https://github.com/Tfarcenim/AdditionalEvents/blob/57e49400b9f6921430e367deb6918948c82854b5/src/main/java/com/tfar/additionalevents/mixin/MixinBlockState.java#L42