9
0
mirror of https://github.com/VolmitSoftware/Iris.git synced 2025-12-31 04:46:40 +00:00

Region rarity

This commit is contained in:
Daniel Mills
2020-08-07 13:36:41 -04:00
parent e5384509cf
commit c158e74fb5
19 changed files with 356 additions and 44 deletions

View File

@@ -6,13 +6,14 @@ import org.bukkit.block.data.BlockData;
import com.volmit.iris.Iris;
import com.volmit.iris.gen.ContextualChunkGenerator;
import com.volmit.iris.gen.atomics.AtomicCache;
import com.volmit.iris.util.RarityCellGenerator;
import com.volmit.iris.util.CNG;
import com.volmit.iris.util.Desc;
import com.volmit.iris.util.DontObfuscate;
import com.volmit.iris.util.IRare;
import com.volmit.iris.util.KList;
import com.volmit.iris.util.KSet;
import com.volmit.iris.util.RNG;
import com.volmit.iris.util.RarityCellGenerator;
import lombok.Data;
import lombok.EqualsAndHashCode;
@@ -21,7 +22,7 @@ import lombok.EqualsAndHashCode;
@Desc("Represents a biome in iris.")
@Data
@EqualsAndHashCode(callSuper = false)
public class IrisBiome extends IrisRegistrant
public class IrisBiome extends IrisRegistrant implements IRare
{
@DontObfuscate
@Desc("This is the human readable name for this biome. This can and should be different than the file name. This is not used for loading biomes in other objects.")
@@ -100,7 +101,7 @@ public class IrisBiome extends IrisRegistrant
private KList<IrisDepositGenerator> deposits = new KList<>();
private transient InferredType inferredType;
private transient AtomicCache<RarityCellGenerator> childrenCell = new AtomicCache<>();
private transient AtomicCache<RarityCellGenerator<IrisBiome>> childrenCell = new AtomicCache<>();
private transient AtomicCache<CNG> biomeGenerator = new AtomicCache<>();
private transient AtomicCache<Integer> maxHeight = new AtomicCache<>();
private transient AtomicCache<KList<IrisBiome>> realChildren = new AtomicCache<>();
@@ -132,11 +133,11 @@ public class IrisBiome extends IrisRegistrant
});
}
public RarityCellGenerator getChildrenGenerator(RNG random, int sig, double scale)
public RarityCellGenerator<IrisBiome> getChildrenGenerator(RNG random, int sig, double scale)
{
return childrenCell.aquire(() ->
{
RarityCellGenerator childrenCell = new RarityCellGenerator(random.nextParallelRNG(sig * 2137));
RarityCellGenerator<IrisBiome> childrenCell = new RarityCellGenerator<IrisBiome>(random.nextParallelRNG(sig * 2137));
childrenCell.setCellScale(scale);
return childrenCell;
});

View File

@@ -182,6 +182,14 @@ public class IrisDimension extends IrisRegistrant
@Desc("Change the size of regions")
private double regionZoom = 1;
@DontObfuscate
@Desc("The shuffle of regions")
private double regionShuffle = 11;
@DontObfuscate
@Desc("The shuffle of land vs sea")
private double continentalShuffle = 99;
@DontObfuscate
@Desc("Disable this to stop placing schematics in biomes")
private boolean placeObjects = true;

View File

@@ -6,6 +6,7 @@ import com.volmit.iris.gen.atomics.AtomicCache;
import com.volmit.iris.util.CNG;
import com.volmit.iris.util.Desc;
import com.volmit.iris.util.DontObfuscate;
import com.volmit.iris.util.IRare;
import com.volmit.iris.util.KList;
import com.volmit.iris.util.KMap;
import com.volmit.iris.util.KSet;
@@ -17,12 +18,16 @@ import lombok.EqualsAndHashCode;
@Desc("Represents an iris region")
@Data
@EqualsAndHashCode(callSuper = false)
public class IrisRegion extends IrisRegistrant
public class IrisRegion extends IrisRegistrant implements IRare
{
@DontObfuscate
@Desc("The name of the region")
private String name = "A Region";
@DontObfuscate
@Desc("The rarity of the region")
private int rarity = 1;
@DontObfuscate
@Desc("The shore ration (How much percent of land should be a shore)")
private double shoreRatio = 0.13;
@@ -182,6 +187,9 @@ public class IrisRegion extends IrisRegistrant
KMap<String, IrisBiome> b = new KMap<>();
KSet<String> names = new KSet<>();
names.addAll(landBiomes);
names.addAll(islandBiomes);
names.addAll(caveBiomes);
names.addAll(skylandBiomes);
names.addAll(seaBiomes);
names.addAll(shoreBiomes);
spotBiomes.forEach((i) -> names.add(i.getBiome()));