diff options
author | Linnea Gräf <nea@nea.moe> | 2024-11-17 17:29:15 +0100 |
---|---|---|
committer | Linnea Gräf <nea@nea.moe> | 2024-11-17 17:29:15 +0100 |
commit | 970dfddaf9e80d6b206f411139227397f4d9e847 (patch) | |
tree | 999f15cf28127c2053058dd877f6354540c22553 /src/main/kotlin/util/mc | |
parent | 915ab96b2444fa2e93d99a9747861b619d77f8f8 (diff) | |
download | Firmament-970dfddaf9e80d6b206f411139227397f4d9e847.tar.gz Firmament-970dfddaf9e80d6b206f411139227397f4d9e847.tar.bz2 Firmament-970dfddaf9e80d6b206f411139227397f4d9e847.zip |
feat: Add bazaar/ah search hotkey
Diffstat (limited to 'src/main/kotlin/util/mc')
-rw-r--r-- | src/main/kotlin/util/mc/FirmamentDataComponentTypes.kt | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/main/kotlin/util/mc/FirmamentDataComponentTypes.kt b/src/main/kotlin/util/mc/FirmamentDataComponentTypes.kt new file mode 100644 index 0000000..012f52e --- /dev/null +++ b/src/main/kotlin/util/mc/FirmamentDataComponentTypes.kt @@ -0,0 +1,36 @@ +package moe.nea.firmament.util.mc + +import com.mojang.serialization.Codec +import net.minecraft.component.ComponentType +import net.minecraft.registry.Registries +import net.minecraft.registry.Registry +import moe.nea.firmament.Firmament +import moe.nea.firmament.annotations.Subscribe +import moe.nea.firmament.events.ClientInitEvent + +object FirmamentDataComponentTypes { + + @Subscribe + fun init(event: ClientInitEvent) { + } + + private fun <T> register( + id: String, + builderOperator: (ComponentType.Builder<T>) -> Unit + ): ComponentType<T> { + return Registry.register( + Registries.DATA_COMPONENT_TYPE, + Firmament.identifier(id), + ComponentType.builder<T>().also(builderOperator) + .build() + ) + } + + val IS_BROKEN = register<Boolean>( + "is_broken" + ) { + it.codec(Codec.BOOL.fieldOf("is_broken").codec()) + } + + +} |