diff options
| author | bculkin2442 <bjculkin@mix.wvu.edu> | 2019-09-04 22:24:39 -0400 |
|---|---|---|
| committer | bculkin2442 <bjculkin@mix.wvu.edu> | 2019-09-04 22:24:39 -0400 |
| commit | cdbbd891c43e082a36a32e49420bf87b6edd28e0 (patch) | |
| tree | c3a970f6cc05a74e3c1fec6c670a07055e21c01d /src/main/java/darkknight/jewelrycraft/random/WeightedRandomItem.java | |
| parent | 857d548f591b8f3770befd2535985959fd870474 (diff) | |
More affix work
Diffstat (limited to 'src/main/java/darkknight/jewelrycraft/random/WeightedRandomItem.java')
| -rwxr-xr-x | src/main/java/darkknight/jewelrycraft/random/WeightedRandomItem.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/main/java/darkknight/jewelrycraft/random/WeightedRandomItem.java b/src/main/java/darkknight/jewelrycraft/random/WeightedRandomItem.java index 351046b..dba4caa 100755 --- a/src/main/java/darkknight/jewelrycraft/random/WeightedRandomItem.java +++ b/src/main/java/darkknight/jewelrycraft/random/WeightedRandomItem.java @@ -51,10 +51,15 @@ public class WeightedRandomItem extends WeightedRandom.Item { public ItemStack getItem(Random random) {
ItemStack itemstack = this.item.copy();
- if (maxMeta > 0)
+
+ if (maxMeta > 0) {
itemstack.setItemDamage(minMeta + random.nextInt(maxMeta - minMeta));
- if (maxItem > 1)
+ }
+
+ if (maxItem > 1) {
itemstack.stackSize = this.minItem + random.nextInt(this.maxItem - this.minItem + 1);
+ }
+
return itemstack;
}
}
\ No newline at end of file |
