The Endergetic Expansion

The Endergetic Expansion

25M Downloads

Incompatibility with Enigmatic Legacy

alpharou opened this issue ยท 7 comments

commented

Versions:

  • EnigmaticLegacy-2.11.2
  • curios-forge-1.16.5-4.0.5.0
  • Patchouli-1.16.4-50
  • abnormals_core-1.16.5-3.1.1 (not the issue, this library installed is just fine)
  • endergetic-1.16.4-3.0.0
  • forge 36.0.42

Description:

Mild incompatibility with Enigmatic Legacy: https://github.com/Aizistral-Studios/Enigmatic-Legacy

I already posted an issue to them and they did their best: Aizistral-Studios/Enigmatic-Legacy#159

All equipped curios added by Enigmatic Legacy are unequipped when quitting and reentering singleplayer or server worlds. If there's no inventory space available the curios will be dropped onto the ground.

The unequipped curios will leave a ghost item in the curios slot that dissapears when it is interacted with.

It only affects Enigmatic Legacy's curios (more testing required), and more importantly, affects the seven curses ring, so it's possible to get it off without the power of god.

It seems really odd to me, since Endergetic does not add any curios as far as I can tell, it doesn't even have curios as a dependency.

How to Reproduce:

  1. Load a world
  2. Equip any Enigmatic curios, including the ring of seven curses
  3. Log out/save and quit
  4. Reenter the world
  5. Behold!
    image

Logs:

No crashes.

commented

Just dropping a comment here so I know when the issue is fixed, since I'd like to have all above mentioned mods in the same server :)

commented

Update on this: we are planning a final hotfix for the mod for 1.16 before we port the mod to 1.18.2.

commented

Sorry for the late response to this.
Endergetic versions 3.0.1 and above fix this issue.

commented

This is breaking Waystones too: TwelveIterationMods/Waystones#336 (comment)

commented

I've added additional details in the Enigmatic Legacy issue that should help clarify what the issue is.

In short:

@Inject(at = @At("RETURN"), method = "initializeConnectionToPlayer")

The balloons code causes Curios to do a readNBT twice and since Enigmatic only allows you to equip unique Curios it unequips them since it it had it equipped during the first readNBT call.

EDIT: I'm personally conflicted as to which mod (Enigmatic, Endergetic, or Curios) would be the best place to fix this issue.

commented

I'm personally conflicted as to which mod (Enigmatic, Endergetic, or Curios) would be the best place to fix this issue.

Well, there's nothing in particular Enigmatic Legacy does wrong that causes this. Honestly it's Endergetic's problem first and foremost, because there exist other ways to achieve what it does, without all of this needless Mixin action going around and thus without touching vanilla methods it really isn't supposed to be touching. For instance - just consider capabilities, these thingies were specifically designed to attach extra features and handle extra save-able data on entities (or stacks, or tile entities, or... anything you may ever want): https://mcforge.readthedocs.io/en/latest/datastorage/capabilities/

commented

I'm in agreement with Extregal on the matter, that this could be done better and by using capabilities.

However, I did look into it to see if there was a quick fix to this and there is. In Endergetic's spawnBalloons code it gets the CompoundNBT using readPlayerDataFromFile. However, readPlayerDataFromFile doesn't only just get you the CompoundNBT it also calls the Player Entity's read method.

If all you wanted is the NBT you can replace the usage of readPlayerDataFromFile with something like:

      CompoundNBT compound = ((PlayerList) (Object) this).server.getServerConfiguration().getHostPlayerNBT();
      if (compoundnbt != null && player.getName().getString().equals(((PlayerList) (Object) this).server.getServerOwner())) {
         compound = ((PlayerList) (Object) this).playerDataManager.loadPlayerData(player);
      }

The code above that I suggested is untested and only based off of the implementation of readPlayerDataFromFile. Of course, it'd probably be better to do it with Capabilities as Extregal suggested.