Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
PlayerBedEnterEvent.java
1 package org.bukkit.event.player;
2 
3 import org.bukkit.block.Block;
4 import org.bukkit.entity.Player;
7 
8 /**
9  * This event is fired when the player is almost about to enter the bed.
10  */
11 public class PlayerBedEnterEvent extends PlayerEvent implements Cancellable {
12  private static final HandlerList handlers = new HandlerList();
13  private boolean cancel = false;
14  private final Block bed;
15 
16  public PlayerBedEnterEvent(final Player who, final Block bed) {
17  super(who);
18  this.bed = bed;
19  }
20 
21  public boolean isCancelled() {
22  return cancel;
23  }
24 
25  public void setCancelled(boolean cancel) {
26  this.cancel = cancel;
27  }
28 
29  /**
30  * Returns the bed block involved in this event.
31  *
32  * @return the bed block involved in this event
33  */
34  public Block getBed() {
35  return bed;
36  }
37 
38  @Override
39  public HandlerList getHandlers() {
40  return handlers;
41  }
42 
43  public static HandlerList getHandlerList() {
44  return handlers;
45  }
46 }