RedPxnda / RespawnObelisks

MIT License
5 stars 3 forks source link

Fix curse only applying to non-respawns #19

Closed ByThePowerOfScience closed 3 months ago

ByThePowerOfScience commented 4 months ago

RespawnObeliskBlock#getRespawnLocation currently applies the Immortality Curse if isTeleport || player.isAlive() instead of !(isTeleport || player.isAlive()). This PR fixes that.

Essentially, this PR just makes the curse apply to respawning targets like the mod page says instead of only teleporting targets.

RedPxnda commented 4 months ago

So, as of right now, the curse doesn't apply to respawning targets at all?

ByThePowerOfScience commented 3 months ago

So, as of right now, the curse doesn't apply to respawning targets at all?

As of right now, it only applies to targets that were alive when the method was called.

RedPxnda commented 3 months ago

Alright. I won't be able to merge this pr immediately, haven't been on my computer in a while and when I do get on it I have a lot of school work to catch up on, lol.

ByThePowerOfScience commented 3 months ago

Yeah no worries, just wanted to make the PR while I had the issue identified.

RedPxnda commented 3 months ago

I'm sorry but, I'm still not sure I entirely understand the issue. I just tested and the curse does apply to respawning targets?

RedPxnda commented 3 months ago

Ah, I think you might've misunderstood how the curse works, I guess. The "applyCurse" variable is actually a little misleading, as it can be false when the player still receives the effect. For respawning targets, the curse of immortality is actually extended(like, when it stacks and the amplifier increases) in the player clone event(CommonEvents class, iirc). If I didn't do it here, it would apply to the old player and the actual player that's respawned wouldn't have the effect. For teleportation, it has to be different since the player never dies.

Feel free to reopen if need be.