Merge remote-tracking branch 'upstream/master' into saplingOverrides

This commit is contained in:
CocoTheOwner
2021-07-18 11:10:42 +02:00
13 changed files with 283 additions and 163 deletions

View File

@@ -349,6 +349,7 @@ public class IrisDimension extends IrisRegistrant {
private final transient AtomicCache<Double> sinr = new AtomicCache<>();
private final transient AtomicCache<Double> cosr = new AtomicCache<>();
private final transient AtomicCache<Double> rad = new AtomicCache<>();
private final transient AtomicCache<Boolean> featuresUsed = new AtomicCache<>();
public boolean hasSky() {
return getSky() != null;
@@ -517,4 +518,48 @@ public class IrisDimension extends IrisRegistrant {
return changed;
}
public boolean hasFeatures(DataProvider data) {
return featuresUsed.aquire(() -> {
if(getFeatures().isNotEmpty() || getSpecificFeatures().isNotEmpty())
{
return true;
}
for(IrisRegion i : getAllRegions(data))
{
if(i.getFeatures().isNotEmpty())
{
return true;
}
for(IrisObjectPlacement j : i.getObjects())
{
if(j.isVacuum())
{
return true;
}
}
for(IrisBiome j : i.getAllBiomes(data))
{
if(j.getFeatures().isNotEmpty())
{
return true;
}
for(IrisObjectPlacement k : i.getObjects())
{
if(k.isVacuum())
{
return true;
}
}
}
}
Iris.verbose("Not using parallax noise features (they arent used in this dimension)");
return false;
});
}
}