parent
49bb695af2
commit
a2ecc8b383
@ -130,12 +130,29 @@ class MatteryModelBuilder(resourceLocation: ResourceLocation, existingFileHelper
|
||||
with(face(Direction.valueOf(k.uppercase()))) {
|
||||
check(v is JsonObject) { "Element has invalid face at $k" }
|
||||
|
||||
(v["uv"] as? JsonArray)?.let { uv ->
|
||||
(v["uv"] as? JsonArray)?.also { uv ->
|
||||
check(uv.size() == 4) { "Element at $k has invalid number of uvs ${uv.size()}" }
|
||||
uvs(uv[0].asFloat, uv[1].asFloat, uv[2].asFloat, uv[3].asFloat)
|
||||
}
|
||||
|
||||
(v["texture"] as? JsonPrimitive)?.let {
|
||||
(v["rotation"] as? JsonPrimitive)?.also { rotation ->
|
||||
when (rotation.asInt) {
|
||||
90 -> rotation(FaceRotation.CLOCKWISE_90)
|
||||
-90, 270 -> rotation(FaceRotation.COUNTERCLOCKWISE_90)
|
||||
180, -180 -> rotation(FaceRotation.UPSIDE_DOWN)
|
||||
else -> rotation(FaceRotation.ZERO)
|
||||
}
|
||||
}
|
||||
|
||||
(v["emissivity"] as? JsonPrimitive)?.asInt?.also { emissivity ->
|
||||
emissivity(emissivity)
|
||||
}
|
||||
|
||||
(v["ao"] as? JsonPrimitive)?.asBoolean?.also { ao ->
|
||||
ao(ao)
|
||||
}
|
||||
|
||||
(v["texture"] as? JsonPrimitive)?.also {
|
||||
texture(it.asString)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user