mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-24 17:22:55 +01:00
Don't allow nulls in PlayerRespawnEvent. Fixes BUKKIT-2571
By: feildmaster <admin@feildmaster.com>
This commit is contained in:
parent
ba8db742e4
commit
105539f28c
1 changed files with 4 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
||||||
package org.bukkit.event.player;
|
package org.bukkit.event.player;
|
||||||
|
|
||||||
|
import org.apache.commons.lang.Validate;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.HandlerList;
|
import org.bukkit.event.HandlerList;
|
||||||
|
@ -30,6 +31,9 @@ public class PlayerRespawnEvent extends PlayerEvent {
|
||||||
* @param respawnLocation new location for the respawn
|
* @param respawnLocation new location for the respawn
|
||||||
*/
|
*/
|
||||||
public void setRespawnLocation(Location respawnLocation) {
|
public void setRespawnLocation(Location respawnLocation) {
|
||||||
|
Validate.notNull(respawnLocation, "Respawn location can not be null");
|
||||||
|
Validate.notNull(respawnLocation.getWorld(), "Respawn world can not be null");
|
||||||
|
|
||||||
this.respawnLocation = respawnLocation;
|
this.respawnLocation = respawnLocation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue