Civcraft / PrisonPearl

Minecraft plugin for civcraft which allows players to imprison other players inside ender pearls
BSD 3-Clause "New" or "Revised" License
4 stars 16 forks source link

Respawn overworld if using portal #183

Open ProgrammerDan opened 8 years ago

ProgrammerDan commented 8 years ago

If a prisoner jumps into the end portal, they momentarily appear at 0,0 before dying of distnace damage.

rourke750 commented 8 years ago

Are they in the overworld trying to go to the end while summoned?

ProgrammerDan commented 8 years ago

Ah no, this is an exit glitch. It's ignoring that the player is on the same physical server, using the "one tick respawn at main world" codepath instead of just directly respawning in the end.

ProgrammerDan commented 8 years ago

E..g They are pearled, and jump in the dragon's death portal, and if they press escape, momentarily appear in the overworld.

rourke750 commented 8 years ago

https://github.com/Civcraft/PrisonPearl/blob/master/src/vg/civcraft/mc/prisonpearl/listener/PlayerListener.java#L144 That shouldnt be happening.

ProgrammerDan commented 8 years ago

Agreed, but I expect it's actually happening here: https://github.com/Civcraft/PrisonPearl/blob/master/src/vg/civcraft/mc/prisonpearl/listener/PlayerListener.java#L170

rourke750 commented 8 years ago

Then they would be still send to spawn in the end https://github.com/Civcraft/PrisonPearl/blob/master/src/vg/civcraft/mc/prisonpearl/PrisonPearlUtil.java#L43

ProgrammerDan commented 8 years ago

No idea then, had it happen several times in testing.

rourke750 commented 8 years ago

Can you turn debug on and see messages you get.

ProgrammerDan commented 8 years ago

Figured it out. It's because the summoned was still set to true. So it followed a different codepath -- e.g. the teleport was allowed, but then the distance checker killed you.

So the fix for the other issue appears to have fixed this one.

ProgrammerDan commented 8 years ago

Oh but new issue. If you do hop in the portal, the event is cancelled, but you aren't teleported out of the end portal, so you ar ejust kind of stuck in it.

rourke750 commented 8 years ago

What behavior do we want?

ProgrammerDan commented 8 years ago

If possible, effectively randomspawn them without death somewhere in the end, as if a new arrival.

rourke750 commented 8 years ago

if they are summoned and try to go from the overworld to the end what should be done in that case?

ProgrammerDan commented 8 years ago

A prisoner voluntarily returning to the end? I'd assume just remove them from the summoned list, they returned themselves to jail.