Package de.lv.jvoxgl.world.entities

Examples of de.lv.jvoxgl.world.entities.Block


   */
  public void updateChunk(){
    for(int cx=0;cx<world.getChunkWidth();cx++){
      for(int cy=0;cy<world.getChunkHeight();cy++){
        for(int cz=0;cz<world.getChunkDepth();cz++){
          Block block = blocks[cx][cy][cz];
          if(block == null)continue;
          if(block.getId() == 0)continue;
          this.renderer.addVertices(block.getVertices());
        }
      }
    }
    this.renderer.fill();
    this.setChanged(false);
View Full Code Here


   * @param x
   * @param y
   * @param z
   */
  public void setBlockIdAt(int id, int x, int y, int z){
    Block block = this.getBlockAt(x, y, z);
    if(block == null){
      new Block(this, id, x, y, z);
    }else{
      block.setId(id);
    }
  }
View Full Code Here

    Chunk chunk = this.getChunkAt(x, z);
    if(chunk == null)return null;
    int cx = Coordinates.WorldToChunkCoordinatesX(this, x);
    int cz = Coordinates.WorldToChunkCoordinatesZ(this, z);
    if(cx < 0 || cx > chunk_width-1 || cz < 0 || cz > chunk_depth-1 || y < 0 || y > chunk_height-1)return null;
    Block block = chunk.getBlocks()[cx][y][cz];
    return block;
  }
View Full Code Here

    Random rand = new Random(System.currentTimeMillis());
    for(int x=0;x<(world.getChunkWidth()*5);x++){
      for(int y=0;y<world.getChunkHeight();y++){
        for(int z=0;z<(world.getChunkDepth()*5);z++){
          if(rand.nextInt(20)==0){
            new Block(world, 1, x, y, z);
          }
        }
      }
    }
  }
View Full Code Here

TOP

Related Classes of de.lv.jvoxgl.world.entities.Block

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.