mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-17 03:15:35 -04:00
fix parent bug in ResourceLocationRegistry
This commit is contained in:
parent
4c94ae5ffb
commit
6ab220d2a6
@ -26,17 +26,17 @@ class ResourceLocationRegistry(
|
||||
valueIdMap.clear()
|
||||
}
|
||||
|
||||
override fun get(any: Any?): ResourceLocation? {
|
||||
override operator fun get(any: Any?): ResourceLocation? {
|
||||
check(any is Int) { "Don't know how to get $any" }
|
||||
return idValueMap[any]
|
||||
return this[any]
|
||||
}
|
||||
|
||||
override fun get(id: Int): ResourceLocation? {
|
||||
return idValueMap[id]
|
||||
override operator fun get(id: Int): ResourceLocation? {
|
||||
return idValueMap[id] ?: parent?.get(id)
|
||||
}
|
||||
|
||||
override fun getId(value: ResourceLocation): Int {
|
||||
return valueIdMap[value] ?: -1
|
||||
return valueIdMap[value] ?: parent?.getId(value) ?: -1
|
||||
}
|
||||
|
||||
fun initialize(data: Map<ResourceLocation, Any>?, alternative: ResourceLocationRegistry? = null): ResourceLocationRegistry {
|
||||
|
Loading…
x
Reference in New Issue
Block a user