mirror of
https://gitlab.bixilon.de/bixilon/pixlyzer.git
synced 2025-09-24 04:21:59 -04:00
fix 1.16 generation (failed because of max model offset)
This commit is contained in:
parent
bfd0af21aa
commit
fd4bf29236
@ -89,7 +89,9 @@ object BlockGenerator : Generator(
|
||||
val offsetType = OFFSET_TYPE_NAME_METHOD.invoke(BLOCK_GET_OFFSET_TYPE.invoke(block)) as String
|
||||
if (offsetType != "NONE") {
|
||||
blockData.addProperty("offset_type", offsetType.lowercase(Locale.getDefault()))
|
||||
blockData.addProperty("max_model_offset", block.maxModelOffset)
|
||||
BLOCK_GET_MAX_OFFSET?.invoke(block)?.let {
|
||||
blockData.addProperty("max_model_offset", it as Float)
|
||||
}
|
||||
}
|
||||
|
||||
val render = Util.readJsonMinecraftResource("assets/${resourceIdentifier.namespace}/blockstates/${resourceIdentifier.path}.json")
|
||||
@ -425,6 +427,7 @@ object BlockGenerator : Generator(
|
||||
BlockState::class.java.getMethod("getOffsetPos", BlockView::class.java, BlockPos::class.java)
|
||||
}
|
||||
|
||||
private val BLOCK_GET_MAX_OFFSET = getGetter(getClass("net.minecraft.block.AbstractBlock"), "getMaxModelOffset")
|
||||
private val BLOCK_GET_OFFSET_TYPE = getClass("net.minecraft.block.AbstractBlock", "net.minecraft.block.Block")!!.getMethod("getOffsetType")
|
||||
private val OFFSET_TYPE_NAME_METHOD = getClass("net.minecraft.block.AbstractBlock\$OffsetType", "net.minecraft.block.Block\$OffsetType")!!.getMethod("name")
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user