@@ -532,7 +532,7 @@ public void stencilBrush(
532
532
int maxY = player .getWorld ().getMaxY ();
533
533
try {
534
534
brush = new StencilBrush (stream , rotation , yscale , onlyWhite ,
535
- "#clipboard" . equalsIgnoreCase (image )
535
+ isClipboard (image )
536
536
? session .getClipboard ().getClipboard () : null , minY , maxY
537
537
);
538
538
} catch (EmptyClipboardException ignored ) {
@@ -903,32 +903,28 @@ private void terrainBrush(
903
903
int minY = player .getWorld ().getMinY ();
904
904
int maxY = player .getWorld ().getMaxY ();
905
905
if (flat ) {
906
- try {
907
- brush = new FlattenBrush (stream , rotation , yscale , layers , smooth ,
908
- "#clipboard" .equalsIgnoreCase (image )
909
- ? session .getClipboard ().getClipboard () : null , shape , minY , maxY
910
- );
911
- } catch (EmptyClipboardException ignored ) {
912
- brush = new FlattenBrush (stream , rotation , yscale , layers , smooth , null , shape , minY , maxY );
913
- }
906
+ brush = new FlattenBrush (stream , rotation , yscale , layers , smooth ,
907
+ isClipboard (image )
908
+ ? session .getClipboard ().getClipboard () : null , shape , minY , maxY
909
+ );
914
910
} else {
915
- try {
916
- brush = new HeightBrush (stream , rotation , yscale , layers , smooth ,
917
- "#clipboard" .equalsIgnoreCase (image )
918
- ? session .getClipboard ().getClipboard () : null , minY , maxY
919
- );
920
- } catch (EmptyClipboardException ignored ) {
921
- brush = new HeightBrush (stream , rotation , yscale , layers , smooth , null , minY , maxY );
922
- }
911
+ brush = new HeightBrush (stream , rotation , yscale , layers , smooth ,
912
+ isClipboard (image )
913
+ ? session .getClipboard ().getClipboard () : null , minY , maxY
914
+ );
923
915
}
924
916
if (randomRotate ) {
925
917
brush .setRandomRotate (true );
926
918
}
927
919
set (context , brush , "worldedit.brush.height" ).setSize (radius );
928
920
}
929
921
922
+ private static boolean isClipboard (String image ) {
923
+ return "#clipboard" .equalsIgnoreCase (image );
924
+ }
925
+
930
926
private InputStream getHeightmapStream (String filename ) throws FileNotFoundException {
931
- if (filename == null || "none" .equalsIgnoreCase (filename )) {
927
+ if (filename == null || "none" .equalsIgnoreCase (filename ) || isClipboard ( filename ) ) {
932
928
return null ;
933
929
}
934
930
String filenamePng = filename .endsWith (".png" ) ? filename : filename + ".png" ;
0 commit comments