MoonflowerTeam / pollen

⚙️ Library for all Moonflower mods. Adds bridges for Fabric and Forge using Architectury along with utilities such as our Pinwheel bedrock animation API.
https://www.curseforge.com/minecraft/mc-mods/pollen
Other
32 stars 19 forks source link

[1.18.2-fabric] Etched crashes when trying to add villager trades #60

Closed TelepathicGrunt closed 2 years ago

TelepathicGrunt commented 2 years ago

What version are you seeing the problem on?

1.18.2

Describe the issue

User reported that Repurposed Structures and Etched crashes together. https://www.curseforge.com/minecraft/mc-mods/repurposed-structures-fabric?comment=529

Upon testing, it seems Etched is crashing when trying to add a villager trade to the bard. It seems the tier it gets back is null?

https://github.com/MoonflowerTeam/etched/blob/ff51fba785f3391a1075d0ddff5fab2e4e370a75/common/src/main/java/gg/moonflower/etched/core/Etched.java#L66

However, do note, I have stopped supporting 1.18.2 but if the issue is on my end, I'll put a fix out for 1.19. Though I do not see why the tier for the bard would be null only when my mod is on. On Forge our mods work together just fine (as I use the Forge trade API there. I had to copy Forge's event to Fabric so I can keep my datapackable villager trade stuff since Fabric's villager trade runs at mod startup before any datapack is read. Flaw of Fabric's event)
https://github.com/TelepathicGrunt/RepurposedStructures-Quilt/blob/ddacea6f05b730fc48b604a83994b50792d6aa8e/src/main/java/com/telepathicgrunt/repurposedstructures/misc/maptrades/StructureMapTradesEvents.java#L43

The only thing I can think of is the Bard's trades is not being put into VillagerTrades.TRADES and that's causing some weird interaction with my code. Otherwise, it is strange as my mod seems to work fine with other Villager mods like More Villagers and such.

latest.log

[23:40:28] [main/INFO]: Loading Minecraft 1.18.2 with Fabric Loader 0.14.8
[23:40:28] [main/INFO]: Fabric is preparing JARs on first launch, this may take a few seconds...
[23:40:29] [main/INFO]: Loading 58 mods:
    - cardinal-components-base 4.1.4 via pollen
    - cardinal-components-entity 4.1.4 via pollen
    - cloth-basic-math 0.6.1 via cloth-config
    - cloth-config 6.2.62
    - etched 2.0.0
    - fabric 0.58.0+1.18.2
    - fabric-api-base 0.4.4+d7c144a860 via fabric
    - fabric-api-lookup-api-v1 1.6.2+2373a54560 via fabric
    - fabric-biome-api-v1 8.0.6+651bcc5960 via fabric
    - fabric-blockrenderlayer-v1 1.1.12+3ac43d9560 via fabric
    - fabric-command-api-v1 1.1.9+d7c144a860 via fabric
    - fabric-commands-v0 0.2.8+b4f4f6cd60 via fabric
    - fabric-containers-v0 0.1.23+d7c144a860 via fabric
    - fabric-content-registries-v0 3.1.1+c85f2e3860 via fabric
    - fabric-convention-tags-v1 1.0.1+474e4f7960 via fabric
    - fabric-crash-report-info-v1 0.2.1+ee261a3e60 via fabric
    - fabric-data-generation-api-v1 3.0.1+9fcb91d260 via fabric
    - fabric-dimensions-v1 2.1.20+489d6f8260 via fabric
    - fabric-entity-events-v1 1.4.8+d7c144a860 via fabric
    - fabric-events-interaction-v0 0.4.19+d7c144a860 via fabric
    - fabric-events-lifecycle-v0 0.2.19+d7c144a860 via fabric
    - fabric-game-rule-api-v1 1.0.13+d7c144a860 via fabric
    - fabric-item-api-v1 1.5.2+17cbbd4360 via fabric
    - fabric-item-groups-v0 0.3.14+91896a4960 via fabric
    - fabric-key-binding-api-v1 1.0.12+54e5b2ec60 via fabric
    - fabric-keybindings-v0 0.2.10+b4f4f6cd60 via fabric
    - fabric-lifecycle-events-v1 2.1.0+cc71601c60 via fabric
    - fabric-loot-api-v2 1.1.0+1997ad1260 via fabric
    - fabric-loot-tables-v1 1.1.2+e747827960 via fabric
    - fabric-mining-level-api-v1 2.1.4+cc71601c60 via fabric
    - fabric-models-v0 0.3.6+d7c144a860 via fabric
    - fabric-networking-api-v1 1.0.23+2d30af4b60 via fabric
    - fabric-networking-v0 0.3.10+b4f4f6cd60 via fabric
    - fabric-object-builder-api-v1 2.1.3+032c981d60 via fabric
    - fabric-particles-v1 0.2.12+526dc1ac60 via fabric
    - fabric-registry-sync-v0 0.9.10+0d9ab37260 via fabric
    - fabric-renderer-api-v1 0.4.13+d882b91560 via fabric
    - fabric-renderer-indigo 0.5.3+41a02c8a60 via fabric
    - fabric-renderer-registries-v1 3.2.11+b4f4f6cd60 via fabric
    - fabric-rendering-data-attachment-v1 0.3.7+d7c144a860 via fabric
    - fabric-rendering-fluids-v1 2.0.2+54e5b2ec60 via fabric
    - fabric-rendering-v0 1.1.13+b4f4f6cd60 via fabric
    - fabric-rendering-v1 1.10.7+54e5b2ec60 via fabric
    - fabric-resource-conditions-api-v1 2.0.3+91b7aa6660 via fabric
    - fabric-resource-loader-v0 0.5.2+446e059560 via fabric
    - fabric-screen-api-v1 1.0.10+d882b91560 via fabric
    - fabric-screen-handler-api-v1 1.2.2+1f6558e860 via fabric
    - fabric-textures-v0 1.0.12+3ac43d9560 via fabric
    - fabric-transfer-api-v1 1.6.3+f4563ac860 via fabric
    - fabric-transitive-access-wideners-v1 1.1.0+e747827960 via fabric
    - fabricloader 0.14.8
    - feature_nbt_deadlock_be_gone 2.0.0+1.18.2-rc1
    - java 17
    - javazoom_jlayer 1.0.1 via etched
    - minecraft 1.18.2
    - omega-config 1.0.8 via repurposed_structures
    - pollen 1.4.7
    - repurposed_structures 4.1.14+1.18.2
[23:40:29] [main/INFO]: SpongePowered MIXIN Subsystem Version=0.8.5 Source=file:/C:/Users/MSI%20Laptop/Twitch/Minecraft/Install/libraries/net/fabricmc/sponge-mixin/0.11.4+mixin.0.8.5/sponge-mixin-0.11.4+mixin.0.8.5.jar Service=Knot/Fabric Env=CLIENT
[23:40:29] [main/INFO]: Attempting to load Fernflower decompiler (Threaded mode)
[23:40:29] [main/INFO]: Fernflower could not be loaded, exported classes will not be decompiled. NoClassDefFoundError: org/jetbrains/java/decompiler/main/extern/IResultSaver
[23:40:31] [main/INFO]: Compatibility level set to JAVA_17
[23:40:32] [main/WARN]: Configuration conflict: there is more than one oshi.properties file on the classpath
[23:40:32] [main/WARN]: Configuration conflict: there is more than one oshi.architecture.properties file on the classpath
[23:40:39] [Render thread/INFO]: Environment: authHost='https://authserver.mojang.com', accountsHost='https://api.mojang.com', sessionHost='https://sessionserver.mojang.com', servicesHost='https://api.minecraftservices.com', name='PROD'
[23:40:39] [Render thread/INFO]: Setting user: TelepathicGrunt
[23:40:39] [Render thread/ERROR]: No data fixer registered for minecart_jukebox
[23:40:41] [Render thread/WARN]: Configuration file C:\Users\MSI Laptop\Twitch\Minecraft\Instances\fabric-1.18.2\config\etched-client.toml is not correct. Correcting
[23:40:41] [Render thread/WARN]: Incorrect key Game Feel was corrected from null to its default, SimpleCommentedConfig:{}. 
[23:40:41] [Render thread/WARN]: Incorrect key Game Feel.Display Note Particles was corrected from null to its default, true. 
[23:40:41] [Render thread/ERROR]: No data fixer registered for pollen:boat
[23:40:42] [Render thread/INFO]: [Indigo] Registering Indigo renderer!
[23:40:42] [Render thread/INFO]: Backend library: LWJGL version 3.2.2 build 10
[23:40:47] [Render thread/INFO]: Narrator library for x64 successfully loaded
[23:40:48] [Render thread/INFO]: Reloading ResourceManager: Default, Fabric Mods (Cardinal Components API (base), Cardinal Components API (entities), Cloth Config v6, Etched, Fabric API, Fabric API Base, Fabric API Lookup API (v1), Fabric Biome API (v1), Fabric BlockRenderLayer Registration (v1), Fabric Command API (v1), Fabric Commands (v0), Fabric Containers (v0), Fabric Content Registries (v0), Fabric Convention Tags, Fabric Crash Report Info (v1), Fabric Data Generation API (v1), Fabric Dimensions API (v1), Fabric Entity Events (v1), Fabric Events Interaction (v0), Fabric Events Lifecycle (v0), Fabric Game Rule API (v1), Fabric Item API (v1), Fabric Item Groups (v0), Fabric Key Binding API (v1), Fabric Key Bindings (v0), Fabric Lifecycle Events (v1), Fabric Loot API (v2), Fabric Loot Tables (v1), Fabric Mining Level API (v1), Fabric Models (v0), Fabric Networking API (v1), Fabric Networking (v0), Fabric Object Builder API (v1), Fabric Particles (v1), Fabric Registry Sync (v0), Fabric Renderer API (v1), Fabric Renderer - Indigo, Fabric Renderer Registries (v1), Fabric Rendering Data Attachment (v1), Fabric Rendering Fluids (v1), Fabric Rendering (v0), Fabric Rendering (v1), Fabric Resource Conditions API (v1), Fabric Resource Loader (v0), Fabric Screen API (v1), Fabric Screen Handler API (v1), Fabric Textures (v0), Fabric Transfer API (v1), Fabric Transitive Access Wideners (v1), Fabric Loader, Feature NBT Deadlock Be Gone - Fabric, Pollen, Repurposed Structures)
[23:40:48] [Render thread/INFO]: Loaded 0 resource modifiers
[23:40:48] [Worker-Main-14/INFO]: Loaded 0 geometry models.
[23:40:48] [Worker-Main-14/INFO]: Loaded 0 geometry models.
[23:40:48] [Worker-Main-22/INFO]: Loaded 0 hash tables.
[23:40:48] [Worker-Main-14/INFO]: Loaded 0 model texture tables.
[23:40:53] [Render thread/INFO]: OpenAL initialized on device OpenAL Soft on Speakers (Realtek(R) Audio)
[23:40:53] [Render thread/INFO]: Sound engine started
[23:40:53] [Render thread/INFO]: Created: 1024x1024x4 minecraft:textures/atlas/blocks.png-atlas
[23:40:53] [Render thread/INFO]: Created: 256x128x4 minecraft:textures/atlas/signs.png-atlas
[23:40:53] [Render thread/INFO]: Created: 1024x512x4 minecraft:textures/atlas/banner_patterns.png-atlas
[23:40:53] [Render thread/INFO]: Created: 1024x512x4 minecraft:textures/atlas/shield_patterns.png-atlas
[23:40:53] [Render thread/INFO]: Created: 256x256x4 minecraft:textures/atlas/chest.png-atlas
[23:40:53] [Render thread/INFO]: Created: 512x256x4 minecraft:textures/atlas/beds.png-atlas
[23:40:53] [Render thread/INFO]: Created: 512x256x4 minecraft:textures/atlas/shulker_boxes.png-atlas
[23:40:54] [Render thread/INFO]: Created: 256x256x0 minecraft:textures/atlas/particles.png-atlas
[23:40:54] [Render thread/INFO]: Created: 256x256x0 minecraft:textures/atlas/paintings.png-atlas
[23:40:54] [Render thread/INFO]: Created: 256x128x0 minecraft:textures/atlas/mob_effects.png-atlas
[23:40:54] [Render thread/INFO]: Loaded 0 geometry models.
[23:40:54] [Render thread/INFO]: Created: 16x16x4 pollen:textures/atlas/geometry.png-atlas
[23:40:54] [Render thread/INFO]: Loaded 0 animations.
[23:41:01] [Render thread/WARN]: Method overwrite conflict for getRolls in pollen-common.mixins.json:loot.LootPoolAccessor from mod pollen, previously written by net.fabricmc.fabric.mixin.loot.table.MixinLootPool. Skipping method.
[23:41:02] [Render thread/WARN]: Ambiguity between arguments [teleport, location] and [teleport, destination] with inputs: [0.1 -0.5 .9, 0 0 0]
[23:41:02] [Render thread/WARN]: Ambiguity between arguments [teleport, location] and [teleport, targets] with inputs: [0.1 -0.5 .9, 0 0 0]
[23:41:02] [Render thread/WARN]: Ambiguity between arguments [teleport, destination] and [teleport, targets] with inputs: [Player, 0123, @e, dd12be42-52a9-4a91-a8a1-11c01849e498]
[23:41:02] [Render thread/WARN]: Ambiguity between arguments [teleport, targets] and [teleport, destination] with inputs: [Player, 0123, dd12be42-52a9-4a91-a8a1-11c01849e498]
[23:41:02] [Render thread/WARN]: Ambiguity between arguments [teleport, targets, location] and [teleport, targets, destination] with inputs: [0.1 -0.5 .9, 0 0 0]
[23:41:02] [Render thread/INFO]: Loaded 0 data modifiers
[23:41:03] [Render thread/INFO]: Loaded 8 recipes
[23:41:03] [Render thread/INFO]: Loaded 1167 advancements
[23:41:04] [Render thread/WARN]: Ambiguity between arguments [teleport, location] and [teleport, destination] with inputs: [0.1 -0.5 .9, 0 0 0]
[23:41:04] [Render thread/WARN]: Ambiguity between arguments [teleport, location] and [teleport, targets] with inputs: [0.1 -0.5 .9, 0 0 0]
[23:41:04] [Render thread/WARN]: Ambiguity between arguments [teleport, destination] and [teleport, targets] with inputs: [Player, 0123, @e, dd12be42-52a9-4a91-a8a1-11c01849e498]
[23:41:04] [Render thread/WARN]: Ambiguity between arguments [teleport, targets] and [teleport, destination] with inputs: [Player, 0123, dd12be42-52a9-4a91-a8a1-11c01849e498]
[23:41:04] [Render thread/WARN]: Ambiguity between arguments [teleport, targets, location] and [teleport, targets, destination] with inputs: [0.1 -0.5 .9, 0 0 0]
[23:41:04] [Render thread/INFO]: Loaded 0 data modifiers
[23:41:05] [Render thread/INFO]: Loaded 8 recipes
[23:41:05] [Render thread/INFO]: Loaded 1167 advancements
[23:41:05] [Render thread/INFO]: Environment: authHost='https://authserver.mojang.com', accountsHost='https://api.mojang.com', sessionHost='https://sessionserver.mojang.com', servicesHost='https://api.minecraftservices.com', name='PROD'
[23:41:05] [Render thread/INFO]: Applied 130 biome modifications to 61 of 61 new biomes in 21.27 ms
[23:41:05] [Server thread/INFO]: Starting integrated minecraft server version 1.18.2
[23:41:05] [Server thread/INFO]: Generating keypair
[23:41:05] [Server thread/WARN]: Configuration file C:\Users\MSI Laptop\Twitch\Minecraft\Instances\fabric-1.18.2\saves\New World\serverconfig\etched-server.toml is not correct. Correcting
[23:41:05] [Server thread/WARN]: Incorrect key Boombox was corrected from null to its default, SimpleCommentedConfig:{}. 
[23:41:05] [Server thread/WARN]: Incorrect key Boombox.Use boombox menu was corrected from null to its default, false. 
[23:41:05] [Server thread/WARN]: Incorrect key Album Cover was corrected from null to its default, SimpleCommentedConfig:{}. 
[23:41:05] [Server thread/WARN]: Incorrect key Album Cover.Use album cover menu was corrected from null to its default, false. 
[23:41:05] [Server thread/ERROR]: Encountered an unexpected exception
java.lang.NullPointerException: Cannot invoke "gg.moonflower.pollen.api.event.events.entity.ModifyTradesEvents$TradeRegistry.add(net.minecraft.class_1935, int, int, int, int, boolean)" because "tier1" is null
    at gg.moonflower.etched.core.Etched.lambda$commonInit$2(Etched.java:66) ~[etched-fabric-2.0.0+1.18.2.jar:?]
    at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:732) ~[?:?]
    at gg.moonflower.pollen.api.registry.EventRegistry.invokeFast(EventRegistry.java:61) ~[pollen-fabric-1.4.7+1.18.2.jar:?]
    at gg.moonflower.pollen.api.registry.EventRegistry.lambda$createLoop$0(EventRegistry.java:40) ~[pollen-fabric-1.4.7+1.18.2.jar:?]
    at jdk.proxy2.$Proxy40.modifyTrades(Unknown Source) ~[?:?]
    at gg.moonflower.pollen.common.trades.VillagerTradeManager.registerVillagerTrades(VillagerTradeManager.java:82) ~[pollen-fabric-1.4.7+1.18.2.jar:?]
    at gg.moonflower.pollen.common.trades.VillagerTradeManager.init(VillagerTradeManager.java:33) ~[pollen-fabric-1.4.7+1.18.2.jar:?]
    at gg.moonflower.pollen.core.fabric.PollenFabric.lambda$onInitialize$18(PollenFabric.java:101) ~[pollen-fabric-1.4.7+1.18.2.jar:?]
    at gg.moonflower.pollen.api.event.events.lifecycle.ServerLifecycleEvents.lambda$static$0(ServerLifecycleEvents.java:11) ~[pollen-fabric-1.4.7+1.18.2.jar:?]
    at net.minecraft.class_1132.handler$znd001$preStart(class_1132.java:516) ~[client-intermediary.jar:?]
    at net.minecraft.class_1132.method_3823(class_1132.java:70) ~[client-intermediary.jar:?]
    at net.minecraft.server.MinecraftServer.method_29741(MinecraftServer.java:670) ~[client-intermediary.jar:?]
    at net.minecraft.server.MinecraftServer.method_29739(MinecraftServer.java:273) ~[client-intermediary.jar:?]
    at java.lang.Thread.run(Thread.java:833) [?:?]
[23:41:05] [Server thread/WARN]: Configuration conflict: there is more than one oshi.architecture.properties file on the classpath
[23:41:05] [Server thread/ERROR]: This crash report has been saved to: C:\Users\MSI Laptop\Twitch\Minecraft\Instances\fabric-1.18.2\crash-reports\crash-2022-08-03_23.41.05-server.txt
[23:41:05] [Server thread/INFO]: Stopping server
[23:41:05] [Server thread/INFO]: Saving players
[23:41:05] [Server thread/INFO]: Saving worlds
[23:41:05] [Server thread/ERROR]: Exception stopping the server
java.lang.NullPointerException: Cannot invoke "net.minecraft.class_3218.method_8621()" because "$$5" is null
    at net.minecraft.server.MinecraftServer.method_3723(MinecraftServer.java:569) ~[client-intermediary.jar:?]
    at net.minecraft.server.MinecraftServer.method_3782(MinecraftServer.java:626) ~[client-intermediary.jar:?]
    at net.minecraft.class_1132.method_3782(class_1132.java:193) ~[client-intermediary.jar:?]
    at net.minecraft.server.MinecraftServer.method_29741(MinecraftServer.java:729) ~[client-intermediary.jar:?]
    at net.minecraft.server.MinecraftServer.method_29739(MinecraftServer.java:273) ~[client-intermediary.jar:?]
    at java.lang.Thread.run(Thread.java:833) [?:?]
jacksonhardaway commented 2 years ago

this helps a lot, thank you. I will look into this

jacksonhardaway commented 2 years ago

Fixed in MoonflowerTeam/pollen@62fc72b9b06e15a6173574c4652be5bf8bf143c3