geforkt von Mirrors/FastAsyncWorldEdit
only close clipboard on error during copy
apply to //cut as well
Dieser Commit ist enthalten in:
Ursprung
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
|
||||
}
|
||||
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren