3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-18 04:20:08 +01:00

Add validation checks to CraftPlayer.teleport

Dieser Commit ist enthalten in:
md_5 2018-07-11 09:06:48 +10:00
Ursprung ab13683d8e
Commit ca6d2cf9dc

Datei anzeigen

@ -487,6 +487,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@Override @Override
public boolean teleport(Location location, PlayerTeleportEvent.TeleportCause cause) { 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(); EntityPlayer entity = getHandle();
if (getHealth() == 0 || entity.dead) { if (getHealth() == 0 || entity.dead) {