models: rename cullface to cull

This commit is contained in:
Bixilon 2023-03-23 16:38:54 +01:00
parent 96ba612fc9
commit 586393ca6d
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4
2 changed files with 4 additions and 4 deletions

View File

@ -36,7 +36,7 @@ class BakedModelTest {
val map: MutableMap<Directions, ModelFace> = mutableMapOf()
for (direction in Directions) {
map[direction] = ModelFace(texture, FaceUV(Vec2(0), Vec2(1)), cullface = direction, rotation = 0)
map[direction] = ModelFace(texture, FaceUV(Vec2(0), Vec2(1)), cull = direction, rotation = 0)
}
return map

View File

@ -27,7 +27,7 @@ data class ModelFace(
val texture: String,
val uv: FaceUV,
val rotation: Int,
val cullface: Directions?,
val cull: Directions?,
val tintIndex: Int = -1,
) {
@ -50,10 +50,10 @@ data class ModelFace(
val uv = data["uv"]?.listCast<Number>()?.let { FaceUV(start = Vec2(it[0], it[1]) / BLOCK_SIZE, end = Vec2(it[2], it[3]) / BLOCK_SIZE) } ?: fallbackUV(direction, from, to)
val rotation = data["rotation"]?.toInt() ?: 0
val cullface = data["cullface"]?.toString()?.let { if (it == "none") null else Directions[it] }
val cull = data["cullface"]?.toString()?.let { if (it == "none") null else Directions[it] }
val tintIndex = data["tintindex"]?.toInt() ?: TintManager.DEFAULT_TINT_INDEX
return ModelFace(texture, uv, rotation, cullface, tintIndex)
return ModelFace(texture, uv, rotation, cull, tintIndex)
}
fun deserialize(from: Vec3, to: Vec3, data: Map<String, JsonObject>): Map<Directions, ModelFace>? {