This commit is contained in:
Daniel Mills
2021-07-31 22:32:14 -04:00
parent 9a11021560
commit 6b97acdb50
12 changed files with 204 additions and 97 deletions

View File

@@ -305,9 +305,13 @@ public interface ProceduralStream<T> extends ProceduralLayer, Interpolated<T> {
@SuppressWarnings("unchecked")
default <V> ProceduralStream<V> selectRarity(V... types) {
KList<V> rarityTypes = new KList<>();
int totalRarity = 0;
for (V i : types) {
totalRarity += IRare.get(i);
}
for (V i : types) {
rarityTypes.addMultiple(i, IRare.get(i));
rarityTypes.addMultiple(i, totalRarity / IRare.get(i));
}
return new SelectionStream<V>(this, rarityTypes);