From fab60a0d539d76e310ec60014d962dd2ab199997 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Tue, 5 Apr 2016 11:07:37 +1000 Subject: [PATCH] Fix schematic on claim/auto --- .../main/java/com/plotsquared/bukkit/util/block/GenChunk.java | 4 +++- .../main/java/com/intellectualcrafters/plot/object/Plot.java | 2 +- .../com/intellectualcrafters/plot/util/SchematicHandler.java | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/util/block/GenChunk.java b/Bukkit/src/main/java/com/plotsquared/bukkit/util/block/GenChunk.java index 8b0f2af43..286f63aee 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/util/block/GenChunk.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/util/block/GenChunk.java @@ -41,7 +41,9 @@ public class GenChunk extends PlotChunk { @Override public void setBiome(int x, int z, int biome) { - this.grid.setBiome(x, z, this.biomes[biome]); + if (this.grid != null) { + this.grid.setBiome(x, z, this.biomes[biome]); + } } public void setBiome(int x, int z, Biome biome) { diff --git a/Core/src/main/java/com/intellectualcrafters/plot/object/Plot.java b/Core/src/main/java/com/intellectualcrafters/plot/object/Plot.java index 7a775fa45..cda7b404b 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/object/Plot.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/object/Plot.java @@ -1301,7 +1301,7 @@ public class Plot { PlotArea plotworld = getArea(); if (plotworld.SCHEMATIC_ON_CLAIM) { SchematicHandler.Schematic sch; - if (schematic.isEmpty()) { + if (schematic == null || schematic.isEmpty()) { sch = SchematicHandler.manager.getSchematic(plotworld.SCHEMATIC_FILE); } else { sch = SchematicHandler.manager.getSchematic(schematic); diff --git a/Core/src/main/java/com/intellectualcrafters/plot/util/SchematicHandler.java b/Core/src/main/java/com/intellectualcrafters/plot/util/SchematicHandler.java index 31c70b0cd..d151634a2 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/util/SchematicHandler.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/util/SchematicHandler.java @@ -705,7 +705,7 @@ public abstract class SchematicHandler { * @return Map of block location to tag */ public HashMap getTiles() { - return this.tiles; + return this.tiles == null ? new HashMap() : tiles; } /**