mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-06 20:56:41 +00:00
Make EditSession closeable for easy flushing
This commit is contained in:
@ -134,7 +134,7 @@ import javax.annotation.Nullable;
|
||||
* using the {@link ChangeSetExtent}.</p>
|
||||
*/
|
||||
@SuppressWarnings({"FieldCanBeLocal"})
|
||||
public class EditSession implements Extent {
|
||||
public class EditSession implements Extent, AutoCloseable {
|
||||
|
||||
private static final Logger log = Logger.getLogger(EditSession.class.getCanonicalName());
|
||||
|
||||
@ -636,6 +636,14 @@ public class EditSession implements Extent {
|
||||
return bypassNone.getEntities();
|
||||
}
|
||||
|
||||
/**
|
||||
* Closing an EditSession {@linkplain #flushSession() flushes its buffers}.
|
||||
*/
|
||||
@Override
|
||||
public void close() {
|
||||
flushSession();
|
||||
}
|
||||
|
||||
/**
|
||||
* Communicate to the EditSession that all block changes are complete,
|
||||
* and that it should apply them to the world.
|
||||
|
Reference in New Issue
Block a user