Add note if clipboard >= Integer.MAX_VALUE

This commit is contained in:
NotMyFault 2021-02-05 13:21:15 +01:00
parent ac16c9a2ba
commit 3df080abe4
No known key found for this signature in database
GPG Key ID: 158F5701A6AAD00C

View File

@ -78,7 +78,7 @@ public class DiskOptimizedClipboard extends LinearClipboard implements Closeable
public DiskOptimizedClipboard(BlockVector3 dimensions, File file) {
super(dimensions);
if (HEADER_SIZE + ((long) getVolume() << 1) >= Integer.MAX_VALUE) {
throw new IllegalArgumentException("Dimensions too large for this clipboard format");
throw new IllegalArgumentException("Dimensions too large for this clipboard format. Use //lazycopy for large selections.");
} else if (HEADER_SIZE + ((long) getVolume() << 1) + (long) ((getHeight() >> 2) + 1) * ((getLength() >> 2) + 1) * ((getWidth() >> 2) + 1) >= Integer.MAX_VALUE) {
log.error("Dimensions are too large for biomes to be stored in a DiskOptimizedClipboard");
canHaveBiomes = false;