mirror of
https://github.com/songoda/UltimateKits.git
synced 2024-11-08 11:41:28 +01:00
Count failed chances as successful attempts.
This commit is contained in:
parent
d931173733
commit
c23802ec69
@ -306,7 +306,6 @@ public class Kit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean generateRandomItem(List<KitItem> innerContents, int itemGiveAmount, Player player) {
|
private boolean generateRandomItem(List<KitItem> innerContents, int itemGiveAmount, Player player) {
|
||||||
|
|
||||||
if (innerContents.size() != itemGiveAmount || kitAnimation != KitAnimation.NONE)
|
if (innerContents.size() != itemGiveAmount || kitAnimation != KitAnimation.NONE)
|
||||||
Collections.shuffle(innerContents);
|
Collections.shuffle(innerContents);
|
||||||
|
|
||||||
@ -314,8 +313,8 @@ public class Kit {
|
|||||||
if (itemGiveAmount == 0) break;
|
if (itemGiveAmount == 0) break;
|
||||||
double ch = item.getChance() == 0 ? 100 : item.getChance();
|
double ch = item.getChance() == 0 ? 100 : item.getChance();
|
||||||
double rand = Math.random() * 100;
|
double rand = Math.random() * 100;
|
||||||
|
itemGiveAmount--;
|
||||||
if (rand < ch || ch == 100) {
|
if (rand < ch || ch == 100) {
|
||||||
itemGiveAmount--;
|
|
||||||
|
|
||||||
ItemStack parseStack = item.getContent().process(player);
|
ItemStack parseStack = item.getContent().process(player);
|
||||||
if (kitAnimation != KitAnimation.NONE) {
|
if (kitAnimation != KitAnimation.NONE) {
|
||||||
|
Loading…
Reference in New Issue
Block a user