More minor fixes to the colors

This commit is contained in:
Calclavia 2014-02-01 13:42:45 +08:00
parent 9ccee1addc
commit b53af54bac
2 changed files with 11 additions and 3 deletions

View file

@ -242,4 +242,14 @@ public class ResourceGenerator
{
return materialNames.size() > id ? materialNames.get(id) : null;
}
public static int getColor(String name)
{
if (name != null && materialColors.containsKey(name))
{
return materialColors.get(name);
}
return 0xFFFFFF;
}
}

View file

@ -21,9 +21,7 @@ public class TileMaterial extends TileAdvanced implements IPacketReceiver
public int getColor()
{
if (name != null)
return ResourceGenerator.materialColors.get(name);
return 0xFFFFFF;
return ResourceGenerator.getColor(name);
}
@Override