Search in sources :

Example 1 with ElementClassificationEnum

use of minechem.item.element.ElementClassificationEnum 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)

Aggregations

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