mirror of
https://gitlab.bixilon.de/bixilon/pixlyzer.git
synced 2025-09-28 06:31:08 -04:00
fix more bugs
This commit is contained in:
parent
5fa43d52b1
commit
7deb6659ef
@ -142,13 +142,13 @@ object PixLyzer {
|
|||||||
} else {
|
} else {
|
||||||
File(tempFileOutputPath).renameTo(outputFile)
|
File(tempFileOutputPath).renameTo(outputFile)
|
||||||
println("Generated and saved hash file to ${outputFile.absolutePath}")
|
println("Generated and saved hash file to ${outputFile.absolutePath}")
|
||||||
|
}
|
||||||
|
|
||||||
val assetsIndexJson = Util.readJsonFile(assetsIndex.absolutePath + ".json")
|
val assetsIndexJson = Util.readJsonFile(assetsIndex.absolutePath + ".json")
|
||||||
|
|
||||||
assetsIndexJson.addProperty(versionId, hash)
|
assetsIndexJson.addProperty(versionId, hash)
|
||||||
|
|
||||||
writeJson(assetsIndex.absolutePath, assetsIndexJson)
|
writeJson(assetsIndex.absolutePath, assetsIndexJson)
|
||||||
}
|
|
||||||
|
|
||||||
println("Done in ${System.currentTimeMillis() - startTime}ms")
|
println("Done in ${System.currentTimeMillis() - startTime}ms")
|
||||||
}
|
}
|
||||||
|
@ -206,10 +206,16 @@ object BlockGenerator : Generator(
|
|||||||
try {
|
try {
|
||||||
if (hasColorProperties) {
|
if (hasColorProperties) {
|
||||||
val tintColor = DEFAULT_BLOCK_COLORS.getColor(state, null, null)
|
val tintColor = DEFAULT_BLOCK_COLORS.getColor(state, null, null)
|
||||||
|
when (blockData["tint"]?.asString) {
|
||||||
|
"minecraft:foliage_tint", "minecraft:lily_pad_tint", "minecraft:grass_tint" -> {
|
||||||
|
}
|
||||||
|
else -> {
|
||||||
if (tintColor != -1 && tintColor != 0) {
|
if (tintColor != -1 && tintColor != 0) {
|
||||||
stateData.addProperty("tint_color", tintColor)
|
stateData.addProperty("tint_color", tintColor)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
} catch (exception: Exception) {
|
} catch (exception: Exception) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -266,9 +272,7 @@ object BlockGenerator : Generator(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (multipart.size() > 0 && !stateData.has("render")) {
|
if (multipart.size() > 0 && !stateData.has("render")) {
|
||||||
val multipartWrapper = JsonArray()
|
stateData.add("render", multipart)
|
||||||
multipartWrapper.add(multipart)
|
|
||||||
stateData.add("render", multipartWrapper)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!block.hasDynamicBounds()) {
|
if (!block.hasDynamicBounds()) {
|
||||||
@ -476,26 +480,6 @@ object BlockGenerator : Generator(
|
|||||||
output.addProperty(name, input)
|
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) {
|
private fun addBlockModel(json: JsonElement) {
|
||||||
when (json) {
|
when (json) {
|
||||||
is JsonObject -> {
|
is JsonObject -> {
|
||||||
|
@ -126,6 +126,23 @@ object DimensionGenerator : Generator(
|
|||||||
private fun getDimensions(): MutableSet<Triple<Identifier, Int?, DimensionType>> {
|
private fun getDimensions(): MutableSet<Triple<Identifier, Int?, DimensionType>> {
|
||||||
val types: MutableSet<Triple<Identifier, Int?, DimensionType>> = mutableSetOf()
|
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()) {
|
if (types.isEmpty()) {
|
||||||
for (field in DimensionType::class.java.declaredFields) {
|
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
|
return types
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -171,7 +171,7 @@ object ItemGenerator : Generator(
|
|||||||
private val TOOL_ITEM_GETTER = getGetter(ToolMaterial::class.java, "getMiningSpeed", "getMiningSpeedMultiplier")!!
|
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_BLOCKS_FIELD = MiningToolItem::class.java.getDeclaredField("effectiveBlocks")
|
||||||
private val DIGGER_ITEM_SPEED_FIELD = MiningToolItem::class.java.getDeclaredField("miningSpeed")
|
private val DIGGER_ITEM_SPEED_FIELD = MiningToolItem::class.java.getDeclaredField("miningSpeed")
|
||||||
|
@ -490,7 +490,7 @@
|
|||||||
"HoglinEntity": {
|
"HoglinEntity": {
|
||||||
"data": {
|
"data": {
|
||||||
"IMMUNE_TO_ZOMBIFICATION": "HOGLIN_IMMUNE_TO_ZOMBIFICATION",
|
"IMMUNE_TO_ZOMBIFICATION": "HOGLIN_IMMUNE_TO_ZOMBIFICATION",
|
||||||
"BABY": "HOGLIN_IS_BABY"
|
"BABY": "AGEABLE_IS_BABY"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"AbstractPiglinEntity": {
|
"AbstractPiglinEntity": {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user