From c5b332246e47c3c9fb157d76ba6e26b7cac15629 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Wed, 11 Apr 2018 23:40:58 +1000 Subject: [PATCH] Fix setblock npe 1.8 --- .../bukkit/util/block/BukkitLocalQueue_1_8.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/util/block/BukkitLocalQueue_1_8.java b/Bukkit/src/main/java/com/plotsquared/bukkit/util/block/BukkitLocalQueue_1_8.java index ed0234e38..6be15a088 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/util/block/BukkitLocalQueue_1_8.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/util/block/BukkitLocalQueue_1_8.java @@ -1,5 +1,7 @@ package com.plotsquared.bukkit.util.block; +import static com.intellectualcrafters.plot.util.ReflectionUtils.getRefClass; + import com.intellectualcrafters.plot.object.ChunkWrapper; import com.intellectualcrafters.plot.object.PlotBlock; import com.intellectualcrafters.plot.util.MainUtil; @@ -17,9 +19,6 @@ import org.bukkit.Chunk; import org.bukkit.World; import org.bukkit.block.Block; - -import static com.intellectualcrafters.plot.util.ReflectionUtils.getRefClass; - public class BukkitLocalQueue_1_8 extends BukkitLocalQueue { private final ReflectionUtils.RefMethod methodInitLighting; @@ -96,6 +95,8 @@ public class BukkitLocalQueue_1_8 extends BukkitLocalQueue { int y = MainUtil.y_loc[i][j]; int z = MainUtil.z_loc[i][j]; PlotBlock newBlock = result2[j]; + if (newBlock == null) continue; + if (newBlock.id == -1) { chunk.getBlock(x, y, z).setData(newBlock.data, false); continue;