* @param oldLevel
* @param newLevel
*/
public int onRedstoneChange(Block block, int oldLevel, int newLevel) {
BlockVector v = new BlockVector(block.getX(), block.getY(), block.getZ());
// Give the method a BlockVector instead of a Block
boolean wasOn = oldLevel >= 1;
boolean isOn = newLevel >= 1;
boolean wasChange = wasOn != isOn;
// For efficiency reasons, we're only going to consider changes between
// off and on state, and ignore simple current changes (i.e. 15->13)
if (!wasChange) {
return newLevel;
}
int x = v.getBlockX();
int y = v.getBlockY();
int z = v.getBlockZ();
int type = w.getId(x, y, z);
// When this hook has been called, the level in the world has not
// yet been updated, so we're going to do this very ugly thing of