mirror of
https://gitlab.bixilon.de/bixilon/pixlyzer.git
synced 2025-09-25 13:11:30 -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 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 {
|
render["multipart"]?.asJsonArray?.let {
|
||||||
@ -108,7 +108,7 @@ object BlockGenerator : Generator(
|
|||||||
}
|
}
|
||||||
addBlockModel(condition["apply"])
|
addBlockModel(condition["apply"])
|
||||||
for (propertyMap in properties) {
|
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()
|
val multipart = JsonArray()
|
||||||
for ((properties, element) in multipartVariants) {
|
for ((properties, elementList) in multipartVariants) {
|
||||||
var valid = true
|
var valid = true
|
||||||
for ((propertyName, values) in properties) {
|
for ((propertyName, values) in properties) {
|
||||||
if (!propertyData.has(propertyName)) {
|
if (!propertyData.has(propertyName)) {
|
||||||
@ -257,15 +257,17 @@ object BlockGenerator : Generator(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (valid) {
|
if (valid) {
|
||||||
if (element is JsonArray) {
|
for (element in elementList) {
|
||||||
for (apply in element) {
|
if (element is JsonArray) {
|
||||||
if (!multipart.contains(apply)) {
|
for (apply in element) {
|
||||||
multipart.add(apply)
|
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