@Override public void setupFromNBT(NBTTagCompound tagCompound, int dim, int x, int y, int z) { if (tagCompound != null) { line = tagCompound.getString("text"); if (tagCompound.hasKey("color")) { color = tagCompound.getInteger("color"); } else { color = 0xffffff; } if (tagCompound.hasKey("rfcolor")) { rfcolor = tagCompound.getInteger("rfcolor"); } else { rfcolor = 0xffffff; } if (tagCompound.hasKey("rfcolor_neg")) { rfcolorNeg = tagCompound.getInteger("rfcolor_neg"); } else { rfcolorNeg = 0xffffff; } hidebar = tagCompound.getBoolean("hidebar"); hidetext = tagCompound.getBoolean("hidetext"); showdiff = tagCompound.getBoolean("showdiff"); showpct = tagCompound.getBoolean("showpct"); format = FormatStyle.values()[tagCompound.getInteger("format")]; } }
public static FormatStyle fromString(String styleAsString) { String upperCase = styleAsString.toUpperCase(); return FormatStyle.valueOf(upperCase); }