mirror of
https://gitlab.bixilon.de/bixilon/pixlyzer.git
synced 2025-09-27 22:20:14 -04:00
fix more bugs
This commit is contained in:
parent
5fa43d52b1
commit
7deb6659ef
@ -142,14 +142,14 @@ object PixLyzer {
|
||||
} else {
|
||||
File(tempFileOutputPath).renameTo(outputFile)
|
||||
println("Generated and saved hash file to ${outputFile.absolutePath}")
|
||||
|
||||
val assetsIndexJson = Util.readJsonFile(assetsIndex.absolutePath + ".json")
|
||||
|
||||
assetsIndexJson.addProperty(versionId, hash)
|
||||
|
||||
writeJson(assetsIndex.absolutePath, assetsIndexJson)
|
||||
}
|
||||
|
||||
val assetsIndexJson = Util.readJsonFile(assetsIndex.absolutePath + ".json")
|
||||
|
||||
assetsIndexJson.addProperty(versionId, hash)
|
||||
|
||||
writeJson(assetsIndex.absolutePath, assetsIndexJson)
|
||||
|
||||
println("Done in ${System.currentTimeMillis() - startTime}ms")
|
||||
}
|
||||
|
||||
|
@ -206,8 +206,14 @@ object BlockGenerator : Generator(
|
||||
try {
|
||||
if (hasColorProperties) {
|
||||
val tintColor = DEFAULT_BLOCK_COLORS.getColor(state, null, null)
|
||||
if (tintColor != -1 && tintColor != 0) {
|
||||
stateData.addProperty("tint_color", tintColor)
|
||||
when (blockData["tint"]?.asString) {
|
||||
"minecraft:foliage_tint", "minecraft:lily_pad_tint", "minecraft:grass_tint" -> {
|
||||
}
|
||||
else -> {
|
||||
if (tintColor != -1 && tintColor != 0) {
|
||||
stateData.addProperty("tint_color", tintColor)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (exception: Exception) {
|
||||
@ -266,9 +272,7 @@ object BlockGenerator : Generator(
|
||||
}
|
||||
|
||||
if (multipart.size() > 0 && !stateData.has("render")) {
|
||||
val multipartWrapper = JsonArray()
|
||||
multipartWrapper.add(multipart)
|
||||
stateData.add("render", multipartWrapper)
|
||||
stateData.add("render", multipart)
|
||||
}
|
||||
|
||||
if (!block.hasDynamicBounds()) {
|
||||
@ -476,26 +480,6 @@ object BlockGenerator : Generator(
|
||||
output.addProperty(name, input)
|
||||
}
|
||||
|
||||
|
||||
fun getType(input: String): Any {
|
||||
try {
|
||||
return Integer.parseInt(input)
|
||||
} catch (exception: Exception) {
|
||||
}
|
||||
|
||||
try {
|
||||
when (input) {
|
||||
"true" -> return true
|
||||
"false" -> return false
|
||||
else -> {
|
||||
}
|
||||
}
|
||||
} catch (exception: Exception) {
|
||||
}
|
||||
|
||||
return input
|
||||
}
|
||||
|
||||
private fun addBlockModel(json: JsonElement) {
|
||||
when (json) {
|
||||
is JsonObject -> {
|
||||
|
@ -126,6 +126,23 @@ object DimensionGenerator : Generator(
|
||||
private fun getDimensions(): MutableSet<Triple<Identifier, Int?, DimensionType>> {
|
||||
val types: MutableSet<Triple<Identifier, Int?, DimensionType>> = mutableSetOf()
|
||||
|
||||
if (types.isEmpty()) {
|
||||
val dimensionRegistry = getField(Registry::class.java, "DIMENSION", "DIMENSION_TYPE")
|
||||
|
||||
try {
|
||||
dimensionRegistry?.get(null)?.let {
|
||||
check(it is Registry<*>)
|
||||
val registryGetKeyMethod = Registry::class.java.getDeclaredMethod("getId", Object::class.java)
|
||||
val dimensionTypeGetIdMethod = DimensionType::class.java.getDeclaredMethod("getRawId")
|
||||
for (entry in it) {
|
||||
check(entry is DimensionType)
|
||||
types.add(Triple(registryGetKeyMethod.invoke(it, entry) as Identifier, dimensionTypeGetIdMethod.invoke(entry) as Int, entry))
|
||||
|
||||
}
|
||||
}
|
||||
} catch (exception: Exception) {
|
||||
}
|
||||
}
|
||||
|
||||
if (types.isEmpty()) {
|
||||
for (field in DimensionType::class.java.declaredFields) {
|
||||
@ -154,20 +171,6 @@ object DimensionGenerator : Generator(
|
||||
}
|
||||
}
|
||||
|
||||
if (types.isEmpty()) {
|
||||
val dimensionRegistry = getField(Registry::class.java, "DIMENSION")
|
||||
|
||||
dimensionRegistry?.get(null)?.let {
|
||||
check(it is Registry<*>)
|
||||
val registryGetKeyMethod = Registry::class.java.getDeclaredMethod("getId", Object::class.java)
|
||||
val dimensionTypeGetIdMethod = DimensionType::class.java.getDeclaredMethod("getRawId")
|
||||
for (entry in it) {
|
||||
check(entry is DimensionType)
|
||||
types.add(Triple(registryGetKeyMethod.invoke(it, entry) as Identifier, dimensionTypeGetIdMethod.invoke(entry) as Int, entry))
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
return types
|
||||
}
|
||||
|
||||
|
@ -171,7 +171,7 @@ object ItemGenerator : Generator(
|
||||
private val TOOL_ITEM_GETTER = getGetter(ToolMaterial::class.java, "getMiningSpeed", "getMiningSpeedMultiplier")!!
|
||||
|
||||
|
||||
private val IS_FIRE_RESISTANT_FIELD = getField(Item::class.java, "blocks")
|
||||
private val IS_FIRE_RESISTANT_FIELD = getField(Item::class.java, "fireproof")
|
||||
|
||||
private val DIGGER_ITEM_BLOCKS_FIELD = MiningToolItem::class.java.getDeclaredField("effectiveBlocks")
|
||||
private val DIGGER_ITEM_SPEED_FIELD = MiningToolItem::class.java.getDeclaredField("miningSpeed")
|
||||
|
@ -490,7 +490,7 @@
|
||||
"HoglinEntity": {
|
||||
"data": {
|
||||
"IMMUNE_TO_ZOMBIFICATION": "HOGLIN_IMMUNE_TO_ZOMBIFICATION",
|
||||
"BABY": "HOGLIN_IS_BABY"
|
||||
"BABY": "AGEABLE_IS_BABY"
|
||||
}
|
||||
},
|
||||
"AbstractPiglinEntity": {
|
||||
|
Loading…
x
Reference in New Issue
Block a user