Search in sources :

Example 1 with IConstellationSpecialShowup

use of hellfirepvp.astralsorcery.common.constellation.IConstellationSpecialShowup in project AstralSorcery by HellFirePvP.

the class DistributionHandler method updateDistribution.

private void updateDistribution(World world) {
    MoonPhase current = MoonPhase.fromWorld(world);
    Map<IConstellation, Float> distribution = new HashMap<>(this.dayDistributionMap.get(current.ordinal()));
    for (IConstellationSpecialShowup special : ConstellationRegistry.getSpecialShowupConstellations()) {
        if (special.doesShowUp(world, lastRecordedDay)) {
            distribution.put(special, MathHelper.clamp(special.getDistribution(world, lastRecordedDay, true), 0F, 1F));
        } else {
            distribution.put(special, MathHelper.clamp(special.getDistribution(world, lastRecordedDay, false), 0F, 1F));
        }
    }
    this.activeDistribution = distribution;
}
Also used : MoonPhase(hellfirepvp.astralsorcery.common.base.MoonPhase) HashMap(java.util.HashMap) IConstellation(hellfirepvp.astralsorcery.common.constellation.IConstellation) IConstellationSpecialShowup(hellfirepvp.astralsorcery.common.constellation.IConstellationSpecialShowup)

Aggregations

MoonPhase (hellfirepvp.astralsorcery.common.base.MoonPhase)1 IConstellation (hellfirepvp.astralsorcery.common.constellation.IConstellation)1 IConstellationSpecialShowup (hellfirepvp.astralsorcery.common.constellation.IConstellationSpecialShowup)1 HashMap (java.util.HashMap)1