ActuallyAdditions/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/metalists/TheColoredLampColors.java

55 lines
1.4 KiB
Java
Raw Normal View History

2015-08-29 14:33:25 +02:00
/*
2016-05-16 22:52:27 +02:00
* This file ("TheColoredLampColors.java") is part of the Actually Additions mod for Minecraft.
2015-08-29 14:33:25 +02:00
* It is created and owned by Ellpeck and distributed
* under the Actually Additions License to be found at
2016-05-16 22:52:27 +02:00
* http://ellpeck.de/actaddlicense
2015-08-29 14:33:25 +02:00
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
*
2016-05-16 22:54:42 +02:00
* © 2015-2016 Ellpeck
2015-08-29 14:33:25 +02:00
*/
2016-01-05 04:47:35 +01:00
package de.ellpeck.actuallyadditions.mod.blocks.metalists;
2015-06-28 21:28:58 +02:00
2016-05-10 18:48:35 +02:00
import java.util.Locale;
public enum TheColoredLampColors{
2015-06-28 21:28:58 +02:00
WHITE("White"),
ORANGE("Orange"),
MAGENTA("Magenta"),
LIGHT_BLUE("LightBlue"),
YELLOW("Yellow"),
LIME("Lime"),
PINK("Pink"),
GRAY("Gray"),
LIGHT_GRAY("LightGray"),
CYAN("Cyan"),
PURPLE("Purple"),
BLUE("Blue"),
BROWN("Brown"),
GREEN("Green"),
RED("Red"),
BLACK("Black");
2016-05-19 20:05:12 +02:00
public final String name;
2015-06-28 21:28:58 +02:00
TheColoredLampColors(String name){
this.name = name;
}
public static TheColoredLampColors getColorFromDyeName(String color){
2015-06-29 20:55:06 +02:00
if(color.substring(0, 3).equals("dye")){
String actualName = color.substring(3);
2016-05-16 22:52:27 +02:00
for(int i = 0; i < values().length; i++){
String aName = values()[i].name;
if(aName != null){
if(aName.toLowerCase(Locale.ROOT).equals(actualName.toLowerCase(Locale.ROOT))){
return values()[i];
2016-05-10 18:48:35 +02:00
}
2015-10-03 10:16:18 +02:00
}
2015-06-29 20:55:06 +02:00
}
2015-06-28 21:28:58 +02:00
}
return null;
}
}