From 249c5674e1eed2ba2357198edbc6e82a6263ec10 Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Sun, 17 Mar 2024 09:07:50 +0000 Subject: [PATCH] Utilise if for copy creation --- .../adapter/impl/fawe/v1_17_R1_2/PaperweightGetBlocks.java | 5 ++++- .../adapter/impl/fawe/v1_18_R2/PaperweightGetBlocks.java | 5 ++++- .../adapter/impl/fawe/v1_19_R3/PaperweightGetBlocks.java | 5 ++++- .../adapter/impl/fawe/v1_20_R1/PaperweightGetBlocks.java | 5 ++++- .../adapter/impl/fawe/v1_20_R2/PaperweightGetBlocks.java | 5 ++++- .../adapter/impl/fawe/v1_20_R3/PaperweightGetBlocks.java | 5 ++++- 6 files changed, 24 insertions(+), 6 deletions(-) diff --git a/worldedit-bukkit/adapters/adapter-1_17_1/src/main/java/com/sk89q/worldedit/bukkit/adapter/impl/fawe/v1_17_R1_2/PaperweightGetBlocks.java b/worldedit-bukkit/adapters/adapter-1_17_1/src/main/java/com/sk89q/worldedit/bukkit/adapter/impl/fawe/v1_17_R1_2/PaperweightGetBlocks.java index 169883eb0..992233cab 100644 --- a/worldedit-bukkit/adapters/adapter-1_17_1/src/main/java/com/sk89q/worldedit/bukkit/adapter/impl/fawe/v1_17_R1_2/PaperweightGetBlocks.java +++ b/worldedit-bukkit/adapters/adapter-1_17_1/src/main/java/com/sk89q/worldedit/bukkit/adapter/impl/fawe/v1_17_R1_2/PaperweightGetBlocks.java @@ -404,9 +404,12 @@ public class PaperweightGetBlocks extends CharGetBlocks implements BukkitGetBloc forceLoadSections = false; ServerLevel nmsWorld = serverLevel; LevelChunk nmsChunk = ensureLoaded(nmsWorld, chunkX, chunkZ); - PaperweightGetBlocks_Copy copy = createCopy ? new PaperweightGetBlocks_Copy(nmsChunk) : null; + PaperweightGetBlocks_Copy copy; if (createCopy) { + copy = new PaperweightGetBlocks_Copy(nmsChunk); copies.put(copyKey, copy); + } else { + copy = null; } boolean fastmode = set.isFastMode() && Settings.settings().QUEUE.NO_TICK_FASTMODE; diff --git a/worldedit-bukkit/adapters/adapter-1_18_2/src/main/java/com/sk89q/worldedit/bukkit/adapter/impl/fawe/v1_18_R2/PaperweightGetBlocks.java b/worldedit-bukkit/adapters/adapter-1_18_2/src/main/java/com/sk89q/worldedit/bukkit/adapter/impl/fawe/v1_18_R2/PaperweightGetBlocks.java index da9714318..b0be5e364 100644 --- a/worldedit-bukkit/adapters/adapter-1_18_2/src/main/java/com/sk89q/worldedit/bukkit/adapter/impl/fawe/v1_18_R2/PaperweightGetBlocks.java +++ b/worldedit-bukkit/adapters/adapter-1_18_2/src/main/java/com/sk89q/worldedit/bukkit/adapter/impl/fawe/v1_18_R2/PaperweightGetBlocks.java @@ -395,9 +395,12 @@ public class PaperweightGetBlocks extends CharGetBlocks implements BukkitGetBloc forceLoadSections = false; ServerLevel nmsWorld = serverLevel; LevelChunk nmsChunk = ensureLoaded(nmsWorld, chunkX, chunkZ); - PaperweightGetBlocks_Copy copy = createCopy ? new PaperweightGetBlocks_Copy(nmsChunk) : null; + PaperweightGetBlocks_Copy copy; if (createCopy) { + copy = new PaperweightGetBlocks_Copy(nmsChunk); copies.put(copyKey, copy); + } else { + copy = null; } // Remove existing tiles. Create a copy so that we can remove blocks diff --git a/worldedit-bukkit/adapters/adapter-1_19_4/src/main/java/com/sk89q/worldedit/bukkit/adapter/impl/fawe/v1_19_R3/PaperweightGetBlocks.java b/worldedit-bukkit/adapters/adapter-1_19_4/src/main/java/com/sk89q/worldedit/bukkit/adapter/impl/fawe/v1_19_R3/PaperweightGetBlocks.java index 996a6e2e3..9688786cc 100644 --- a/worldedit-bukkit/adapters/adapter-1_19_4/src/main/java/com/sk89q/worldedit/bukkit/adapter/impl/fawe/v1_19_R3/PaperweightGetBlocks.java +++ b/worldedit-bukkit/adapters/adapter-1_19_4/src/main/java/com/sk89q/worldedit/bukkit/adapter/impl/fawe/v1_19_R3/PaperweightGetBlocks.java @@ -398,9 +398,12 @@ public class PaperweightGetBlocks extends CharGetBlocks implements BukkitGetBloc forceLoadSections = false; ServerLevel nmsWorld = serverLevel; LevelChunk nmsChunk = ensureLoaded(nmsWorld, chunkX, chunkZ); - PaperweightGetBlocks_Copy copy = createCopy ? new PaperweightGetBlocks_Copy(nmsChunk) : null; + PaperweightGetBlocks_Copy copy; if (createCopy) { + copy = new PaperweightGetBlocks_Copy(nmsChunk); copies.put(copyKey, copy); + } else { + copy = null; } // Remove existing tiles. Create a copy so that we can remove blocks diff --git a/worldedit-bukkit/adapters/adapter-1_20/src/main/java/com/sk89q/worldedit/bukkit/adapter/impl/fawe/v1_20_R1/PaperweightGetBlocks.java b/worldedit-bukkit/adapters/adapter-1_20/src/main/java/com/sk89q/worldedit/bukkit/adapter/impl/fawe/v1_20_R1/PaperweightGetBlocks.java index cc32e8292..9419960ac 100644 --- a/worldedit-bukkit/adapters/adapter-1_20/src/main/java/com/sk89q/worldedit/bukkit/adapter/impl/fawe/v1_20_R1/PaperweightGetBlocks.java +++ b/worldedit-bukkit/adapters/adapter-1_20/src/main/java/com/sk89q/worldedit/bukkit/adapter/impl/fawe/v1_20_R1/PaperweightGetBlocks.java @@ -397,9 +397,12 @@ public class PaperweightGetBlocks extends CharGetBlocks implements BukkitGetBloc forceLoadSections = false; ServerLevel nmsWorld = serverLevel; LevelChunk nmsChunk = ensureLoaded(nmsWorld, chunkX, chunkZ); - PaperweightGetBlocks_Copy copy = createCopy ? new PaperweightGetBlocks_Copy(nmsChunk) : null; + PaperweightGetBlocks_Copy copy; if (createCopy) { + copy = new PaperweightGetBlocks_Copy(nmsChunk); copies.put(copyKey, copy); + } else { + copy = null; } // Remove existing tiles. Create a copy so that we can remove blocks diff --git a/worldedit-bukkit/adapters/adapter-1_20_2/src/main/java/com/sk89q/worldedit/bukkit/adapter/impl/fawe/v1_20_R2/PaperweightGetBlocks.java b/worldedit-bukkit/adapters/adapter-1_20_2/src/main/java/com/sk89q/worldedit/bukkit/adapter/impl/fawe/v1_20_R2/PaperweightGetBlocks.java index 8a9646e59..019c57f60 100644 --- a/worldedit-bukkit/adapters/adapter-1_20_2/src/main/java/com/sk89q/worldedit/bukkit/adapter/impl/fawe/v1_20_R2/PaperweightGetBlocks.java +++ b/worldedit-bukkit/adapters/adapter-1_20_2/src/main/java/com/sk89q/worldedit/bukkit/adapter/impl/fawe/v1_20_R2/PaperweightGetBlocks.java @@ -383,9 +383,12 @@ public class PaperweightGetBlocks extends CharGetBlocks implements BukkitGetBloc forceLoadSections = false; ServerLevel nmsWorld = serverLevel; LevelChunk nmsChunk = ensureLoaded(nmsWorld, chunkX, chunkZ); - PaperweightGetBlocks_Copy copy = createCopy ? new PaperweightGetBlocks_Copy(nmsChunk) : null; + PaperweightGetBlocks_Copy copy; if (createCopy) { + copy = new PaperweightGetBlocks_Copy(nmsChunk); copies.put(copyKey, copy); + } else { + copy = null; } // Remove existing tiles. Create a copy so that we can remove blocks diff --git a/worldedit-bukkit/adapters/adapter-1_20_4/src/main/java/com/sk89q/worldedit/bukkit/adapter/impl/fawe/v1_20_R3/PaperweightGetBlocks.java b/worldedit-bukkit/adapters/adapter-1_20_4/src/main/java/com/sk89q/worldedit/bukkit/adapter/impl/fawe/v1_20_R3/PaperweightGetBlocks.java index ab63cdfe7..177ca2329 100644 --- a/worldedit-bukkit/adapters/adapter-1_20_4/src/main/java/com/sk89q/worldedit/bukkit/adapter/impl/fawe/v1_20_R3/PaperweightGetBlocks.java +++ b/worldedit-bukkit/adapters/adapter-1_20_4/src/main/java/com/sk89q/worldedit/bukkit/adapter/impl/fawe/v1_20_R3/PaperweightGetBlocks.java @@ -383,9 +383,12 @@ public class PaperweightGetBlocks extends CharGetBlocks implements BukkitGetBloc forceLoadSections = false; ServerLevel nmsWorld = serverLevel; LevelChunk nmsChunk = ensureLoaded(nmsWorld, chunkX, chunkZ); - PaperweightGetBlocks_Copy copy = createCopy ? new PaperweightGetBlocks_Copy(nmsChunk) : null; + PaperweightGetBlocks_Copy copy; if (createCopy) { + copy = new PaperweightGetBlocks_Copy(nmsChunk); copies.put(copyKey, copy); + } else { + copy = null; } // Remove existing tiles. Create a copy so that we can remove blocks