mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-06 04:46:40 +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:
@ -73,6 +73,7 @@ public class LocalSession {
|
||||
private String lastScript;
|
||||
private boolean beenToldVersion = false;
|
||||
private boolean hasCUISupport = false;
|
||||
private boolean fastMode = false;
|
||||
private TimeZone timezone = TimeZone.getDefault();
|
||||
|
||||
/**
|
||||
@ -144,6 +145,7 @@ public class LocalSession {
|
||||
EditSession newEditSession =
|
||||
new EditSession(editSession.getWorld(), -1, newBlockBag);
|
||||
newEditSession.enableQueue();
|
||||
newEditSession.setFastMode(fastMode);
|
||||
editSession.undo(newEditSession);
|
||||
return editSession;
|
||||
} else {
|
||||
@ -164,6 +166,7 @@ public class LocalSession {
|
||||
EditSession newEditSession =
|
||||
new EditSession(editSession.getWorld(), -1, newBlockBag);
|
||||
newEditSession.enableQueue();
|
||||
newEditSession.setFastMode(fastMode);
|
||||
editSession.redo(newEditSession);
|
||||
historyPointer++;
|
||||
return editSession;
|
||||
@ -642,4 +645,40 @@ public class LocalSession {
|
||||
public boolean hasExpired() {
|
||||
return System.currentTimeMillis() - expirationTime > EXPIRATION_GRACE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new edit session.
|
||||
*
|
||||
* @param player
|
||||
* @return
|
||||
*/
|
||||
public EditSession createEditSession(LocalPlayer player) {
|
||||
BlockBag blockBag = getBlockBag(player);
|
||||
|
||||
// Create an edit session
|
||||
EditSession editSession =
|
||||
new EditSession(player.getWorld(),
|
||||
getBlockChangeLimit(), blockBag);
|
||||
editSession.setFastMode(fastMode);
|
||||
|
||||
return editSession;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the session has fast mode enabled.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean hasFastMode() {
|
||||
return fastMode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set fast mode.
|
||||
*
|
||||
* @param fastMode
|
||||
*/
|
||||
public void setFastMode(boolean fastMode) {
|
||||
this.fastMode = fastMode;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user