mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-20 07:34:48 +01:00
SPIGOT-6316: PlayerBedLeaveEvent implements Cancellable
By: md_5 <git@md-5.net>
This commit is contained in:
parent
7502690157
commit
f9af7f9ef6
1 changed files with 13 additions and 1 deletions
|
@ -3,16 +3,18 @@ package org.bukkit.event.player;
|
|||
import org.bukkit.Location;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* This event is fired when the player is leaving a bed.
|
||||
*/
|
||||
public class PlayerBedLeaveEvent extends PlayerEvent {
|
||||
public class PlayerBedLeaveEvent extends PlayerEvent implements Cancellable {
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
private final Block bed;
|
||||
private boolean setBedSpawn;
|
||||
private boolean cancelled;
|
||||
|
||||
public PlayerBedLeaveEvent(@NotNull final Player who, @NotNull final Block bed, boolean setBedSpawn) {
|
||||
super(who);
|
||||
|
@ -62,6 +64,16 @@ public class PlayerBedLeaveEvent extends PlayerEvent {
|
|||
this.setBedSpawn = setBedSpawn;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return this.cancelled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancelled) {
|
||||
this.cancelled = cancelled;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
|
|
Loading…
Reference in a new issue