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));
}
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));
}
Aggregations