mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-11 10:12:06 -07:00
SPIGOT-5930: Add PlayerRespawnEvent#isAnchorSpawn
By: md_5 <git@md-5.net>
This commit is contained in:
@@ -13,11 +13,18 @@ public class PlayerRespawnEvent extends PlayerEvent {
|
|||||||
private static final HandlerList handlers = new HandlerList();
|
private static final HandlerList handlers = new HandlerList();
|
||||||
private Location respawnLocation;
|
private Location respawnLocation;
|
||||||
private final boolean isBedSpawn;
|
private final boolean isBedSpawn;
|
||||||
|
private final boolean isAnchorSpawn;
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
public PlayerRespawnEvent(@NotNull final Player respawnPlayer, @NotNull final Location respawnLocation, final boolean isBedSpawn) {
|
public PlayerRespawnEvent(@NotNull final Player respawnPlayer, @NotNull final Location respawnLocation, final boolean isBedSpawn) {
|
||||||
|
this(respawnPlayer, respawnLocation, isBedSpawn, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public PlayerRespawnEvent(@NotNull final Player respawnPlayer, @NotNull final Location respawnLocation, final boolean isBedSpawn, final boolean isAnchorSpawn) {
|
||||||
super(respawnPlayer);
|
super(respawnPlayer);
|
||||||
this.respawnLocation = respawnLocation;
|
this.respawnLocation = respawnLocation;
|
||||||
this.isBedSpawn = isBedSpawn;
|
this.isBedSpawn = isBedSpawn;
|
||||||
|
this.isAnchorSpawn = isAnchorSpawn;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -51,6 +58,15 @@ public class PlayerRespawnEvent extends PlayerEvent {
|
|||||||
return this.isBedSpawn;
|
return this.isBedSpawn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets whether the respawn location is the player's respawn anchor.
|
||||||
|
*
|
||||||
|
* @return true if the respawn location is the player's respawn anchor.
|
||||||
|
*/
|
||||||
|
public boolean isAnchorSpawn() {
|
||||||
|
return isAnchorSpawn;
|
||||||
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public HandlerList getHandlers() {
|
public HandlerList getHandlers() {
|
||||||
|
Reference in New Issue
Block a user