mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-06-18 06:41:08 +00:00
Support weight
This commit is contained in:
@@ -50,7 +50,7 @@ public class IrisBiomePaletteLayer
|
|||||||
private double zoom = 5;
|
private double zoom = 5;
|
||||||
|
|
||||||
@Required
|
@Required
|
||||||
@ArrayType(min = 1, type = String.class)
|
@ArrayType(min = 1, type = IrisBlockData.class)
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
@Desc("The palette of blocks to be used in this layer")
|
@Desc("The palette of blocks to be used in this layer")
|
||||||
private KList<IrisBlockData> palette = new KList<IrisBlockData>().qadd(new IrisBlockData("GRASS_BLOCK"));
|
private KList<IrisBlockData> palette = new KList<IrisBlockData>().qadd(new IrisBlockData("GRASS_BLOCK"));
|
||||||
@@ -105,7 +105,10 @@ public class IrisBiomePaletteLayer
|
|||||||
BlockData bx = ix.getBlockData();
|
BlockData bx = ix.getBlockData();
|
||||||
if(bx != null)
|
if(bx != null)
|
||||||
{
|
{
|
||||||
blockData.add(bx);
|
for(int i = 0; i < ix.getWeight(); i++)
|
||||||
|
{
|
||||||
|
blockData.add(bx);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ import lombok.experimental.Accessors;
|
|||||||
public class IrisBlockData
|
public class IrisBlockData
|
||||||
{
|
{
|
||||||
@RegistryListBlockType
|
@RegistryListBlockType
|
||||||
|
|
||||||
@Required
|
@Required
|
||||||
@DontObfuscate
|
@DontObfuscate
|
||||||
@Desc("The cave zoom. Higher values makes caves spread out further and branch less often, but are thicker.")
|
@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")
|
@Desc("The resource key. Typically Minecraft")
|
||||||
private String key = "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
|
@DontObfuscate
|
||||||
@Desc("Optional properties for this block data such as 'waterlogged': true")
|
@Desc("Optional properties for this block data such as 'waterlogged': true")
|
||||||
private KMap<String, Object> data = new KMap<>();
|
private KMap<String, Object> data = new KMap<>();
|
||||||
|
|||||||
@@ -91,7 +91,10 @@ public class IrisMaterialPalette
|
|||||||
BlockData bx = ix.getBlockData();
|
BlockData bx = ix.getBlockData();
|
||||||
if(bx != null)
|
if(bx != null)
|
||||||
{
|
{
|
||||||
blockData.add(bx);
|
for(int i = 0; i < ix.getWeight(); i++)
|
||||||
|
{
|
||||||
|
blockData.add(bx);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user