Clone mutable regions given to clipboards

Fixes #630
This commit is contained in:
dordsor21 2020-09-18 15:02:25 +01:00
parent 8e8bd810b5
commit fc91c3b56e
No known key found for this signature in database
GPG Key ID: 1E53E88969FFCF0B
2 changed files with 3 additions and 3 deletions

View File

@ -22,7 +22,7 @@ public abstract class ReadOnlyClipboard extends SimpleClipboard {
public ReadOnlyClipboard(Region region) {
super(region);
this.region = region;
this.region = region.clone();
}
public static ReadOnlyClipboard of(final Region region) {

View File

@ -63,7 +63,7 @@ public class BlockArrayClipboard implements Clipboard {
public BlockArrayClipboard(Clipboard clipboard, BlockVector3 offset) {
this.parent = clipboard;
Region shifted = clipboard.getRegion();
Region shifted = clipboard.getRegion().clone();
shifted.shift(offset);
this.region = shifted;
this.origin = shifted.getMinimumPoint();
@ -84,7 +84,7 @@ public class BlockArrayClipboard implements Clipboard {
checkNotNull(parent);
checkNotNull(region);
this.parent = parent;
this.region = region;
this.region = region.clone();
this.origin = region.getMinimumPoint();
}