ejektaflex / Bountiful

A Minecraft mod adding bounties for specific items.
https://minecraft.curseforge.com/projects/bountiful
GNU General Public License v3.0
91 stars 32 forks source link

[Bug]: LootBeams conflict [ALTERNATIVE SOLUTION FOUND] #301

Closed vollukas closed 1 month ago

vollukas commented 1 month ago

What happened?

After I dropped the expired bounty, saved and closed the world and tried to open it again. My game kept crashing after loading that world with expired bounty dropped on the ground. (conflict with lootbeams mod)

How can we reproduce it?

Drop expired bounty on ground with lootbeams mod installed. Exit and try to load game again.

Mod Version

Minecraft 1.20.1

Mod Loader

None

Mod Loader Version

forge 47.3.7

Relevant log output

(removed some mod imports to make it more readable)

---- Minecraft Crash Report ----

// Hi. I'm Connector, and I'm a crashaholic

SINYTRA CONNECTOR IS PRESENT! Please verify issues are not caused by Connector before reporting them to mod authors. If you're unsure, file a report on Connector's issue tracker found at https://github.com/Sinytra/Connector/issues.

// I bet Cylons wouldn't have this problem.

Time: 2024-10-20 21:49:11 Description: Exception ticking world

java.lang.NullPointerException: Exception ticking world at io.ejekta.bountiful.content.BountyItem.m7626(BountyItem.java:35) ~[Bountiful-6.0.3+1.20.1-forge.jar%23581!/:?] {re:classloading} at net.minecraft.world.item.ItemStack.m41786(ItemStack.java:580) ~[client-1.20.1-20230612.114412-srg.jar%23890!/:?] {re:mixin,pl:accesstransformer:B,xf:fml:calio:calio_remove_flag,xf:fml:forge:itemstack,pl:connector_pre_launch:A,re:classloading,pl:accesstransformer:B,xf:fml:calio:calio_remove_flag,xf:fml:forge:itemstack,pl:mixin:APP:recipeessentials.mixins.json:nbt.ItemStackMixin from mod recipeessentials,pl:mixin:APP:apotheosis.mixins.json:ItemStackMixin from mod apotheosis,pl:mixin:APP:connectormod.mixins.json:item.ItemStackMixin from mod bclib,pl:mixin:APP:mixins.deeperdarker.json:ItemStackMixin from mod deeperdarker,pl:mixin:APP:itemfilters-common.mixins.json:ItemStackMixin from mod itemfilters,pl:mixin:APP:forbidden_arcanus.mixins.json:ItemStackMixin from mod forbidden_arcanus,pl:mixin:APP:skilltree.mixins.json:minecraft/ItemStackMixin from mod skilltree,pl:mixin:APP:quark.mixins.json:ItemStackMixin from mod quark,pl:mixin:APP:apugli.mixins.json:common.ItemStackMixin from mod apugli,pl:mixin:APP:apugli.forge.mixins.json:common.ItemStackMixin from mod apugli,pl:mixin:APP:connectormod.mixins.json:item.LateItemStackMixin from mod connectormod,pl:mixin:A,pl:connector_pre_launch:A} at com.lootbeams.ClientSetup.lambda$onItemCreation$3(ClientSetup.java:197) ~[lootbeams-1.20.1-1.2.6.jar%23721!/:1.20.1-1.2.6] {re:mixin,re:classloading} at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1708) ~[?:?] {re:mixin} at com.lootbeams.ClientSetup.onItemCreation(ClientSetup.java:197) ~[lootbeams-1.20.1-1.2.6.jar%23721!/:1.20.1-1.2.6] {re:mixin,re:classloading} at net.minecraftforge.eventbus.EventBus.doCastFilter(EventBus.java:260) ~[eventbus-6.0.5.jar%2387!/:?] {} at net.minecraftforge.eventbus.EventBus.lambda$addListener$11(EventBus.java:252) ~[eventbus-6.0.5.jar%2387!/:?] {} at net.minecraftforge.eventbus.EventBus.post(EventBus.java:315) ~[eventbus-6.0.5.jar%2387!/:?] {} at net.minecraftforge.eventbus.EventBus.post(EventBus.java:296) ~[eventbus-6.0.5.jar%2387!/:?] {} at net.minecraft.world.level.entity.PersistentEntitySectionManager.m157538(PersistentEntitySectionManager.java:79) ~[client-1.20.1-20230612.114412-srg.jar%23890!/:?] {re:mixin,pl:accesstransformer:B,pl:connector_pre_launch:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:smoothchunk.mixins.json:PersistentEntitySectionManagerMixin from mod smoothchunk,pl:mixin:APP:lithium.mixins.json:chunk.entity_class_groups.ServerEntityManagerAccessor from mod radium,pl:mixin:APP:lithium.mixins.json:util.entity_movement_tracking.ServerEntityManagerAccessor from mod radium,pl:mixin:A,pl:connector_pre_launch:A} at net.minecraft.world.level.entity.PersistentEntitySectionManager.m157592(PersistentEntitySectionManager.java:260) ~[client-1.20.1-20230612.114412-srg.jar%23890!/:?] {re:mixin,pl:accesstransformer:B,pl:connector_pre_launch:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:smoothchunk.mixins.json:PersistentEntitySectionManagerMixin from mod smoothchunk,pl:mixin:APP:lithium.mixins.json:chunk.entity_class_groups.ServerEntityManagerAccessor from mod radium,pl:mixin:APP:lithium.mixins.json:util.entity_movement_tracking.ServerEntityManagerAccessor from mod radium,pl:mixin:A,pl:connector_pre_launch:A} at java.util.Collections$2.tryAdvance(Collections.java:4853) ~[?:?] {} at java.util.Collections$2.forEachRemaining(Collections.java:4861) ~[?:?] {} at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:762) ~[?:?] {} at net.minecraft.world.level.entity.PersistentEntitySectionManager.m157582(PersistentEntitySectionManager.java:259) ~[client-1.20.1-20230612.114412-srg.jar%23890!/:?] {re:mixin,pl:accesstransformer:B,pl:connector_pre_launch:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:smoothchunk.mixins.json:PersistentEntitySectionManagerMixin from mod smoothchunk,pl:mixin:APP:lithium.mixins.json:chunk.entity_class_groups.ServerEntityManagerAccessor from mod radium,pl:mixin:APP:lithium.mixins.json:util.entity_movement_tracking.ServerEntityManagerAccessor from mod radium,pl:mixin:A,pl:connector_pre_launch:A} at net.minecraft.world.level.entity.PersistentEntitySectionManager.m157506(PersistentEntitySectionManager.java:269) ~[client-1.20.1-20230612.114412-srg.jar%23890!/:?] {re:mixin,pl:accesstransformer:B,pl:connector_pre_launch:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:smoothchunk.mixins.json:PersistentEntitySectionManagerMixin from mod smoothchunk,pl:mixin:APP:lithium.mixins.json:chunk.entity_class_groups.ServerEntityManagerAccessor from mod radium,pl:mixin:APP:lithium.mixins.json:util.entity_movement_tracking.ServerEntityManagerAccessor from mod radium,pl:mixin:A,pl:connector_pre_launch:A} at net.minecraft.server.level.ServerLevel.m8793(ServerLevel.java:355) ~[client-1.20.1-20230612.114412-srg.jar%23890!/:?]

A detailed walkthrough of the error, its code path and all known details is as follows:

-- Head -- Thread: Server thread Suspected Mods: Bountiful (bountiful), Version: 6.0.3+1.20.1 at TRANSFORMER/bountiful@6.0.3+1.20.1/io.ejekta.bountiful.content.BountyItem.m7626(BountyItem.java:35)

LootBeams (lootbeams), Version: 1.20.1
    at TRANSFORMER/lootbeams@1.20.1/com.lootbeams.ClientSetup.lambda$onItemCreation$3(ClientSetup.java:197)

Stacktrace: at io.ejekta.bountiful.content.BountyItem.m7626(BountyItem.java:35) ~[Bountiful-6.0.3+1.20.1-forge.jar%23581!/:?] {re:classloading} at net.minecraft.world.item.ItemStack.m41786(ItemStack.java:580) ~[client-1.20.1-20230612.114412-srg.jar%23890!/:?] {re:mixin,pl:accesstransformer:B,xf:fml:calio:calio_remove_flag,xf:fml:forge:itemstack,pl:connector_pre_launch:A,re:classloading,pl:accesstransformer:B,xf:fml:calio:calio_remove_flag,xf:fml:forge:itemstack,pl:mixin:APP:recipeessentials.mixins.json:nbt.ItemStackMconnectormod,pl:mixin:A,pl:connector_pre_launch:A} at net.minecraft.world.item.ItemStack.m41651(ItemStack.java:616) ~[client-1.20.1-20230612.114412-srg.jar%23890!/:?] {re:mixin,pl:accesstransformer:B,xf:fml:calio:calio_remove_flag,xf:fml:forge:itemstack,pl:connector_pre_launch:A,re:classloading,pl:accesstransformer:B,xf:fml:calio:calio_remove_flag,xf:fml:forge:itemstack,pl:mixin:APP:recipeessentials.mixins.json:nbt.ItemStackMiconnectormod,pl:mixin:A,pl:connector_pre_launch:A} at com.lootbeams.ClientSetup.lambda$onItemCreation$3(ClientSetup.java:197) ~[lootbeams-1.20.1-1.2.6.jar%23721!/:1.20.1-1.2.6] {re:mixin,re:classloading} at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1708) ~[?:?] {re:mixin} at com.lootbeams.ClientSetup.onItemCreation(ClientSetup.java:197) ~[lootbeams-1.20.1-1.2.6.jar%23721!/:1.20.1-1.2.6] {re:mixin,re:classloading} at net.minecraftforge.eventbus.EventBus.doCastFilter(EventBus.java:260) ~[eventbus-6.0.5.jar%2387!/:?] {} at net.minecraftforge.eventbus.EventBus.lambda$addListener$11(EventBus.java:252) ~[eventbus-6.0.5.jar%2387!/:?] {} at net.minecraftforge.eventbus.EventBus.post(EventBus.java:315) ~[eventbus-6.0.5.jar%2387!/:?] {} at net.minecraftforge.eventbus.EventBus.post(EventBus.java:296) ~[eventbus-6.0.5.jar%2387!/:?] {} at net.minecraft.world.level.entity.PersistentEntitySectionManager.m157538(PersistentEntitySectionManager.java:79) ~[client-1.20.1-20230612.114412-srg.jar%23890!/:?] {re:mixin,pl:accesstransformer:B,pl:connector_pre_launch:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:smoothchunk.mixins.json:PersistentEntitySectionManagerMixin from mod smoothchunk,pl:mixin:APP:lithium.mixins.json:chunk.entity_class_groups.ServerEntityManagerAccessor from mod radium,pl:mixin:APP:lithium.mixins.json:util.entity_movement_tracking.ServerEntityManagerAccessor from mod radium,pl:mixin:A,pl:connector_pre_launch:A} at net.minecraft.world.level.entity.PersistentEntitySectionManager.m157592(PersistentEntitySectionManager.java:260) ~[client-1.20.1-20230612.114412-srg.jar%23890!/:?] {re:mixin,pl:accesstransformer:B,pl:connector_pre_launch:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:smoothchunk.mixins.json:PersistentEntitySectionManagerMixin from mod smoothchunk,pl:mixin:APP:lithium.mixins.json:chunk.entity_class_groups.ServerEntityManagerAccessor from mod radium,pl:mixin:APP:lithium.mixins.json:util.entity_movement_tracking.ServerEntityManagerAccessor from mod radium,pl:mixin:A,pl:connector_pre_launch:A} at java.util.Collections$2.tryAdvance(Collections.java:4853) ~[?:?] {} at java.util.Collections$2.forEachRemaining(Collections.java:4861) ~[?:?] {} at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:762) ~[?:?] {} at net.minecraft.world.level.entity.PersistentEntitySectionManager.m157582(PersistentEntitySectionManager.java:259) ~[client-1.20.1-20230612.114412-srg.jar%23890!/:?] {re:mixin,pl:accesstransformer:B,pl:connector_pre_launch:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:smoothchunk.mixins.json:PersistentEntitySectionManagerMixin from mod smoothchunk,pl:mixin:APP:lithium.mixins.json:chunk.entity_class_groups.ServerEntityManagerAccessor from mod radium,pl:mixin:APP:lithium.mixins.json:util.entity_movement_tracking.ServerEntityManagerAccessor from mod radium,pl:mixin:A,pl:connector_pre_launch:A} at net.minecraft.world.level.entity.PersistentEntitySectionManager.m157506(PersistentEntitySectionManager.java:269) ~[client-1.20.1-20230612.114412-srg.jar%23890!/:?] {re:mixin,pl:accesstransformer:B,pl:connector_pre_launch:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:smoothchunk.mixins.json:PersistentEntitySectionManagerMixin from mod smoothchunk,pl:mixin:APP:lithium.mixins.json:chunk.entity_class_groups.ServerEntityManagerAccessor from mod radium,pl:mixin:APP:lithium.mixins.json:util.entity_movement_tracking.ServerEntityManagerAccessor from mod radium,pl:mixin:A,pl:connector_pre_launch:A} at net.minecraft.server.level.ServerLevel.m8793(ServerLevel.java:355) ~[client-1.20.1-20230612.114412-srg.jar%23890!/:?] {re:mixin,pl:accesstransformer:B,pl:connector_pre_launch:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:cupboard.mixins.json:ServerAddEntityMixin from mod cupboard,pl:mixin:APP:betterendisland.mixins.json:ServerLevelMixin from mod fabric_data_attachment_api_v1,pl:mixin:APP:bclib.mixins.common.json:ServerLevelMixin from mod bclib,pl:mixin:APP:fabric-lifecycle-events-v1.mixins.json:ServerWorldMixin from mod fabric_lifecycle_events_v1,pl:mixin:APP:supplementaries-common.mixins.json:ServerLevelMixin from mod supplementaries,pl:mixin:APP:apugli.mixins.json:common.ServerWorldMixin from mod apugli,pl:mixin:APP:betterendisland.mixins.json:EndergeticExpansionMixins from mod betterendisland,pl:mixin:A,pl:connector_pre_launch:A}

-- Affected level -- Details: All players: 0 total; [] Chunk stats: 2209 Level dimension: minecraft:overworld Level spawn location: World: (-496,124,112), Section: (at 0,12,0 in -31,7,7; chunk contains blocks -496,-64,112 to -481,319,127), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,-64,0 to -1,319,511) Level time: 3003920 game time, 4513616 day time Level name: Journey Level game mode: Game mode: survival (ID 0). Hardcore: false. Cheats: true Level weather: Rain time: 45825 (now: false), thunder time: 119066 (now: false) Known server brands: forge Removed feature flags: Level was modded: true Level storage version: 0x04ABD - Anvil

Forge: net.minecraftforge:47.3.7
Kiwi Modules: 
    kiwi:block_components
    kiwi:block_templates
    kiwi:contributors
    kiwi:data
    kiwi:item_templates
    passablefoliage:core
    passablefoliage:enchantment
    snowrealmagic:core
vollukas commented 1 month ago

I found solution online to blacklist Bountiful in lootbeams mod. But I wasn't really sure how to exactly do it (not sure if I got correct config file, which string or ID should I put into blacklist etc..)

So I found my own solution: image In config file for your Bountiful mod (mine was in folder for medieval Minecraft [Forge MMC4]) set shouldBountiesHaveTimersAndExpire to false and load your world without error! Then find dropped expired bounty and pick it up. After that you can close the game and set shouldBountiesHaveTimersAndExpire back to true.

Hope it helps someone! :)

ejektaflex commented 1 month ago

Lootbeams for some reason caches every single tooltip of every single item that enters the world (https://github.com/shiroroku/LootBeams/blob/36f44644cf086de9da45c1cfa2bf86cbc4a67779/src/main/java/com/lootbeams/ClientSetup.java#L197). I presume it's needed for mod functionality, but the fact that they do this on the server is a bit odd.

Anyhow, this is how I've found out that calling BountyItem::getName() on the server will crash, I never realized you could call it on the server or that you'd even want do so (Bounty names only render on the client). This could be fixed, but it is a very low priority.

ejektaflex commented 1 month ago

I'm going to mark this as 'wontfix' and close it. This is my reasoning:

If one of us fixes our bugs (the LootBeams dev or me), it will go away. However, since I'm sadly quite busy and preoccupied right now, and since I've never seen a person actually intentionally call getName on the server, I am rather content with not fixing this bug and leaving it for the LootBeams developer to fix if they so choose. I hope you understand, thank you!

ejektaflex commented 1 month ago

For reference, this same bug is affecting these issues in the LootBeams issue tracker: https://github.com/shiroroku/LootBeams/issues/50 https://github.com/shiroroku/LootBeams/issues/48 https://github.com/shiroroku/LootBeams/issues/43 https://github.com/shiroroku/LootBeams/issues/33

And this issue from 1.19.2: https://github.com/shiroroku/LootBeams/issues/26 Is different (they're doing a concurrentaccessmodification), but it's clear that it's still running client code on the server side, so the issue may still be present in 1.19.2 or earlier for LootBeams.