Fixed regenallroads in partial plotworlds

This commit is contained in:
boy0001 2015-05-15 00:33:10 +10:00
parent fa62ede0e7
commit 2b7adedeeb

View File

@ -70,10 +70,20 @@ public abstract class HybridUtils {
if (!plotworld.ROAD_SCHEMATIC_ENABLED) { if (!plotworld.ROAD_SCHEMATIC_ENABLED) {
return false; return false;
} }
boolean toCheck = false;
if (plotworld.TYPE == 2) {
boolean c1 = MainUtil.isPlotArea(new Location(plotworld.worldname, x, 1, z));
boolean c2 = MainUtil.isPlotArea(new Location(plotworld.worldname, ex, 1, ez));
if (!c1 && !c2) {
return false;
}
else {
toCheck = c1 ^ c2;
}
}
final PlotManager manager = PlotSquared.getPlotManager(world); final PlotManager manager = PlotSquared.getPlotManager(world);
final PlotId id1 = manager.getPlotId(plotworld, x, 0, z); final PlotId id1 = manager.getPlotId(plotworld, x, 0, z);
final PlotId id2 = manager.getPlotId(plotworld, ex, 0, ez); final PlotId id2 = manager.getPlotId(plotworld, ex, 0, ez);
boolean toCheck = false;
if ((id1 == null) || (id2 == null) || (id1 != id2)) { if ((id1 == null) || (id2 == null) || (id1 != id2)) {
final boolean result = ChunkManager.manager.loadChunk(world, chunk); final boolean result = ChunkManager.manager.loadChunk(world, chunk);
if (result) { if (result) {
@ -102,7 +112,7 @@ public abstract class HybridUtils {
} }
boolean condition; boolean condition;
if (toCheck) { if (toCheck) {
condition = manager.getPlotId(plotworld, x + X, 1, z + Z) == null; condition = MainUtil.isPlotRoad(new Location(plotworld.worldname, x + X, 1, z + Z));
} else { } else {
final boolean gx = absX > plotworld.PATH_WIDTH_LOWER; final boolean gx = absX > plotworld.PATH_WIDTH_LOWER;
final boolean gz = absZ > plotworld.PATH_WIDTH_LOWER; final boolean gz = absZ > plotworld.PATH_WIDTH_LOWER;