mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 01:37:37 +00:00
only close clipboard on error during copy
apply to //cut as well
This commit is contained in:
parent
470ba64fe4
commit
db24b429c1
@ -139,8 +139,8 @@ public class ClipboardCommands {
|
||||
}
|
||||
session.setClipboard(null);
|
||||
|
||||
try (Clipboard clipboard = new BlockArrayClipboard(region, actor.getUniqueId())) {
|
||||
|
||||
Clipboard clipboard = new BlockArrayClipboard(region, actor.getUniqueId());
|
||||
try {
|
||||
clipboard.setOrigin(centerClipboard ? region.getCenter().toBlockPoint() : session.getPlacementPosition(actor));
|
||||
ForwardExtentCopy copy = new ForwardExtentCopy(editSession, region, clipboard, region.getMinimumPoint());
|
||||
copy.setCopyingEntities(copyEntities);
|
||||
@ -170,6 +170,9 @@ public class ClipboardCommands {
|
||||
session.setClipboard(new ClipboardHolder(clipboard));
|
||||
|
||||
copy.getStatusMessages().forEach(actor::print);
|
||||
} catch (Throwable e) {
|
||||
clipboard.close();
|
||||
throw e;
|
||||
}
|
||||
//FAWE end
|
||||
}
|
||||
@ -274,6 +277,7 @@ public class ClipboardCommands {
|
||||
session.setClipboard(null);
|
||||
|
||||
BlockArrayClipboard clipboard = new BlockArrayClipboard(region, actor.getUniqueId());
|
||||
try {
|
||||
clipboard.setOrigin(session.getPlacementPosition(actor));
|
||||
ForwardExtentCopy copy = new ForwardExtentCopy(editSession, region, clipboard, region.getMinimumPoint());
|
||||
copy.setSourceFunction(new BlockReplace(editSession, leavePattern));
|
||||
@ -306,6 +310,10 @@ public class ClipboardCommands {
|
||||
actor.print(Caption.of("fawe.tips.tip.lazycut"));
|
||||
}
|
||||
copy.getStatusMessages().forEach(actor::print);
|
||||
} catch (Throwable e) {
|
||||
clipboard.close();
|
||||
throw e;
|
||||
}
|
||||
//FAWE end
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user