get tint index directly from model

This commit is contained in:
octarine-noise
2021-07-13 20:06:45 +02:00
parent 1e69081a2f
commit 8ef84718b5
16 changed files with 74 additions and 54 deletions

View File

@@ -13,11 +13,17 @@ import org.apache.logging.log4j.Level
abstract class ParametrizedModelDiscovery : HasLogger() {
abstract fun processModel(ctx: ModelDiscoveryContext, params: Map<String, String>)
fun Map<String, String>.texture(key: String): ResourceLocation? {
fun Map<String, String>.location(key: String): ResourceLocation? {
val result = get(key)?.let { ResourceLocation(it) }
if (result == null) detailLogger.log(Level.WARN, "Cannot find texture parameter \"$key\"")
return result
}
fun Map<String, String>.int(key: String): Int? {
val result = get(key)?.toInt()
if (result == null) detailLogger.log(Level.WARN, "Cannot find integer parameter \"$key\"")
return result
}
}
class RuleProcessingContext(