@@ -1342,31 +1342,36 @@ default int southEast() {
1342
1342
if (other .size () != size ())
1343
1343
throw new IllegalArgumentException (String .format ("Cannot copy from GUI with different size %s != %s" ,
1344
1344
size (), other .size ()));
1345
- if (other .getTitle () == null || replace ) other .setTitle (getTitle ());
1346
- copyAll ((Metadatable ) other , replace );
1347
- for (int i = 0 ; i < size (); i ++) {
1348
- final @ NotNull List <GUIContent > contents = getContents (i );
1349
- if (contents .isEmpty ()) continue ;
1350
- if (other .getContents (i ).isEmpty () || replace )
1351
- other .setContents (i , contents .toArray (new GUIContent [0 ]));
1345
+ else {
1346
+ if (other .getTitle () == null || replace ) other .setTitle (getTitle ());
1347
+
1348
+ copyAll ((Metadatable ) other , replace );
1349
+
1350
+ for (int i = 0 ; i < size (); i ++) {
1351
+ final @ NotNull List <GUIContent > contents = getContents (i );
1352
+ if (!contents .isEmpty () && (other .getContents (i ).isEmpty () || replace ))
1353
+ other .setContents (i , contents .toArray (new GUIContent [0 ]));
1354
+ }
1355
+
1356
+ openGUIAction ().ifPresent (a -> {
1357
+ @ NotNull Optional <GUIAction > open = other .openGUIAction ();
1358
+ if (!open .isPresent () || replace ) other .onOpenGUI (a );
1359
+ });
1360
+ closeGUIAction ().ifPresent (a -> {
1361
+ @ NotNull Optional <GUIAction > close = other .closeGUIAction ();
1362
+ if (!close .isPresent () || replace ) other .onCloseGUI (a );
1363
+ });
1364
+ changeGUIAction ().ifPresent (a -> {
1365
+ @ NotNull Optional <BiGUIAction > change = other .changeGUIAction ();
1366
+ if (!change .isPresent () || replace ) other .onChangeGUI (a );
1367
+ });
1368
+ clickOutsideAction ().ifPresent (a -> {
1369
+ @ NotNull Optional <GUIAction > clickOutside = other .clickOutsideAction ();
1370
+ if (!clickOutside .isPresent () || replace ) other .onClickOutside (a );
1371
+ });
1372
+
1373
+ return this ;
1352
1374
}
1353
- openGUIAction ().ifPresent (a -> {
1354
- @ NotNull Optional <GUIAction > open = other .openGUIAction ();
1355
- if (!open .isPresent () || replace ) other .onOpenGUI (a );
1356
- });
1357
- closeGUIAction ().ifPresent (a -> {
1358
- @ NotNull Optional <GUIAction > close = other .closeGUIAction ();
1359
- if (!close .isPresent () || replace ) other .onCloseGUI (a );
1360
- });
1361
- changeGUIAction ().ifPresent (a -> {
1362
- @ NotNull Optional <BiGUIAction > change = other .changeGUIAction ();
1363
- if (!change .isPresent () || replace ) other .onChangeGUI (a );
1364
- });
1365
- clickOutsideAction ().ifPresent (a -> {
1366
- @ NotNull Optional <GUIAction > clickOutside = other .clickOutsideAction ();
1367
- if (!clickOutside .isPresent () || replace ) other .onClickOutside (a );
1368
- });
1369
- return this ;
1370
1375
}
1371
1376
1372
1377
/**
0 commit comments