Package org.bukkit.event.block

Examples of org.bukkit.event.block.BlockRedstoneEvent


            source.setData((byte) (sData - 1), true);
            source.setData(sData, true);

            // lets call blockredstone events on the source block and the lever
            // in order to correctly update all surrounding blocks
            BlockRedstoneEvent leverEvent = new BlockRedstoneEvent(block, wasOn ? 15 : 0, state ? 15 : 0);
            BlockRedstoneEvent sourceEvent = new BlockRedstoneEvent(source, wasOn ? 15 : 0, state ? 15 : 0);
            CraftBookPlugin.inst().getServer().getPluginManager().callEvent(leverEvent);
            CraftBookPlugin.inst().getServer().getPluginManager().callEvent(sourceEvent);
            return true;
        }
View Full Code Here


    newMaterialData.setPowered(down);
    if (getRawData(newMaterialData) != data) {
      // CraftBukkit start - Redstone event for lever
      int old = !down ? 1 : 0;
      int current = down ? 1 : 0;
      BlockRedstoneEvent eventRedstone = new BlockRedstoneEvent(lever, old, current);
      CommonUtil.callEvent(eventRedstone);
      if ((eventRedstone.getNewCurrent() > 0) != down) {
        return;
      }
      // CraftBukkit end
      setData(lever, newMaterialData, true);
      applyPhysics(getAttachedBlock(lever), Material.LEVER);
View Full Code Here

TOP

Related Classes of org.bukkit.event.block.BlockRedstoneEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.