Numismatic Overhaul

Numismatic Overhaul

2M Downloads

Villager trading data conflict/crash with Moonlight Lib/Supplementaries

mosharky opened this issue ยท 3 comments

commented

Numismatic Overhaul's data driven trades clashes directly with Moonlight Lib's data driven trades. So far, I think only Supplementaries uses Moonlight Lib for that. Both Numismatic and Moonlight use the villager_trades folder.

Crash is reproduceable with:

  • MC 1.20.1
  • Fabric API 0.91.0
  • Moonlight Lib >2.9.0
  • Supplementaries 2.7.30
  • Numismatic Overhaul
  • owo lib

Since it's a data error, just make/load a world to get it

commented

It seems numismatic-overhaul is still trying to parse files under moonlight/villager_trades:

[13:52:23] [Server thread/WARN]: Failed to execute reload
java.util.concurrent.CompletionException: java.lang.NullPointerException: Cannot invoke "com.google.gson.JsonElement.getAsString()" because the return value of "com.google.gson.JsonObject.get(String)" is null
	at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315) ~[?:?]
	at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320) ~[?:?]
	at java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:722) ~[?:?]
	at java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:482) ~[?:?]
	at net.minecraft.class_4014.method_18365(class_4014.java:69) ~[client-intermediary.jar:?]
	at net.minecraft.class_3738.run(class_3738.java:18) ~[client-intermediary.jar:?]
	at net.minecraft.class_1255.method_18859(class_1255.java:156) ~[client-intermediary.jar:?]
	at net.minecraft.class_4093.method_18859(class_4093.java:23) ~[client-intermediary.jar:?]
	at net.minecraft.server.MinecraftServer.method_24306(MinecraftServer.java:782) ~[client-intermediary.jar:?]
	at net.minecraft.server.MinecraftServer.method_18859(MinecraftServer.java:164) ~[client-intermediary.jar:?]
	at net.minecraft.class_1255.method_16075(class_1255.java:130) ~[client-intermediary.jar:?]
	at net.minecraft.server.MinecraftServer.method_20415(MinecraftServer.java:764) ~[client-intermediary.jar:?]
	at net.minecraft.server.MinecraftServer.method_16075(MinecraftServer.java:758) ~[client-intermediary.jar:?]
	at net.minecraft.class_1255.method_18857(class_1255.java:139) ~[client-intermediary.jar:?]
	at net.minecraft.server.MinecraftServer.method_29439(MinecraftServer.java:1345) ~[client-intermediary.jar:?]
	at net.minecraft.class_3097.method_29480(class_3097.java:22) ~[client-intermediary.jar:?]
	at net.minecraft.class_3097.method_13530(class_3097.java:53) ~[client-intermediary.jar:?]
	at com.mojang.brigadier.CommandDispatcher.execute(CommandDispatcher.java:264) ~[brigadier-1.1.8.jar:?]
	at net.minecraft.class_2170.redirect$zik000$architectury$performCommand(class_2170.java:1045) ~[client-intermediary.jar:?]
	at net.minecraft.class_2170.method_9249(class_2170.java:287) ~[client-intermediary.jar:?]
	at net.minecraft.class_3244.method_45010(class_3244.java:1341) ~[client-intermediary.jar:?]
	at net.minecraft.class_3244.method_44356(class_3244.java:1321) ~[client-intermediary.jar:?]
	at net.minecraft.class_1255.method_5386(class_1255.java:67) ~[client-intermediary.jar:?]
	at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768) ~[?:?]
	at net.minecraft.class_3738.run(class_3738.java:18) ~[client-intermediary.jar:?]
	at net.minecraft.class_1255.method_18859(class_1255.java:156) ~[client-intermediary.jar:?]
	at net.minecraft.class_4093.method_18859(class_4093.java:23) ~[client-intermediary.jar:?]
	at net.minecraft.server.MinecraftServer.method_24306(MinecraftServer.java:782) ~[client-intermediary.jar:?]
	at net.minecraft.server.MinecraftServer.method_18859(MinecraftServer.java:164) ~[client-intermediary.jar:?]
	at net.minecraft.class_1255.method_16075(class_1255.java:130) ~[client-intermediary.jar:?]
	at net.minecraft.server.MinecraftServer.method_20415(MinecraftServer.java:764) ~[client-intermediary.jar:?]
	at net.minecraft.server.MinecraftServer.method_16075(MinecraftServer.java:758) ~[client-intermediary.jar:?]
	at net.minecraft.class_1255.method_18857(class_1255.java:139) ~[client-intermediary.jar:?]
	at net.minecraft.server.MinecraftServer.method_16208(MinecraftServer.java:743) ~[client-intermediary.jar:?]
	at net.minecraft.server.MinecraftServer.method_29741(MinecraftServer.java:675) ~[client-intermediary.jar:?]
	at net.minecraft.server.MinecraftServer.method_29739(MinecraftServer.java:265) ~[client-intermediary.jar:?]
	at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: java.lang.NullPointerException: Cannot invoke "com.google.gson.JsonElement.getAsString()" because the return value of "com.google.gson.JsonObject.get(String)" is null
	at com.glisco.numismaticoverhaul.villagers.json.VillagerTradesHandler.loadProfession(VillagerTradesHandler.java:66) ~[numismatic-overhaul-0.2.14+1.20.jar:?]
	at com.glisco.numismaticoverhaul.villagers.data.VillagerTradesResourceListener.lambda$apply$0(VillagerTradesResourceListener.java:42) ~[numismatic-overhaul-0.2.14+1.20.jar:?]
	at java.util.HashMap.forEach(HashMap.java:1421) ~[?:?]
	at com.glisco.numismaticoverhaul.villagers.data.VillagerTradesResourceListener.apply(VillagerTradesResourceListener.java:39) ~[numismatic-overhaul-0.2.14+1.20.jar:?]
	at com.glisco.numismaticoverhaul.villagers.data.VillagerTradesResourceListener.method_18788(VillagerTradesResourceListener.java:21) ~[numismatic-overhaul-0.2.14+1.20.jar:?]
	at net.minecraft.class_4080.method_18790(class_4080.java:13) ~[client-intermediary.jar:?]
	at java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:718) ~[?:?]
	... 34 more

for this JSON at \data\moonlight\villager_trades\carpenter:

{
  "type": "simple",
  "max_trades": 12,
  "price": {
    "id": "numismatic-overhaul:silver_coin",
    "Count": 1
  },
  "offer": {
    "id": "minecraft:armor_stand",
    "Count": 1
  },
  "level": 2
}

Edit: nevermind, it should be under \data<namespace>\moonlight\villager_trades\ apparently

commented

Got this same crash earlier today after updating a modpack I am building. Log is nearly identical.

commented

Fixed as of Moonlight 2.9.7 and Supplementaries 2.7.32. Their trades were moved to the moonlight/villager_trades namespace.