diff --git a/build.gradle.kts b/build.gradle.kts index 42ec225..b8b0f2d 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,7 +1,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile -java.sourceCompatibility = JavaVersion.VERSION_21 -java.targetCompatibility = JavaVersion.VERSION_21 +java.sourceCompatibility = JavaVersion.VERSION_1_8 +java.targetCompatibility = JavaVersion.VERSION_1_8 plugins { id("fabric-loom") @@ -31,7 +31,7 @@ tasks.named("processResources") { } tasks.withType { - kotlinOptions.jvmTarget = "21" + kotlinOptions.jvmTarget = "1.8" } tasks.withType { diff --git a/gradle.properties b/gradle.properties index 2116124..62eee66 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,12 +2,12 @@ kotlin.code.style=official org.gradle.jvmargs=-Xmx1G # Project -version=2.0.8 +version=2.0.8+1.16 # Versions (https://fabricmc.net/develop) -minecraft=1.20.6 -yarn=1.20.6+build.1 +minecraft=1.16.5 +yarn=1.16.5+build.10 loader=0.15.11 -fabric_api=0.98.0+1.20.6 +fabric_api=0.42.0+1.16 fabric_kotlin=1.10.20+kotlin.1.9.24 \ No newline at end of file diff --git a/src/main/kotlin/dev/auxves/disco/Disc.kt b/src/main/kotlin/dev/auxves/disco/Disc.kt index fdb45ee..d0c96b5 100644 --- a/src/main/kotlin/dev/auxves/disco/Disc.kt +++ b/src/main/kotlin/dev/auxves/disco/Disc.kt @@ -1,19 +1,22 @@ package dev.auxves.disco import net.minecraft.item.Item +import net.minecraft.item.ItemGroup import net.minecraft.item.ItemStack import net.minecraft.item.MusicDiscItem import net.minecraft.sound.SoundEvent import net.minecraft.text.Text +import net.minecraft.text.TranslatableText import net.minecraft.util.Identifier import net.minecraft.util.Rarity private val settings = Item.Settings() .rarity(Rarity.RARE) + .group(ItemGroup.TOOLS) .maxCount(1) -class Disc(val id: Identifier, duration: Int) : MusicDiscItem(15, SoundEvent.of(id), settings, duration) { +class Disc(val id: Identifier, duration: Int) : MusicDiscItem(15, SoundEvent(id), settings) { override fun getName(stack: ItemStack?): Text { - return Text.translatable("item.minecraft.music_disc_cat") + return TranslatableText("item.minecraft.music_disc_cat") } } diff --git a/src/main/kotlin/dev/auxves/disco/Entrypoint.kt b/src/main/kotlin/dev/auxves/disco/Entrypoint.kt index 8d9e8d6..e803eb1 100644 --- a/src/main/kotlin/dev/auxves/disco/Entrypoint.kt +++ b/src/main/kotlin/dev/auxves/disco/Entrypoint.kt @@ -1,10 +1,7 @@ package dev.auxves.disco -import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents import net.fabricmc.loader.api.FabricLoader -import net.minecraft.item.ItemGroups -import net.minecraft.registry.Registries -import net.minecraft.registry.Registry +import net.minecraft.util.registry.Registry fun init() { val addons = FabricLoader.getInstance().allMods @@ -14,10 +11,6 @@ fun init() { val discs = addons.flatMap { it.discs } discs.forEach { - Registry.register(Registries.ITEM, it.id, it) - } - - ItemGroupEvents.modifyEntriesEvent(ItemGroups.TOOLS).register { entries -> - discs.forEach(entries::add) + Registry.register(Registry.ITEM, it.id, it) } } \ No newline at end of file diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 4f8900f..d62379c 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -17,8 +17,8 @@ }, "mixins": [], "depends": { - "minecraft": ">=1.20", - "fabric-api": "*", + "minecraft": "1.16.x", + "fabric": "*", "fabric-language-kotlin": "*" } }