Search in sources :

Example 1 with ChemicalRoomStateEnum

use of minechem.item.ChemicalRoomStateEnum in project Minechem by iopleke.

the class Chemicals method addElement.

@ZenMethod
public static void addElement(int id, String name, String descriptiveName, String classification, String roomState, String radioactivity) {
    if (id < 0) {
        throw new IllegalArgumentException(id + " is invalid");
    }
    if (ElementEnum.getByID(id) != null) {
        throw new IllegalArgumentException(id + ": " + name + " is already registered as an element");
    }
    ElementClassificationEnum eClass = InputHelper.getClassification(classification);
    ChemicalRoomStateEnum state = InputHelper.getRoomState(roomState);
    RadiationEnum radiation = InputHelper.getRadiation(radioactivity);
    MineTweakerAPI.apply(new AddElementAction(id, name, descriptiveName, eClass, state, radiation));
}
Also used : RadiationEnum(minechem.radiation.RadiationEnum) ChemicalRoomStateEnum(minechem.item.ChemicalRoomStateEnum) ElementClassificationEnum(minechem.item.element.ElementClassificationEnum) ZenMethod(stanhebben.zenscript.annotations.ZenMethod)

Example 2 with ChemicalRoomStateEnum

use of minechem.item.ChemicalRoomStateEnum in project Minechem by iopleke.

the class Chemicals method addMolecule.

@ZenMethod
public static void addMolecule(String name, int id, String roomState, IIngredient[] chemicals) {
    ChemicalRoomStateEnum state = InputHelper.getRoomState(roomState);
    if (MoleculeEnum.getByName(name) != null || MoleculeEnum.getById(id) != null) {
        throw new IllegalArgumentException(name + " is already registered as a molecule");
    }
    ArrayList<PotionChemical> chem = InputHelper.getChemicals(chemicals);
    PotionChemical[] chemical = chem.toArray(new PotionChemical[chem.size()]);
    MineTweakerAPI.apply(new AddMoleculeAction(name, id, state, chemical));
}
Also used : PotionChemical(minechem.potion.PotionChemical) ChemicalRoomStateEnum(minechem.item.ChemicalRoomStateEnum) ZenMethod(stanhebben.zenscript.annotations.ZenMethod)

Aggregations

ChemicalRoomStateEnum (minechem.item.ChemicalRoomStateEnum)2 ZenMethod (stanhebben.zenscript.annotations.ZenMethod)2 ElementClassificationEnum (minechem.item.element.ElementClassificationEnum)1 PotionChemical (minechem.potion.PotionChemical)1 RadiationEnum (minechem.radiation.RadiationEnum)1