mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-27 06:20:29 +08:00
Add validation checks to CraftPlayer.teleport
This commit is contained in:
parent
ab13683d8e
commit
ca6d2cf9dc
@ -487,6 +487,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
|
||||
@Override
|
||||
public boolean teleport(Location location, PlayerTeleportEvent.TeleportCause cause) {
|
||||
Preconditions.checkArgument(location != null, "location");
|
||||
Preconditions.checkArgument(location.getWorld() != null, "location.world");
|
||||
location.checkFinite();
|
||||
|
||||
EntityPlayer entity = getHandle();
|
||||
|
||||
if (getHealth() == 0 || entity.dead) {
|
||||
|
Loading…
Reference in New Issue
Block a user