mirror of
https://github.com/boy0001/FastAsyncWorldedit.git
synced 2024-11-25 03:55:35 +01:00
Some minor code cleanup
This commit is contained in:
parent
5c6a5c48d1
commit
b19402ae17
@ -49,7 +49,6 @@ public class DiskOptimizedClipboard extends FaweClipboard implements Closeable {
|
|||||||
private final HashMap<IntegerTrio, CompoundTag> nbtMap;
|
private final HashMap<IntegerTrio, CompoundTag> nbtMap;
|
||||||
private final HashSet<ClipboardEntity> entities;
|
private final HashSet<ClipboardEntity> entities;
|
||||||
private final File file;
|
private final File file;
|
||||||
private final byte[] buffer;
|
|
||||||
|
|
||||||
private final BufferedRandomAccessFile raf;
|
private final BufferedRandomAccessFile raf;
|
||||||
private int last;
|
private int last;
|
||||||
@ -62,7 +61,6 @@ public class DiskOptimizedClipboard extends FaweClipboard implements Closeable {
|
|||||||
try {
|
try {
|
||||||
nbtMap = new HashMap<>();
|
nbtMap = new HashMap<>();
|
||||||
entities = new HashSet<>();
|
entities = new HashSet<>();
|
||||||
this.buffer = new byte[2];
|
|
||||||
this.file = file;
|
this.file = file;
|
||||||
this.raf = new BufferedRandomAccessFile(file, "rw", 16);
|
this.raf = new BufferedRandomAccessFile(file, "rw", 16);
|
||||||
raf.setLength(file.length());
|
raf.setLength(file.length());
|
||||||
@ -111,7 +109,6 @@ public class DiskOptimizedClipboard extends FaweClipboard implements Closeable {
|
|||||||
nbtMap = new HashMap<>();
|
nbtMap = new HashMap<>();
|
||||||
entities = new HashSet<>();
|
entities = new HashSet<>();
|
||||||
this.file = file;
|
this.file = file;
|
||||||
this.buffer = new byte[2];
|
|
||||||
this.width = width;
|
this.width = width;
|
||||||
this.height = height;
|
this.height = height;
|
||||||
this.length = length;
|
this.length = length;
|
||||||
|
@ -192,7 +192,7 @@ public class Schematic {
|
|||||||
extent.setBlock(mutable.getBlockX() + relx, mutable.getBlockY() + rely, mutable.getBlockZ() + relz, block);
|
extent.setBlock(mutable.getBlockX() + relx, mutable.getBlockY() + rely, mutable.getBlockZ() + relz, block);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}, (HasFaweQueue) (extent instanceof HasFaweQueue ? extent : null));
|
}, null);
|
||||||
Operations.completeBlindly(visitor);
|
Operations.completeBlindly(visitor);
|
||||||
}
|
}
|
||||||
// Entity offset is the paste location subtract the clipboard origin (entity's location is already relative to the world origin)
|
// Entity offset is the paste location subtract the clipboard origin (entity's location is already relative to the world origin)
|
||||||
|
@ -42,6 +42,7 @@ import com.boydti.fawe.object.changeset.CPUOptimizedChangeSet;
|
|||||||
import com.boydti.fawe.object.changeset.DiskStorageHistory;
|
import com.boydti.fawe.object.changeset.DiskStorageHistory;
|
||||||
import com.boydti.fawe.object.changeset.FaweChangeSet;
|
import com.boydti.fawe.object.changeset.FaweChangeSet;
|
||||||
import com.boydti.fawe.object.changeset.MemoryOptimizedHistory;
|
import com.boydti.fawe.object.changeset.MemoryOptimizedHistory;
|
||||||
|
import com.boydti.fawe.object.clipboard.WorldCopyClipboard;
|
||||||
import com.boydti.fawe.object.collection.LocalBlockVectorSet;
|
import com.boydti.fawe.object.collection.LocalBlockVectorSet;
|
||||||
import com.boydti.fawe.object.exception.FaweException;
|
import com.boydti.fawe.object.exception.FaweException;
|
||||||
import com.boydti.fawe.object.extent.FastWorldEditExtent;
|
import com.boydti.fawe.object.extent.FastWorldEditExtent;
|
||||||
@ -79,6 +80,7 @@ import com.sk89q.worldedit.extent.AbstractDelegateExtent;
|
|||||||
import com.sk89q.worldedit.extent.ChangeSetExtent;
|
import com.sk89q.worldedit.extent.ChangeSetExtent;
|
||||||
import com.sk89q.worldedit.extent.Extent;
|
import com.sk89q.worldedit.extent.Extent;
|
||||||
import com.sk89q.worldedit.extent.MaskingExtent;
|
import com.sk89q.worldedit.extent.MaskingExtent;
|
||||||
|
import com.sk89q.worldedit.extent.clipboard.BlockArrayClipboard;
|
||||||
import com.sk89q.worldedit.extent.inventory.BlockBag;
|
import com.sk89q.worldedit.extent.inventory.BlockBag;
|
||||||
import com.sk89q.worldedit.extent.world.SurvivalModeExtent;
|
import com.sk89q.worldedit.extent.world.SurvivalModeExtent;
|
||||||
import com.sk89q.worldedit.function.GroundFunction;
|
import com.sk89q.worldedit.function.GroundFunction;
|
||||||
@ -378,6 +380,18 @@ public class EditSession extends AbstractWorld implements HasFaweQueue, Lighting
|
|||||||
this(world, null, null, null, null, null, true, null, null, null, blockBag, eventBus, event);
|
this(world, null, null, null, null, null, true, null, null, null, blockBag, eventBus, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Lazily copy a region
|
||||||
|
* @param region
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public BlockArrayClipboard lazyCopy(Region region) {
|
||||||
|
WorldCopyClipboard faweClipboard = new WorldCopyClipboard(this, region);
|
||||||
|
BlockArrayClipboard weClipboard = new BlockArrayClipboard(region, faweClipboard);
|
||||||
|
weClipboard.setOrigin(region.getMinimumPoint());
|
||||||
|
return weClipboard;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The limit for this specific edit (blocks etc)
|
* The limit for this specific edit (blocks etc)
|
||||||
* @return
|
* @return
|
||||||
|
Loading…
Reference in New Issue
Block a user