Mithion / Mana-And-Artifice

Ars Magica 3: Mana and Artifice
53 stars 7 forks source link

Incompatibility with Roughly Enough Resources - "Invalid player data" #601

Closed unilock closed 1 month ago

unilock commented 1 year ago

Describe the bug With Mana and Artifice and Roughly Enough Resources installed, trying to join a world results in an instant disconnect, with the error message "Invalid player data".

To Reproduce Steps to reproduce the behavior:

  1. Install Mana and Artifice and its dependencies
  2. Install Roughly Enough Resources and its dependencies
  3. Start Minecraft and create a new world
  4. See error

Expected behavior The world loads.

Screenshots

image

(it says "Back to Server List" regardless of whether you're joining a singleplayer or multiplayer world)

Version Information

Additional context Relevant bit of latest.log, snipped from when creating a new world: https://gist.github.com/unilock/bf563624fca626ca4af48d256f0298da

unilock commented 1 year ago

I """fixed""" this by mixing into Mana and Artifice's loot modifier registration class and completely preventing the loot functions breaking RER from ever being registered in the first place, then editing the mod's built-in datapack to replace all loot tables referencing those loot functions to contain only sticks. Not an ideal solution IMO. But if you don't need mana caches, then I guess it's fine...?

https://github.com/unilock/MNA-Mixin/blob/main/src/main/java/net/unilock/mnamixin/mixin/GlobalLootModifiersMixin.java

EDIT: Replacing the loot tables with sticks works even without the mixin, so maybe the loot table JSONs are malformed???

xAlicatt commented 6 months ago

This is happening in 1.20.1 as well.

unilock commented 6 months ago

The issue is caused by MNA returning LootItemFunctions.SET_CONTENTS in the getType() method of each of its LootItemConditionalFunctions. It should be returning the result of Registry.register(BuiltInRegistries.LOOT_FUNCTION_TYPE, RLoc.create(path), new LootItemFunctionType(serializer)); instead.

Here's a mod I made that actually fixes the issue: https://github.com/unilock/MNAMixin2

(By the way, I would recommend using EMI and EMI Loot instead of REI and RER. EMI has native support for JEI plugins when both recipe viewers are installed ๐Ÿ™‚)

xAlicatt commented 6 months ago

(By the way, I would recommend using EMI and EMI Loot instead of REI and RER. EMI has native support for JEI plugins when both recipe viewers are installed ๐Ÿ™‚)

I'm trying EMI/Loot and getting the same error mentioning COFH Core and Sawmill now. Turning off Loot does not stop the error.

I just swapped RER for JER and it's working fine. shrug

aking4125 commented 6 months ago

There may be another conflicting mod in my modpack (Especially since we're using Sinytra connector). But it breaks EMI entirely with the (EMI waiting for server) message forever when installing MnA (1.20.1)

The issue is caused by MNA returning LootItemFunctions.SET_CONTENTS in the getType() method of each of its LootItemConditionalFunctions. It should be returning the result of Registry.register(BuiltInRegistries.LOOT_FUNCTION_TYPE, RLoc.create(path), new LootItemFunctionType(serializer)); instead.

Here's a mod I made that actually fixes the issue: https://github.com/unilock/MNAMixin2

(By the way, I would recommend using EMI and EMI Loot instead of REI and RER. EMI has native support for JEI plugins when both recipe viewers are installed ๐Ÿ™‚)

I don't know how to use this mod. Attempting to build it via IntelliJ fails.

unilock commented 5 months ago

@xAlicatt

I'm trying EMI/Loot and getting the same error mentioning COFH Core and Sawmill now. Turning off Loot does not stop the error.

That's strange; I have both of those mods running alongside EMI + EMI Loot just fine.
Since the issue persists even without EMI Loot, I'm guessing there's a mod incompatibility somewhere else, but it's hard to say where without a crash log.

I just swapped RER for JER and it's working fine. shrug

If I'm reading its code correctly, JER hardcodes the loot tables it supports to only those from vanilla Minecraft by default. (source)
So it's not surprising that it works, given it doesn't touch M&A's loot tables at all :p


@aking4125

There may be another conflicting mod in my modpack (Especially since we're using Sinytra connector). But it breaks EMI entirely with the (EMI waiting for server) message forever when installing MnA (1.20.1)

I also have EMI and M&A working together well, even with Sinytra Connector, so there's likely some other issue at play. But, again, it's hard to say what.

I don't know how to use this mod. Attempting to build it via IntelliJ fails.

It should be as simple as

  1. git clone https://github.com/unilock/MNAMixin2.git
  2. cd MNAMixin2
  3. ./gradlew build

Alternatively you can download the latest build from the workflow I just set up.

Mithion commented 1 month ago

After a lot of consideration I've decided to drop support for 1.18. I can't keep up with older versions and the currently supported version. Note that this, and many more issues have been fixed in 1.20.1 along with many new features, improvements, and QoL additions. Sorry for the inconvenience.

unilock commented 1 month ago

Note that this, and many more issues have been fixed in 1.20.1

It most certainly is not. You're still returning LootItemFunctions.SET_CONTENTS for LootItemFunction#getType in all of your LootItemConditionalFunctions, as of MNA 3.0.0.22.