Package se.llbit.chunky.world

Examples of se.llbit.chunky.world.ChunkPosition


          for (int sx = x-1; sx <= x+1; ++sx) {
            int wx = cp.x*16 + sx;
            for (int sz = z-1; sz <= z+1; ++sz) {
              int wz = cp.z*16 + sz;

              ChunkPosition ccp = ChunkPosition.get(wx >> 4, wz >> 4);
              if (chunkSet.contains(ccp)) {
                nsum += 1;
                int biomeId = biomeIdMap.get(wx, wz);
                float[] grassColor = Biomes.getGrassColorLinear(biomeId);
                grassMix[0] += grassColor[0];
View Full Code Here


          }
          if (containsRegion) {
            next = ChunkPosition.get(cx, cz);
            return;
          } else {
            ChunkPosition chunk = ChunkPosition.get(cx, cz);
            if (chunks.contains(chunk)) {
              next = chunk;
              return;
            }
          }
        }
        next = null;
      }

      @Override
      public boolean hasNext() {
        return next != null;
      }

      @Override
      public ChunkPosition next() {
        ChunkPosition pos = next;
        findNext();
        return pos;
      }

      @Override
View Full Code Here

import se.llbit.chunky.world.ChunkPosition;

public class Test {

  public static void main(String[] args) {
    ChunkPosition cp;
    cp = ChunkPosition.get(17179869197L);
    System.out.println(cp.toString());
    cp = ChunkPosition.get(8589934606L);
    System.out.println(cp.toString());
    cp = ChunkPosition.get(8589934605L);
    System.out.println(cp.toString());
    cp = ChunkPosition.get(17179869198L);
    System.out.println(cp.toString());
    cp = ChunkPosition.get(12884901902L);
    System.out.println(cp.toString());
    cp = ChunkPosition.get(12884901901L);
    System.out.println(cp.toString());
  }
View Full Code Here

      if (dx == 0 && dy == 0) {
        return;
      }

      ChunkPosition chunk = getChunk(e);
      if (chunk != end) {
        end = chunk;
        repaint();
      }
View Full Code Here

      }
    }

    @Override
    public void mouseMoved(MouseEvent e) {
      ChunkPosition chunk = getChunk(e);
      if (chunk != start) {
        start = chunk;
        end = chunk;
        repaint();
      }
View Full Code Here

      int cz = (int) QuickMath.floor(z);
      int bx = (int) QuickMath.floor((x-cx)*16);
      int bz = (int) QuickMath.floor((z-cz)*16);
      bx = Math.max(0, Math.min(Chunk.X_MAX-1, bx));
      bz = Math.max(0, Math.min(Chunk.Z_MAX-1, bz));
      ChunkPosition cp = ChunkPosition.get(cx, cz);
      Chunk hoveredChunk = chunky.getWorld().getChunk(cp);
      if (!hoveredChunk.isEmpty()) {
        mapLabel.setText(String.format("%s, biome: %s",
            ""+hoveredChunk.toString(),
            hoveredChunk.biomeAt(bx, bz)));
View Full Code Here

    }
  }

  protected synchronized void selectWithinRect() {
    if (selectRect) {
      ChunkPosition cp0 = start;
      ChunkPosition cp1 = end;
      int x0 = Math.min(cp0.x, cp1.x);
      int x1 = Math.max(cp0.x, cp1.x);
      int z0 = Math.min(cp0.z, cp1.z);
      int z1 = Math.max(cp0.z, cp1.z);
      chunky.selectChunks(x0, x1, z0, z1);
View Full Code Here

    if (!mouseInsideWindow) {
      return;
    }
    ChunkView cv = view;

    ChunkPosition cp = end;
    g.setFont(font);
    g.setColor(Color.red);

    if (selectRect) {
      ChunkPosition cp0 = start;
      ChunkPosition cp1 = end;
      int x0 = Math.min(cp0.x, cp1.x);
      int x1 = Math.max(cp0.x, cp1.x);
      int z0 = Math.min(cp0.z, cp1.z);
      int z1 = Math.max(cp0.z, cp1.z);
      x0 = (int) (cv.scale * (x0 - cv.x0));
View Full Code Here

TOP

Related Classes of se.llbit.chunky.world.ChunkPosition

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.