Examples of VanillaCuboidLightBuffer


Examples of org.spout.vanilla.world.lighting.VanillaCuboidLightBuffer

      for (int xx = xs; xx <= xi; xx++) {
        for (int yy = ys; yy <= yi; yy++) {
          int zOld = 0;
          ChunkSnapshot chunk = null;
          VanillaCuboidLightBuffer blockLight = null;
          VanillaCuboidLightBuffer skyLight = null;

          for (int zz = zs; zz <= zi; zz++) {
            int zChunk = zz >> Chunk.BLOCKS.BITS;
            if (zChunk != zOld || chunk == null) {
              chunk = chunkModel.getChunkFromBlock(xx, yy, zz);
              if (chunk == null) {
                continue;
              }
              blockLight = (VanillaCuboidLightBuffer) chunk.getLightBuffer(VanillaLighting.BLOCK_LIGHT.getId());
              skyLight = (VanillaCuboidLightBuffer) chunk.getLightBuffer(VanillaLighting.SKY_LIGHT.getId());
              zOld = zChunk;
            }
            BlockMaterial m = chunk.getBlockMaterial(xx, yy, zz);
            if (!m.isOpaque()) {
              light += blockLight.get(xx, yy, zz);
              skylight += skyLight.get(xx, yy, zz); //use the SkyLightRaw, the real sky state would be apply by the shader
              count++;
            }
          }
        }
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.