Package Hexel.blocks.types

Examples of Hexel.blocks.types.BlockWater


  private boolean checkAgain;

  @Override
  public int freqRun(int bx, int by, final int bz, boolean fastMode, Block b, final Chunk c,
      HighestBlockChunk hbc, final Chunks chunks, int step, final BlockDeltaAdder blockDeltaAdder) {
    BlockWater bw = (BlockWater)b;
    final Vector3i start = new Vector3i(bx, by, bz);
    checkAgain = false;
    numSeen = 0;
    final int startWaterLevel = bz*8 + bw.getTop();
    lowestWaterLevel.contents = Integer.MAX_VALUE;
    lowestWaterPoint.contents = null;
//    System.out.println("HWG " + step);
    BlockTools.pointFloodSearch(start, new BlockTools.PointFloodSearchMatcher() {
      @Override
      public boolean matches(Vector3i p) {
        Block b = chunks.getBlock(p.x, p.y, p.z, tmp3i, c);
        if (numSeen > 100){
          return false;
        }

//        if (b instanceof BlockEmpty && p.z == bz) {
//          Block bl = chunks.getBlock(p.x, p.y, p.z - 1, tmp3i, c);
//          if (bl instanceof BlockEmpty || bl instanceof BlockWater) {
//            b = bl;
//            p.z -= 1;
//          }
//        }

        int waterLevel;
        if (b instanceof BlockWater || b instanceof BlockEmpty){
          if (b instanceof BlockWater){
            numSeen += 1;
            int blockWaterLevel = 0;
            BlockWater wb = (BlockWater) b;
            if (wb.getBottom() != 0){
              blockWaterLevel = wb.getBottom();
            }
            else if (wb.getTop() < 8) {
              blockWaterLevel = wb.getTop();
            }
            waterLevel = p.z*8 + blockWaterLevel;
          }
          else {
            waterLevel = p.z*8;
 
View Full Code Here

TOP

Related Classes of Hexel.blocks.types.BlockWater

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.