Package org.getspout.spout.block

Examples of org.getspout.spout.block.SpoutCraftBlock


    }
    if (block.getPistonMoveReaction().equals(PistonMoveReaction.MOVE)) {
      int customBlockId = block.getCustomBlock().getCustomId();
      Byte customBlockData = block.getCustomBlockData();

      SpoutCraftBlock targetScb = (SpoutCraftBlock) block.getRelative(blockFace);

      // Only move the data, since the base block will be moved *After* this event fires. So if we also move the base block now, we are in fact, creating a new block.
      targetScb.setCustomBlockId(customBlockId);
      targetScb.setCustomBlockData(customBlockData);
      this.mm.queueBlockOverrides(targetScb, customBlockId, customBlockData);

      this.mm.removeBlockOverride(block);
    } else if (block.getPistonMoveReaction().equals(PistonMoveReaction.BREAK)) {
      breakOnPushed(block);
View Full Code Here


    return id;
  }

  @Override
  public boolean removeBlockOverride(Block block) {
    SpoutCraftBlock scb = (SpoutCraftBlock) block;

    if (scb.isCustomBlock()) {
      scb.getCustomBlock().onBlockDestroyed(scb.getWorld(), scb.getX(), scb.getY(), scb.getZ());
    }

    scb.removeCustomBlockData();

    queueBlockOverrides(scb, null, (byte) 0);
    return true;
  }
View Full Code Here

  @Override
  public boolean overrideBlock(Block block, CustomBlock customBlock, byte data) {
    block.setTypeId(customBlock.getBlockId());
    int blockId = customBlock.getCustomId();

    SpoutCraftBlock scb = (SpoutCraftBlock) block;

    customBlock.onBlockPlace(scb.getWorld(), scb.getX(), scb.getY(), scb.getZ());

    scb.setCustomBlockId(blockId);
    scb.setCustomBlockData(data);
    queueBlockOverrides(scb, blockId, data);

    return true;
  }
View Full Code Here

TOP

Related Classes of org.getspout.spout.block.SpoutCraftBlock

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.