Move clipboards to temp
Einige Prüfungen sind fehlgeschlagen
SteamWarCI Build failed

Dieser Commit ist enthalten in:
Lixfel 2022-09-06 21:34:07 +02:00
Ursprung 2553f169aa
Commit dd8ed8d5c6
2 geänderte Dateien mit 14 neuen und 5 gelöschten Zeilen

Datei anzeigen

@ -110,7 +110,7 @@ public class BukkitPlayer extends AbstractPlayerActor {
if (player != null && Settings.settings().CLIPBOARD.USE_DISK) { if (player != null && Settings.settings().CLIPBOARD.USE_DISK) {
BukkitPlayer cached = WorldEditPlugin.getInstance().getCachedPlayer(player); BukkitPlayer cached = WorldEditPlugin.getInstance().getCachedPlayer(player);
if (cached == null) { if (cached == null) {
loadClipboardFromDisk(); //loadClipboardFromDisk();
} }
} }
//FAWE end //FAWE end

Datei anzeigen

@ -71,16 +71,25 @@ public class DiskOptimizedClipboard extends LinearClipboard {
private boolean canHaveBiomes = true; private boolean canHaveBiomes = true;
private int nbtBytesRemaining; private int nbtBytesRemaining;
private static File createTmpFile() {
File temp;
try {
temp = File.createTempFile("fawe", ".bd");
} catch (IOException e) {
throw new RuntimeException(e);
}
temp.deleteOnExit();
return temp;
}
/** /**
* Creates a new DiskOptimizedClipboard for the given region. Creates or overwrites a file using the given UUID as a name. * Creates a new DiskOptimizedClipboard for the given region. Creates or overwrites a file using the given UUID as a name.
*/ */
public DiskOptimizedClipboard(Region region, UUID uuid) { public DiskOptimizedClipboard(Region region, UUID uuid) {
this( this(
region.getDimensions(), region.getDimensions(),
MainUtil.getFile( createTmpFile()
Fawe.instance() != null ? Fawe.platform().getDirectory() : new File("."),
Settings.settings().PATHS.CLIPBOARD + File.separator + uuid + ".bd"
)
); );
setOffset(region.getMinimumPoint()); setOffset(region.getMinimumPoint());
setOrigin(region.getMinimumPoint()); setOrigin(region.getMinimumPoint());