Package Hexel.blocks.types

Examples of Hexel.blocks.types.BlockTransparent


          return false;
        }
        if (!inSimRange.pointIsInRange(p)){
          return false;
        }
        BlockTransparent be = (BlockTransparent)b;
        int newLightLevel = 0;
        int highestBlock = chunks.getHighestBlockAtXY(p.x, p.y, tmp2i, highestBlockChunk);

        if (p.z > highestBlock){
          newLightLevel = 0;
        }
        else {
          Vector3i[] neighbors = HexGeometry.getAllNeighbors(p.x);
          int highestNeighborLightLevel = BlockTransparent.MAX_LIGHT_LEVEL;
          for (Vector3i neighbor3 : neighbors) {
            tmp3i2.x = p.x+neighbor3.x;
            tmp3i2.y = p.y+neighbor3.y;
            tmp3i2.z = p.z+neighbor3.z;
            Block neighbor = chunks.getBlock(tmp3i2.x, tmp3i2.y, tmp3i2.z, tmp3i, chunk);
            if (neighbor instanceof BlockTransparent){
              int naturalOcclusion = 1;
              if (neighbor3.z == 1)
                naturalOcclusion = 0;
              BlockTransparent neighborE = (BlockTransparent)neighbor;
              highestNeighborLightLevel = Math.min(highestNeighborLightLevel, neighborE.getLightLevel()+naturalOcclusion+neighborE.occlusion);
            }
          }
          newLightLevel = highestNeighborLightLevel;
        }
        if (newLightLevel != be.naturalLightLevel){
          BlockTransparent newBE = BlockTools.updateLightLevel(be, newLightLevel);
          blockDeltaAdder.addBlockDelta(BlockDelta.Aquire(p.x, p.y, p.z, newBE, startStepsToSim));
          return INSTANT;
        }
        return false;
      }
View Full Code Here


        return false;
      }
    });

    if (lowestWaterPoint.contents != null){
      BlockTransparent lowestWaterBlock = (BlockTransparent)chunks.getBlock(
          lowestWaterPoint.contents.x,
          lowestWaterPoint.contents.y,
          lowestWaterPoint.contents.z, tmp3i, c);
      int waterLevelDiff = startWaterLevel - lowestWaterLevel.contents;
      int toMove = Math.min(waterLevelDiff/2, bw.getTop() - bw.getBottom());
View Full Code Here

      }

      @Override
      public void spawn(double x, double y, double z, int bx, int by, int bz, int step, Chunk c, Chunks chunks) {
        Block ab = chunks.getBlock(bx, by, bz+1, tmp, c);
        BlockTransparent abt = (BlockTransparent)ab;
        int numberToSpawn = engine.zsp.getNumberToSpawn();
        if (numberToSpawn <= 0)
          return;
        double lightLevel = engine.getAmbientLight() - abt.naturalLightLevel*1.0/BlockTransparent.MAX_LIGHT_LEVEL;
        if (lightLevel < .5 && Util.hashToDouble(Util.hash(Hexel.session.seed, step, bx, by, bz)) < .25){
View Full Code Here

TOP

Related Classes of Hexel.blocks.types.BlockTransparent

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.