diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/BlockBucket.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/BlockBucket.java index 5a99168a5..3278b62d3 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/BlockBucket.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/BlockBucket.java @@ -141,16 +141,22 @@ import java.util.Map.Entry; // if (sum < 100) { final int remaining = 100 - sum; - final int perUnassigned = remaining / unassigned.size(); - for (final PlotBlock block : unassigned) { - temp.put(block, perUnassigned); - sum += perUnassigned; - } - // Make sure there isn't a tiny difference remaining - if (sum < 100) { - final int difference = 100 - sum; - temp.put(unassigned.get(0), perUnassigned + difference); - sum = 100; + if (unassigned.isEmpty()) { + // If there are no unassigned values, we just add it to the first value + final Entry entry = temp.entrySet().iterator().next(); + temp.put(entry.getKey(), (entry.getValue() + 1 + remaining)); + } else { + final int perUnassigned = remaining / unassigned.size(); + for (final PlotBlock block : unassigned) { + temp.put(block, perUnassigned); + sum += perUnassigned; + } + // Make sure there isn't a tiny difference remaining + if (sum < 100) { + final int difference = 100 - sum; + temp.put(unassigned.get(0), perUnassigned + difference); + sum = 100; + } } } else if (!unassigned.isEmpty()) { C.BUCKET_ENTRIES_IGNORED.send(ConsolePlayer.getConsole()); diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Plot.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Plot.java index 03ea4bb9c..8f0e344ce 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Plot.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/object/Plot.java @@ -1423,7 +1423,7 @@ public class Plot { } PlotArea plotworld = getArea(); if (plotworld.SCHEMATIC_ON_CLAIM) { - Schematic sch = null; + Schematic sch; try { if (schematic == null || schematic.isEmpty()) { sch = SchematicHandler.manager.getSchematic(plotworld.SCHEMATIC_FILE);