SuperMartijn642 / TrashCans

2 stars 12 forks source link

[Crash - Neo] Crash Upon Filter Items Save #49

Closed KhanhPham05 closed 2 days ago

KhanhPham05 commented 2 days ago

Version Info

Description

Crash description Full stack trace has been truncated to relevant parts.

IllegalStateException: Element Reference{ResourceKey[minecraft:enchantment / minecraft:efficiency]=Enchantment Efficiency} is not valid in current registry set
    at DataResult$Error.getOrThrow(DataResult.java:287)
    at DataResult.getOrThrow(DataResult.java:81)
    at DataComponentUtil.wrapEncodingExceptions(DataComponentUtil.java:24)
    at ItemStack.save(ItemStack.java:415)
    at ItemStack.saveOptional(ItemStack.java:429)
        * at TrashCanBlockEntity.writeData(TrashCanBlockEntity.java:320)
    * at com.supermartijn642.core.block.BaseBlockEntity.saveAdditional(BaseBlockEntity.java:70)
    at BlockEntity.saveWithoutMetadata(BlockEntity.java:114)
    at BlockEntity.saveWithFullMetadata(BlockEntity.java:101)
SuperMartijn642 commented 2 days ago

Crash happens upon breaking the Item Trash Can with item that has ANY enchantment (tested with Unbreaking, presumably applies to all enchantments in any levels).

Empty filter or filter with non-enchanted items will not causes crash.

I am confused, does the crash happen when you break the trash can with an enchanted item or does the crash happen when you use an enchanted item in the filter?

KhanhPham05 commented 2 days ago

I mean crash happened when any enchanted item is in the filter slots

SuperMartijn642 commented 2 days ago

Should be fixed now in version 1.0.18c of Trash Cans. Thank you for reporting the issue!