Bewitchment (Legacy)

Bewitchment (Legacy)

8M Downloads

Infusions lost after death

cybercat5555 opened this issue ยท 2 comments

commented

Expected Behavior

Infusions are kept after death but their MP emptied

Actual Behavior

Dying removes the infusion and reverts it back to the default

Steps to Reproduce

  1. Set up any infusion (I used "Infusion of the Flames" for this, but I'd assume any others would work)
  2. Kill yourself somehow
  3. Respawn with the default power bar

Version of Minecraft, Bewitchment, Forge, Patchouli, LLibrary and Baubles used

MC 1.12.2
BW 0.19.16
Forge .2814
Patchouli 1.0-16
Llibrary: 1.7.17-1.12.2
Baubles: 1.13-1.5.2

Screenshots encouraged

https://imgur.com/a/H2hReuN

Logs, in the event of a crash

N/A

commented

It looks like the infusion type isn't saved with the other capabilities on player death. I don't have time to set this up in my dev environment or test that the fix works today, but it just needs one line of code. Add

CapabilityHelper.copyDataOnPlayerRespawn(event, InfusionCapability.CAPABILITY);

after line 28.

@SubscribeEvent
public static void onPlayerClone(net.minecraftforge.event.entity.player.PlayerEvent.Clone event) {
if (event.isWasDeath()) {
CapabilityHelper.copyDataOnPlayerRespawn(event, IMagicPowerContainer.CAPABILITY);
CapabilityHelper.copyDataOnPlayerRespawn(event, CapabilityMPExpansion.CAPABILITY);
}
}

commented

It looks like this issue should be closed. Sunconure11 took care of it