From 907c6b353408797b3ca5787ba65e969618e7c47b Mon Sep 17 00:00:00 2001 From: tastybento Date: Mon, 11 Oct 2021 17:27:24 -0700 Subject: [PATCH] Prevent NPE --- .../bentobox/bentobox/blueprints/BlueprintClipboard.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/world/bentobox/bentobox/blueprints/BlueprintClipboard.java b/src/main/java/world/bentobox/bentobox/blueprints/BlueprintClipboard.java index 66ed549ad..7d0c01b82 100644 --- a/src/main/java/world/bentobox/bentobox/blueprints/BlueprintClipboard.java +++ b/src/main/java/world/bentobox/bentobox/blueprints/BlueprintClipboard.java @@ -139,7 +139,7 @@ public class BlueprintClipboard { Math.rint(e.getLocation().getY()), Math.rint(e.getLocation().getZ())).equals(v)) .collect(Collectors.toList()); - if (copyBlock(v.toLocation(world), origin, copyAir, ents)) { + if (copyBlock(v.toLocation(world), copyAir, ents)) { count++; } }); @@ -179,12 +179,13 @@ public class BlueprintClipboard { return r; } - private boolean copyBlock(Location l, @Nullable Vector origin2, boolean copyAir, Collection entities) { + private boolean copyBlock(Location l, boolean copyAir, Collection entities) { Block block = l.getBlock(); if (!copyAir && block.getType().equals(Material.AIR) && entities.isEmpty()) { return false; } // Create position + Vector origin2 = origin == null ? new Vector(0,0,0) : origin; int x = l.getBlockX() - origin2.getBlockX(); int y = l.getBlockY() - origin2.getBlockY(); int z = l.getBlockZ() - origin2.getBlockZ();