Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-12-25 18:40:05 +01:00
Fix saving entities in DiskOptimizedClipboard when no tiles are present (#1815)
Dieser Commit ist enthalten in:
Ursprung
907ad8528e
Commit
003cec30be
@ -182,7 +182,7 @@ public class DiskOptimizedClipboard extends LinearClipboard {
|
|||||||
readBiomeStatusFromHeader();
|
readBiomeStatusFromHeader();
|
||||||
int nbtCount = readNBTSavedCountFromHeader();
|
int nbtCount = readNBTSavedCountFromHeader();
|
||||||
int entitiesCount = readEntitiesSavedCountFromHeader();
|
int entitiesCount = readEntitiesSavedCountFromHeader();
|
||||||
if (Settings.settings().CLIPBOARD.SAVE_CLIPBOARD_NBT_TO_DISK && nbtCount + entitiesCount > 0) {
|
if (Settings.settings().CLIPBOARD.SAVE_CLIPBOARD_NBT_TO_DISK && (nbtCount + entitiesCount > 0)) {
|
||||||
loadNBTFromFileFooter(nbtCount, entitiesCount, biomeLength);
|
loadNBTFromFileFooter(nbtCount, entitiesCount, biomeLength);
|
||||||
}
|
}
|
||||||
} else if (braf.length() - headerSize == ((long) getVolume() << 1) + biomeLength) {
|
} else if (braf.length() - headerSize == ((long) getVolume() << 1) + biomeLength) {
|
||||||
@ -551,6 +551,7 @@ public class DiskOptimizedClipboard extends LinearClipboard {
|
|||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
nbtOS.flush();
|
||||||
if (baOS.size() > nbtBytesRemaining) {
|
if (baOS.size() > nbtBytesRemaining) {
|
||||||
LOGGER.warn(
|
LOGGER.warn(
|
||||||
"Clipboard file {} does not have enough remaining space to store entity data on disk.",
|
"Clipboard file {} does not have enough remaining space to store entity data on disk.",
|
||||||
@ -564,14 +565,14 @@ public class DiskOptimizedClipboard extends LinearClipboard {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (output == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (entitiesFit) {
|
if (entitiesFit) {
|
||||||
output = baOS.toByteArray();
|
output = baOS.toByteArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (output == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
long currentLength = this.braf.length();
|
long currentLength = this.braf.length();
|
||||||
this.braf.setLength(currentLength + baOS.size());
|
this.braf.setLength(currentLength + baOS.size());
|
||||||
MappedByteBuffer tempBuffer = fileChannel.map(
|
MappedByteBuffer tempBuffer = fileChannel.map(
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren