Search in sources :

Example 1 with RequirementStarlight

use of com.warmthdawn.mod.gugu_utils.modularmachenary.requirements.RequirementStarlight in project gugu-utils by ParaParty.

the class RequirementTypeStarlight method gererateRequirementPerTick.

@Override
public ComponentRequirementAdapter.PerTick<Integer> gererateRequirementPerTick(IOType type, JsonObject obj) {
    JsonPrimitive constellationStr = tryGet(obj, "constellation", false);
    IConstellation constellation = null;
    if (constellationStr != null && constellationStr.isString()) {
        constellation = ConstellationRegistry.getConstellationByName(constellationStr.getAsString());
        if (constellation == null) {
            GuGuUtils.logger.warn("Couldn't find constellation " + constellationStr.getAsString());
        }
    }
    return new RequirementStarlight(tryGet(obj, "starlight", true).getAsInt(), constellation, type);
}
Also used : JsonPrimitive(com.google.gson.JsonPrimitive) RequirementStarlight(com.warmthdawn.mod.gugu_utils.modularmachenary.requirements.RequirementStarlight) IConstellation(hellfirepvp.astralsorcery.common.constellation.IConstellation)

Aggregations

JsonPrimitive (com.google.gson.JsonPrimitive)1 RequirementStarlight (com.warmthdawn.mod.gugu_utils.modularmachenary.requirements.RequirementStarlight)1 IConstellation (hellfirepvp.astralsorcery.common.constellation.IConstellation)1