(Properties props, String fileName, String prefix, String logName)
| 1448 | } |
| 1449 | |
| 1450 | private static float[][] readDyeColors(Properties props, String fileName, String prefix, String logName) |
| 1451 | { |
| 1452 | EnumDyeColor[] aenumdyecolor = EnumDyeColor.values(); |
| 1453 | Map<String, EnumDyeColor> map = new HashMap(); |
| 1454 | |
| 1455 | for (int i = 0; i < aenumdyecolor.length; ++i) |
| 1456 | { |
| 1457 | EnumDyeColor enumdyecolor = aenumdyecolor[i]; |
| 1458 | map.put(enumdyecolor.getName(), enumdyecolor); |
| 1459 | } |
| 1460 | |
| 1461 | float[][] afloat1 = new float[aenumdyecolor.length][]; |
| 1462 | int k = 0; |
| 1463 | |
| 1464 | for (Object e : props.keySet()) |
| 1465 | { |
| 1466 | String s = (String) e; |
| 1467 | String s1 = props.getProperty(s); |
| 1468 | |
| 1469 | if (s.startsWith(prefix)) |
| 1470 | { |
| 1471 | String s2 = StrUtils.removePrefix(s, prefix); |
| 1472 | |
| 1473 | if (s2.equals("lightBlue")) |
| 1474 | { |
| 1475 | s2 = "light_blue"; |
| 1476 | } |
| 1477 | |
| 1478 | EnumDyeColor enumdyecolor1 = (EnumDyeColor)map.get(s2); |
| 1479 | int j = parseColor(s1); |
| 1480 | |
| 1481 | if (enumdyecolor1 != null && j >= 0) |
| 1482 | { |
| 1483 | float[] afloat = new float[] {(float)(j >> 16 & 255) / 255.0F, (float)(j >> 8 & 255) / 255.0F, (float)(j & 255) / 255.0F}; |
| 1484 | afloat1[enumdyecolor1.ordinal()] = afloat; |
| 1485 | ++k; |
| 1486 | } |
| 1487 | else |
| 1488 | { |
| 1489 | warn("Invalid color: " + s + " = " + s1); |
| 1490 | } |
| 1491 | } |
| 1492 | } |
| 1493 | |
| 1494 | if (k <= 0) |
| 1495 | { |
| 1496 | return (float[][])null; |
| 1497 | } |
| 1498 | else |
| 1499 | { |
| 1500 | dbg(logName + " colors: " + k); |
| 1501 | return afloat1; |
| 1502 | } |
| 1503 | } |
| 1504 | |
| 1505 | private static float[] getDyeColors(EnumDyeColor dye, float[][] dyeColors, float[] colors) |
| 1506 | { |
no test coverage detected