コード例 #1
0
 private void removeLava(Block block) {
   if (block != null) {
     if (AFFECTED_BLOCKS.containsKey(block)) {
       if (!GeneralMethods.isAdjacentToThreeOrMoreSources(block)) {
         TempBlock.revertBlock(block, Material.AIR);
       }
       AFFECTED_BLOCKS.remove(block);
     }
   }
 }
コード例 #2
0
  public void moveLava() {
    if (sourceBlock != null) {
      targetDestination = getTargetEarthBlock((int) range).getLocation();

      if (targetDestination.distanceSquared(location) <= 1) {
        progressing = false;
        targetDestination = null;
      } else {
        progressing = true;
        settingUp = true;
        firstDestination = getToEyeLevel();
        firstDirection = getDirection(sourceBlock.getLocation(), firstDestination);
        targetDirection = getDirection(firstDestination, targetDestination);

        if (!GeneralMethods.isAdjacentToThreeOrMoreSources(sourceBlock)) {
          sourceBlock.setType(Material.AIR);
        }
        addLava(sourceBlock);
      }
    }
  }