mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 18:23:06 +00:00
Support double plants and fix scatter chances
This commit is contained in:
parent
b61a71b3b4
commit
30ffc8cd11
@ -556,11 +556,16 @@ public class IrisGenerator extends ParallaxWorldGenerator
|
||||
|
||||
else
|
||||
{
|
||||
MB mbx = biome.getScatterChanceSingle(scatter(wx, h, wz));
|
||||
MB mbx = biome.getScatterChanceSingle(scatter(wx, h, wz), scatter(wz, h, wx));
|
||||
|
||||
if(!mbx.material.equals(Material.AIR))
|
||||
{
|
||||
data.setBlock(x, h + 1, z, mbx.material, mbx.data);
|
||||
|
||||
if(mbx.material.equals(Material.DOUBLE_PLANT))
|
||||
{
|
||||
data.setBlock(x, h + 2, z, mbx.material, (byte) 10);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -599,19 +599,31 @@ public class IrisBiome
|
||||
return scatterChance;
|
||||
}
|
||||
|
||||
public MB getScatterChanceSingle(double d)
|
||||
public MB getScatterChanceSingle(double d, double aux)
|
||||
{
|
||||
KList<MB> a = new KList<>();
|
||||
|
||||
for(MB i : getScatterChance().keySet())
|
||||
{
|
||||
if(d < getScatterChance().get(i))
|
||||
{
|
||||
return i;
|
||||
a.add(i);
|
||||
}
|
||||
}
|
||||
|
||||
if(a.isEmpty())
|
||||
{
|
||||
return MB.of(Material.AIR);
|
||||
}
|
||||
|
||||
if(a.size() == 1)
|
||||
{
|
||||
return a.get(0);
|
||||
}
|
||||
|
||||
return a.get((int) (aux * (a.size() - 1)));
|
||||
}
|
||||
|
||||
public static KList<IrisBiome> getBiomes()
|
||||
{
|
||||
return map.v();
|
||||
|
Loading…
x
Reference in New Issue
Block a user