Use BlockVectorSet

This commit is contained in:
Jesse Boyd
2019-04-06 01:01:05 +11:00
parent f7cdae5e56
commit 9e2832c273
4 changed files with 11 additions and 6 deletions

View File

@ -19,6 +19,7 @@
package com.sk89q.worldedit.world.snapshot;
import com.boydti.fawe.object.collection.LocalBlockVectorSet;
import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.MaxChangedBlocksException;
import com.sk89q.worldedit.math.BlockVector2;
@ -35,13 +36,14 @@ import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* A snapshot restore operation.
*/
public class SnapshotRestore {
private final Map<BlockVector2, ArrayList<BlockVector3>> neededChunks = new LinkedHashMap<>();
private final Map<BlockVector2, Set<BlockVector3>> neededChunks = new LinkedHashMap<>();
private final ChunkStore chunkStore;
private final EditSession editSession;
private ArrayList<BlockVector2> missingChunks;
@ -108,7 +110,7 @@ public class SnapshotRestore {
// Unidentified chunk
if (!neededChunks.containsKey(chunkPos)) {
neededChunks.put(chunkPos, new ArrayList<>());
neededChunks.put(chunkPos, new LocalBlockVectorSet());
}
neededChunks.get(chunkPos).add(pos);
@ -134,7 +136,7 @@ public class SnapshotRestore {
errorChunks = new ArrayList<>();
// Now let's start restoring!
for (Map.Entry<BlockVector2, ArrayList<BlockVector3>> entry : neededChunks.entrySet()) {
for (Map.Entry<BlockVector2, Set<BlockVector3>> entry : neededChunks.entrySet()) {
BlockVector2 chunkPos = entry.getKey();
Chunk chunk;