Dieser Commit ist enthalten in:
Ursprung
ea37dc8287
Commit
2b3b885a7b
@ -40,8 +40,7 @@ import java.util.Random;
|
||||
public abstract class SpecialItem {
|
||||
|
||||
private static final Random random = new Random();
|
||||
private static long missileCount = 0;
|
||||
private static long supportCount = 0;
|
||||
private static long count = 0;
|
||||
|
||||
private static List<SpecialItem> supportItems = new ArrayList<>();
|
||||
private static List<SpecialItem> missileItems = new ArrayList<>();
|
||||
@ -111,20 +110,12 @@ public abstract class SpecialItem {
|
||||
}
|
||||
|
||||
public static ItemStack getRandomItem() {
|
||||
double missile = missileCount * Config.MissileChance;
|
||||
double support = supportCount;
|
||||
double missileChance;
|
||||
if (missile == 0 && support == 0) {
|
||||
missileChance = 0.5;
|
||||
} else {
|
||||
missileChance = support / (support + missile);
|
||||
}
|
||||
|
||||
double missileChance = Config.MissileChance + (-count) * 0.1;
|
||||
if (random.nextDouble() > missileChance) {
|
||||
supportCount++;
|
||||
count++;
|
||||
return supportItems.get(random.nextInt(supportItems.size())).getItem();
|
||||
} else {
|
||||
missileCount++;
|
||||
count--;
|
||||
return missileItems.get(random.nextInt(missileItems.size())).getItem();
|
||||
}
|
||||
}
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren