コード例 #1
0
 private void processInvalidatedChunks(NetData.NetMessage message) {
   for (NetData.InvalidateChunkMessage chunk : message.getInvalidateChunkList()) {
     Vector3i chunkPos = NetMessageUtil.convert(chunk.getPos());
     remoteWorldProvider.invalidateChunks(chunkPos);
     awaitingChunkReadyBlockUpdates.removeAll(chunkPos);
     awaitingChunkReadyBiomeUpdates.removeAll(chunkPos);
   }
 }
コード例 #2
0
ファイル: Parser.java プロジェクト: h87kg/buck
  /**
   * Remove the targets and rules defined by {@code path} from the cache and recursively remove the
   * targets and rules defined by files that transitively include {@code path} from the cache.
   *
   * @param path The File that has changed.
   */
  private synchronized void invalidateDependents(Path path) {
    // Normalize path to ensure it hashes equally with map keys.
    path = normalize(path);

    if (parsedBuildFiles.containsKey(path)) {
      if (console.getVerbosity() == Verbosity.ALL) {
        console.getStdErr().printf("Parser invalidating %s cache\n", path.toAbsolutePath());
      }

      // Remove all targets defined by path from cache.
      for (Map<String, Object> rawRule : parsedBuildFiles.get(path)) {
        BuildTarget target = parseBuildTargetFromRawRule(rawRule);
        knownBuildTargets.remove(target);
      }

      // Remove all rules defined in path from cache.
      parsedBuildFiles.removeAll(path);

      // All targets have no longer been parsed and cached.
      allBuildFilesParsed = false;
    }

    // Recursively invalidate dependents.
    for (Path dependent : buildFileDependents.get(path)) {

      if (!dependent.equals(path)) {
        invalidateDependents(dependent);
      }
    }

    // Dependencies will be repopulated when files are re-parsed.
    buildFileDependents.removeAll(path);
  }
コード例 #3
0
 /**
  * Remove a listener.
  *
  * @param key the associated key object
  * @param listener the listener to remove
  */
 public void removeListner(Object key, UniversalLookupListener listener) {
   listeners.get(key).remove(listener);
   // Some cleanup
   if (listeners.get(key).isEmpty()) {
     listeners.removeAll(key);
   }
 }
コード例 #4
0
  @Override
  public void onChunkReady(Vector3i chunkPos) {
    WorldProvider worldProvider = CoreRegistry.get(WorldProvider.class);

    List<NetData.BlockChangeMessage> updateBlockMessages =
        awaitingChunkReadyBlockUpdates.removeAll(chunkPos);
    for (NetData.BlockChangeMessage message : updateBlockMessages) {
      Vector3i pos = NetMessageUtil.convert(message.getPos());
      Block newBlock = blockManager.getBlock((short) message.getNewBlock());
      worldProvider.setBlock(pos, newBlock);
    }

    List<NetData.BiomeChangeMessage> updateBiomeMessages =
        awaitingChunkReadyBiomeUpdates.removeAll(chunkPos);
    for (NetData.BiomeChangeMessage message : updateBiomeMessages) {
      Vector3i pos = NetMessageUtil.convert(message.getPos());
      Biome newBiome = biomeManager.getBiomeByShortId((short) message.getNewBiome());
      worldProvider.setBiome(pos, newBiome);
    }
  }
コード例 #5
0
 public void clearNotes(String k) {
   notes.removeAll(k);
 }
コード例 #6
0
 @Override
 public List<V> remove(final Object key) {
   return backingMap.removeAll(key);
 }
コード例 #7
0
 /**
  * Removes all the elements associated with the provided key, in addition to removing the key.
  *
  * @param key the key to remove
  */
 public void removeAll(Object key) {
   lookupMultimap.removeAll(key);
 }