Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
Ursprung
7675e464a7
Commit
b87f708c28
@ -76,6 +76,14 @@ public class Laufbau {
|
||||
}
|
||||
return -Double.compare(o1.volume(), o2.volume());
|
||||
});
|
||||
} else {
|
||||
elements.sort((o1, o2) -> {
|
||||
int compared = Double.compare(o1.volume(), o2.volume());
|
||||
if (compared != 0) {
|
||||
return -compared;
|
||||
}
|
||||
return -Double.compare(o1.blockData.getMaterial().getBlastResistance(), o2.blockData.getMaterial().getBlastResistance());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -76,16 +76,8 @@ public class CreatingInnerBlocksState implements LaufbauState {
|
||||
for (BlockBoundingBox blockDataWithBoundingBox : elements) {
|
||||
List<Cuboid> cuboids = blockDataWithBoundingBox.getCuboidList().stream().map(c -> c.add(point)).collect(Collectors.toList());
|
||||
|
||||
/*
|
||||
List<Cuboid> extendedCuboids = null;
|
||||
if (cuboids.stream().anyMatch(cuboid -> cuboid.getDy() > 1)) {
|
||||
extendedCuboids = cuboidList;
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
boolean isInCuboid = false;
|
||||
for (Cuboid cuboid : /*extendedCuboids == null ? neededCuboids : extendedCuboids*/ neededCuboids) {
|
||||
for (Cuboid cuboid : neededCuboids) {
|
||||
if (cuboids.stream().anyMatch(cuboid::intersects)) {
|
||||
isInCuboid = true;
|
||||
break;
|
||||
@ -93,31 +85,14 @@ public class CreatingInnerBlocksState implements LaufbauState {
|
||||
}
|
||||
if (!isInCuboid) {
|
||||
blockDataWithBoundingBoxList.add(blockDataWithBoundingBox);
|
||||
if (preferingBlastResistance) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (blockDataWithBoundingBoxList.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
BlockBoundingBox highest = blockDataWithBoundingBoxList.get(0);
|
||||
|
||||
if (!preferingBlastResistance) {
|
||||
for (BlockBoundingBox blockDataWithBoundingBox : blockDataWithBoundingBoxList) {
|
||||
if (highest.volume() < blockDataWithBoundingBox.volume()) {
|
||||
highest = blockDataWithBoundingBox;
|
||||
}
|
||||
if (preferingBlastResistance) {
|
||||
if (highest.blockData.getMaterial().getBlastResistance() < blockDataWithBoundingBox.blockData.getMaterial().getBlastResistance()) {
|
||||
if (highest.volume() > blockDataWithBoundingBox.volume()) {
|
||||
highest = blockDataWithBoundingBox;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Location location = new Location(world, point.getX(), point.getY(), point.getZ());
|
||||
if (!location.getBlock().getType().isAir()) {
|
||||
return;
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren