mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-07-17 21:04:42 +02:00
Compare commits
7 Commits
6.10.2
...
feature/v6
Author | SHA1 | Date | |
---|---|---|---|
9ee3e9a3a4 | |||
28bd993680 | |||
8330f37d8a | |||
985fae65b6 | |||
db2d590e8e | |||
c8d356783a | |||
4947450ff0 |
@ -298,7 +298,10 @@ public class HybridPlotWorld extends ClassicPlotWorld {
|
|||||||
int roadSchemHeight;
|
int roadSchemHeight;
|
||||||
|
|
||||||
if (schematic1 != null) {
|
if (schematic1 != null) {
|
||||||
roadSchemHeight = schematic1.getClipboard().getDimensions().getY();
|
roadSchemHeight = Math.max(
|
||||||
|
schematic1.getClipboard().getDimensions().getY(),
|
||||||
|
schematic2.getClipboard().getDimensions().getY()
|
||||||
|
);
|
||||||
maxSchematicHeight = Math.max(roadSchemHeight, maxSchematicHeight);
|
maxSchematicHeight = Math.max(roadSchemHeight, maxSchematicHeight);
|
||||||
if (maxSchematicHeight == worldGenHeight) {
|
if (maxSchematicHeight == worldGenHeight) {
|
||||||
SCHEM_Y = getMinGenHeight();
|
SCHEM_Y = getMinGenHeight();
|
||||||
|
@ -234,44 +234,52 @@ public class HybridUtils {
|
|||||||
Set<BlockType> types = new HashSet<>();
|
Set<BlockType> types = new HashSet<>();
|
||||||
for (int yIndex = 0; yIndex < height; yIndex++) {
|
for (int yIndex = 0; yIndex < height; yIndex++) {
|
||||||
BlockState old = oldBlocks[yIndex][x][z]; // Nullable
|
BlockState old = oldBlocks[yIndex][x][z]; // Nullable
|
||||||
try {
|
BlockState now = newBlocks[yIndex][x][z]; // Not null
|
||||||
BlockState now = newBlocks[yIndex][x][z]; // Not null
|
if (now == null) {
|
||||||
if (!now.equals(old) && !(old == null && now.getBlockType().equals(BlockTypes.AIR))) {
|
throw new NullPointerException(String.format(
|
||||||
changes[i]++;
|
"\"now\" block null attempting to perform plot analysis. Indexes: x=%d of %d, yIndex=%d" +
|
||||||
}
|
" of %d, z=%d of %d",
|
||||||
if (now.getBlockType().getMaterial().isAir()) {
|
x,
|
||||||
air[i]++;
|
width,
|
||||||
} else {
|
yIndex,
|
||||||
// check vertices
|
height,
|
||||||
// modifications_adjacent
|
z,
|
||||||
if (x > 0 && z > 0 && yIndex > 0 && x < width - 1 && z < length - 1 && yIndex < (height - 1)) {
|
length
|
||||||
if (newBlocks[yIndex - 1][x][z].getBlockType().getMaterial().isAir()) {
|
));
|
||||||
faces[i]++;
|
}
|
||||||
}
|
if (!now.equals(old) && !(old == null && now.getBlockType().equals(BlockTypes.AIR))) {
|
||||||
if (newBlocks[yIndex][x - 1][z].getBlockType().getMaterial().isAir()) {
|
changes[i]++;
|
||||||
faces[i]++;
|
}
|
||||||
}
|
if (now.getBlockType().getMaterial().isAir()) {
|
||||||
if (newBlocks[yIndex][x][z - 1].getBlockType().getMaterial().isAir()) {
|
air[i]++;
|
||||||
faces[i]++;
|
} else {
|
||||||
}
|
// check vertices
|
||||||
if (newBlocks[yIndex + 1][x][z].getBlockType().getMaterial().isAir()) {
|
// modifications_adjacent
|
||||||
faces[i]++;
|
if (x > 0 && z > 0 && yIndex > 0 && x < width - 1 && z < length - 1 && yIndex < (height - 1)) {
|
||||||
}
|
if (newBlocks[yIndex - 1][x][z].getBlockType().getMaterial().isAir()) {
|
||||||
if (newBlocks[yIndex][x + 1][z].getBlockType().getMaterial().isAir()) {
|
faces[i]++;
|
||||||
faces[i]++;
|
|
||||||
}
|
|
||||||
if (newBlocks[yIndex][x][z + 1].getBlockType().getMaterial().isAir()) {
|
|
||||||
faces[i]++;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
if (newBlocks[yIndex][x - 1][z].getBlockType().getMaterial().isAir()) {
|
||||||
|
faces[i]++;
|
||||||
|
}
|
||||||
|
if (newBlocks[yIndex][x][z - 1].getBlockType().getMaterial().isAir()) {
|
||||||
|
faces[i]++;
|
||||||
|
}
|
||||||
|
if (newBlocks[yIndex + 1][x][z].getBlockType().getMaterial().isAir()) {
|
||||||
|
faces[i]++;
|
||||||
|
}
|
||||||
|
if (newBlocks[yIndex][x + 1][z].getBlockType().getMaterial().isAir()) {
|
||||||
|
faces[i]++;
|
||||||
|
}
|
||||||
|
if (newBlocks[yIndex][x][z + 1].getBlockType().getMaterial().isAir()) {
|
||||||
|
faces[i]++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!now.equals(now.getBlockType().getDefaultState())) {
|
if (!now.equals(now.getBlockType().getDefaultState())) {
|
||||||
data[i]++;
|
data[i]++;
|
||||||
}
|
|
||||||
types.add(now.getBlockType());
|
|
||||||
}
|
}
|
||||||
} catch (NullPointerException e) {
|
types.add(now.getBlockType());
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
variety[i] = types.size();
|
variety[i] = types.size();
|
||||||
|
@ -19,7 +19,7 @@ plugins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
group = "com.plotsquared"
|
group = "com.plotsquared"
|
||||||
version = "6.10.2"
|
version = "6.10.4-SNAPSHOT"
|
||||||
|
|
||||||
subprojects {
|
subprojects {
|
||||||
group = rootProject.group
|
group = rootProject.group
|
||||||
@ -65,7 +65,7 @@ subprojects {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation(platform("com.intellectualsites.bom:bom-1.18.x:1.16"))
|
implementation(platform("com.intellectualsites.bom:bom-1.18.x:1.18"))
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
Reference in New Issue
Block a user