diff --git a/PlotSquared/pom.xml b/PlotSquared/pom.xml
index 94edc9832..c51ea345e 100644
--- a/PlotSquared/pom.xml
+++ b/PlotSquared/pom.xml
@@ -6,7 +6,7 @@
com.intellectualcrafters
PlotSquared
- 2.3.6
+ 2.3.7
PlotSquared
jar
diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/generator/DefaultPlotManager.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/generator/DefaultPlotManager.java
index 613004b99..97d4ae5fe 100644
--- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/generator/DefaultPlotManager.java
+++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/generator/DefaultPlotManager.java
@@ -662,13 +662,13 @@ public class DefaultPlotManager extends PlotManager {
PlotHelper.setSimpleCuboid(w, new Location(w, sx, Math.min(dpw.WALL_HEIGHT, dpw.ROAD_HEIGHT) + 1, sz + 1), new Location(w, ex + 1, 257 + 1, ez), new PlotBlock((short) 0, (byte) 0));
- PlotHelper.setSimpleCuboid(w, new Location(w, sx, 1, sz + 1), new Location(w, sx + 1, dpw.WALL_HEIGHT + 1, ez), dpw.WALL_FILLING);
- PlotHelper.setSimpleCuboid(w, new Location(w, sx, dpw.WALL_HEIGHT + 1, sz + 1), new Location(w, sx + 1, dpw.WALL_HEIGHT + 2, ez), dpw.WALL_BLOCK);
+ PlotHelper.setCuboid(w, new Location(w, sx, 1, sz + 1), new Location(w, sx + 1, dpw.WALL_HEIGHT + 1, ez), dpw.WALL_FILLING);
+ PlotHelper.setCuboid(w, new Location(w, sx, dpw.WALL_HEIGHT + 1, sz + 1), new Location(w, sx + 1, dpw.WALL_HEIGHT + 2, ez), dpw.WALL_BLOCK);
- PlotHelper.setSimpleCuboid(w, new Location(w, ex, 1, sz + 1), new Location(w, ex + 1, dpw.WALL_HEIGHT + 1, ez), dpw.WALL_FILLING);
- PlotHelper.setSimpleCuboid(w, new Location(w, ex, dpw.WALL_HEIGHT + 1, sz + 1), new Location(w, ex + 1, dpw.WALL_HEIGHT + 2, ez), dpw.WALL_BLOCK);
+ PlotHelper.setCuboid(w, new Location(w, ex, 1, sz + 1), new Location(w, ex + 1, dpw.WALL_HEIGHT + 1, ez), dpw.WALL_FILLING);
+ PlotHelper.setCuboid(w, new Location(w, ex, dpw.WALL_HEIGHT + 1, sz + 1), new Location(w, ex + 1, dpw.WALL_HEIGHT + 2, ez), dpw.WALL_BLOCK);
- PlotHelper.setSimpleCuboid(w, new Location(w, sx + 1, 1, sz + 1), new Location(w, ex, dpw.ROAD_HEIGHT + 1, ez), dpw.ROAD_BLOCK);
+ PlotHelper.setCuboid(w, new Location(w, sx + 1, 1, sz + 1), new Location(w, ex, dpw.ROAD_HEIGHT + 1, ez), dpw.ROAD_BLOCK);
return true;
}
@@ -688,13 +688,13 @@ public class DefaultPlotManager extends PlotManager {
PlotHelper.setSimpleCuboid(w, new Location(w, sx, Math.min(dpw.WALL_HEIGHT, dpw.ROAD_HEIGHT) + 1, sz + 1), new Location(w, ex + 1, 257, ez), new PlotBlock((short) 0, (byte) 0));
- PlotHelper.setSimpleCuboid(w, new Location(w, sx + 1, 1, sz), new Location(w, ex, dpw.WALL_HEIGHT + 1, sz + 1), dpw.WALL_FILLING);
- PlotHelper.setSimpleCuboid(w, new Location(w, sx + 1, dpw.WALL_HEIGHT + 1, sz), new Location(w, ex, dpw.WALL_HEIGHT + 2, sz + 1), dpw.WALL_BLOCK);
+ PlotHelper.setCuboid(w, new Location(w, sx + 1, 1, sz), new Location(w, ex, dpw.WALL_HEIGHT + 1, sz + 1), dpw.WALL_FILLING);
+ PlotHelper.setCuboid(w, new Location(w, sx + 1, dpw.WALL_HEIGHT + 1, sz), new Location(w, ex, dpw.WALL_HEIGHT + 2, sz + 1), dpw.WALL_BLOCK);
- PlotHelper.setSimpleCuboid(w, new Location(w, sx + 1, 1, ez), new Location(w, ex, dpw.WALL_HEIGHT + 1, ez + 1), dpw.WALL_FILLING);
- PlotHelper.setSimpleCuboid(w, new Location(w, sx + 1, dpw.WALL_HEIGHT + 1, ez), new Location(w, ex, dpw.WALL_HEIGHT + 2, ez + 1), dpw.WALL_BLOCK);
+ PlotHelper.setCuboid(w, new Location(w, sx + 1, 1, ez), new Location(w, ex, dpw.WALL_HEIGHT + 1, ez + 1), dpw.WALL_FILLING);
+ PlotHelper.setCuboid(w, new Location(w, sx + 1, dpw.WALL_HEIGHT + 1, ez), new Location(w, ex, dpw.WALL_HEIGHT + 2, ez + 1), dpw.WALL_BLOCK);
- PlotHelper.setSimpleCuboid(w, new Location(w, sx + 1, 1, sz + 1), new Location(w, ex, dpw.ROAD_HEIGHT + 1, ez), dpw.ROAD_BLOCK);
+ PlotHelper.setCuboid(w, new Location(w, sx + 1, 1, sz + 1), new Location(w, ex, dpw.ROAD_HEIGHT + 1, ez), dpw.ROAD_BLOCK);
return true;
}
@@ -712,7 +712,7 @@ public class DefaultPlotManager extends PlotManager {
final int ez = (sz + dpw.ROAD_WIDTH) - 1;
PlotHelper.setSimpleCuboid(w, new Location(w, sx, dpw.ROAD_HEIGHT + 1, sz + 1), new Location(w, ex + 1, 257, ez), new PlotBlock((short) 0, (byte) 0));
- PlotHelper.setSimpleCuboid(w, new Location(w, sx + 1, 1, sz + 1), new Location(w, ex, dpw.ROAD_HEIGHT + 1, ez), dpw.ROAD_BLOCK);
+ PlotHelper.setCuboid(w, new Location(w, sx + 1, 1, sz + 1), new Location(w, ex, dpw.ROAD_HEIGHT + 1, ez), dpw.ROAD_BLOCK);
return true;
}
diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/object/PlotWorld.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/object/PlotWorld.java
index 9a249156c..c232caf15 100644
--- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/object/PlotWorld.java
+++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/object/PlotWorld.java
@@ -23,11 +23,13 @@ package com.intellectualcrafters.plot.object;
import com.intellectualcrafters.plot.config.Configuration;
import com.intellectualcrafters.plot.config.ConfigurationNode;
+
import org.bukkit.Material;
import org.bukkit.block.Biome;
import org.bukkit.configuration.ConfigurationSection;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
@@ -44,7 +46,7 @@ public abstract class PlotWorld {
public final static boolean SCHEMATIC_ON_CLAIM_DEFAULT = false;
public final static String SCHEMATIC_FILE_DEFAULT = "null";
public final static List SCHEMATICS_DEFAULT = null;
- public final static List DEFAULT_FLAGS_DEFAULT = new ArrayList<>();
+ public final static List DEFAULT_FLAGS_DEFAULT = Arrays.asList();
public final static boolean USE_ECONOMY_DEFAULT = false;
public final static double PLOT_PRICE_DEFAULT = 100;
public final static double MERGE_PRICE_DEFAULT = 100;
@@ -193,7 +195,6 @@ public abstract class PlotWorld {
options.put("event.spawn.custom", PlotWorld.SPAWN_CUSTOM_DEFAULT);
options.put("event.spawn.breeding", PlotWorld.SPAWN_BREEDING_DEFAULT);
final ConfigurationNode[] settings = getSettingNodes();
-
/*
* Saving generator specific settings
*/
diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/object/StringWrapper.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/object/StringWrapper.java
index 4b1619bcd..d36e6a7b7 100644
--- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/object/StringWrapper.java
+++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/object/StringWrapper.java
@@ -74,6 +74,9 @@ public class StringWrapper {
*/
@Override
public int hashCode() {
+ if (this.value == null) {
+ return 0;
+ }
return this.value.toLowerCase().hashCode();
}
}
diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/PlotHelper.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/PlotHelper.java
index 76a838d0c..0627ff8d3 100644
--- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/PlotHelper.java
+++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/PlotHelper.java
@@ -249,7 +249,7 @@ public class PlotHelper {
}
public static void setSign(final Player player, final Plot p) {
- setSign(player.getWorld(), player.getName(), p);
+ setSign(Bukkit.getWorld(p.world), player.getName(), p);
}
@SuppressWarnings("deprecation")
@@ -737,7 +737,41 @@ public class PlotHelper {
}
+ public static void setCuboid(final World world, final Location pos1, final Location pos2, final PlotBlock newblock) {
+ if (!canSetFast) {
+ for (int y = pos1.getBlockY(); y < pos2.getBlockY(); y++) {
+ for (int x = pos1.getBlockX(); x < pos2.getBlockX(); x++) {
+ for (int z = pos1.getBlockZ(); z < pos2.getBlockZ(); z++) {
+ final Block block = world.getBlockAt(x, y, z);
+ if (!((block.getTypeId() == newblock.id) && (block.getData() == newblock.data))) {
+ block.setTypeIdAndData(newblock.id, newblock.data, false);
+ }
+ }
+ }
+ }
+ } else {
+ try {
+ for (int y = pos1.getBlockY(); y < pos2.getBlockY(); y++) {
+ for (int x = pos1.getBlockX(); x < pos2.getBlockX(); x++) {
+ for (int z = pos1.getBlockZ(); z < pos2.getBlockZ(); z++) {
+ final Block block = world.getBlockAt(x, y, z);
+ if (!((block.getTypeId() == newblock.id) && (block.getData() == newblock.data))) {
+ SetBlockFast.set(world, x, y, z, newblock.id, newblock.data);
+ }
+ }
+ }
+ }
+ } catch (final Exception e) {
+ //
+ }
+ }
+ }
+
public static void setCuboid(final World world, final Location pos1, final Location pos2, final PlotBlock[] blocks) {
+ if (blocks.length == 1) {
+ setCuboid(world, pos1, pos2, blocks[0]);
+ return;
+ }
if (!canSetFast) {
for (int y = pos1.getBlockY(); y < pos2.getBlockY(); y++) {
for (int x = pos1.getBlockX(); x < pos2.getBlockX(); x++) {
diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/uuid/PlotUUIDSaver.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/uuid/PlotUUIDSaver.java
index 2258effb5..ca6653eab 100644
--- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/uuid/PlotUUIDSaver.java
+++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/uuid/PlotUUIDSaver.java
@@ -59,7 +59,9 @@ public class PlotUUIDSaver implements UUIDSaver {
uuid = player.getUniqueId();
if (!UUIDHandler.uuidExists(uuid)) {
name = player.getName();
- UUIDHandler.add(new StringWrapper(name), uuid);
+ if (name != null) {
+ UUIDHandler.add(new StringWrapper(name), uuid);
+ }
}
}