mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-15 18:34:56 -04:00
index assets manager: ignore realms resources
This should reduce size of saved assets and bandwidth usage (not a lot, but some MB)
This commit is contained in:
parent
d90ccd3780
commit
abbf5d0f84
@ -102,7 +102,7 @@ class IndexAssetsManager(
|
||||
check(data is Map<*, *>)
|
||||
val name = path.toAssetName(false) ?: continue
|
||||
|
||||
val type = IndexAssetsType.determinate(name.path)
|
||||
val type = IndexAssetsType.determinate(name)
|
||||
if (type == null || type !in this.types) {
|
||||
continue
|
||||
}
|
||||
|
@ -16,6 +16,8 @@ package de.bixilon.minosoft.assets.minecraft.index
|
||||
import de.bixilon.kutil.enums.EnumUtil
|
||||
import de.bixilon.kutil.enums.ValuesEnum
|
||||
import de.bixilon.minosoft.assets.util.FileAssetsTypes
|
||||
import de.bixilon.minosoft.data.registries.identified.Namespaces
|
||||
import de.bixilon.minosoft.data.registries.identified.ResourceLocation
|
||||
|
||||
enum class IndexAssetsType(val type: String) {
|
||||
LANGUAGE(FileAssetsTypes.GAME),
|
||||
@ -28,12 +30,13 @@ enum class IndexAssetsType(val type: String) {
|
||||
override val NAME_MAP: Map<String, IndexAssetsType> = EnumUtil.getEnumValues(VALUES)
|
||||
|
||||
|
||||
fun determinate(path: String): IndexAssetsType? {
|
||||
fun determinate(identifier: ResourceLocation): IndexAssetsType? {
|
||||
return when {
|
||||
path.startsWith("lang/") -> LANGUAGE
|
||||
path.startsWith("sounds/") -> SOUNDS
|
||||
path == "sounds.json" -> SOUNDS
|
||||
path.startsWith("textures/") -> TEXTURES
|
||||
identifier.path == "sounds.json" -> SOUNDS
|
||||
identifier.namespace != Namespaces.MINECRAFT -> null
|
||||
identifier.path.startsWith("sounds/") -> SOUNDS
|
||||
identifier.path.startsWith("lang/") -> LANGUAGE
|
||||
identifier.path.startsWith("textures/") -> TEXTURES
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user