mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 01:37:37 +00:00
Fix #1260
This commit is contained in:
parent
829ddc393f
commit
470ba64fe4
@ -838,6 +838,17 @@ public class LocalSession implements TextureHolder {
|
|||||||
}
|
}
|
||||||
setClipboard(multi);
|
setClipboard(multi);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Ensure the player's clipboard is closed. (will only do something with clipboard-on-disk)
|
||||||
|
*/
|
||||||
|
public void closeClipboard() {
|
||||||
|
synchronized (clipboardLock) {
|
||||||
|
if (this.clipboard != null) {
|
||||||
|
this.clipboard.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
//FAWE end
|
//FAWE end
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -139,37 +139,38 @@ public class ClipboardCommands {
|
|||||||
}
|
}
|
||||||
session.setClipboard(null);
|
session.setClipboard(null);
|
||||||
|
|
||||||
Clipboard clipboard = new BlockArrayClipboard(region, actor.getUniqueId());
|
try (Clipboard clipboard = new BlockArrayClipboard(region, actor.getUniqueId())) {
|
||||||
|
|
||||||
clipboard.setOrigin(centerClipboard ? region.getCenter().toBlockPoint() : session.getPlacementPosition(actor));
|
clipboard.setOrigin(centerClipboard ? region.getCenter().toBlockPoint() : session.getPlacementPosition(actor));
|
||||||
ForwardExtentCopy copy = new ForwardExtentCopy(editSession, region, clipboard, region.getMinimumPoint());
|
ForwardExtentCopy copy = new ForwardExtentCopy(editSession, region, clipboard, region.getMinimumPoint());
|
||||||
copy.setCopyingEntities(copyEntities);
|
copy.setCopyingEntities(copyEntities);
|
||||||
copy.setCopyingBiomes(copyBiomes);
|
copy.setCopyingBiomes(copyBiomes);
|
||||||
|
|
||||||
Mask sourceMask = editSession.getSourceMask();
|
Mask sourceMask = editSession.getSourceMask();
|
||||||
Region[] regions = editSession.getAllowedRegions();
|
Region[] regions = editSession.getAllowedRegions();
|
||||||
Region allowedRegion;
|
Region allowedRegion;
|
||||||
if (regions == null || regions.length == 0) {
|
if (regions == null || regions.length == 0) {
|
||||||
allowedRegion = new NullRegion();
|
allowedRegion = new NullRegion();
|
||||||
} else {
|
} else {
|
||||||
allowedRegion = new RegionIntersection(regions);
|
allowedRegion = new RegionIntersection(regions);
|
||||||
|
}
|
||||||
|
final Mask firstSourceMask = mask != null ? mask : sourceMask;
|
||||||
|
final Mask finalMask = MaskIntersection.of(firstSourceMask, new RegionMask(allowedRegion)).optimize();
|
||||||
|
if (finalMask != Masks.alwaysTrue()) {
|
||||||
|
copy.setSourceMask(finalMask);
|
||||||
|
}
|
||||||
|
if (sourceMask != null) {
|
||||||
|
editSession.setSourceMask(null);
|
||||||
|
new MaskTraverser(sourceMask).reset(editSession);
|
||||||
|
editSession.setSourceMask(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
Operations.completeLegacy(copy);
|
||||||
|
saveDiskClipboard(clipboard);
|
||||||
|
session.setClipboard(new ClipboardHolder(clipboard));
|
||||||
|
|
||||||
|
copy.getStatusMessages().forEach(actor::print);
|
||||||
}
|
}
|
||||||
final Mask firstSourceMask = mask != null ? mask : sourceMask;
|
|
||||||
final Mask finalMask = MaskIntersection.of(firstSourceMask, new RegionMask(allowedRegion)).optimize();
|
|
||||||
if (finalMask != Masks.alwaysTrue()) {
|
|
||||||
copy.setSourceMask(finalMask);
|
|
||||||
}
|
|
||||||
if (sourceMask != null) {
|
|
||||||
editSession.setSourceMask(null);
|
|
||||||
new MaskTraverser(sourceMask).reset(editSession);
|
|
||||||
editSession.setSourceMask(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
Operations.completeLegacy(copy);
|
|
||||||
saveDiskClipboard(clipboard);
|
|
||||||
session.setClipboard(new ClipboardHolder(clipboard));
|
|
||||||
|
|
||||||
copy.getStatusMessages().forEach(actor::print);
|
|
||||||
//FAWE end
|
//FAWE end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -391,7 +391,7 @@ public interface Player extends Entity, Actor {
|
|||||||
*/
|
*/
|
||||||
default void unregister() {
|
default void unregister() {
|
||||||
cancel(true);
|
cancel(true);
|
||||||
getSession().setClipboard(null);
|
getSession().closeClipboard();
|
||||||
if (Settings.IMP.HISTORY.DELETE_ON_LOGOUT) {
|
if (Settings.IMP.HISTORY.DELETE_ON_LOGOUT) {
|
||||||
getSession().clearHistory();
|
getSession().clearHistory();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user