Package org.spout.api.util.bytebit

Examples of org.spout.api.util.bytebit.ByteBitSet


    int oz = o.getZ() + 1;
    BlockMaterial neighbor = materials[ox][oy][oz];
    if (neighbor == null) {
      return 0;
    }
    ByteBitSet occulusion = neighbor.getOcclusion(neighbor.getData());
    if (occulusion.get(face.getOpposite())) {
      return 0;
    }

    BlockMaterial center = materials[1][1][1];
    occulusion = center.getOcclusion(center.getData());
    if (occulusion.get(face)) {
      return 0;
    }
    return lightLevels[ox][oy][oz] - 1 - center.getOpacity();
  }
View Full Code Here


      int neighborLight = manager.getLightLevel(light, nx, ny, nz, true);

      short nData = material.getData(nx, ny, nz);
      BlockMaterial nMaterial = BlockMaterial.get(nId, nData);

      ByteBitSet occlusionSet = nMaterial.getOcclusion(nData);
      if (occlusionSet.get(face.getOpposite())) {
        continue;
      }

      int newLight = previousLevel - nMaterial.getOpacity() - 1;
View Full Code Here

  protected int computeLightLevel(ChunkCuboidLightBufferWrapper<VanillaCuboidLightBuffer> light, ImmutableCuboidBlockMaterialBuffer material, ImmutableHeightMapBuffer height, int x, int y, int z) {
    BlockMaterial m = material.get(x, y, z);
    short data = material.getData(x, y, z);

    ByteBitSet occlusionSet = m.getOcclusion(data);

    int neighborLight = getEmittedLight(material, height, x, y, z);

    if (m.isOpaque() || occlusionSet.get(BlockFaces.NESWBT)) {
      return neighborLight;
    }

    int opacity = m.getOpacity() + 1;
View Full Code Here

    }
    short data = material.getData(nx, ny, nz);

    BlockMaterial m = BlockMaterial.get(id, data);

    ByteBitSet neighborOcclusionSet = m.getOcclusion(data);
    if (neighborOcclusionSet.get(face.getOpposite())) {
      return 0;
    }

    return getLightLevel(light, nx, ny, nz);
  }
View Full Code Here

      int y = v.getY();
      int z = v.getZ();

      BlockMaterial m = buffer.get(x + baseX - 1, y + baseY - 1, z + baseZ - 1);

      ByteBitSet occulusion = m.getOcclusion(m.getData());

      int center = newLight[x][y][z];

      for (BlockFace face : allFaces) {
        if (occulusion.get(face)) {
          continue;
        }
        IntVector3 off = face.getIntOffset();
        int nx = x + off.getX();
        int ny = y + off.getY();
View Full Code Here

  //TODO: Box Shape
  public Stairs(String name, int id, String model) {
    super(name, id, model, null);
    this.occlusion = new ByteBitSet[8];
    for (int i = 0; i < 4; i++) {
      this.occlusion[i] = new ByteBitSet(BlockFaces.NSEW.get(i).getOpposite(), BlockFace.BOTTOM);
      this.occlusion[i | 0x4] = new ByteBitSet(BlockFaces.NSEW.get(i).getOpposite(), BlockFace.TOP);
    }
  }
View Full Code Here

      return true;
    }

    BlockMaterial m = material.get(x, y, z);

    ByteBitSet centerOcclusionSet = m.getOcclusion(m.getData());

    for (int f = 0; f < allFaces.length; f++) {
      BlockFace face = allFaces[f];

      if (centerOcclusionSet.get(face)) {
        continue;
      }

      IntVector3 offset = face.getIntOffset();
      int nx = x + offset.getX();
      int ny = y + offset.getY();
      int nz = z + offset.getZ();

      short nId = material.getId(nx, ny, nz);
      if (nId == BlockMaterial.UNGENERATED.getId()) {
        continue;
      }

      int neighborLight = manager.getLightLevel(light, nx, ny, nz, true);
      if (neighborLight >= lightLevel - 1) {
        continue;
      }

      short nData = material.getData(nx, ny, nz);
      BlockMaterial nMaterial = BlockMaterial.get(nId, nData);

      ByteBitSet occlusionSet = nMaterial.getOcclusion(nData);
      if (occlusionSet.get(face.getOpposite())) {
        continue;
      }

      int newLight = targetLevel - nMaterial.getOpacity() - 1;
      // Spout.getLogger().info("new light " + newLight + " neighbor light " + neighborLight + " for neighbor " + nx + ", " + ny + ", " + nz);
View Full Code Here

TOP

Related Classes of org.spout.api.util.bytebit.ByteBitSet

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.