Mekanism-tilera-Edition/common/mekanism/api/gas/EnumGas.java

47 lines
853 B
Java
Raw Normal View History

package mekanism.api.gas;
import net.minecraft.util.Icon;
2013-07-20 18:10:14 +02:00
import net.minecraft.util.ResourceLocation;
/**
* The gasses currently available in Mekanism.
* @author AidanBrady
*
*/
public enum EnumGas
{
NONE("None", null, null),
OXYGEN("Oxygen", null, null),
HYDROGEN("Hydrogen", null, null);
public String name;
public Icon gasIcon;
2013-07-20 18:10:14 +02:00
public ResourceLocation texturePath;
public static EnumGas getFromName(String gasName)
{
for(EnumGas gas : values())
{
if(gasName.contains(gas.name))
{
return gas;
}
}
System.out.println("[Mekanism] Invalid gas identifier when retrieving with name.");
return NONE;
}
public boolean hasTexture()
{
return gasIcon != null && texturePath != null;
}
2013-07-20 18:10:14 +02:00
private EnumGas(String s, Icon icon, ResourceLocation path)
{
name = s;
gasIcon = icon;
texturePath = path;
}
}