Mana-And-Artifice icon indicating copy to clipboard operation
Mana-And-Artifice copied to clipboard

Incompatibility with Roughly Enough Resources - "Invalid player data"

Open unilock opened this issue 1 year ago • 6 comments

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 avatar Mar 07 '23 06:03 unilock

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???

unilock avatar Mar 23 '23 23:03 unilock

This is happening in 1.20.1 as well.

xAlicatt avatar Mar 23 '24 14:03 xAlicatt

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 🙂)

unilock avatar Mar 23 '24 16:03 unilock

(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

xAlicatt avatar Mar 23 '24 18:03 xAlicatt

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.

aking4125 avatar Apr 16 '24 02:04 aking4125

@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.

unilock avatar Apr 26 '24 23:04 unilock

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.

Mithion avatar Aug 24 '24 21:08 Mithion

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.

unilock avatar Aug 24 '24 22:08 unilock