Fix NPE for PlayerPostRespawnEvent#getRespawnedLocation (#11268)

This commit is contained in:
Lulu13022002 2024-08-16 09:20:57 +02:00
parent 815149208d
commit fee33bd1e2

View file

@ -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);
} }