mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-04-08 16:56:25 +00:00
Speed up plax mgr
This commit is contained in:
@@ -343,6 +343,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;
|
||||
@@ -511,4 +512,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;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user