11package com .fastasyncworldedit .core .extent .clipboard ;
22
3+ import com .fastasyncworldedit .core .Fawe ;
4+ import com .fastasyncworldedit .core .queue .implementation .SingleThreadQueueExtent ;
5+ import com .fastasyncworldedit .core .util .ExtentTraverser ;
36import com .sk89q .worldedit .EditSession ;
47import com .sk89q .worldedit .EditSessionBuilder ;
58import com .sk89q .worldedit .WorldEdit ;
@@ -39,17 +42,19 @@ public WorldCopyClipboard(Supplier<Extent> supplier, Region region) {
3942 */
4043 @ Deprecated (forRemoval = true , since = "2.13.0" )
4144 public WorldCopyClipboard (Supplier <Extent > supplier , Region region , boolean hasEntities , boolean hasBiomes ) {
42- super (region );
43- this .hasBiomes = hasBiomes ;
44- this .hasEntities = hasEntities ;
45- this .extent = supplier .get ();
45+ this (supplier .get (), region , hasEntities , hasBiomes );
4646 }
4747
4848 private WorldCopyClipboard (Extent extent , Region region , boolean hasEntities , boolean hasBiomes ) {
4949 super (region );
5050 this .hasBiomes = hasBiomes ;
5151 this .hasEntities = hasEntities ;
5252 this .extent = extent ;
53+ if (new ExtentTraverser <>(extent ).find (SingleThreadQueueExtent .class ) != null ) {
54+ // If we have a SingleThreadQueueExtent present, uncache so it cannot be used again for pasting (and therefore
55+ // potentially resetting the world)
56+ Fawe .instance ().getQueueHandler ().unCache ();
57+ }
5358 }
5459
5560 public static WorldCopyClipboard of (Extent extent , Region region ) {
@@ -64,6 +69,11 @@ public static WorldCopyClipboard of(Extent extent, Region region, boolean hasEnt
6469 return new WorldCopyClipboard (extent , region , hasEntities , hasBiomes );
6570 }
6671
72+ @ Override
73+ public long getMaxSize () {
74+ return -1 ;
75+ }
76+
6777 public Extent getExtent () {
6878 return extent ;
6979 }
0 commit comments