mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-10 04:38:35 +00:00
Added //fast mode, which allows the server to skip the dirtying of chunks. This means that you have to rejoin to see changes though, but most operations are doubled in speed.
This commit is contained in:
@ -87,15 +87,23 @@ public class EditSession {
|
||||
* indicates no limit.
|
||||
*/
|
||||
private int maxBlocks = -1;
|
||||
|
||||
/**
|
||||
* Indicates whether some types of blocks should be queued for best
|
||||
* reproduction.
|
||||
*/
|
||||
private boolean queued = false;
|
||||
|
||||
/**
|
||||
* Use the fast mode, which may leave chunks not flagged "dirty".
|
||||
*/
|
||||
private boolean fastMode = false;
|
||||
|
||||
/**
|
||||
* Block bag to use for getting blocks.
|
||||
*/
|
||||
private BlockBag blockBag;
|
||||
|
||||
/**
|
||||
* List of missing blocks;
|
||||
*/
|
||||
@ -185,11 +193,22 @@ public class EditSession {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
boolean result;
|
||||
|
||||
boolean result = world.setBlockType(pt, id);
|
||||
if (fastMode) {
|
||||
result = world.setBlockTypeFast(pt, id);
|
||||
} else {
|
||||
result = world.setBlockType(pt, id);
|
||||
}
|
||||
|
||||
if (id != 0) {
|
||||
if (BlockType.usesData(id)) {
|
||||
world.setBlockData(pt, block.getData());
|
||||
if (existing != type && block.getData() > 0 && BlockType.usesData(id)) {
|
||||
if (fastMode) {
|
||||
world.setBlockDataFast(pt, block.getData());
|
||||
} else {
|
||||
world.setBlockData(pt, block.getData());
|
||||
}
|
||||
}
|
||||
|
||||
// Signs
|
||||
@ -488,6 +507,24 @@ public class EditSession {
|
||||
}
|
||||
queued = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set fast mode.
|
||||
*
|
||||
* @param fastMode
|
||||
*/
|
||||
public void setFastMode(boolean fastMode) {
|
||||
this.fastMode = fastMode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return fast mode status.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean hasFastMode() {
|
||||
return fastMode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Finish off the queue.
|
||||
|
Reference in New Issue
Block a user