!updated to latest mmolib

This commit is contained in:
ASangarin 2020-10-16 17:42:12 +02:00
parent 2a8874ae1c
commit 3eb10e65aa
2 changed files with 0 additions and 7 deletions

Binary file not shown.

View File

@ -20,7 +20,6 @@ import net.Indyuce.mmoitems.stat.data.StringData;
import net.Indyuce.mmoitems.stat.data.type.Mergeable; import net.Indyuce.mmoitems.stat.data.type.Mergeable;
import net.Indyuce.mmoitems.stat.data.type.StatData; import net.Indyuce.mmoitems.stat.data.type.StatData;
import net.Indyuce.mmoitems.stat.type.ItemStat; import net.Indyuce.mmoitems.stat.type.ItemStat;
import net.mmogroup.mmolib.api.weight.WeightedContainer;
public class MMOItemBuilder { public class MMOItemBuilder {
private final MMOItem mmoitem; private final MMOItem mmoitem;
@ -65,15 +64,9 @@ public class MMOItemBuilder {
mmoitem.setData(ItemStat.TIER, new StringData(tier.getId())); mmoitem.setData(ItemStat.TIER, new StringData(tier.getId()));
if (level > 0) if (level > 0)
mmoitem.setData(ItemStat.ITEM_LEVEL, new DoubleData(level)); mmoitem.setData(ItemStat.ITEM_LEVEL, new DoubleData(level));
//TODO: Rewrite weightedcontainer to support double values
//TODO: Rewrite weightedcontainer to support no shuffle
WeightedContainer<TemplateModifier> weighted = new WeightedContainer<>();
// roll item gen modifiers // roll item gen modifiers
for (TemplateModifier modifier : rollModifiers(template)) { for (TemplateModifier modifier : rollModifiers(template)) {
weighted.add(modifier.getWeight(), modifier);
// roll modifier chance // roll modifier chance
// only apply if enough item weight // only apply if enough item weight
if (!modifier.rollChance() && modifier.getWeight() > capacity) if (!modifier.rollChance() && modifier.getWeight() > capacity)