Java Code Examples for java.util.ArrayList.clear()

The following are Jave code examples for showing how to use clear() of the java.util.ArrayList class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: monarch   File: DistTXStateProxyImplOnCoordinator.java   Source Code and License Vote up 6 votes
private void populateEntryEventList(DistributedMember target,
    ArrayList<ArrayList<DistTxThinEntryState>> entryEventList, TreeSet<String> sortedRegionMap) {
  DistTXCoordinatorInterface distTxItem = target2realDeals.get(target);
  sortedRegionMap.clear();
  distTxItem.gatherAffectedRegionsName(sortedRegionMap, false, true);

  // Get region as per sorted order of region path
  entryEventList.clear();
  for (String rName : sortedRegionMap) {
    ArrayList<DistTxThinEntryState> entryStates = this.txEntryEventMap.get(rName);
    if (entryStates == null) {
      throw new UnsupportedOperationInTransactionException(LocalizedStrings.DISTTX_TX_EXPECTED
          .toLocalizedString("entryStates for " + rName + " at target " + target, "null"));
    }
    entryEventList.add(entryStates);
  }
}
 
Example 2
Project: codigo3   File: TSS.java   Source Code and License Vote up 6 votes
public boolean Open(DataInputStream F){    //Lee la TSS del Flujo F.        
    ArrayList <String> Aux = new ArrayList<String>();
    
    try{            
            //Leer la Cant. de StringCtte's.            
        int n = F.readInt();
        
            //Leer los StringCtte's y depositarlas en la lista Aux.
        for (int i=1; i<=n; i++)
            Aux.add( F.readUTF() );
        
            //Copiar lista Aux a L y liberar Aux
        L.clear();      L=null;            
        L = Clonar(Aux);
        Aux.clear();    Aux = null;
        
        return true;                
    }
    catch(Exception e){
    }
    
    return false;
}
 
Example 3
Project: FlickLauncher   File: CellLayout.java   Source Code and License Vote up 6 votes
private void getViewsIntersectingRegion(int cellX, int cellY, int spanX, int spanY,
        View dragView, Rect boundingRect, ArrayList<View> intersectingViews) {
    if (boundingRect != null) {
        boundingRect.set(cellX, cellY, cellX + spanX, cellY + spanY);
    }
    intersectingViews.clear();
    Rect r0 = new Rect(cellX, cellY, cellX + spanX, cellY + spanY);
    Rect r1 = new Rect();
    final int count = mShortcutsAndWidgets.getChildCount();
    for (int i = 0; i < count; i++) {
        View child = mShortcutsAndWidgets.getChildAt(i);
        if (child == dragView) continue;
        LayoutParams lp = (LayoutParams) child.getLayoutParams();
        r1.set(lp.cellX, lp.cellY, lp.cellX + lp.cellHSpan, lp.cellY + lp.cellVSpan);
        if (Rect.intersects(r0, r1)) {
            mIntersectingViews.add(child);
            if (boundingRect != null) {
                boundingRect.union(r1);
            }
        }
    }
}
 
Example 4
Project: prisonPicks   File: PickoplentyTest.java   Source Code and License Vote up 6 votes
@Test
public void isXPickTest()
{
    doReturn(true).when(itemMeta).hasLore();
    doReturn(true).when(tool).hasItemMeta();
    doReturn(itemMeta).when(tool).getItemMeta();
    //this is the wrong lore
    ArrayList<String> lore = new ArrayList<String>();
    lore.add(ChatColor.GREEN + "Pick o'Plenty");
    doReturn(lore).when(itemMeta).getLore();
    assertFalse(Pickoplenty.isPick(tool));
 
    //this should work with the correct lore
    lore.clear();
    lore.add(ChatColor.LIGHT_PURPLE + "Pick o'Plenty");
    doReturn(lore).when(itemMeta).getLore();
    assertTrue(Pickoplenty.isPick(tool));
}
 
Example 5
Project: SQLite2XL   File: DBQueries.java   Source Code and License Vote up 6 votes
public ArrayList<Users> readUsers() {
    ArrayList<Users> list = new ArrayList<>();
    try {
        Cursor cursor;
        database = dbHelper.getReadableDatabase();
        cursor = database.rawQuery(DBConstants.SELECT_QUERY, null);
        list.clear();
        if (cursor.getCount() > 0) {
            if (cursor.moveToFirst()) {
                do {
                    String contactId = cursor.getString(cursor.getColumnIndex(DBConstants.CONTACT_ID));
                    String conPerson = cursor.getString(cursor.getColumnIndex(DBConstants.CONTACT_PERSON_NAME));
                    String conNo = cursor.getString(cursor.getColumnIndex(DBConstants.CONTACT_NO));
                    Users users = new Users(contactId,conPerson,conNo);
                    list.add(users);
                } while (cursor.moveToNext());
            }
        }
        cursor.close();
    } catch (Exception e) {
        Log.v("Exception", e.getMessage());
    }
    return list;
}
 
Example 6
Project: Pogamut3   File: BvhBuilder.java   Source Code and License Vote up 6 votes
public float genChildSubsets( float cur_SAH, BvhNodeT node, ArrayList<Integer> subset_A, ArrayList<Integer> subset_B){
  int items = node._itemCount();
 
  float   SA_P = 1/node._getAABB().getSurfaceArea();
  float[] SA_A = new float[items-1];
  float[] SA_B = new float[items-1];

  // precompute the arrays of SURFACE AREAS using a sorted! triangle-list. SA_A[]=left->right, and SA_B[]=left<-right
  AABB a = AABB.init(); for(int i = 0;  i < items-1; i++) SA_A[i] = a.grow(obj.f[node._getObjects().get(i  )].aabb).getSurfaceArea();
  AABB b = AABB.init(); for(int i = items-2; i >= 0; i--) SA_B[i] = b.grow(obj.f[node._getObjects().get(i+1)].aabb).getSurfaceArea();
  
  int cur_items_A = -1;
  for(int i = 0, items_A = 1; i < items-1; i++, items_A++){
    float new_SAH = getSAH(SA_P, SA_A[i], items_A, SA_B[i], items-items_A);
    if( new_SAH < cur_SAH ){
      cur_SAH = new_SAH;
      cur_items_A = items_A;
    }
  }

  if( cur_items_A >= 0){ 
    subset_A.clear();  subset_A.addAll(node._getObjects().subList(0,    cur_items_A));     subset_A.trimToSize();
    subset_B.clear();  subset_B.addAll(node._getObjects().subList(cur_items_A, items));    subset_B.trimToSize();
  }
  return cur_SAH;
}
 
Example 7
Project: polcla   File: DependencyGraph.java   Source Code and License Vote up 6 votes
/**
 * This method is similar to
 * {@link #getSentimentSourceTarget(WordObj, String, WordObj)} except that it
 * deals with multi-word expressions (MWEs). It returns either the
 * corresponding source or the target (depending if it has been called to
 * identify source or target in SentimentChecker class) for a given sentiment
 * expression that is of the 'mwe' type.
 *
 * @param wtmp The word from which the MWE sentiment expression is recognized.
 * @param mwe The sentiment expression (mwe) that is matched.
 * @param label It should be checked whether the sentiment expression has an
 * outgoing node to another node (this would then be the source or the target)
 * with a certain dependency relation specified in this parameter
 * @param containsDeleted If there is a sentiment expression whose
 * corresponding node in the graph of the sentence has been deleted due to
 * normalization, the WordObj parent node (which is still in the graph,
 * necessary to yield existing graph relations) will be stored in this
 * parameter (empty otherwise)
 * @return a list in which the source or the target is stored, empty otherwise
 * if no fitting source/target exists for given label and sent expr
 */
public ArrayList<WordObj> getSentimentSourceTargetMWE(WordObj wtmp, SentimentUnit mwe, String label,
        WordObj containsDeleted) {
  ArrayList<String> mweWords = new ArrayList<String>();
  for (String word : mwe.collocations) {
    mweWords.add(word);
  }

  ArrayList<WordObj> list = new ArrayList<WordObj>();
  ArrayList<WordObj> matches = getMweMatches(wtmp, mweWords, true);
  if (!(matches.size() > mwe.collocations.length)) {
    return new ArrayList<WordObj>();
  }

  for (WordObj mweNode : matches) {
    list.addAll(this.getSentimentSourceTarget(mweNode, label, new WordObj("")));
  }

  // remove doubles
  HashSet<WordObj> hs = new HashSet<WordObj>();
  hs.addAll(list);
  list.clear();
  list.addAll(hs);

  return list;
}
 
Example 8
Project: LiveNotes   File: Dispatcher.java   Source Code and License Vote up 6 votes
private void scheduleNotesForBar(final Bar bar, final Date barStartTime) {
    if (noteHandler != null && !bar.countIn){
        List<Note> notes = allNotesInBar(bar);
        // gather chords and schedule for each new start time
        ArrayList<Note> chord = new ArrayList<Note>();
        int lastStartTime = -1;
        for (Note note : notes)
        {
            if (note.start >= 0) // ignore notes with negative start times - these belong to the previous bar
            {
                boolean isChord = (note.start == lastStartTime);
                if (lastStartTime >= 0 && !isChord && chord.size() > 0) // new note time
                {
                    scheduleNoteChangeHandler(lastStartTime, barStartTime, chord);
                    chord.clear();
                }
                chord.add(note);
                lastStartTime = note.start;
            }
        }
        if (chord.size() > 0) // handle last chord in bar
        {
            scheduleNoteChangeHandler(lastStartTime, barStartTime, chord);
        }
    }
}
 
Example 9
Project: ctsms   File: SearchBeanBase.java   Source Code and License Vote up 6 votes
private static void copyCriteriaOutToIn(CriteriaInVO criteriaIn, ArrayList<CriterionInVO> criterionsIn, CriteriaOutVO out) {
	if (criteriaIn != null && criterionsIn != null && out != null) {
		Collection<CriterionOutVO> criterionVOs = out.getCriterions();
		criteriaIn.setCategory(out.getCategory());
		criteriaIn.setId(out.getId());
		criteriaIn.setVersion(out.getVersion());
		criteriaIn.setLabel(out.getLabel());
		criteriaIn.setComment(out.getComment());
		criteriaIn.setModule(out.getModule());
		criteriaIn.setLoadByDefault(out.getLoadByDefault());
		criterionsIn.clear();
		criterionsIn.ensureCapacity(criterionVOs.size());
		Iterator<CriterionOutVO> it = criterionVOs.iterator();
		while (it.hasNext()) {
			CriterionInVO criterionIn = new CriterionInVO();
			copyCriterionOutToIn(criterionIn, it.next());
			criterionsIn.add(criterionIn);
		}
		Collections.sort(criterionsIn, new VOPositionComparator(false));
		normalizeCriterionPositions(criterionsIn);
	}
}
 
Example 10
Project: ChronoBike   File: Tag.java   Source Code and License Vote up 6 votes
public void removeAllChildren()
{
	ArrayList<Tag> arr = new ArrayList<Tag>(); 
	TagCursor cur = new TagCursor();
	Tag tag = getFirstChild(cur);
	while(tag != null)
	{
		arr.add(tag);
		tag = getNextChild(cur);
	}
	boolean b = true;
	for(int n=0; b && n<arr.size(); n++)
	{
		tag = arr.get(n);
		removeChild(tag);
	}
	arr.clear();
}
 
Example 11
Project: athena   File: OFChannelHandler.java   Source Code and License Vote up 5 votes
private void handlePendingPortStatusMessages(OFChannelHandler h, int index)
        throws SwitchStateException {
    if (h.sw == null) {
        String msg = "State machine error: switch is null. Should never " +
                "happen";
        throw new SwitchStateException(msg);
    }
    log.info("Processing {} pending port status messages for {}",
             h.pendingPortStatusMsg.size(), h.sw.getStringId());

    ArrayList<OFPortStatus> temp  = new ArrayList<OFPortStatus>();
    for (OFPortStatus ps: h.pendingPortStatusMsg) {
        temp.add(ps);
        handlePortStatusMessage(h, ps, false);
    }
    // expensive but ok - we don't expect too many port-status messages
    // note that we cannot use clear(), because of the reasons below
    h.pendingPortStatusMsg.removeAll(temp);
    temp.clear();
    // the iterator above takes a snapshot of the list - so while we were
    // dealing with the pending port-status messages, we could have received
    // newer ones. Handle them recursively, but break the recursion after
    // five steps to avoid an attack.
    if (!h.pendingPortStatusMsg.isEmpty() && ++index < 5) {
        handlePendingPortStatusMessages(h, index);
    }
}
 
Example 12
Project: support-application   File: RouteCompat.java   Source Code and License Vote up 5 votes
/**
 * Called to get the best specific destination.
 * <p>
 * <b>only use for condition not mAllowLeaving.</b>
 * <b>only same or similar package name will return.</b>
 * ResolveInfo's priority was highest,
 * if priority equal, same package return.
 * <b>we asume the packagename is xxx.xxx.xxx style.</b>
 */
private ResolveInfo optimum(final List<ResolveInfo> list) {

    if (list == null)
        return null;
    else if (list.size() == 1) {
        return list.get(0);
    }

    final ArrayList<SortedResolveInfo> resolveInfo = new ArrayList<SortedResolveInfo>();

    for (final ResolveInfo info : list) {

        if (!TextUtils.isEmpty(info.activityInfo.packageName)) {
            if (info.activityInfo.packageName.endsWith(mContext.getPackageName())) {
                resolveInfo.add(new SortedResolveInfo(info, info.priority, 1));
            } else {
                final String p1 = info.activityInfo.packageName;
                final String p2 = mContext.getPackageName();
                final String[] l1 = p1.split("\\.");
                final String[] l2 = p2.split("\\.");
                if (l1.length >= 2 && l2.length >= 2) {
                    if (l1[0].equals(l2[0]) && l1[1].equals(l2[1]))
                        resolveInfo.add(new SortedResolveInfo(info, info.priority, 0));
                }
            }
        }
    }

    if (resolveInfo.size() > 0) {
        if (resolveInfo.size() > 1) {
            Collections.sort(resolveInfo);
        }
        final ResolveInfo ret = resolveInfo.get(0).info;
        resolveInfo.clear();
        return ret;
    } else {
        return null;
    }
}
 
Example 13
Project: LaunchEnr   File: IconColorExtractor.java   Source Code and License Vote up 5 votes
private static ArrayList<Integer> palette(Palette p, int defaultColor) {

        ArrayList<Integer> extractedPalette = new ArrayList<>();

        //get all palettes
        Integer lightVibrant, vibrant, darkVibrant, lightMuted, muted, darkMuted;

        lightVibrant = p.getVibrantColor(defaultColor);
        vibrant = p.getVibrantColor(defaultColor);
        darkVibrant = p.getDarkVibrantColor(defaultColor);
        lightMuted = p.getLightMutedColor(defaultColor);
        muted = p.getMutedColor(defaultColor);
        darkMuted = p.getDarkMutedColor(defaultColor);

        extractedPalette.add(lightVibrant);
        extractedPalette.add(vibrant);
        extractedPalette.add(darkVibrant);
        extractedPalette.add(lightMuted);
        extractedPalette.add(muted);
        extractedPalette.add(darkMuted);

        //add also default color, because if the next method fails we have a color anyway
        extractedPalette.add(defaultColor);

        //pass these palettes to a hashset to avoid duplicates
        HashSet<Integer> hashSet = new HashSet<>();
        hashSet.addAll(extractedPalette);

        //add back these values to the palettes array list
        extractedPalette.clear();
        extractedPalette.addAll(hashSet);

        return extractedPalette;
    }
 
Example 14
Project: LD38   File: Shader.java   Source Code and License Vote up 5 votes
public static void updateCheck(){
	ArrayList<Shader> checks = new ArrayList<Shader>();
	//filter out dead shaders
	for(Shader shader : shaders.values()){
		if(shader.isDestroyed() && !checks.contains(shader)){
			checks.add(shader);
		}
	}
	//remove all of the dead shaders
	shaders.values().removeAll(checks);
	
	//make sure there aren't any stray references
	checks.clear();
}
 
Example 15
Project: openjdk-jdk10   File: Arrrghs.java   Source Code and License Vote up 5 votes
private void initDirWithJavaFiles(File libDir) throws IOException {

        if (libDir.exists()) {
            recursiveDelete(libDir);
        }
        libDir.mkdirs();
        ArrayList<String> scratchpad = new ArrayList<>();
        scratchpad.add("package lib;");
        scratchpad.add("public class Fbo {");
        scratchpad.add("public static void main(String... args){Foo.f();}");
        scratchpad.add("public static void f(){}");
        scratchpad.add("}");
        createFile(new File(libDir, "Fbo.java"), scratchpad);

        scratchpad.clear();
        scratchpad.add("package lib;");
        scratchpad.add("public class Foo {");
        scratchpad.add("public static void main(String... args){");
        scratchpad.add("for (String x : args) {");
        scratchpad.add("System.out.println(x);");
        scratchpad.add("}");
        scratchpad.add("Fbo.f();");
        scratchpad.add("}");
        scratchpad.add("public static void f(){}");
        scratchpad.add("}");
        createFile(new File(libDir, "Foo.java"), scratchpad);
    }
 
Example 16
Project: RLibrary   File: FileDownloadMessageStation.java   Source Code and License Vote up 5 votes
private void dispose(final ArrayList<IFileDownloadMessenger> disposingList) {
    // dispose Sub-package-size each time.
    for (IFileDownloadMessenger iFileDownloadMessenger : disposingList) {
        iFileDownloadMessenger.handoverMessage();
    }

    disposingList.clear();
}
 
Example 17
Project: LD38   File: UIScene.java   Source Code and License Vote up 5 votes
public void input(){
	ArrayList<ClickType> clicks = new ArrayList<ClickType>();
	
	for(int k : Keyboard.events){
		clicks.add(new ClickType(false, k));
	}
	
	//focused element listens to the keyboard clicks
	for(ClickType click : clicks){
		options[current].onClick(click);
	}
	
	clicks.clear();
	
	for(int m : Mouse.events){
		clicks.add(new ClickType(true, m));
	}
	
	Vector2f mPos = scene.flipY(Mouse.x, Mouse.y);
	
	if(clicks.size() != 0){
		for(UIElement option : options){
			if(option.contains(mPos)){
				clicks.forEach((click)->option.onClick(click));
			}
		}
		clicks.clear();
	}
	
	Input();
}
 
Example 18
Project: accelerator-core-android   File: OTWrapper.java   Source Code and License Vote up 5 votes
private void removeOTListener(BaseOTListener listener, HashMap retriableMap,
                              ArrayList listenerList) {
  if (listener != null) {
    BaseOTListener internalListener = listener instanceof RetriableOTListener ?
            ((RetriableOTListener) listener).getInternalListener() :
            listener;
    RetriableOTListener realListener = (RetriableOTListener) retriableMap.get(internalListener);
    listenerList.remove(realListener);
    retriableMap.remove(internalListener);
  } else {
    listenerList.clear();
    retriableMap.clear();
  }
}
 
Example 19
Project: metanome-algorithms   File: DFDMiner.java   Source Code and License Vote up 4 votes
private Stack<Seed> nextSeeds(int currentRHSIndex) {
//		System.out.println("Find holes");
		THashSet<ColumnCollection> deps = new THashSet<>();
		ArrayList<ColumnCollection> currentMaximalNonDependencies = maximalNonDependencies.getLHSForRHS(currentRHSIndex);
		HashSet<ColumnCollection> currentMinimalDependencies = new HashSet<>(minimalDependencies.getLHSForRHS(currentRHSIndex));
		ArrayList<ColumnCollection> newDeps = new ArrayList<>(numberOfColumns * deps.size());
//		Holes holes = new Holes();
		
//		int i = 0;
//		for (ColumnCollection maximalNonDependency : currentMaximalNonDependencies) {
//			ColumnCollection complement = maximalNonDependency.setCopy(currentRHSIndex).complement();
//			if (deps.isEmpty()) {
//				ColumnCollection emptyColumnIndices = new ColumnCollection(numberOfColumns);
//				for (Integer complementColumnIndex : complement.getSetBits()) {
//					deps.add(emptyColumnIndices.setCopy(complementColumnIndex));
//				}
//			} else {
//				for (ColumnCollection dep : deps) {
//					int[] setBits = complement.getSetBits();
//					for (int setBit = 0; setBit < setBits.length; setBit++) {
//						holes.add(dep.setCopy(setBits[setBit]));
////						System.out.println("Dep:\t" + dep.setCopy(setBits[setBit]));
//					}
//				}
//				// minimize newDeps
//				System.out.println(i++ + "\t" + currentMaximalNonDependencies.size());
//				System.out.println("total deps:\t" + deps.size());
//				System.out.println("before minimizing:\t" + holes.size());
////				ArrayList<ColumnCollection> minimizedNewDeps = minimizeSeeds(newDeps);
//				holes.minimize();
//				System.out.println("after minimizing:\t" + holes.size());
//				deps.clear();
//				deps.addAll(holes);
//				holes.clear();
//			}
//		}

		for (ColumnCollection maximalNonDependency : currentMaximalNonDependencies) {
			ColumnCollection complement = maximalNonDependency.setCopy(currentRHSIndex).complement();
			if (deps.isEmpty()) {
				ColumnCollection emptyColumnIndices = new ColumnCollection(numberOfColumns);
				for (Integer complementColumnIndex : complement.getSetBits()) {
					deps.add(emptyColumnIndices.setCopy(complementColumnIndex));
				}
			} else {
				for (ColumnCollection dep : deps) {
					int[] setBits = complement.getSetBits();
					for (int setBit = 0; setBit < setBits.length; setBit++) {
						newDeps.add(dep.setCopy(setBits[setBit]));
					}
				}
				// minimize newDeps
				ArrayList<ColumnCollection> minimizedNewDeps = minimizeSeeds(newDeps);
				deps.clear();
				deps.addAll(minimizedNewDeps);
				newDeps.clear();
			}
		}
		
		// return only elements that aren't already covered by the minimal
		// dependencies
		Stack<Seed> remainingSeeds = new Stack<>();
		deps.removeAll(currentMinimalDependencies);
		for (ColumnCollection remainingSeed : deps) {
			remainingSeeds.push(new Seed(remainingSeed));
		}

		return remainingSeeds;
	}
 
Example 20
Project: AntiCheat   File: ChunkReloader.java   Source Code and License Vote up 4 votes
public void run() {
    HashSet<ChunkCoord> loadedChunksForProcess = new HashSet<ChunkCoord>();
    HashSet<ChunkCoord> unloadedChunksForProcess = new HashSet<ChunkCoord>();
    Map<World, HashSet<ChunkCoord>> chunksForReload = new WeakHashMap<World, HashSet<ChunkCoord>>();
    ArrayList<World> localWorldsToCheck = new ArrayList<World>();
    ArrayList<ChunkCoord> reloadedChunks = new ArrayList<ChunkCoord>();

    while (!this.isInterrupted() && !kill.get()) {
        try {
            // Wait until necessary
            long timeWait = lastExecute + OrebfuscatorConfig.ChunkReloaderRate - System.currentTimeMillis();
            lastExecute = System.currentTimeMillis();
            if (timeWait > 0) {
                Thread.sleep(timeWait);
            }

            synchronized (loadedChunks) {
                localWorldsToCheck.addAll(loadedChunks.keySet());
            }

            for(World world : localWorldsToCheck) {
                HashSet<ChunkCoord> chunksForReloadForWorld = chunksForReload.get(world);
                if(chunksForReloadForWorld == null) {
                    chunksForReload.put(world, chunksForReloadForWorld = new HashSet<ChunkCoord>());
                }

                synchronized (unloadedChunks) {
                    HashSet<ChunkCoord> unloadedChunksForWorld = unloadedChunks.get(world);

                    if(unloadedChunksForWorld != null && !unloadedChunksForWorld.isEmpty()) {
                        unloadedChunksForProcess.addAll(unloadedChunksForWorld);
                        unloadedChunksForWorld.clear();
                    }
                }

                for(ChunkCoord unloadedChunk : unloadedChunksForProcess) {
                    chunksForReloadForWorld.remove(unloadedChunk);
                }

                unloadedChunksForProcess.clear();

                synchronized (loadedChunks) {
                    HashSet<ChunkCoord> loadedChunksForWorld = loadedChunks.get(world);

                    if(loadedChunksForWorld != null && !loadedChunksForWorld.isEmpty()) {
                        loadedChunksForProcess.addAll(loadedChunksForWorld);
                        loadedChunksForWorld.clear();
                    }
                }

                for(ChunkCoord loadedChunk : loadedChunksForProcess) {
                    ChunkCoord chunk1 = new ChunkCoord(loadedChunk.x - 1, loadedChunk.z);
                    ChunkCoord chunk2 = new ChunkCoord(loadedChunk.x + 1, loadedChunk.z);
                    ChunkCoord chunk3 = new ChunkCoord(loadedChunk.x, loadedChunk.z - 1);
                    ChunkCoord chunk4 = new ChunkCoord(loadedChunk.x, loadedChunk.z + 1);

                    chunksForReloadForWorld.add(chunk1);
                    chunksForReloadForWorld.add(chunk2);
                    chunksForReloadForWorld.add(chunk3);
                    chunksForReloadForWorld.add(chunk4);
                }

                loadedChunksForProcess.clear();

                if(!chunksForReloadForWorld.isEmpty()) {
                    reloadChunks(world, chunksForReloadForWorld, reloadedChunks);

                    chunksForReloadForWorld.removeAll(reloadedChunks);
                    reloadedChunks.clear();
                }
            }

            localWorldsToCheck.clear();
        } catch (Exception e) {
            Orebfuscator.log(e);
        }
    }
}