From 386ee78026801bf50d9cba24de541ed087f145d6 Mon Sep 17 00:00:00 2001 From: nea Date: Tue, 26 Jul 2022 23:12:13 +0200 Subject: 1.19 and no more forge --- .../moe/nea/notenoughupdates/NotEnoughUpdates.kt | 2 +- .../moe/nea/notenoughupdates/rei/NEUReiPlugin.kt | 1 + .../notenoughupdates/rei/SBItemEntryDefinition.kt | 5 +- .../moe/nea/notenoughupdates/repo/ItemCache.kt | 7 +- forge/build.gradle.kts | 108 ------------------- forge/gradle.properties | 1 - .../examplemod/forge/ExampleExpectPlatformImpl.kt | 14 --- .../kotlin/net/examplemod/forge/ExampleModForge.kt | 16 --- forge/src/main/resources/META-INF/mods.toml | 35 ------ forge/src/main/resources/examplemod.mixins.json | 12 --- forge/src/main/resources/pack.mcmeta | 6 -- gradle.properties | 20 ++-- quilt/build.gradle.kts | 118 --------------------- quilt/gradle.properties | 1 - .../examplemod/fabric/ExampleExpectPlatformImpl.kt | 13 --- .../kotlin/net/examplemod/quilt/ExampleModQuilt.kt | 12 --- quilt/src/main/resources/quilt.mod.json | 45 -------- settings.gradle.kts | 2 - 18 files changed, 15 insertions(+), 403 deletions(-) delete mode 100644 forge/build.gradle.kts delete mode 100644 forge/gradle.properties delete mode 100644 forge/src/main/kotlin/net/examplemod/forge/ExampleExpectPlatformImpl.kt delete mode 100644 forge/src/main/kotlin/net/examplemod/forge/ExampleModForge.kt delete mode 100644 forge/src/main/resources/META-INF/mods.toml delete mode 100644 forge/src/main/resources/examplemod.mixins.json delete mode 100644 forge/src/main/resources/pack.mcmeta delete mode 100644 quilt/build.gradle.kts delete mode 100644 quilt/gradle.properties delete mode 100644 quilt/src/main/kotlin/net/examplemod/fabric/ExampleExpectPlatformImpl.kt delete mode 100644 quilt/src/main/kotlin/net/examplemod/quilt/ExampleModQuilt.kt delete mode 100644 quilt/src/main/resources/quilt.mod.json diff --git a/common/src/main/kotlin/moe/nea/notenoughupdates/NotEnoughUpdates.kt b/common/src/main/kotlin/moe/nea/notenoughupdates/NotEnoughUpdates.kt index b55c5d8..3526bc4 100644 --- a/common/src/main/kotlin/moe/nea/notenoughupdates/NotEnoughUpdates.kt +++ b/common/src/main/kotlin/moe/nea/notenoughupdates/NotEnoughUpdates.kt @@ -3,11 +3,11 @@ package moe.nea.notenoughupdates import dev.architectury.registry.registries.Registries import io.github.moulberry.repo.NEURepository import java.nio.file.Path +import java.util.logging.Logger object NotEnoughUpdates { val REGISTRIES by lazy { Registries.get(MOD_ID) } - const val MOD_ID = "notenoughupdates" val neuRepo = NEURepository.of(Path.of("NotEnoughUpdates-REPO")).also { diff --git a/common/src/main/kotlin/moe/nea/notenoughupdates/rei/NEUReiPlugin.kt b/common/src/main/kotlin/moe/nea/notenoughupdates/rei/NEUReiPlugin.kt index 6d960e3..cc4b0f1 100644 --- a/common/src/main/kotlin/moe/nea/notenoughupdates/rei/NEUReiPlugin.kt +++ b/common/src/main/kotlin/moe/nea/notenoughupdates/rei/NEUReiPlugin.kt @@ -28,6 +28,7 @@ class NEUReiPlugin : REIClientPlugin { registry.register(SKYBLOCK_ITEM_TYPE_ID, SBItemEntryDefinition) } + override fun registerEntries(registry: EntryRegistry) { neuRepo.items.items.values.forEach { if (!it.isVanilla) diff --git a/common/src/main/kotlin/moe/nea/notenoughupdates/rei/SBItemEntryDefinition.kt b/common/src/main/kotlin/moe/nea/notenoughupdates/rei/SBItemEntryDefinition.kt index 6612113..6726b4f 100644 --- a/common/src/main/kotlin/moe/nea/notenoughupdates/rei/SBItemEntryDefinition.kt +++ b/common/src/main/kotlin/moe/nea/notenoughupdates/rei/SBItemEntryDefinition.kt @@ -6,6 +6,7 @@ import me.shedaniel.math.Point import me.shedaniel.math.Rectangle import me.shedaniel.rei.api.client.entry.renderer.EntryRenderer import me.shedaniel.rei.api.client.gui.widgets.Tooltip +import me.shedaniel.rei.api.client.gui.widgets.TooltipContext import me.shedaniel.rei.api.common.entry.EntrySerializer import me.shedaniel.rei.api.common.entry.EntryStack import me.shedaniel.rei.api.common.entry.comparison.ComparisonContext @@ -50,9 +51,9 @@ object SBItemEntryDefinition : EntryDefinition { ) } - override fun getTooltip(entry: EntryStack, mouse: Point): Tooltip? { + override fun getTooltip(entry: EntryStack, tooltipContext: TooltipContext): Tooltip? { return VanillaEntryTypes.ITEM.definition.renderer - .getTooltip(entry.asItemEntry(), mouse) + .getTooltip(entry.asItemEntry(), tooltipContext) } } diff --git a/common/src/main/kotlin/moe/nea/notenoughupdates/repo/ItemCache.kt b/common/src/main/kotlin/moe/nea/notenoughupdates/repo/ItemCache.kt index 8b3939e..aa93fec 100644 --- a/common/src/main/kotlin/moe/nea/notenoughupdates/repo/ItemCache.kt +++ b/common/src/main/kotlin/moe/nea/notenoughupdates/repo/ItemCache.kt @@ -8,7 +8,7 @@ import moe.nea.notenoughupdates.util.LegacyTagParser import moe.nea.notenoughupdates.util.appendLore import net.minecraft.nbt.CompoundTag import net.minecraft.nbt.NbtOps -import net.minecraft.network.chat.TextComponent +import net.minecraft.network.chat.Component import net.minecraft.resources.ResourceLocation import net.minecraft.util.datafix.DataFixers import net.minecraft.util.datafix.fixes.References @@ -46,8 +46,8 @@ object ItemCache : IReloadable { val oldItemTag = get10809CompoundTag() val modernItemTag = oldItemTag.transformFrom10809ToModern() ?: return ItemStack(Items.PAINTING).apply { - setHoverName(TextComponent(this@asItemStackNow.displayName)) - appendLore(listOf(TextComponent("Exception rendering item: $skyblockItemId"))) + setHoverName(Component.literal(this@asItemStackNow.displayName)) + appendLore(listOf(Component.literal("Exception rendering item: $skyblockItemId"))) } val itemInstance = ItemStack.of(modernItemTag) if (itemInstance.tag?.contains("Enchantments") == true) { @@ -69,7 +69,6 @@ object ItemCache : IReloadable { ResourceLocation("skyblockitem", skyblockItemId.lowercase().replace(";", "__")) - override fun reload(repository: NEURepository) { cache.clear() } diff --git a/forge/build.gradle.kts b/forge/build.gradle.kts deleted file mode 100644 index 47a56db..0000000 --- a/forge/build.gradle.kts +++ /dev/null @@ -1,108 +0,0 @@ -plugins { - id("com.github.johnrengelman.shadow") version "7.1.2" -} - -architectury { - platformSetupLoomIde() - forge() -} - -loom { - accessWidenerPath.set(project(":common").loom.accessWidenerPath) - - forge { - convertAccessWideners.set(true) - extraAccessWideners.add(loom.accessWidenerPath.get().asFile.name) - } -} - -/** - * @see: https://docs.gradle.org/current/userguide/migrating_from_groovy_to_kotlin_dsl.html - * */ -val common: Configuration by configurations.creating -val shadowCommon: Configuration by configurations.creating // Don't use shadow from the shadow plugin because we don't want IDEA to index this. -val developmentForge: Configuration = configurations.getByName("developmentForge") -configurations { - compileClasspath.get().extendsFrom(configurations["common"]) - runtimeClasspath.get().extendsFrom(configurations["common"]) - developmentForge.extendsFrom(configurations["common"]) -} - -dependencies { - forge("net.minecraftforge:forge:${rootProject.property("forge_version")}") - // Remove the next line if you don't want to depend on the API - modApi("dev.architectury:architectury-forge:${rootProject.property("architectury_version")}") - common(project(":common", configuration = "namedElements")) { isTransitive = false } - shadowCommon(project(":common", configuration = "transformProductionForge")) { isTransitive = false } - common(kotlin("stdlib-jdk8")) - modRuntimeOnly("me.shedaniel:RoughlyEnoughItems-forge:${rootProject.property("rei_version")}") -} - -val javaComponent = components["java"] as AdhocComponentWithVariants -javaComponent.withVariantsFromConfiguration(configurations["sourcesElements"]) { - skip() -} - -tasks { - processResources { - inputs.property("version", project.version) - - filesMatching("META-INF/mods.toml") { - expand("version" to project.version) - } - } - - shadowJar { - exclude("fabric.mod.json") - exclude("architectury.common.json") - - /** - * magic! - * groovy -> kotlin dsl - * [project.configurations.shadowCommon] -> listOf(project.configurations["shadowCommon"]) - * */ - configurations = listOf(project.configurations["shadowCommon"]) - archiveClassifier.set("dev-shadow") - } - - remapJar { - /** - * magic! - * groovy -> kotlin dsl - * shadowJar.archiveFile -> shadowJar.flatMap { it.archiveFile } - * */ - inputFile.set(shadowJar.flatMap { it.archiveFile }) - dependsOn(shadowJar) - /** - * affect suffix of build jar name - * if { archiveClassifier.set("forge") } - * name will be examplemod-1.0.0-forge.jar - */ - archiveClassifier.set("forge") - } - - jar { - archiveClassifier.set("dev") - } - - sourcesJar { - val commonSources = project(":common").tasks.getByName("sourcesJar", Jar::class) - dependsOn(commonSources) - from(commonSources.archiveFile.map { zipTree(it) }) - } - - - publishing { - publications { - create("mavenForge") { - artifactId = "${rootProject.property("archives_base_name")}-${project.name}" - from(javaComponent) - } - } - - // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing. - repositories { - // Add repositories to publish to here. - } - } -} diff --git a/forge/gradle.properties b/forge/gradle.properties deleted file mode 100644 index 32f842a..0000000 --- a/forge/gradle.properties +++ /dev/null @@ -1 +0,0 @@ -loom.platform=forge \ No newline at end of file diff --git a/forge/src/main/kotlin/net/examplemod/forge/ExampleExpectPlatformImpl.kt b/forge/src/main/kotlin/net/examplemod/forge/ExampleExpectPlatformImpl.kt deleted file mode 100644 index 8617e69..0000000 --- a/forge/src/main/kotlin/net/examplemod/forge/ExampleExpectPlatformImpl.kt +++ /dev/null @@ -1,14 +0,0 @@ -package net.examplemod.forge - -import net.minecraftforge.fml.loading.FMLPaths -import java.nio.file.Path -import net.examplemod.ExampleExpectPlatform - -@Suppress("unused") -object ExampleExpectPlatformImpl { - /** - * This is our actual method to [ExampleExpectPlatform.getConfigDirectory]. - */ - @JvmStatic - fun getConfigDirectory(): Path = FMLPaths.CONFIGDIR.get() -} \ No newline at end of file diff --git a/forge/src/main/kotlin/net/examplemod/forge/ExampleModForge.kt b/forge/src/main/kotlin/net/examplemod/forge/ExampleModForge.kt deleted file mode 100644 index 21fa303..0000000 --- a/forge/src/main/kotlin/net/examplemod/forge/ExampleModForge.kt +++ /dev/null @@ -1,16 +0,0 @@ -package net.examplemod.forge - -import dev.architectury.platform.forge.EventBuses -import moe.nea.notenoughupdates.NotEnoughUpdates -import moe.nea.notenoughupdates.NotEnoughUpdates.init -import net.minecraftforge.fml.common.Mod -import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext - -@Mod(NotEnoughUpdates.MOD_ID) -class ExampleModForge { - init { - // Submit our event bus to let architectury register our content on the right time - EventBuses.registerModEventBus(NotEnoughUpdates.MOD_ID, FMLJavaModLoadingContext.get().modEventBus) - init() - } -} diff --git a/forge/src/main/resources/META-INF/mods.toml b/forge/src/main/resources/META-INF/mods.toml deleted file mode 100644 index 4c3d869..0000000 --- a/forge/src/main/resources/META-INF/mods.toml +++ /dev/null @@ -1,35 +0,0 @@ -modLoader = "javafml" -loaderVersion = "[40,)" -#issueTrackerURL = "TODO" -license = "LGPL-3.0" - -[[mods]] -modId = "notenoughupdates" -version = "${version}" -displayName = "Not Enough Updates" -authors = "nea89" -description = ''' -Not Enough Updates - A mod for Hypixel Skyblock -''' -#logoFile = "" - -[[dependencies.notenoughupdates]] -modId = "forge" -mandatory = true -versionRange = "[40,)" -ordering = "NONE" -side = "BOTH" - -[[dependencies.notenoughupdates]] -modId = "minecraft" -mandatory = true -versionRange = "[1.18.2,)" -ordering = "NONE" -side = "BOTH" - -[[dependencies.notenoughupdates]] -modId = "architectury" -mandatory = true -versionRange = "[4.2.50,)" -ordering = "AFTER" -side = "BOTH" diff --git a/forge/src/main/resources/examplemod.mixins.json b/forge/src/main/resources/examplemod.mixins.json deleted file mode 100644 index 50eba1c..0000000 --- a/forge/src/main/resources/examplemod.mixins.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "required": true, - "package": "net.examplemod.mixin.forge", - "compatibilityLevel": "JAVA_16", - "client": [ - ], - "mixins": [ - ], - "injectors": { - "defaultRequire": 1 - } -} \ No newline at end of file diff --git a/forge/src/main/resources/pack.mcmeta b/forge/src/main/resources/pack.mcmeta deleted file mode 100644 index 9252d3d..0000000 --- a/forge/src/main/resources/pack.mcmeta +++ /dev/null @@ -1,6 +0,0 @@ -{ - "pack": { - "description": "Example Mod", - "pack_format": 8 - } -} diff --git a/gradle.properties b/gradle.properties index f18c603..73d85fc 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,25 +1,19 @@ org.gradle.jvmargs=-Xmx4096M -minecraft_version=1.18.2 -enabled_platforms=quilt,fabric,forge +minecraft_version=1.19 +enabled_platforms=fabric archives_base_name=notenoughupdates mod_version=1.0.0 maven_group=moe.nea.notenoughupdates -architectury_version=4.2.50 +architectury_version=5.10.33 -fabric_loader_version=0.14.0 -fabric_api_version=0.51.1+1.18.2 - -forge_version=1.18.2-40.1.0 - -quilt_loader_version=0.16.0-beta.7 -quilt_fabric_api_version=1.0.0-beta.7+0.51.1-1.18.2 +fabric_loader_version=0.14.8 +fabric_api_version=0.58.0+1.19 kotlin_version=1.7.0-RC - -rei_version=8.0.+ +rei_version=9.1.518 devauth_version=1.0.0 -modmenu_version=3.2.3 +modmenu_version=4.0.4 diff --git a/quilt/build.gradle.kts b/quilt/build.gradle.kts deleted file mode 100644 index 5f859c1..0000000 --- a/quilt/build.gradle.kts +++ /dev/null @@ -1,118 +0,0 @@ -plugins { - id("com.github.johnrengelman.shadow") version "7.1.2" -} - -repositories { - maven { url = uri("https://maven.quiltmc.org/repository/release/") } - mavenCentral() -} - -architectury { - platformSetupLoomIde() - loader("quilt") -} - -loom { - accessWidenerPath.set(project(":common").loom.accessWidenerPath) -} - -/** - * @see: https://docs.gradle.org/current/userguide/migrating_from_groovy_to_kotlin_dsl.html - * */ -val common: Configuration by configurations.creating -val shadowCommon: Configuration by configurations.creating // Don't use shadow from the shadow plugin because we don't want IDEA to index this. - -val developmentQuilt: Configuration = configurations.getByName("developmentQuilt") -configurations { - compileClasspath.get().extendsFrom(configurations["common"]) - runtimeClasspath.get().extendsFrom(configurations["common"]) - developmentQuilt.extendsFrom(configurations["common"]) -} - -dependencies { - modImplementation("org.quiltmc:quilt-loader:${rootProject.property("quilt_loader_version")}") - modApi("org.quiltmc.quilted-fabric-api:quilted-fabric-api:${rootProject.property("quilt_fabric_api_version")}") - // Remove the next few lines if you don't want to depend on the API - modApi("dev.architectury:architectury-fabric:${rootProject.property("architectury_version")}") { - // We must not pull Fabric Loader from Architectury Fabric - exclude(group = "net.fabricmc") - exclude(group = "net.fabricmc.fabric-api") - } - - common(project(":common", configuration = "namedElements")) { isTransitive = false } - shadowCommon(project(":common", configuration = "transformProductionQuilt")) { isTransitive = false } - common(kotlin("stdlib-jdk8")) -} - -val javaComponent = components.getByName("java", AdhocComponentWithVariants::class) -javaComponent.withVariantsFromConfiguration(configurations["sourcesElements"]) { - skip() -} - -tasks { - processResources { - inputs.property("group", rootProject.property("maven_group")) - inputs.property("version", project.version) - - filesMatching("quilt.mod.json") { - expand( - "group" to rootProject.property("maven_group"), - "version" to project.version - ) - } - } - - shadowJar { - exclude("architectury.common.json") - /** - * magic! - * groovy -> kotlin dsl - * [project.configurations.shadowCommon] -> listOf(project.configurations["shadowCommon"]) - * */ - configurations = listOf(project.configurations["shadowCommon"]) - archiveClassifier.set("dev-shadow") - } - - remapJar { - injectAccessWidener.set(true) - /** - * magic! - * groovy -> kotlin dsl - * shadowJar.archiveFile -> shadowJar.flatMap { it.archiveFile } - * */ - inputFile.set(shadowJar.flatMap { it.archiveFile }) - dependsOn(shadowJar) - /** - * affect suffix of build jar name - * if { archiveClassifier.set("quilt") } - * name will be examplemod-1.0.0-quilt.jar - */ - archiveClassifier.set("quilt") - } - - jar { - archiveClassifier.set("dev") - } - - - sourcesJar { - val commonSources = project(":common").tasks.getByName("sourcesJar", Jar::class) - dependsOn(commonSources) - from(commonSources.archiveFile.map { zipTree(it) }) - } - - - publishing { - publications { - create("mavenQuilt") { - artifactId = "${rootProject.property("archives_base_name")}-${project.name}" - from(javaComponent) - } - } - - // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing. - repositories { - // Add repositories to publish to here. - } - } -} \ No newline at end of file diff --git a/quilt/gradle.properties b/quilt/gradle.properties deleted file mode 100644 index 96758ce..0000000 --- a/quilt/gradle.properties +++ /dev/null @@ -1 +0,0 @@ -loom.platform=quilt \ No newline at end of file diff --git a/quilt/src/main/kotlin/net/examplemod/fabric/ExampleExpectPlatformImpl.kt b/quilt/src/main/kotlin/net/examplemod/fabric/ExampleExpectPlatformImpl.kt deleted file mode 100644 index 6f78162..0000000 --- a/quilt/src/main/kotlin/net/examplemod/fabric/ExampleExpectPlatformImpl.kt +++ /dev/null @@ -1,13 +0,0 @@ -package net.examplemod.fabric - -import org.quiltmc.loader.api.QuiltLoader -import java.nio.file.Path -import net.examplemod.ExampleExpectPlatform - -object ExampleExpectPlatformImpl { - /** - * This is our actual method to [ExampleExpectPlatform.getConfigDirectory]. - */ - @JvmStatic - fun getConfigDirectory(): Path = QuiltLoader.getConfigDir() -} \ No newline at end of file diff --git a/quilt/src/main/kotlin/net/examplemod/quilt/ExampleModQuilt.kt b/quilt/src/main/kotlin/net/examplemod/quilt/ExampleModQuilt.kt deleted file mode 100644 index a5dae4d..0000000 --- a/quilt/src/main/kotlin/net/examplemod/quilt/ExampleModQuilt.kt +++ /dev/null @@ -1,12 +0,0 @@ -package net.examplemod.quilt - -import moe.nea.notenoughupdates.NotEnoughUpdates.init -import org.quiltmc.loader.api.ModContainer -import org.quiltmc.qsl.base.api.entrypoint.ModInitializer - -@Suppress("unused") -class ExampleModQuilt : ModInitializer { - override fun onInitialize(mod: ModContainer) { - init() - } -} diff --git a/quilt/src/main/resources/quilt.mod.json b/quilt/src/main/resources/quilt.mod.json deleted file mode 100644 index 6cdf9ae..0000000 --- a/quilt/src/main/resources/quilt.mod.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "schema_version": 1, - "mixins": [ - "notenoughupdates.mixins.json", - "notenoughupdates-common.mixins.json" - ], - "quilt_loader": { - "group": "${group}", - "id": "notenoughupdates", - "version": "${version}", - "name": "Not Enough Updates", - "description": "Not Enough Updates - A mod for Hypixel Skyblock", - "authors": ["nea89"], - "contact": { - "sources": "https://github.com/romangraef/TODO" - }, - "license": "LGPL-3.0", - "icon": "assets/notenoughupdates/icon.png", - "intermediate_mappings": "net.fabricmc:intermediary", - "environment": "*", - "entrypoints": { - "init": [ - "net.examplemod.quilt.ExampleModQuilt" - ] - }, - "depends": [ - { - "id": "quilt_loader", - "version": "*" - }, - { - "id": "quilt_base", - "version": "*" - }, - { - "id": "minecraft", - "version": ">=1.18.2" - }, - { - "id": "architectury", - "version": ">=4.2.50" - } - ] - } -} diff --git a/settings.gradle.kts b/settings.gradle.kts index b775ae5..ca29fa8 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -18,8 +18,6 @@ pluginManagement { include("common") include("fabric") -include("quilt") -include("forge") rootProject.name = "NotEnoughApdates" -- cgit