mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-12-30 04:29:05 +00:00
VANILLA STRUCTURES
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
package com.volmit.iris.object;
|
||||
|
||||
import com.volmit.iris.scaffold.cache.AtomicCache;
|
||||
import com.volmit.iris.generator.noise.CNG;
|
||||
import com.volmit.iris.scaffold.engine.GeneratorAccess;
|
||||
import com.volmit.iris.manager.IrisDataManager;
|
||||
import com.volmit.iris.scaffold.cache.AtomicCache;
|
||||
import com.volmit.iris.scaffold.data.DataProvider;
|
||||
import com.volmit.iris.util.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
@@ -376,7 +377,7 @@ public class IrisDimension extends IrisRegistrant
|
||||
return cosr.aquire(() -> Math.cos(getDimensionAngle()));
|
||||
}
|
||||
|
||||
public KList<IrisRegion> getAllRegions(GeneratorAccess g)
|
||||
public KList<IrisRegion> getAllRegions(DataProvider g)
|
||||
{
|
||||
KList<IrisRegion> r = new KList<>();
|
||||
|
||||
@@ -388,18 +389,53 @@ public class IrisDimension extends IrisRegistrant
|
||||
return r;
|
||||
}
|
||||
|
||||
public KList<IrisBiome> getAllBiomes(GeneratorAccess g)
|
||||
|
||||
public KList<IrisRegion> getAllAnyRegions()
|
||||
{
|
||||
KList<IrisRegion> r = new KList<>();
|
||||
|
||||
for(String i : getRegions())
|
||||
{
|
||||
r.add(IrisDataManager.loadAnyRegion(i));
|
||||
}
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
public KList<IrisBiome> getAllBiomes(DataProvider g)
|
||||
{
|
||||
KList<IrisBiome> r = new KList<>();
|
||||
|
||||
for(IrisRegion i : getAllRegions(g))
|
||||
{
|
||||
if(i == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
r.addAll(i.getAllBiomes(g));
|
||||
}
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
public KList<IrisBiome> getAllAnyBiomes()
|
||||
{
|
||||
KList<IrisBiome> r = new KList<>();
|
||||
|
||||
for(IrisRegion i : getAllAnyRegions())
|
||||
{
|
||||
if(i == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
r.addAll(i.getAllAnyBiomes());
|
||||
}
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
public IrisGeneratorStyle getBiomeStyle(InferredType type)
|
||||
{
|
||||
switch(type)
|
||||
|
||||
@@ -29,6 +29,10 @@ public class IrisDimensionIndex
|
||||
@Desc("If inverted is set to true, the dimension will be updide down in the world")
|
||||
private boolean inverted = false;
|
||||
|
||||
@DontObfuscate
|
||||
@Desc("Only one dimension layer should be set to primary. The primary dimension layer is where players spawn, and the biomes that the vanilla structure system uses to figure out what structures to place.")
|
||||
private boolean primary = false;
|
||||
|
||||
@DontObfuscate
|
||||
@Required
|
||||
@RegistryListDimension
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
package com.volmit.iris.object;
|
||||
|
||||
import com.volmit.iris.scaffold.cache.AtomicCache;
|
||||
import com.volmit.iris.generator.noise.CNG;
|
||||
import com.volmit.iris.manager.IrisDataManager;
|
||||
import com.volmit.iris.scaffold.cache.AtomicCache;
|
||||
import com.volmit.iris.scaffold.data.DataProvider;
|
||||
import com.volmit.iris.util.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -531,4 +532,43 @@ public class IrisRegion extends IrisRegistrant implements IRare
|
||||
return realLandBiomes;
|
||||
});
|
||||
}
|
||||
|
||||
public KList<IrisBiome> getAllAnyBiomes() {
|
||||
KMap<String, IrisBiome> b = new KMap<>();
|
||||
KSet<String> names = new KSet<>();
|
||||
names.addAll(landBiomes);
|
||||
names.addAll(caveBiomes);
|
||||
names.addAll(seaBiomes);
|
||||
names.addAll(shoreBiomes);
|
||||
names.addAll(riverBiomes);
|
||||
names.addAll(lakeBiomes);
|
||||
spotBiomes.forEach((i) -> names.add(i.getBiome()));
|
||||
ridgeBiomes.forEach((i) -> names.add(i.getBiome()));
|
||||
|
||||
while(!names.isEmpty())
|
||||
{
|
||||
for(String i : new KList<>(names))
|
||||
{
|
||||
if(b.containsKey(i))
|
||||
{
|
||||
names.remove(i);
|
||||
continue;
|
||||
}
|
||||
|
||||
IrisBiome biome = IrisDataManager.loadAnyBiome(i);
|
||||
|
||||
names.remove(i);
|
||||
if(biome == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
names.add(biome.getCarvingBiome());
|
||||
b.put(biome.getLoadKey(), biome);
|
||||
names.addAll(biome.getChildren());
|
||||
}
|
||||
}
|
||||
|
||||
return b.v();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user