stop bottling clipboard sizes for no reason

This commit is contained in:
dordsor21 2020-12-31 15:01:54 +00:00
parent 71059505d1
commit df48b7e81d
No known key found for this signature in database
GPG Key ID: 1E53E88969FFCF0B
2 changed files with 1 additions and 5 deletions

View File

@ -21,10 +21,6 @@ import java.util.HashSet;
import java.util.Iterator;
import java.util.UUID;
/**
* Best used when clipboard selections are small, or using legacy formats
* (Small being < Integer.MAX_VALUE/BLOCK_SIZE_BYTES blocks)
*/
public abstract class LinearClipboard extends SimpleClipboard {
protected final HashSet<ClipboardEntity> entities = new HashSet<>();

View File

@ -14,7 +14,7 @@ public abstract class SimpleClipboard implements Clipboard {
SimpleClipboard(BlockVector3 dimensions) {
this.size = dimensions;
long longVolume = (long) getWidth() * (long) getHeight() * (long) getLength();
if (longVolume >= Integer.MAX_VALUE >> 2) {
if (longVolume >= Integer.MAX_VALUE) {
throw new IllegalArgumentException("Dimensions are too large for this clipboard format.");
}
this.area = getWidth() * getLength();