geforkt von Mirrors/Paper
Fix NPE while trying to respawn an already disconnected player (#11353)
Dieser Commit ist enthalten in:
Ursprung
9d935c67e6
Commit
83ba6295a8
@ -24,12 +24,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
|
|
||||||
if (!flag) entityplayer.reset(); // SPIGOT-4785
|
if (!flag) entityplayer.reset(); // SPIGOT-4785
|
||||||
+ // Paper start - Add PlayerPostRespawnEvent
|
+ // Paper start - Add PlayerPostRespawnEvent
|
||||||
|
+ if (dimensiontransition == null) return entityplayer; // Early exit, mirrors belows early return for disconnected players in respawn event
|
||||||
+ isRespawn = true;
|
+ isRespawn = true;
|
||||||
+ location = CraftLocation.toBukkit(dimensiontransition.pos(), dimensiontransition.newLevel().getWorld(), dimensiontransition.yRot(), dimensiontransition.xRot());
|
+ location = CraftLocation.toBukkit(dimensiontransition.pos(), dimensiontransition.newLevel().getWorld(), dimensiontransition.yRot(), dimensiontransition.xRot());
|
||||||
+ // Paper end - Add PlayerPostRespawnEvent
|
+ // Paper end - Add PlayerPostRespawnEvent
|
||||||
} else {
|
} else {
|
||||||
dimensiontransition = new DimensionTransition(((CraftWorld) location.getWorld()).getHandle(), CraftLocation.toVec3D(location), Vec3.ZERO, location.getYaw(), location.getPitch(), DimensionTransition.DO_NOTHING);
|
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 {
|
@@ -0,0 +0,0 @@ public abstract class PlayerList {
|
||||||
if (iblockdata.is(Blocks.RESPAWN_ANCHOR)) {
|
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()));
|
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()));
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren