Added #816: Whitelist and blacklist for decorators.

This commit is contained in:
tanticle 2022-09-28 02:40:52 +02:00
parent 27070f44c7
commit 0818f971fe
No known key found for this signature in database
GPG Key ID: C6F07B79B2ED9150
2 changed files with 15 additions and 1 deletions

View File

@ -62,8 +62,16 @@ public class IrisSurfaceDecorator extends IrisEngineDecorator {
}
}
if(decorator.getForceBlock() != null)
if(decorator.getForceBlock() != null) {
data.set(x, height, z, fixFaces(decorator.getForceBlock().getBlockData(getData()), x, height, z));
} else if(!decorator.isForcePlace()) {
if(decorator.getWhitelist() != null && decorator.getWhitelist().stream().noneMatch(d -> d.getBlockData(getData()).equals(bdx))) {
return;
}
if(decorator.getBlacklist() != null && decorator.getWhitelist().stream().anyMatch(d -> d.getBlockData(getData()).equals(bdx))) {
return;
}
}
if(bd instanceof Bisected) {
bd = bd.clone();

View File

@ -55,6 +55,12 @@ public class IrisDecorator {
private boolean forcePlace = false;
@Desc("Forced the surface block of this decorant to be the specified block. Assumes forcePlace.")
private IrisBlockData forceBlock;
@ArrayType(min = 1, type = IrisBlockData.class)
@Desc("When set, the decorator can only place onto any of these blocks.")
private KList<IrisBlockData> whitelist;
@ArrayType(min = 1, type = IrisBlockData.class)
@Desc("When set, the decorator will never place onto any of these blocks.")
private KList<IrisBlockData> blacklist;
@DependsOn({"scaleStack", "stackMin", "stackMax"})
@Desc("If stackMax is set to true, use this to limit its max height for large caverns")
private int absoluteMaxStack = 30;