Bukkit  1.4.7-R1.0
 All Classes Namespaces Files Functions Variables Enumerator Pages
EntityChangeBlockEvent.java
Go to the documentation of this file.
1 package org.bukkit.event.entity;
2 
3 import org.bukkit.Material;
4 import org.bukkit.block.Block;
5 import org.bukkit.entity.Entity;
6 import org.bukkit.entity.LivingEntity;
7 import org.bukkit.event.Cancellable;
8 import org.bukkit.event.HandlerList;
9 
13 public class EntityChangeBlockEvent extends EntityEvent implements Cancellable {
14  private static final HandlerList handlers = new HandlerList();
15  private final Block block;
16  private boolean cancel;
17  private final Material to;
18  private final byte data;
19 
27  @Deprecated
28  public EntityChangeBlockEvent(final LivingEntity what, final Block block, final Material to) {
29  this (what, block, to, (byte) 0);
30  }
31 
39  public EntityChangeBlockEvent(final Entity what, final Block block, final Material to, final byte data) {
40  super(what);
41  this.block = block;
42  this.cancel = false;
43  this.to = to;
44  this.data = data;
45  }
46 
52  public Block getBlock() {
53  return block;
54  }
55 
56  public boolean isCancelled() {
57  return cancel;
58  }
59 
60  public void setCancelled(boolean cancel) {
61  this.cancel = cancel;
62  }
63 
69  public Material getTo() {
70  return to;
71  }
72 
78  public byte getData() {
79  return data;
80  }
81 
82  @Override
84  return handlers;
85  }
86 
87  public static HandlerList getHandlerList() {
88  return handlers;
89  }
90 }