mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-12 17:07:55 -04:00
fix version mapping block getting with pre flattening meta data
This commit is contained in:
parent
efe05ed03f
commit
f94adbd3de
@ -101,6 +101,8 @@ class VersionMapping {
|
||||
var isFullyLoaded = false
|
||||
private set
|
||||
|
||||
private var isFlattened = false
|
||||
|
||||
|
||||
var parentMapping: VersionMapping? = null
|
||||
set(value) {
|
||||
@ -115,7 +117,13 @@ class VersionMapping {
|
||||
if (blockState == ProtocolDefinition.NULL_BLOCK_ID) {
|
||||
return null
|
||||
}
|
||||
return blockStateIdMap[blockState] ?: parentMapping?.getBlockState(blockState)
|
||||
return blockStateIdMap[blockState] ?: parentMapping?.getBlockState(blockState) ?: let {
|
||||
if (isFlattened) {
|
||||
null
|
||||
} else {
|
||||
blockStateIdMap[(blockState shr 4) shl 4] // Remove meta data and test again
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun getEntityMetaDataIndex(field: EntityMetaDataFields): Int? {
|
||||
@ -131,6 +139,7 @@ class VersionMapping {
|
||||
}
|
||||
|
||||
fun load(version: Version, pixlyzerData: JsonObject) {
|
||||
isFlattened = version.isFlattened()
|
||||
// pre init stuff
|
||||
loadShapes(pixlyzerData["shapes"]?.asJsonObject)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user