This commit is contained in:
boy0001 2015-02-11 13:35:15 +11:00
parent 21514ca3e3
commit 680e54e6e1
3 changed files with 26 additions and 8 deletions

View File

@ -269,10 +269,15 @@ public abstract class FlagValue<T> {
String[] split = t.split(":"); String[] split = t.split(":");
byte data; byte data;
if (split.length == 2) { if (split.length == 2) {
data = Byte.parseByte(split[1]); if ("*".equals(split[1])) {
data = -1;
}
else {
data = Byte.parseByte(split[1]);
}
} }
else { else {
data = 0; data = -1;
} }
short id = Short.parseShort(split[0]); short id = Short.parseShort(split[0]);
return new PlotBlock(id, data); return new PlotBlock(id, data);
@ -314,10 +319,15 @@ public abstract class FlagValue<T> {
String[] split = item.split(":"); String[] split = item.split(":");
byte data; byte data;
if (split.length == 2) { if (split.length == 2) {
data = Byte.parseByte(split[1]); if ("*".equals(split[1])) {
data = -1;
}
else {
data = Byte.parseByte(split[1]);
}
} }
else { else {
data = 0; data = -1;
} }
short id = Short.parseShort(split[0]); short id = Short.parseShort(split[0]);
PlotBlock block = new PlotBlock(id, data); PlotBlock block = new PlotBlock(id, data);

View File

@ -14,6 +14,7 @@ import com.intellectualcrafters.plot.object.BlockWrapper;
import com.intellectualcrafters.plot.object.PlotBlock; import com.intellectualcrafters.plot.object.PlotBlock;
import com.intellectualcrafters.plot.object.PlotCluster; import com.intellectualcrafters.plot.object.PlotCluster;
import com.intellectualcrafters.plot.object.PlotGenerator; import com.intellectualcrafters.plot.object.PlotGenerator;
import com.intellectualcrafters.plot.object.PlotId;
import com.intellectualcrafters.plot.object.PlotManager; import com.intellectualcrafters.plot.object.PlotManager;
import com.intellectualcrafters.plot.object.PlotWorld; import com.intellectualcrafters.plot.object.PlotWorld;
import com.intellectualcrafters.plot.util.PlotHelper; import com.intellectualcrafters.plot.util.PlotHelper;
@ -112,10 +113,14 @@ public class AugmentedPopulator extends BlockPopulator {
check = true; check = true;
} }
else { else {
if (plotworld.TERRAIN == 2) { check = false;
}
if (plotworld.TERRAIN == 2) {
PlotId plot1 = manager.getPlotIdAbs(plotworld, new Location(world, x, 0, z));
PlotId plot2 = manager.getPlotIdAbs(plotworld, new Location(world, x2, 0, z2));
if (plot1 != null && plot2 != null && plot1.equals(plot2)) {
return; return;
} }
check = false;
} }
if (this.o) { if (this.o) {
chunk.load(true); chunk.load(true);

View File

@ -45,16 +45,19 @@ public class PlotBlock {
return false; return false;
} }
final PlotBlock other = (PlotBlock) obj; final PlotBlock other = (PlotBlock) obj;
return (this.id == other.id && (this.data == other.data || other.data == -1)); return (this.id == other.id && (this.data == other.data || this.data == -1 || other.data == -1));
} }
@Override @Override
public int hashCode() { public int hashCode() {
return (id + data) * (id + data + 1) + data; return id;
} }
@Override @Override
public String toString() { public String toString() {
if (this.data == -1) {
return this.id + "";
}
return this.id + ":" + this.data; return this.id + ":" + this.data;
} }
} }