Examples of Chunk


Examples of net.minecraft.world.chunk.Chunk

  /**
   * Will return back a chunk, if it doesn't exist and its not a MP client it will generates all the blocks for the
   * specified chunk from the map seed and chunk seed
   */
  public Chunk provideChunk(int par1, int par2) {
    Chunk chunk = new Chunk(this.worldObj, par1, par2);

    for (int k = 0; k < this.cachedBlockIDs.length; ++k) {
      int l = k >> 4;
      ExtendedBlockStorage extendedblockstorage = chunk.getBlockStorageArray()[l];

      if (extendedblockstorage == null) {
        extendedblockstorage = new ExtendedBlockStorage(k, !this.worldObj.provider.hasNoSky);
        chunk.getBlockStorageArray()[l] = extendedblockstorage;
      }

      for (int i1 = 0; i1 < 16; ++i1) {
        for (int j1 = 0; j1 < 16; ++j1) {
          extendedblockstorage.func_150818_a(i1, k & 15, j1, Block.getBlockById(this.cachedBlockIDs[k] & 255));
          extendedblockstorage.setExtBlockMetadata(i1, k & 15, j1, this.cachedBlockMetadata[k]);
        }
      }
    }

    chunk.generateSkylightMap();
    BiomeGenBase[] abiomegenbase = this.worldObj.getWorldChunkManager().loadBlockGeneratorData(null, par1 * 16, par2 * 16, 16, 16);
    byte[] abyte = chunk.getBiomeArray();

    for (int k1 = 0; k1 < abyte.length; ++k1) {
      abyte[k1] = (byte) abiomegenbase[k1].biomeID;
    }
    chunk.generateSkylightMap();
    return chunk;
  }
View Full Code Here

Examples of net.minecraft.world.chunk.Chunk

              worldObj.setBlock(targetX, yCoord + 1, targetZ, worldObj.getBlock(xCoord, yCoord + 1, zCoord), worldObj.getBlockMetadata(xCoord, yCoord + 1, zCoord), 3);
              passenger.invalidate();
              worldObj.setBlockToAir(xCoord, yCoord + 1, zCoord);

              //IMovableHandler default code
              Chunk c = worldObj.getChunkFromBlockCoords(targetX, targetZ);

              c.func_150812_a(targetX & 0xF, yCoord + 1, targetZ & 0xF, passenger);

              if (c.isChunkLoaded) {
                worldObj.addTileEntity(passenger);
                worldObj.markBlockForUpdate(targetX, yCoord + 1, targetZ);
              }
View Full Code Here

Examples of nexus.model.structs.Chunk

     
//      this.model.requestChunk(new Vector3(0, 0, 0));
     
      for(int i = -this.renderDistance; i <= this.renderDistance; i++) {
        for(int j = -this.renderDistance; j <= this.renderDistance; j++) {
          Chunk chunk = this.model.chunks.getChunk(this.model.camera.eye.add(new Vector3(i, 0, j).scale(16f)));
          chunk.drawBlocks();
        }
      }
     
      Display.update();
    }
View Full Code Here

Examples of org.apache.commons.jrcs.diff.Chunk

                throw new InvalidFileFormatException(version + ":line:" + ":" + e.getMessage());
            }

            if (action == 'd')
            {
                revision.addDelta(new DeleteDelta(new Chunk(n - 1, count)));
            }
            else if (action == 'a')
            {
                revision.addDelta(new AddDelta(n, new Chunk(getTextLines(it + 1, it + 1 + count), 0, count, n - 1)));
                it += count;
            }
            else
            {
                throw new InvalidFileFormatException(version.toString());
View Full Code Here

Examples of org.apache.ctakes.typesystem.type.syntax.Chunk

  public static ArrayList<Chunk> selectDemonAndRelative (JCas jcas) {
    ArrayList<Chunk> ret = new ArrayList<Chunk>();
    FSIterator iter = jcas.getJFSIndexRepository().getAnnotationIndex(Chunk.type).iterator();
    while (iter.hasNext()) {
      Chunk c = (Chunk)iter.next();
      if (c.getChunkType().equals("NP")) {
        String s = c.getCoveredText().toLowerCase();
        if (s.startsWith("these") ||
          s.startsWith("those") ||
          s.startsWith("this") ||
          s.startsWith("that") ||
          s.startsWith("which"))
View Full Code Here

Examples of org.apache.hadoop.chukwa.Chunk

  public static void extractRawLogFromDump(String directory, String fileName)
      throws Exception {
    File inputFile = new File(directory + fileName + ".bin");
    File outputFile = new File(directory + fileName + ".raw");
    DataInputStream dis = new DataInputStream(new FileInputStream(inputFile));
    Chunk chunk = null;
    FileWriter out = new FileWriter(outputFile);
    boolean eof = false;
    do {
      try {
        chunk = ChunkImpl.read(dis);
        out.write(new String(chunk.getData()));
      } catch (EOFException e) {
        eof = true;
      }

    } while (!eof);
View Full Code Here

Examples of org.apache.hadoop.chukwa.Chunk

    String adaptorId = agent
        .processAddCommand("add org.apache.hadoop.chukwa.datacollection.adaptor."
            +"filetailer." + name
            + " raw " + testFile + " 0");
    assertNotNull(adaptorId);
    Chunk c = chunks.waitForAChunk(1000);
    assertNotNull(c);
    assertEquals(testFile.length(), c.getData().length);
    assertTrue(c.getDataType().equals("raw"));
    assertTrue(c.getRecordOffsets().length == 1);
    assertTrue(c.getSeqID() == testFile.length());
   
    c = chunks.waitForAChunk(1000);
    assertNull(c);
   
    agent.stopAdaptor(adaptorId, false);
View Full Code Here

Examples of org.apache.hadoop.chukwa.Chunk

    String adaptorId = agent
        .processAddCommand("add lr =org.apache.hadoop.chukwa.datacollection.adaptor.filetailer.CharFileTailingAdaptorUTF8"
            + " lines " + testFile + " 0");
    assertTrue(adaptorId.equals("adaptor_lr"));
    System.out.println("getting a chunk...");
    Chunk c = chunks.waitForAChunk();
    System.out.println("got chunk");
    while (!c.getDataType().equals("lines")) {
      c = chunks.waitForAChunk();
    }
    assertTrue(c.getSeqID() == testFile.length());
    assertTrue(c.getRecordOffsets().length == 80);
    int recStart = 0;
    for (int rec = 0; rec < c.getRecordOffsets().length; ++rec) {
      String record = new String(c.getData(), recStart,
          c.getRecordOffsets()[rec] - recStart + 1);
      System.out.println("record " + rec + " was: " + record);
      assertTrue(record.equals(rec + " abcdefghijklmnopqrstuvwxyz\n"));
      recStart = c.getRecordOffsets()[rec] + 1;
    }
    assertTrue(c.getDataType().equals("lines"));
    testFile = makeTestFile("chukwaLogRotateTest", 40);
    c = chunks.waitForAChunk();
    System.out.println("got chunk");
    while (!c.getDataType().equals("lines")) {
      c = chunks.waitForAChunk();
    }
    // assertTrue(c.getSeqID() == testFile.length());
    assertTrue(c.getRecordOffsets().length == 40);
    recStart = 0;
    for (int rec = 0; rec < c.getRecordOffsets().length; ++rec) {
      String record = new String(c.getData(), recStart,
          c.getRecordOffsets()[rec] - recStart + 1);
      System.out.println("record " + rec + " was: " + record);
      assertTrue(record.equals(rec + " abcdefghijklmnopqrstuvwxyz\n"));
      recStart = c.getRecordOffsets()[rec] + 1;
    }
    assertTrue(c.getDataType().equals("lines"));
    agent.stopAdaptor(adaptorId, false);
    agent.shutdown();
    Thread.sleep(2000);
  }
View Full Code Here

Examples of org.apache.hadoop.chukwa.Chunk

            + " lines " + testFile + " 0");
    assertNotNull(adaptorId);
    assertEquals(1, agent.adaptorCount());

    System.out.println("getting a chunk...");
    Chunk c = chunks.waitForAChunk();
    System.out.println("got chunk");
    while (!c.getDataType().equals("lines")) {
      c = chunks.waitForAChunk();
    }
    assertTrue(c.getSeqID() == testFile.length());
    assertTrue(c.getRecordOffsets().length == 80);
    int recStart = 0;
    for (int rec = 0; rec < c.getRecordOffsets().length; ++rec) {
      String record = new String(c.getData(), recStart,
          c.getRecordOffsets()[rec] - recStart + 1);
      assertTrue(record.equals(rec + " abcdefghijklmnopqrstuvwxyz\n"));
      recStart = c.getRecordOffsets()[rec] + 1;
    }
    assertTrue(c.getDataType().equals("lines"));
    agent.stopAdaptor(adaptorId, false);
    agent.shutdown();
    Thread.sleep(2000);
  }
View Full Code Here

Examples of org.apache.hadoop.chukwa.Chunk

        System.out.println("buzzed " + i + " times");
     
      assertEquals(0, agent.adaptorCount());
      agent.processAddCommand("add adaptor_test = filetailer.FileTailingAdaptor raw " +testFile.getCanonicalPath() + " 0");
      assertEquals(1, agent.adaptorCount());
      Chunk c = chunks.waitForAChunk();
      String dat = new String(c.getData());
      assertTrue(dat.startsWith("0 abcdefghijklmnopqrstuvwxyz"));
      assertTrue(dat.endsWith("9 abcdefghijklmnopqrstuvwxyz\n"));
      assertTrue(c.getDataType().equals("raw"));
      if(agent.adaptorCount() > 0)
        agent.stopAdaptor("adaptor_test", false);
    }
    agent.shutdown();
  }
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.