mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-09 19:49:35 +01:00
Add validation checks to CraftPlayer.teleport
By: md_5 <git@md-5.net>
This commit is contained in:
parent
59793ae626
commit
772c19a770
1 changed files with 4 additions and 0 deletions
|
@ -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 a new issue