001 package org.bukkit.event.block; 002 003 import org.bukkit.block.Block; 004 import org.bukkit.event.HandlerList; 005 006 /** 007 * Called when a redstone current changes 008 */ 009 public class BlockRedstoneEvent extends BlockEvent { 010 private static final HandlerList handlers = new HandlerList(); 011 private final int oldCurrent; 012 private int newCurrent; 013 014 public BlockRedstoneEvent(final Block block, final int oldCurrent, final int newCurrent) { 015 super(block); 016 this.oldCurrent = oldCurrent; 017 this.newCurrent = newCurrent; 018 } 019 020 /** 021 * Gets the old current of this block 022 * 023 * @return The previous current 024 */ 025 public int getOldCurrent() { 026 return oldCurrent; 027 } 028 029 /** 030 * Gets the new current of this block 031 * 032 * @return The new current 033 */ 034 public int getNewCurrent() { 035 return newCurrent; 036 } 037 038 /** 039 * Sets the new current of this block 040 * 041 * @param newCurrent The new current to set 042 */ 043 public void setNewCurrent(int newCurrent) { 044 this.newCurrent = newCurrent; 045 } 046 047 @Override 048 public HandlerList getHandlers() { 049 return handlers; 050 } 051 052 public static HandlerList getHandlerList() { 053 return handlers; 054 } 055 }