ActuallyAdditions/src/main/java/de/ellpeck/actuallyadditions/common/blocks/metalists/TheColoredLampColors.java
Michael be421af8e2
Big Refactor of the package layout
Ignore this commit for diffs
2020-09-09 15:48:43 +01:00

50 lines
1.4 KiB
Java

package de.ellpeck.actuallyadditions.blocks.metalists;
import net.minecraft.util.IStringSerializable;
public enum TheColoredLampColors implements IStringSerializable {
WHITE("White", "white"),
ORANGE("Orange", "orange"),
MAGENTA("Magenta", "magenta"),
LIGHT_BLUE("LightBlue", "light_blue"),
YELLOW("Yellow", "yellow"),
LIME("Lime", "lime"),
PINK("Pink", "pink"),
GRAY("Gray", "gray"),
LIGHT_GRAY("LightGray", "light_gray"),
CYAN("Cyan", "cyan"),
PURPLE("Purple", "purple"),
BLUE("Blue", "blue"),
BROWN("Brown", "brown"),
GREEN("Green", "green"),
RED("Red", "red"),
BLACK("Black", "black");
public final String regName;
public final String oreName;
TheColoredLampColors(String oreName, String regName) {
this.oreName = oreName;
this.regName = regName;
}
public static TheColoredLampColors getColorFromDyeName(String color) {
if (color.startsWith("dye")) {
String actualName = color.substring(3);
for (int i = 0; i < values().length; i++) {
String aName = values()[i].oreName;
if (aName != null) {
if (aName.equalsIgnoreCase(actualName)) { return values()[i]; }
}
}
}
return null;
}
@Override
public String getName() {
return this.regName;
}
}