mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-13 10:34:09 +01:00
Resolves #145
This commit is contained in:
parent
21514ca3e3
commit
680e54e6e1
@ -269,10 +269,15 @@ public abstract class FlagValue<T> {
|
||||
String[] split = t.split(":");
|
||||
byte data;
|
||||
if (split.length == 2) {
|
||||
data = Byte.parseByte(split[1]);
|
||||
if ("*".equals(split[1])) {
|
||||
data = -1;
|
||||
}
|
||||
else {
|
||||
data = Byte.parseByte(split[1]);
|
||||
}
|
||||
}
|
||||
else {
|
||||
data = 0;
|
||||
data = -1;
|
||||
}
|
||||
short id = Short.parseShort(split[0]);
|
||||
return new PlotBlock(id, data);
|
||||
@ -314,10 +319,15 @@ public abstract class FlagValue<T> {
|
||||
String[] split = item.split(":");
|
||||
byte data;
|
||||
if (split.length == 2) {
|
||||
data = Byte.parseByte(split[1]);
|
||||
if ("*".equals(split[1])) {
|
||||
data = -1;
|
||||
}
|
||||
else {
|
||||
data = Byte.parseByte(split[1]);
|
||||
}
|
||||
}
|
||||
else {
|
||||
data = 0;
|
||||
data = -1;
|
||||
}
|
||||
short id = Short.parseShort(split[0]);
|
||||
PlotBlock block = new PlotBlock(id, data);
|
||||
|
@ -14,6 +14,7 @@ import com.intellectualcrafters.plot.object.BlockWrapper;
|
||||
import com.intellectualcrafters.plot.object.PlotBlock;
|
||||
import com.intellectualcrafters.plot.object.PlotCluster;
|
||||
import com.intellectualcrafters.plot.object.PlotGenerator;
|
||||
import com.intellectualcrafters.plot.object.PlotId;
|
||||
import com.intellectualcrafters.plot.object.PlotManager;
|
||||
import com.intellectualcrafters.plot.object.PlotWorld;
|
||||
import com.intellectualcrafters.plot.util.PlotHelper;
|
||||
@ -112,10 +113,14 @@ public class AugmentedPopulator extends BlockPopulator {
|
||||
check = true;
|
||||
}
|
||||
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;
|
||||
}
|
||||
check = false;
|
||||
}
|
||||
if (this.o) {
|
||||
chunk.load(true);
|
||||
|
@ -45,16 +45,19 @@ public class PlotBlock {
|
||||
return false;
|
||||
}
|
||||
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
|
||||
public int hashCode() {
|
||||
return (id + data) * (id + data + 1) + data;
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
if (this.data == -1) {
|
||||
return this.id + "";
|
||||
}
|
||||
return this.id + ":" + this.data;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user