mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-16 10:55:01 -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<*, *>)
|
check(data is Map<*, *>)
|
||||||
val name = path.toAssetName(false) ?: continue
|
val name = path.toAssetName(false) ?: continue
|
||||||
|
|
||||||
val type = IndexAssetsType.determinate(name.path)
|
val type = IndexAssetsType.determinate(name)
|
||||||
if (type == null || type !in this.types) {
|
if (type == null || type !in this.types) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,8 @@ package de.bixilon.minosoft.assets.minecraft.index
|
|||||||
import de.bixilon.kutil.enums.EnumUtil
|
import de.bixilon.kutil.enums.EnumUtil
|
||||||
import de.bixilon.kutil.enums.ValuesEnum
|
import de.bixilon.kutil.enums.ValuesEnum
|
||||||
import de.bixilon.minosoft.assets.util.FileAssetsTypes
|
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) {
|
enum class IndexAssetsType(val type: String) {
|
||||||
LANGUAGE(FileAssetsTypes.GAME),
|
LANGUAGE(FileAssetsTypes.GAME),
|
||||||
@ -28,12 +30,13 @@ enum class IndexAssetsType(val type: String) {
|
|||||||
override val NAME_MAP: Map<String, IndexAssetsType> = EnumUtil.getEnumValues(VALUES)
|
override val NAME_MAP: Map<String, IndexAssetsType> = EnumUtil.getEnumValues(VALUES)
|
||||||
|
|
||||||
|
|
||||||
fun determinate(path: String): IndexAssetsType? {
|
fun determinate(identifier: ResourceLocation): IndexAssetsType? {
|
||||||
return when {
|
return when {
|
||||||
path.startsWith("lang/") -> LANGUAGE
|
identifier.path == "sounds.json" -> SOUNDS
|
||||||
path.startsWith("sounds/") -> SOUNDS
|
identifier.namespace != Namespaces.MINECRAFT -> null
|
||||||
path == "sounds.json" -> SOUNDS
|
identifier.path.startsWith("sounds/") -> SOUNDS
|
||||||
path.startsWith("textures/") -> TEXTURES
|
identifier.path.startsWith("lang/") -> LANGUAGE
|
||||||
|
identifier.path.startsWith("textures/") -> TEXTURES
|
||||||
else -> null
|
else -> null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user