mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-13 09:26:11 -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
|
var isFullyLoaded = false
|
||||||
private set
|
private set
|
||||||
|
|
||||||
|
private var isFlattened = false
|
||||||
|
|
||||||
|
|
||||||
var parentMapping: VersionMapping? = null
|
var parentMapping: VersionMapping? = null
|
||||||
set(value) {
|
set(value) {
|
||||||
@ -115,7 +117,13 @@ class VersionMapping {
|
|||||||
if (blockState == ProtocolDefinition.NULL_BLOCK_ID) {
|
if (blockState == ProtocolDefinition.NULL_BLOCK_ID) {
|
||||||
return null
|
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? {
|
fun getEntityMetaDataIndex(field: EntityMetaDataFields): Int? {
|
||||||
@ -131,6 +139,7 @@ class VersionMapping {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun load(version: Version, pixlyzerData: JsonObject) {
|
fun load(version: Version, pixlyzerData: JsonObject) {
|
||||||
|
isFlattened = version.isFlattened()
|
||||||
// pre init stuff
|
// pre init stuff
|
||||||
loadShapes(pixlyzerData["shapes"]?.asJsonObject)
|
loadShapes(pixlyzerData["shapes"]?.asJsonObject)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user