SPIGOT-6316: PlayerBedLeaveEvent implements Cancellable

By: md_5 <git@md-5.net>
This commit is contained in:
Bukkit/Spigot 2021-01-29 11:22:52 +11:00
parent 7502690157
commit f9af7f9ef6

View file

@ -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() {