mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-30 16:19:03 +01:00
Fix NPE while trying to respawn an already disconnected player (#11353)
This commit is contained in:
parent
9d935c67e6
commit
83ba6295a8
1 changed files with 7 additions and 0 deletions
|
@ -24,12 +24,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
|
||||
if (!flag) entityplayer.reset(); // SPIGOT-4785
|
||||
+ // Paper start - Add PlayerPostRespawnEvent
|
||||
+ if (dimensiontransition == null) return entityplayer; // Early exit, mirrors belows early return for disconnected players in respawn event
|
||||
+ isRespawn = true;
|
||||
+ location = CraftLocation.toBukkit(dimensiontransition.pos(), dimensiontransition.newLevel().getWorld(), dimensiontransition.yRot(), dimensiontransition.xRot());
|
||||
+ // Paper end - Add PlayerPostRespawnEvent
|
||||
} else {
|
||||
dimensiontransition = new DimensionTransition(((CraftWorld) location.getWorld()).getHandle(), CraftLocation.toVec3D(location), Vec3.ZERO, location.getYaw(), location.getPitch(), DimensionTransition.DO_NOTHING);
|
||||
}
|
||||
// Spigot Start
|
||||
- if (dimensiontransition == null) {
|
||||
+ if (dimensiontransition == null) { // Paper - Add PlayerPostRespawnEvent - diff on change - spigot early returns if respawn pos is null, that is how they handle disconnected player in respawn event
|
||||
return entityplayer;
|
||||
}
|
||||
// Spigot End
|
||||
@@ -0,0 +0,0 @@ public abstract class PlayerList {
|
||||
if (iblockdata.is(Blocks.RESPAWN_ANCHOR)) {
|
||||
entityplayer1.connection.send(new ClientboundSoundPacket(SoundEvents.RESPAWN_ANCHOR_DEPLETE, SoundSource.BLOCKS, (double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ(), 1.0F, 1.0F, worldserver.getRandom().nextLong()));
|
||||
|
|
Loading…
Reference in a new issue