mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 15:30:19 +01:00
Fix NPE for PlayerPostRespawnEvent#getRespawnedLocation (#11268)
This commit is contained in:
parent
815149208d
commit
fee33bd1e2
1 changed files with 4 additions and 1 deletions
|
@ -23,7 +23,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
dimensiontransition = entityplayer.findRespawnPositionAndUseSpawnBlock(flag, DimensionTransition.DO_NOTHING, reason);
|
dimensiontransition = entityplayer.findRespawnPositionAndUseSpawnBlock(flag, DimensionTransition.DO_NOTHING, reason);
|
||||||
|
|
||||||
if (!flag) entityplayer.reset(); // SPIGOT-4785
|
if (!flag) entityplayer.reset(); // SPIGOT-4785
|
||||||
+ isRespawn = true; // Paper - Add PlayerPostRespawnEvent
|
+ // Paper start - Add PlayerPostRespawnEvent
|
||||||
|
+ isRespawn = true;
|
||||||
|
+ location = CraftLocation.toBukkit(dimensiontransition.pos(), dimensiontransition.newLevel().getWorld(), dimensiontransition.yRot(), dimensiontransition.xRot());
|
||||||
|
+ // 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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue