Fixes NPE when pasting and the blueprint has no original set.

This commit is contained in:
tastybento 2019-05-15 14:40:19 -07:00
parent 3cb9a0e4df
commit a55459a70c

View File

@ -80,7 +80,8 @@ public class BlueprintPaster {
this.plugin = plugin;
this.clipboard = clipboard;
// Calculate location for pasting
Location loc = location.toVector().subtract(clipboard.getOrigin().toVector()).toLocation(location.getWorld());
Vector offset = clipboard.getOrigin() != null ? clipboard.getOrigin().toVector() : new Vector(0, 0, 0);
Location loc = location.toVector().subtract(offset).toLocation(location.getWorld());
paste(location.getWorld(), null, loc, clipboard.getBlueprint(), task);
}