From 3df080abe41a6e13050e6f8c02689424a29e177a Mon Sep 17 00:00:00 2001 From: NotMyFault Date: Fri, 5 Feb 2021 13:21:15 +0100 Subject: [PATCH 1/5] Add note if clipboard >= Integer.MAX_VALUE --- .../boydti/fawe/object/clipboard/DiskOptimizedClipboard.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worldedit-core/src/main/java/com/boydti/fawe/object/clipboard/DiskOptimizedClipboard.java b/worldedit-core/src/main/java/com/boydti/fawe/object/clipboard/DiskOptimizedClipboard.java index 0a27689de..38914a944 100644 --- a/worldedit-core/src/main/java/com/boydti/fawe/object/clipboard/DiskOptimizedClipboard.java +++ b/worldedit-core/src/main/java/com/boydti/fawe/object/clipboard/DiskOptimizedClipboard.java @@ -78,7 +78,7 @@ public class DiskOptimizedClipboard extends LinearClipboard implements Closeable public DiskOptimizedClipboard(BlockVector3 dimensions, File file) { super(dimensions); if (HEADER_SIZE + ((long) getVolume() << 1) >= Integer.MAX_VALUE) { - throw new IllegalArgumentException("Dimensions too large for this clipboard format"); + throw new IllegalArgumentException("Dimensions too large for this clipboard format. Use //lazycopy for large selections."); } else if (HEADER_SIZE + ((long) getVolume() << 1) + (long) ((getHeight() >> 2) + 1) * ((getLength() >> 2) + 1) * ((getWidth() >> 2) + 1) >= Integer.MAX_VALUE) { log.error("Dimensions are too large for biomes to be stored in a DiskOptimizedClipboard"); canHaveBiomes = false; From 2ab207cfe975be2f20116e87ca10f4972e51987d Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Fri, 5 Feb 2021 16:05:53 +0000 Subject: [PATCH 2/5] Fix occasional NPE when removing section lighting --- .../fawe/bukkit/adapter/mc1_15_2/BukkitGetBlocks_1_15_2.java | 2 +- .../fawe/bukkit/adapter/mc1_16_1/BukkitGetBlocks_1_16_1.java | 2 +- .../fawe/bukkit/adapter/mc1_16_2/BukkitGetBlocks_1_16_2.java | 2 +- .../fawe/bukkit/adapter/mc1_16_5/BukkitGetBlocks_1_16_5.java | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_15_2/BukkitGetBlocks_1_15_2.java b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_15_2/BukkitGetBlocks_1_15_2.java index 33e200737..6dc7e81f5 100644 --- a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_15_2/BukkitGetBlocks_1_15_2.java +++ b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_15_2/BukkitGetBlocks_1_15_2.java @@ -191,7 +191,7 @@ public class BukkitGetBlocks_1_15_2 extends CharGetBlocks implements BukkitGetBl if (sky) { SectionPosition sectionPositionSky = SectionPosition.a(getChunk().getPos(), layer); NibbleArray nibbleSky = world.getChunkProvider().getLightEngine().a(EnumSkyBlock.SKY).a(sectionPositionSky); - if (nibble != null) { + if (nibbleSky != null) { lightUpdate = true; synchronized (nibbleSky) { byte[] bytes = PaperLib.isPaper() ? nibbleSky.getIfSet() : nibbleSky.asBytes(); diff --git a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_16_1/BukkitGetBlocks_1_16_1.java b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_16_1/BukkitGetBlocks_1_16_1.java index 20182af7b..9288ff4c9 100644 --- a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_16_1/BukkitGetBlocks_1_16_1.java +++ b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_16_1/BukkitGetBlocks_1_16_1.java @@ -192,7 +192,7 @@ public class BukkitGetBlocks_1_16_1 extends CharGetBlocks implements BukkitGetBl if (sky) { SectionPosition sectionPositionSky = SectionPosition.a(getChunk().getPos(), layer); NibbleArray nibbleSky = world.getChunkProvider().getLightEngine().a(EnumSkyBlock.SKY).a(sectionPositionSky); - if (nibble != null) { + if (nibbleSky != null) { lightUpdate = true; synchronized (nibbleSky) { byte[] bytes = PaperLib.isPaper() ? nibbleSky.getIfSet() : nibbleSky.asBytes(); diff --git a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_16_2/BukkitGetBlocks_1_16_2.java b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_16_2/BukkitGetBlocks_1_16_2.java index 23d47d3f4..9a16e1b73 100644 --- a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_16_2/BukkitGetBlocks_1_16_2.java +++ b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_16_2/BukkitGetBlocks_1_16_2.java @@ -192,7 +192,7 @@ public class BukkitGetBlocks_1_16_2 extends CharGetBlocks implements BukkitGetBl if (sky) { SectionPosition sectionPositionSky = SectionPosition.a(getChunk().getPos(), layer); NibbleArray nibbleSky = world.getChunkProvider().getLightEngine().a(EnumSkyBlock.SKY).a(sectionPositionSky); - if (nibble != null) { + if (nibbleSky != null) { lightUpdate = true; synchronized (nibbleSky) { byte[] bytes = PaperLib.isPaper() ? nibbleSky.getIfSet() : nibbleSky.asBytes(); diff --git a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_16_5/BukkitGetBlocks_1_16_5.java b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_16_5/BukkitGetBlocks_1_16_5.java index 3d28eedcc..0d1d84c02 100644 --- a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_16_5/BukkitGetBlocks_1_16_5.java +++ b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_16_5/BukkitGetBlocks_1_16_5.java @@ -192,7 +192,7 @@ public class BukkitGetBlocks_1_16_5 extends CharGetBlocks implements BukkitGetBl if (sky) { SectionPosition sectionPositionSky = SectionPosition.a(getChunk().getPos(), layer); NibbleArray nibbleSky = world.getChunkProvider().getLightEngine().a(EnumSkyBlock.SKY).a(sectionPositionSky); - if (nibble != null) { + if (nibbleSky != null) { lightUpdate = true; synchronized (nibbleSky) { byte[] bytes = PaperLib.isPaper() ? nibbleSky.getIfSet() : nibbleSky.asBytes(); From 5f83643d88333d25ea83a7fa743c68e1c087e854 Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Fri, 5 Feb 2021 23:20:15 +0000 Subject: [PATCH 3/5] Couple of command fixes fixes #899 --- .../main/java/com/sk89q/worldedit/command/BrushCommands.java | 1 - .../main/java/com/sk89q/worldedit/command/ToolUtilCommands.java | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/BrushCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/BrushCommands.java index 940ca35ed..7f9680a77 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/BrushCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/BrushCommands.java @@ -344,7 +344,6 @@ public class BrushCommands { @Switch(name = 'd', desc = "sags the catenary toward the facing direction") boolean facingDirection) throws WorldEditException { worldEdit.checkMaxBrushRadius(radius); - Brush brush = new CatenaryBrush(shell, select, facingDirection, lengthFactor); set(context, new CatenaryBrush(shell, select, facingDirection, lengthFactor)) .setSize(radius).setFill(fill); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolUtilCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolUtilCommands.java index 0eff1b524..f941d951c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolUtilCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolUtilCommands.java @@ -284,7 +284,7 @@ public class ToolUtilCommands { ) @CommandPermissions("worldedit.brush.targetoffset") public void targetOffset(Player player, EditSession editSession, LocalSession session, - int offset) throws WorldEditException { + @Arg(name = "offset", desc = "offset", def = "0") int offset) throws WorldEditException { BrushTool tool = session.getBrushTool(player, false); if (tool == null) { player.print(TranslatableComponent.of("fawe.worldedit.brush.brush.none")); From eead11f32a778c06950d9447073387f575a596f4 Mon Sep 17 00:00:00 2001 From: NotMyFault Date: Mon, 8 Feb 2021 13:20:56 +0100 Subject: [PATCH 4/5] Fixes #265 --- .../java/com/sk89q/worldedit/world/block/BlockTypesCache.java | 1 - 1 file changed, 1 deletion(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockTypesCache.java b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockTypesCache.java index f17e68e55..880b4f290 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockTypesCache.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockTypesCache.java @@ -205,7 +205,6 @@ public class BlockTypesCache { String defaultState = blockMap.remove(id); if (defaultState == null) { if (internalId != 0) { - getLogger(BlockTypesCache.class).info("Ignoring invalid block {}", id); continue; } defaultState = id; From 83e5e8ea27bf3f3470c3851a92b511e5bf2ba1dc Mon Sep 17 00:00:00 2001 From: NotMyFault Date: Wed, 10 Feb 2021 17:49:34 +0100 Subject: [PATCH 5/5] Improve note if Fawe is used on an older mc release --- .../src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java index 1e9aa8792..78d9e8de7 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/BukkitWorld.java @@ -63,7 +63,6 @@ import org.bukkit.inventory.Inventory; import org.bukkit.inventory.InventoryHolder; import org.slf4j.Logger; -import java.io.IOException; import java.lang.ref.WeakReference; import java.nio.file.Path; import java.util.ArrayList; @@ -290,6 +289,9 @@ public class BukkitWorld extends AbstractWorld { for (TreeGenerator.TreeType type : TreeGenerator.TreeType.values()) { if (treeTypeMapping.get(type) == null) { WorldEdit.logger.error("No TreeType mapping for TreeGenerator.TreeType." + type); + // FAWE start + WorldEdit.logger.warn("Your FAWE version is newer than " + Bukkit.getVersion() + " and contains features of future minecraft versions which do not exist in " + Bukkit.getVersion() + ", hence the tree type " + type + " is not available."); + // FAWE end } } }