Prismwork / EMITrades

Villager trading for EMI.
https://discord.gg/zfPcG37uvm
MIT License
10 stars 5 forks source link

Incompatible with some mods #6

Open Greg-J opened 1 year ago

Greg-J commented 1 year ago

I've been testing this today (great mod/addon by the way) and have discovered that while it does register villagers added by Oh The Biomes You'll Go and More Villagers, it does not register trades by villagers added by Villagers Plus or any villagers created with Custom Villager Professions or villager trades modified by Custom Villager Trades.

Greg-J commented 1 year ago

It's worth mentioning that the author of the second two mods seemingly knows why it isn't working, but would require bespoke code on their part. They have a Discord: https://discord.gg/R4yaRqr2gN

KirboSoftware commented 1 year ago

Villagers Plus seem to work fine? I see their trades and everything. Do you have any logs giving errors by any change?

This screenshot was made on 1.19.3 with the following mods:

Screenshot_20230204_201834

Greg-J commented 1 year ago

I can confirm that those trades do not show up for me. I see an Oceanographer trade from More Villagers (different Oceanographer), but nothing comes up for VillagersPlus when looking at a Sponge or Sugar.

I have an obscene number of mods, but here is my log: https://mclo.gs/9vjl0r2

Lines 353 and 2185 are the only ones that stick out to me.

Greg-J commented 1 year ago

As for the other two mods, here is a message from the author:

A message to pass on to them from me - if they call the method that registers trades they can pull the information from there

KirboSoftware commented 1 year ago

So, I also did another test case with 1.19.2 and added More Villagers to the mix.

the only thing that was odd to me was this:

Reloaded plugin from EMI in 156ms Reloaded plugin from Amethyst Imbuement in 31ms Reloaded plugin from EMI Trades in 100ms Recipe loaded with duplicate id: emi:emitrades/villager_trades/oceanographer_0 Recipe loaded with duplicate id: emi:emitrades/villager_trades/oceanographer_1 Recipe loaded with duplicate id: emi:emitrades/villager_trades/oceanographer_2 Recipe loaded with duplicate id: emi:emitrades/villager_trades/oceanographer_3 Recipe loaded with duplicate id: emi:emitrades/villager_trades/oceanographer_4 Recipe loaded with duplicate id: emi:emitrades/villager_trades/oceanographer_5 Recipe loaded with duplicate id: emi:emitrades/villager_trades/oceanographer_6 Recipe loaded with duplicate id: emi:emitrades/villager_trades/oceanographer_7 Recipe loaded with duplicate id: emi:emitrades/villager_trades/oceanographer_8

I can see all the trades added by Amethyst Imbuement, More Villagers AND VillagersPlus. The only thing I can think of causing the issue would be the other 2 mods you mentioned and would explain your log. But that's about what I can think of.

Greg-J commented 1 year ago

CVT uses mixins to hook into the trade registration code. It essentially takes the existing registered trades and adds extra trades (and removes existing if selected)

This way, the mod can add new trades in real-time (reloadCVT command) without having to reload the game

Dex-too commented 1 month ago

This be necro'ing an issue, but I have a related problem that could be the same problem. I didn't see any other issue that more closely matched my problem and this could be the same problem, so I didn't want to potentially duplicate the issue.

I'm playing the Fabric version of the "Prominence II" modpack for Minecraft 1.20.1. When I load a single player world, I can see all of the trades, including Villagers Plus, but when I connect to a local server I'm running of the same modpack, it only shows the vanilla trades, plus a couple of extras (from an RPG mod). I go from 161 pages of villager trades on single player to just 49 pages of trades in multiplayer.

I thought maybe this was because this mod is not in the server pack (only on the client), so I copied it to server, but that didn't help.

Dex-too commented 1 month ago

I was focused on the server logs and didn't see anything there indicating a problem, but I should have known better. When I check the client logs instead (duh) I see a big error there when I'm connected to multiplayer.

[07:15:48] [Thread-47/INFO]: [EMI] Reloaded plugin from emiffect in 236ms
[07:15:48] [Thread-47/INFO]: [EMI] Loading plugin from emitrades
[07:15:48] [Render thread/INFO]: [STDOUT]: RIGHT
[07:15:48] [Thread-47/ERROR]: [EMI] Exception loading plugin provided by emitrades
[07:15:48] [Thread-47/INFO]: [STDERR]: java.lang.NullPointerException: Cannot read the array length because "<local10>" is null
[07:15:48] [Thread-47/INFO]: [STDERR]:  at io.github.prismwork.emitrades.EMITradesPlugin.register(EMITradesPlugin.java:78)
[07:15:48] [Thread-47/INFO]: [STDERR]:  at dev.emi.emi.runtime.EmiReloadManager$ReloadWorker.run(EmiReloadManager.java:185)
[07:15:48] [Thread-47/INFO]: [STDERR]:  at java.base/java.lang.Thread.run(Thread.java:1583)
[07:15:48] [Thread-47/ERROR]: [EMI] java.lang.NullPointerException: Cannot read the array length because "<local10>" is null
    at io.github.prismwork.emitrades.EMITradesPlugin.register(EMITradesPlugin.java:78)
    at dev.emi.emi.runtime.EmiReloadManager$ReloadWorker.run(EmiReloadManager.java:185)
    at java.base
[07:15:48] [Thread-47/ERROR]: [EMI] java.lang.Thread.run(Thread.java:1583)

Edits for formatting.