3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-12-26 02:50:06 +01:00

Make clipboard flushable

#1286
Dieser Commit ist enthalten in:
dordsor21 2021-09-13 13:25:11 +01:00
Ursprung fcbbc72a19
Commit 5207981fb2
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 1E53E88969FFCF0B
3 geänderte Dateien mit 13 neuen und 4 gelöschten Zeilen

Datei anzeigen

@ -49,9 +49,6 @@ public abstract class LinearClipboard extends SimpleClipboard {
public abstract Collection<CompoundTag> getTileEntities(); public abstract Collection<CompoundTag> getTileEntities();
public void flush() {
}
@Override @Override
protected void finalize() { protected void finalize() {
close(); close();

Datei anzeigen

@ -323,6 +323,11 @@ public class BlockArrayClipboard implements Clipboard {
this.parent.close(); this.parent.close();
} }
@Override
public void flush() {
this.parent.flush();
}
//FAWE start //FAWE start
/** /**

Datei anzeigen

@ -52,6 +52,7 @@ import javax.annotation.Nullable;
import java.io.Closeable; import java.io.Closeable;
import java.io.File; import java.io.File;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.Flushable;
import java.io.IOException; import java.io.IOException;
import java.io.OutputStream; import java.io.OutputStream;
import java.net.URI; import java.net.URI;
@ -63,7 +64,9 @@ import static com.google.common.base.Preconditions.checkNotNull;
/** /**
* Specifies an object that implements something suitable as a "clipboard." * Specifies an object that implements something suitable as a "clipboard."
*/ */
public interface Clipboard extends Extent, Iterable<BlockVector3>, Closeable { //FAWE start - Iterable, closeable and flushable
public interface Clipboard extends Extent, Iterable<BlockVector3>, Closeable, Flushable {
//FAWE end
//FAWE start //FAWE start
static Clipboard create(Region region) { static Clipboard create(Region region) {
@ -187,6 +190,10 @@ public interface Clipboard extends Extent, Iterable<BlockVector3>, Closeable {
default void close() { default void close() {
} }
@Override
default void flush() {
}
/** /**
* Forwards to {@link #paste(World, BlockVector3, boolean, boolean, Transform)}. * Forwards to {@link #paste(World, BlockVector3, boolean, boolean, Transform)}.
*/ */