toppev / strikepractice-public

StrikePractice bug tracking and some free resources
2 stars 3 forks source link

[BUG] Force winning or killing someone in fight does not teleport them to lobby #23

Closed Bermiin closed 1 year ago

Bermiin commented 1 year ago

Describe the bug When you force win the player using StrikePracticeAPI#forceWinRound or StrikePracticeAPI#forceWinFight or you kill them using Player#setHealth(0), then the force-won or killed player does not get teleported to lobby and stays in the arena

To Reproduce Steps to reproduce the behavior:

  1. Kill or Force-win the player using the API
  2. The killed or force-won player will stay in arena and the other player will normally get teleported to lobby

Expected behavior Both players should be teleported to lobby

Errors and console logs StrikePractice debug logs: https://gist.github.com/Bermiin/1c3a6b4eaab983d9de64c7dfef19dd1c

Versions:

toppev commented 1 year ago

SP listens to PlayerDeathEvent so I think Player#setHealth(0) should work, it's same as if someone killed them with a sword, or I do not see any reason why it wouldn't :thinking:

Currently, the behavior whether they are teleported depends on the kit, that was a bit stupid decision tbh (i.e., in parkour you win without the other player being killed).

You should be able to just call #forceWinFight and api.clear(player, true, true) I'll have a better look at some point (or maybe).

Let me know if that's enough.

Bermiin commented 1 year ago

Thats weird, Its like something is preventing the player from being teleported back to spawn. Im currently using StrikePracticeAPI#forceWinFight(player) and right after that im calling StrikePracticeAPI#clear(player, true, true). Both players get normally teleported to spawn when normally killed using sword. Only when doing it through API it does not work.

Plugins: StrikeSurrender, ViaVersion, PlaceholderAPI, ProtocolLib, LuckPerms, Vault, StrikePractice Version: 1.8.8 Paper (not fork)

toppev commented 1 year ago

Check if just player#teleportworks. Also, /sprac debug may show if something's preventing teleportation

toppev commented 1 year ago

I assume this was solved somehow(?), closing