fix saturation threshold not being respected for grass textures

This commit is contained in:
octarine-noise
2016-12-04 20:12:18 +01:00
parent 931dca6f3f
commit 59e4d0c602
3 changed files with 14 additions and 2 deletions

View File

@@ -63,7 +63,7 @@ val BufferedImage.asStream: InputStream get() =
* and the result transformed back to the RGB color space.
*/
val TextureAtlasSprite.averageColor: Int? get() {
val locationNoDirs = ResourceLocation(iconName)
val locationNoDirs = ResourceLocation(iconName).stripStart("blocks/")
val locationWithDirs = ResourceLocation(locationNoDirs.resourceDomain, "textures/blocks/%s.png".format(locationNoDirs.resourcePath))
val image = resourceManager[locationWithDirs]?.loadImage() ?: return null