9
0
mirror of https://github.com/VolmitSoftware/Iris.git synced 2025-12-25 10:09:14 +00:00

Support weight

This commit is contained in:
Daniel Mills
2020-09-09 22:52:29 -04:00
parent c418683b3d
commit 352adbc9cb
3 changed files with 13 additions and 4 deletions

View File

@@ -50,7 +50,7 @@ public class IrisBiomePaletteLayer
private double zoom = 5;
@Required
@ArrayType(min = 1, type = String.class)
@ArrayType(min = 1, type = IrisBlockData.class)
@DontObfuscate
@Desc("The palette of blocks to be used in this layer")
private KList<IrisBlockData> palette = new KList<IrisBlockData>().qadd(new IrisBlockData("GRASS_BLOCK"));
@@ -105,7 +105,10 @@ public class IrisBiomePaletteLayer
BlockData bx = ix.getBlockData();
if(bx != null)
{
blockData.add(bx);
for(int i = 0; i < ix.getWeight(); i++)
{
blockData.add(bx);
}
}
}

View File

@@ -24,7 +24,6 @@ import lombok.experimental.Accessors;
public class IrisBlockData
{
@RegistryListBlockType
@Required
@DontObfuscate
@Desc("The cave zoom. Higher values makes caves spread out further and branch less often, but are thicker.")
@@ -34,6 +33,10 @@ public class IrisBlockData
@Desc("The resource key. Typically Minecraft")
private String key = "minecraft";
@DontObfuscate
@Desc("The weight is used when this block data is inside of a list of blockdata. A weight of two is just as if you placed two of the same block data values in the same list making it more common when randomly picked.")
private int weight = 1;
@DontObfuscate
@Desc("Optional properties for this block data such as 'waterlogged': true")
private KMap<String, Object> data = new KMap<>();

View File

@@ -91,7 +91,10 @@ public class IrisMaterialPalette
BlockData bx = ix.getBlockData();
if(bx != null)
{
blockData.add(bx);
for(int i = 0; i < ix.getWeight(); i++)
{
blockData.add(bx);
}
}
}