Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
BlockRedstoneEvent.java
1 package org.bukkit.event.block;
2 
3 import org.bukkit.block.Block;
5 
6 /**
7  * Called when a redstone current changes
8  */
9 public class BlockRedstoneEvent extends BlockEvent {
10  private static final HandlerList handlers = new HandlerList();
11  private final int oldCurrent;
12  private int newCurrent;
13 
14  public BlockRedstoneEvent(final Block block, final int oldCurrent, final int newCurrent) {
15  super(block);
16  this.oldCurrent = oldCurrent;
17  this.newCurrent = newCurrent;
18  }
19 
20  /**
21  * Gets the old current of this block
22  *
23  * @return The previous current
24  */
25  public int getOldCurrent() {
26  return oldCurrent;
27  }
28 
29  /**
30  * Gets the new current of this block
31  *
32  * @return The new current
33  */
34  public int getNewCurrent() {
35  return newCurrent;
36  }
37 
38  /**
39  * Sets the new current of this block
40  *
41  * @param newCurrent The new current to set
42  */
43  public void setNewCurrent(int newCurrent) {
44  this.newCurrent = newCurrent;
45  }
46 
47  @Override
48  public HandlerList getHandlers() {
49  return handlers;
50  }
51 
52  public static HandlerList getHandlerList() {
53  return handlers;
54  }
55 }