mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-06-18 06:41:08 +00:00
add terminating pool overwrite
This commit is contained in:
@@ -160,6 +160,6 @@ public class PlannedPiece {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean isFull() {
|
public boolean isFull() {
|
||||||
return connected.size() >= piece.getConnectors().size() || isDead();
|
return connected.size() >= piece.getConnectors().size();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -257,7 +257,8 @@ public class PlannedStructure {
|
|||||||
private KList<IrisJigsawPiece> getShuffledPiecesFor(IrisJigsawPieceConnector c) {
|
private KList<IrisJigsawPiece> getShuffledPiecesFor(IrisJigsawPieceConnector c) {
|
||||||
KList<IrisJigsawPiece> p = new KList<>();
|
KList<IrisJigsawPiece> p = new KList<>();
|
||||||
|
|
||||||
for (String i : c.getPools().shuffleCopy(rng)) {
|
KList<String> pools = terminating && getStructure().getTerminatePool() != null ? new KList<>(getStructure().getTerminatePool()) : c.getPools().shuffleCopy(rng);
|
||||||
|
for (String i : pools) {
|
||||||
for (String j : getData().getJigsawPoolLoader().load(i).getPieces().shuffleCopy(rng)) {
|
for (String j : getData().getJigsawPoolLoader().load(i).getPieces().shuffleCopy(rng)) {
|
||||||
IrisJigsawPiece pi = getData().getJigsawPieceLoader().load(j);
|
IrisJigsawPiece pi = getData().getJigsawPieceLoader().load(j);
|
||||||
|
|
||||||
@@ -283,7 +284,9 @@ public class PlannedStructure {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public KList<PlannedPiece> getPiecesWithAvailableConnectors() {
|
public KList<PlannedPiece> getPiecesWithAvailableConnectors() {
|
||||||
return pieces.copy().removeWhere(PlannedPiece::isFull);
|
KList<PlannedPiece> available = pieces.copy().removeWhere(PlannedPiece::isFull);
|
||||||
|
if (!terminating) available.removeIf(PlannedPiece::isDead);
|
||||||
|
return available;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getVolume() {
|
public int getVolume() {
|
||||||
|
|||||||
@@ -56,6 +56,10 @@ public class IrisJigsawStructure extends IrisRegistrant {
|
|||||||
@Desc("If set to true, iris will look for any pieces with only one connector in valid pools for edge connectors and attach them to 'terminate' the paths/piece connectors. Essentially it caps off ends. For example in a village, Iris would add houses to the ends of roads where possible. For terminators to be selected, they can only have one connector or they wont be chosen.")
|
@Desc("If set to true, iris will look for any pieces with only one connector in valid pools for edge connectors and attach them to 'terminate' the paths/piece connectors. Essentially it caps off ends. For example in a village, Iris would add houses to the ends of roads where possible. For terminators to be selected, they can only have one connector or they wont be chosen.")
|
||||||
private boolean terminate = true;
|
private boolean terminate = true;
|
||||||
|
|
||||||
|
@RegistryListResource(IrisJigsawPool.class)
|
||||||
|
@Desc("The pool to use when terminating pieces")
|
||||||
|
private String terminatePool = null;
|
||||||
|
|
||||||
@Desc("Override the y range instead of placing on the height map")
|
@Desc("Override the y range instead of placing on the height map")
|
||||||
private IrisStyledRange overrideYRange = null;
|
private IrisStyledRange overrideYRange = null;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user