mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-22 17:27:38 +00:00
Fix saving entities in DiskOptimizedClipboard when no tiles are present (#1815)
This commit is contained in:
parent
907ad8528e
commit
003cec30be
@ -182,7 +182,7 @@ public class DiskOptimizedClipboard extends LinearClipboard {
|
||||
readBiomeStatusFromHeader();
|
||||
int nbtCount = readNBTSavedCountFromHeader();
|
||||
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);
|
||||
}
|
||||
} else if (braf.length() - headerSize == ((long) getVolume() << 1) + biomeLength) {
|
||||
@ -551,6 +551,7 @@ public class DiskOptimizedClipboard extends LinearClipboard {
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
nbtOS.flush();
|
||||
if (baOS.size() > nbtBytesRemaining) {
|
||||
LOGGER.warn(
|
||||
"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) {
|
||||
output = baOS.toByteArray();
|
||||
}
|
||||
|
||||
if (output == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
long currentLength = this.braf.length();
|
||||
this.braf.setLength(currentLength + baOS.size());
|
||||
MappedByteBuffer tempBuffer = fileChannel.map(
|
||||
|
Loading…
Reference in New Issue
Block a user