From a36778794be8658c30c1fd5baa4025687d287d9b Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Fri, 29 Nov 2019 02:56:07 +0000 Subject: [PATCH] fix paste tile npe --- .../fawe/bukkit/adapter/mc1_13/BukkitGetBlocks_1_13.java | 3 +++ .../fawe/bukkit/adapter/mc1_14/BukkitGetBlocks_1_14.java | 3 +++ 2 files changed, 6 insertions(+) diff --git a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_13/BukkitGetBlocks_1_13.java b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_13/BukkitGetBlocks_1_13.java index 8d6286c6b..cae2c9e2f 100644 --- a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_13/BukkitGetBlocks_1_13.java +++ b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_13/BukkitGetBlocks_1_13.java @@ -96,6 +96,9 @@ public class BukkitGetBlocks_1_13 extends CharGetBlocks { @Override public CompoundTag getTag(int x, int y, int z) { TileEntity tileEntity = getChunk().getTileEntity(new BlockPosition((x & 15) + (X << 4), y, (z & 15) + (Z << 4))); + if (tileEntity == null) { + return null; + } return new LazyCompoundTag_1_13(Suppliers.memoize(() -> tileEntity.save(new NBTTagCompound()))); } diff --git a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_14/BukkitGetBlocks_1_14.java b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_14/BukkitGetBlocks_1_14.java index 891d59b07..73cf2c62f 100644 --- a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_14/BukkitGetBlocks_1_14.java +++ b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/adapter/mc1_14/BukkitGetBlocks_1_14.java @@ -103,6 +103,9 @@ public class BukkitGetBlocks_1_14 extends CharGetBlocks { @Override public CompoundTag getTag(int x, int y, int z) { TileEntity tileEntity = getChunk().getTileEntity(new BlockPosition((x & 15) + (X << 4), y, (z & 15) + (Z << 4))); + if (tileEntity == null) { + return null; + } return new LazyCompoundTag_1_14(Suppliers.memoize(() -> tileEntity.save(new NBTTagCompound()))); }