mirror of
https://gitlab.bixilon.de/bixilon/pixlyzer.git
synced 2025-09-25 05:01:50 -04:00
fix multipart generation
This commit is contained in:
parent
32bb7bb75f
commit
21ca745c54
@ -164,5 +164,5 @@ object PixLyzer {
|
||||
}
|
||||
|
||||
|
||||
private val initializeGameVersionMethod = getGetter(getClass("net.minecraft.SharedConstants"), "method_36208")
|
||||
private val initializeGameVersionMethod = getGetter(getClass("net.minecraft.SharedConstants"), "createGameVersion", "method_36208")
|
||||
}
|
||||
|
@ -73,7 +73,7 @@ object BlockGenerator : Generator(
|
||||
|
||||
val render = Util.readJsonMinecraftResource("assets/${resourceIdentifier.namespace}/blockstates/${resourceIdentifier.path}.json")
|
||||
|
||||
val multipartVariants: MutableMap<MutableMap<String, MutableSet<String>>, JsonElement> = mutableMapOf()
|
||||
val multipartVariants: MutableMap<MutableMap<String, MutableSet<String>>, MutableList<JsonElement>> = mutableMapOf()
|
||||
|
||||
|
||||
render["multipart"]?.asJsonArray?.let {
|
||||
@ -108,7 +108,7 @@ object BlockGenerator : Generator(
|
||||
}
|
||||
addBlockModel(condition["apply"])
|
||||
for (propertyMap in properties) {
|
||||
multipartVariants[propertyMap] = condition["apply"]
|
||||
multipartVariants.getOrPut(propertyMap, { mutableListOf() }).add(condition["apply"])
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -244,7 +244,7 @@ object BlockGenerator : Generator(
|
||||
}
|
||||
}
|
||||
val multipart = JsonArray()
|
||||
for ((properties, element) in multipartVariants) {
|
||||
for ((properties, elementList) in multipartVariants) {
|
||||
var valid = true
|
||||
for ((propertyName, values) in properties) {
|
||||
if (!propertyData.has(propertyName)) {
|
||||
@ -257,15 +257,17 @@ object BlockGenerator : Generator(
|
||||
}
|
||||
}
|
||||
if (valid) {
|
||||
if (element is JsonArray) {
|
||||
for (apply in element) {
|
||||
if (!multipart.contains(apply)) {
|
||||
multipart.add(apply)
|
||||
for (element in elementList) {
|
||||
if (element is JsonArray) {
|
||||
for (apply in element) {
|
||||
if (!multipart.contains(apply)) {
|
||||
multipart.add(apply)
|
||||
}
|
||||
}
|
||||
} else if (element is JsonObject) {
|
||||
if (!multipart.contains(element)) {
|
||||
multipart.add(element)
|
||||
}
|
||||
}
|
||||
} else if (element is JsonObject) {
|
||||
if (!multipart.contains(element)) {
|
||||
multipart.add(element)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user