diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b93c3c6..3c61948 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,10 +12,10 @@ jobs: fetch-depth: 0 fetch-tags: true - - name: Setup JDK 21 + - name: Setup JDK 17 uses: actions/setup-java@v4 with: - java-version: '21' + java-version: '17' distribution: 'temurin' - name: Setup Gradle @@ -27,4 +27,4 @@ jobs: run: chmod +x ./gradlew - name: Build with Gradle - run: ./gradlew build \ No newline at end of file + run: ./gradlew build diff --git a/README.md b/README.md index 1dad4f9..9dde25b 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,13 @@ -# OpenCode Minecraft (NeoForge) +# OpenCode Minecraft (Forge) -[![Minecraft](https://img.shields.io/badge/Minecraft-1.21.1-brightgreen.svg)](https://minecraft.net) -[![NeoForge](https://img.shields.io/badge/Mod%20Loader-NeoForge-orange.svg)](https://neoforged.net) -[![Java](https://img.shields.io/badge/Java-21+-orange.svg)](https://adoptium.net) +[![Minecraft](https://img.shields.io/badge/Minecraft-1.20.1-brightgreen.svg)](https://minecraft.net) +[![Forge](https://img.shields.io/badge/Mod%20Loader-Forge-orange.svg)](https://minecraftforge.net) +[![Java](https://img.shields.io/badge/Java-17+-orange.svg)](https://adoptium.net) [![License](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE) -> **Note:** This is a NeoForge port for Minecraft 1.21.1. For the original Fabric version, see [DNGriffin/minecraftcode](https://github.com/DNGriffin/minecraftcode). +> **Note:** This is a Forge port for Minecraft 1.20.1. For the original Fabric version, see [DNGriffin/minecraftcode](https://github.com/DNGriffin/minecraftcode). -A NeoForge mod that integrates [OpenCode](https://opencode.ai/) into Minecraft Java Edition single player, with a unique pause mechanic that freezes the game while the AI is waiting for input and resumes when it's actively working. +A Forge mod that integrates [OpenCode](https://opencode.ai/) into Minecraft Java Edition single player, with a unique pause mechanic that freezes the game while the AI is waiting for input and resumes when it's actively working. ## Demo @@ -29,7 +29,7 @@ https://github.com/user-attachments/assets/e3aad745-a03a-4c0f-b83c-ce15f92d66ed ## Quick Start -1. Install [NeoForge](https://neoforged.net/) for Minecraft 1.21.1 +1. Install [Forge](https://files.minecraftforge.net/) for Minecraft 1.20.1 2. Download the mod JAR from [Releases](../../releases) and place it in your `.minecraft/mods` folder 3. Start OpenCode: `opencode` 4. Launch Minecraft and create/join a single player world @@ -38,9 +38,9 @@ https://github.com/user-attachments/assets/e3aad745-a03a-4c0f-b83c-ce15f92d66ed ## Requirements -- Minecraft 1.21.1 -- NeoForge 21.1.72+ -- Java 21+ +- Minecraft 1.20.1 +- Forge 47.2.0+ +- Java 17+ - [OpenCode](https://github.com/anthropics/opencode) running in server mode (`opencode serve`) ## Installation @@ -53,8 +53,8 @@ https://github.com/user-attachments/assets/e3aad745-a03a-4c0f-b83c-ce15f92d66ed ### Option 2: Build from Source ```bash -git clone https://github.com/yourusername/opencode-minecraft-neoforge.git -cd opencode-minecraft-neoforge +git clone https://github.com/yourusername/opencode-minecraft-forge.git +cd opencode-minecraft-forge ./gradlew build ``` @@ -138,7 +138,7 @@ Configuration is stored in `.minecraft/config/opencode.json`: - Look at Minecraft logs for errors ### "Connection Lost" when joining world -- Ensure you're using the correct mod version for Minecraft 1.21.1 +- Ensure you're using the correct mod version for Minecraft 1.20.1 - Try `./gradlew clean build` if building from source - Check for conflicting mods diff --git a/build.gradle b/build.gradle index d3cdd01..83e8521 100644 --- a/build.gradle +++ b/build.gradle @@ -1,101 +1,69 @@ plugins { - id 'java-library' - id 'maven-publish' - id 'net.neoforged.moddev' version '2.0.137' + id 'eclipse' id 'idea' -} - -tasks.named('wrapper', Wrapper).configure { - // Define wrapper values here so as to not have to always do so when updating gradlew.properties. - // Switching this to Wrapper.DistributionType.ALL will download the full gradle sources that comes with - // documentation attached on cursor hover of gradle classes and methods. However, this comes with increased - // file size for Gradle. If you do switch this to ALL, run the Gradle wrapper task twice afterwards. - // (Verify by checking gradle/wrapper/gradle-wrapper.properties to see if distributionUrl now points to `-all`) - distributionType = Wrapper.DistributionType.BIN + id 'maven-publish' + id 'net.minecraftforge.gradle' version '[6.0,6.2)' + id 'org.parchmentmc.librarian.forgegradle' version '1.+' + id 'org.spongepowered.mixin' version '0.7.+' } version = mod_version group = mod_group_id -repositories { - // Add here additional repositories if required by some of the dependencies below. -} - base { archivesName = mod_id } -// Mojang ships Java 21 to end users in 1.21.10, so mods should target Java 21. -java.toolchain.languageVersion = JavaLanguageVersion.of(21) +// Mojang ships Java 17 to end users in 1.20.1 +java.toolchain.languageVersion = JavaLanguageVersion.of(17) -neoForge { - // Specify the version of NeoForge to use. - version = project.neo_version +println "Java: ${System.getProperty 'java.version'}, JVM: ${System.getProperty 'java.vm.version'} (${System.getProperty 'java.vendor'}), Arch: ${System.getProperty 'os.arch'}" - parchment { - mappingsVersion = project.parchment_mappings_version - minecraftVersion = project.parchment_minecraft_version - } +minecraft { + // Mappings with Parchment for better parameter names + mappings channel: 'parchment', version: "${parchment_mappings_version}-${minecraft_version}" - // This line is optional. Access Transformers are automatically detected - // accessTransformers = project.files('src/main/resources/META-INF/accesstransformer.cfg') + // Access transformer if you need one + // accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') - // Default run configurations. - // These can be tweaked, removed, or duplicated as needed. + // Default run configurations runs { - client { - client() + // applies to all the run configs below + configureEach { + workingDirectory project.file('run') + + property 'forge.logging.markers', 'REGISTRIES' + property 'forge.logging.console.level', 'debug' + + // Mixin configuration + property 'mixin.env.remapRefMap', 'true' + property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg" - // Comma-separated list of namespaces to load gametests from. Empty = all namespaces. - systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id + mods { + "${mod_id}" { + source sourceSets.main + } + } + } + + client { + // Comma-separated list of namespaces to load gametests from + property 'forge.enabledGameTestNamespaces', mod_id } server { - server() - programArgument '--nogui' - systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id + property 'forge.enabledGameTestNamespaces', mod_id + args '--nogui' } - // This run config launches GameTestServer and runs all registered gametests, then exits. - // By default, the server will crash when no gametests are provided. - // The gametest system is also enabled by default for other run configs under the /test command. gameTestServer { - type = "gameTestServer" - systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id + property 'forge.enabledGameTestNamespaces', mod_id } data { - clientData() - - // example of overriding the workingDirectory set in configureEach above, uncomment if you want to use it - // gameDirectory = project.file('run-data') + workingDirectory project.file('run-data') - // Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources. - programArguments.addAll '--mod', project.mod_id, '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath() - } - - // applies to all the run configs above - configureEach { - // Recommended logging data for a userdev environment - // The markers can be added/remove as needed separated by commas. - // "SCAN": For mods scan. - // "REGISTRIES": For firing of registry events. - // "REGISTRYDUMP": For getting the contents of all registries. - systemProperty 'forge.logging.markers', 'REGISTRIES' - - // Recommended logging level for the console - // You can set various levels here. - // Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels - logLevel = org.slf4j.event.Level.DEBUG - } - } - - mods { - // define mod <-> source bindings - // these are used to tell the game which sources are for which mod - // multi mod projects should define one per mod - "${mod_id}" { - sourceSet(sourceSets.main) + args '--mod', mod_id, '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath() } } } @@ -103,66 +71,77 @@ neoForge { // Include resources generated by data generators. sourceSets.main.resources { srcDir 'src/generated/resources' } -// Sets up a dependency configuration called 'localRuntime'. -// This configuration should be used instead of 'runtimeOnly' to declare -// a dependency that will be present for runtime testing but that is -// "optional", meaning it will not be pulled by dependents of this mod. -configurations { - runtimeClasspath.extendsFrom localRuntime +repositories { + maven { + name = 'Sponge / Mixin' + url = 'https://repo.spongepowered.org/repository/maven-public/' + } } dependencies { - // Example optional mod dependency with JEI - // The JEI API is declared for compile time use, while the full JEI artifact is used at runtime - // compileOnly "mezz.jei:jei-${mc_version}-common-api:${jei_version}" - // compileOnly "mezz.jei:jei-${mc_version}-neoforge-api:${jei_version}" - // We add the full version to localRuntime, not runtimeOnly, so that we do not publish a dependency on it - // localRuntime "mezz.jei:jei-${mc_version}-neoforge:${jei_version}" - - // Example mod dependency using a mod jar from ./libs with a flat dir repository - // This maps to ./libs/coolmod-${mc_version}-${coolmod_version}.jar - // The group id is ignored when searching -- in this case, it is "blank" - // implementation "blank:coolmod-${mc_version}:${coolmod_version}" - - // Example mod dependency using a file as dependency - // implementation files("libs/coolmod-${mc_version}-${coolmod_version}.jar") - - // Example project dependency using a sister or child project: - // implementation project(":myproject") - - // For more info: - // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html - // http://www.gradle.org/docs/current/userguide/dependency_management.html + // Specify the version of Minecraft to use + minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}" + + // Mixin annotation processor + annotationProcessor 'org.spongepowered:mixin:0.8.5:processor' +} + +// Mixin configuration +mixin { + add sourceSets.main, "${mod_id}.refmap.json" + config "${mod_id}.mixins.json" } -// This block of code expands all declared replace properties in the specified resource targets. -// A missing property will result in an error. Properties are expanded using ${} Groovy notation. -var generateModMetadata = tasks.register("generateModMetadata", ProcessResources) { +// Process resources to replace variables +tasks.named('processResources', ProcessResources).configure { var replaceProperties = [ - minecraft_version : minecraft_version, + minecraft_version : minecraft_version, minecraft_version_range: minecraft_version_range, - neo_version : neo_version, - mod_id : mod_id, - mod_name : mod_name, - mod_license : mod_license, - mod_version : mod_version, + forge_version : forge_version, + forge_version_range : forge_version_range, + loader_version_range: loader_version_range, + mod_id : mod_id, + mod_name : mod_name, + mod_license : mod_license, + mod_version : mod_version, + mod_authors : mod_authors, + mod_description : mod_description, ] inputs.properties replaceProperties - expand replaceProperties - from "src/main/templates" - into "build/generated/sources/modMetadata" + + filesMatching(['META-INF/mods.toml', 'pack.mcmeta']) { + expand replaceProperties + [project: project] + } +} + +// Ensure processResources runs before compiling +tasks.named('compileJava', JavaCompile).configure { + dependsOn 'processResources' +} + +jar { + manifest { + attributes([ + 'Specification-Title' : mod_id, + 'Specification-Vendor' : mod_authors, + 'Specification-Version' : '1', + 'Implementation-Title' : project.name, + 'Implementation-Version' : project.jar.archiveVersion, + 'Implementation-Vendor' : mod_authors, + 'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"), + 'MixinConfigs' : "${mod_id}.mixins.json" + ]) + } + + // Ensure mixin refmap is included + finalizedBy 'reobfJar' } -// Include the output of "generateModMetadata" as an input directory for the build -// this works with both building through Gradle and the IDE. -sourceSets.main.resources.srcDir generateModMetadata -// To avoid having to run "generateModMetadata" manually, make it run on every project reload -neoForge.ideSyncTask generateModMetadata -// Example configuration to allow publishing using the maven-publish plugin +// Maven publishing configuration publishing { publications { register('mavenJava', MavenPublication) { - from components.java + artifact jar } } repositories { @@ -173,10 +152,10 @@ publishing { } tasks.withType(JavaCompile).configureEach { - options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation + options.encoding = 'UTF-8' } -// IDEA no longer automatically downloads sources/javadoc jars for dependencies, so we need to explicitly enable the behavior. +// IDEA configuration idea { module { downloadSources = true diff --git a/gradle.properties b/gradle.properties index 9c2f058..64d6a79 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,37 +1,39 @@ # Sets default memory used for gradle commands. Can be overridden by user or command line properties. -org.gradle.jvmargs=-Xmx1G +org.gradle.jvmargs=-Xmx3G org.gradle.daemon=true org.gradle.parallel=true -org.gradle.caching=true -org.gradle.configuration-cache=true -#read more on this at https://github.com/neoforged/ModDevGradle?tab=readme-ov-file#better-minecraft-parameter-names--javadoc-parchment -# you can also find the latest versions at: https://parchmentmc.org/docs/getting-started -parchment_minecraft_version=1.21.10 -parchment_mappings_version=2025.10.12 +# Parchment mappings for better parameter names +# You can find the latest versions at: https://parchmentmc.org/docs/getting-started +parchment_minecraft_version=1.20.1 +parchment_mappings_version=2023.09.03 + # Environment Properties -# You can find the latest versions here: https://projects.neoforged.net/neoforged/neoforge -# The Minecraft version must agree with the Neo version to get a valid artifact -minecraft_version=1.21.1 +# The Minecraft version must agree with the Forge version to get a valid artifact +minecraft_version=1.20.1 # The Minecraft version range can use any release version of Minecraft as bounds. -# Snapshots, pre-releases, and release candidates are not guaranteed to sort properly -# as they do not follow standard versioning conventions. -minecraft_version_range=[1.21.1,1.22) -# The Neo version must agree with the Minecraft version to get a valid artifact -neo_version=21.1.72 +minecraft_version_range=[1.20.1,1.21) +# The Forge version must agree with the Minecraft version to get a valid artifact +# https://files.minecraftforge.net/net/minecraftforge/forge/ +forge_version=47.2.0 +# The Forge version range +forge_version_range=[47,) +# The loader version range +loader_version_range=[47,) ## Mod Properties # The unique mod identifier for the mod. Must be lowercase in English locale. Must fit the regex [a-z][a-z0-9_]{1,63} -# Must match the String constant located in the main mod class annotated with @Mod. mod_id=opencode # The human-readable display name for the mod. mod_name=OpenCode Minecraft -# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default. +# The license of the mod. mod_license=MIT # The mod version. See https://semver.org/ mod_version=1.0.0 -# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository. -# This should match the base package used for the mod sources. -# See https://maven.apache.org/guides/mini/guide-naming-conventions.html +# The group ID for the mod. mod_group_id=com.opencode.minecraft +# Mod authors +mod_authors=OpenCode +# Mod description +mod_description=An OpenCode client for Minecraft single player with game pause integration diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 23449a2..80187ac 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew old mode 100644 new mode 100755 diff --git a/settings.gradle b/settings.gradle index 7a488e3..133f465 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,9 +1,17 @@ pluginManagement { repositories { gradlePluginPortal() + maven { + name = 'MinecraftForge' + url = 'https://maven.minecraftforge.net/' + } + maven { + name = 'Parchment' + url = 'https://maven.parchmentmc.org' + } } } plugins { - id 'org.gradle.toolchains.foojay-resolver-convention' version '1.0.0' + id 'org.gradle.toolchains.foojay-resolver-convention' version '0.5.0' } diff --git a/src/main/java/com/opencode/minecraft/OpenCodeMod.java b/src/main/java/com/opencode/minecraft/OpenCodeMod.java index aff7949..219dc24 100644 --- a/src/main/java/com/opencode/minecraft/OpenCodeMod.java +++ b/src/main/java/com/opencode/minecraft/OpenCodeMod.java @@ -4,11 +4,11 @@ import com.opencode.minecraft.command.OpenCodeCommand; import com.opencode.minecraft.config.ConfigManager; import com.opencode.minecraft.game.PauseController; -import net.neoforged.bus.api.IEventBus; -import net.neoforged.fml.common.Mod; -import net.neoforged.neoforge.client.event.ClientTickEvent; -import net.neoforged.neoforge.client.event.RegisterClientCommandsEvent; -import net.neoforged.neoforge.common.NeoForge; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.TickEvent; +import net.minecraftforge.client.event.RegisterClientCommandsEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.fml.common.Mod; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -21,7 +21,7 @@ public class OpenCodeMod { private static PauseController pauseController; private static ConfigManager configManager; - public OpenCodeMod(IEventBus modEventBus) { + public OpenCodeMod() { LOGGER.info("Initializing OpenCode Minecraft client"); // Initialize configuration @@ -35,18 +35,22 @@ public OpenCodeMod(IEventBus modEventBus) { // Initialize OpenCode client client = new OpenCodeClient(configManager.getConfig(), pauseController); - // Register event handlers - NeoForge.EVENT_BUS.addListener(this::onClientTick); - NeoForge.EVENT_BUS.addListener(this::onRegisterCommands); + // Register event handlers on the Forge event bus + MinecraftForge.EVENT_BUS.register(this); LOGGER.info("OpenCode Minecraft client initialized"); } - private void onClientTick(ClientTickEvent.Post event) { - pauseController.tick(); + @SubscribeEvent + public void onClientTick(TickEvent.ClientTickEvent event) { + // Only process at the end of the tick + if (event.phase == TickEvent.Phase.END) { + pauseController.tick(); + } } - private void onRegisterCommands(RegisterClientCommandsEvent event) { + @SubscribeEvent + public void onRegisterCommands(RegisterClientCommandsEvent event) { OpenCodeCommand.register(event.getDispatcher()); } diff --git a/src/main/java/com/opencode/minecraft/config/ConfigManager.java b/src/main/java/com/opencode/minecraft/config/ConfigManager.java index 2234acc..83daee4 100644 --- a/src/main/java/com/opencode/minecraft/config/ConfigManager.java +++ b/src/main/java/com/opencode/minecraft/config/ConfigManager.java @@ -3,7 +3,7 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.opencode.minecraft.OpenCodeMod; -import net.neoforged.fml.loading.FMLPaths; +import net.minecraftforge.fml.loading.FMLPaths; import java.io.IOException; import java.nio.file.Files; diff --git a/src/main/java/com/opencode/minecraft/gui/OpenCodeGuiScreen.java b/src/main/java/com/opencode/minecraft/gui/OpenCodeGuiScreen.java index 696bdfe..d5cd3df 100644 --- a/src/main/java/com/opencode/minecraft/gui/OpenCodeGuiScreen.java +++ b/src/main/java/com/opencode/minecraft/gui/OpenCodeGuiScreen.java @@ -235,8 +235,8 @@ private void parseAndDisplayMessage(JsonObject message) { @Override public void render(GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTick) { - // Render dark background to prevent blur - renderBackground(guiGraphics, mouseX, mouseY, partialTick); + // Render dark background + renderBackground(guiGraphics); // Calculate dimensions with proper margins int terminalWidth = this.width - 40; @@ -357,15 +357,15 @@ public boolean keyPressed(int keyCode, int scanCode, int modifiers) { } @Override - public boolean mouseScrolled(double mouseX, double mouseY, double deltaX, double deltaY) { + public boolean mouseScrolled(double mouseX, double mouseY, double delta) { // Scroll with mouse wheel int availableHeight = (this.height - 40 - 40 - 24); int lineHeight = this.font.lineHeight + 2; int maxVisibleLines = Math.max(1, availableHeight / lineHeight); - if (deltaY > 0) { + if (delta > 0) { scrollOffset = Math.min(scrollOffset + 1, Math.max(0, messageHistory.size() - maxVisibleLines)); - } else if (deltaY < 0) { + } else if (delta < 0) { scrollOffset = Math.max(0, scrollOffset - 1); } return true; diff --git a/src/main/java/com/opencode/minecraft/mixin/GuiMixin.java b/src/main/java/com/opencode/minecraft/mixin/GuiMixin.java index ee5dc3b..7efda7b 100644 --- a/src/main/java/com/opencode/minecraft/mixin/GuiMixin.java +++ b/src/main/java/com/opencode/minecraft/mixin/GuiMixin.java @@ -1,7 +1,6 @@ package com.opencode.minecraft.mixin; import com.opencode.minecraft.game.PauseOverlay; -import net.minecraft.client.DeltaTracker; import net.minecraft.client.gui.Gui; import net.minecraft.client.gui.GuiGraphics; import org.spongepowered.asm.mixin.Mixin; @@ -17,9 +16,10 @@ public abstract class GuiMixin { /** * Render the pause overlay after the normal HUD renders. + * In 1.20.1, the render method takes GuiGraphics and float partialTick (no DeltaTracker). */ @Inject(method = "render", at = @At("TAIL")) - private void opencode$onRender(GuiGraphics context, DeltaTracker tickCounter, CallbackInfo ci) { - PauseOverlay.render(context, tickCounter.getGameTimeDeltaTicks()); + private void opencode$onRender(GuiGraphics guiGraphics, float partialTick, CallbackInfo ci) { + PauseOverlay.render(guiGraphics, partialTick); } } diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml new file mode 100644 index 0000000..779d2c8 --- /dev/null +++ b/src/main/resources/META-INF/mods.toml @@ -0,0 +1,71 @@ +# This is an example mods.toml file. It contains the data relating to the loading mods. +# There are several mandatory fields (#mandatory), and many more that are optional (#optional). +# The overall format is standard TOML format, v0.5.0. +# Note that there are a couple of TOML lists in this file. +# Find more information on toml format here: https://github.com/toml-lang/toml +# The name of the mod loader type to load - for regular FML @Mod mods it should be javafml +modLoader="javafml" #mandatory +# A version range to match for said mod loader - for regular FML @Mod it will be the forge version +loaderVersion="${loader_version_range}" #mandatory +# The license for you mod. This is mandatory metadata and allows for easier comprehension of your redistributive properties. +# Review your options at https://choosealicense.com/. All rights reserved is the default copyright stance, and is thus the default here. +license="${mod_license}" + +# A URL to refer people to when problems occur with this mod +#issueTrackerURL="https://change.me.to.your.issue.tracker.example.invalid/" #optional + +# A list of mods - how many allowed here is determined by the individual mod loader +[[mods]] #mandatory +# The modid of the mod +modId="${mod_id}" #mandatory +# The version number of the mod +version="${mod_version}" #mandatory +# A display name for the mod +displayName="${mod_name}" #mandatory +# A URL to query for updates for this mod. See the JSON update specification https://docs.minecraftforge.net/en/latest/misc/updatechecker/ +#updateJSONURL="https://change.me.example.invalid/updates.json" #optional +# A URL for the "homepage" for this mod, displayed in the mod UI +#displayURL="https://change.me.to.your.mods.homepage.example.invalid/" #optional +# A file name (in the root of the mod JAR) containing a logo for display +#logoFile="examplemod.png" #optional +# A text field displayed in the mod UI +#credits="" #optional +# A text field displayed in the mod UI +authors="${mod_authors}" #optional +# Display Test +# MATCH_VERSION means your mod will cause a red X if the versions on client and server differ. This is the default behaviour and should be what you choose if you have server and client elements to your mod. +# IGNORE_SERVER_VERSION means that your mod will not cause a red X if it's present on the server but not on the client. This is what you should use if you're a server only mod. +# IGNORE_ALL_VERSION means that your mod will not cause a red X if it's present on the client or the server. This is a special case and should only be used if your mod has no server component. +# NONE means that no display test is set on your mod. You need to do this yourself, see IExtensionPoint.DisplayTest for more information. You can define any scheme you wish with this value. +# IMPORTANT NOTE: this is NOT an instruction as to which environments (CLIENT or DEDICATED_SERVER) your mod loads on. Your mod should load (and maybe do nothing!) wherever it finds itself. +displayTest="IGNORE_ALL_VERSION" #optional - defaults to MATCH_VERSION if not specified +# The description text for the mod (multi line!) (#mandatory) +description='''${mod_description}''' + +# A dependency - use the . to indicate dependency for a specific modid. Dependencies are optional. +[[dependencies.${mod_id}]] #optional + # the modid of the dependency + modId="forge" #mandatory + # Does this dependency have to exist - if not, ordering below must be valid + mandatory=true #mandatory + # The version range of the dependency + versionRange="${forge_version_range}" #mandatory + # An ordering relationship for the dependency - BEFORE or AFTER required if the dependency is not mandatory + # BEFORE - This mod is loaded BEFORE the dependency + # AFTER - This mod is loaded AFTER the dependency + ordering="NONE" + # Side this dependency is applied on - BOTH, CLIENT, or SERVER + side="CLIENT" + +# Here's another dependency +[[dependencies.${mod_id}]] + modId="minecraft" + mandatory=true + # This version range declares a minimum of the current minecraft version up until but not including the next major version + versionRange="${minecraft_version_range}" + ordering="NONE" + side="CLIENT" + +# Mixin configuration +[[mixins]] +config="${mod_id}.mixins.json" diff --git a/src/main/resources/assets/opencodeminecraftneoforge/lang/en_us.json b/src/main/resources/assets/opencodeminecraftneoforge/lang/en_us.json deleted file mode 100644 index 1ac1837..0000000 --- a/src/main/resources/assets/opencodeminecraftneoforge/lang/en_us.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "itemGroup.opencodeminecraftneoforge": "Example Mod Tab", - "block.opencodeminecraftneoforge.example_block": "Example Block", - "item.opencodeminecraftneoforge.example_item": "Example Item", - - "opencodeminecraftneoforge.configuration.title": "opencode-minecraft-neoforge Configs", - "opencodeminecraftneoforge.configuration.section.opencodeminecraftneoforge.common.toml": "opencode-minecraft-neoforge Configs", - "opencodeminecraftneoforge.configuration.section.opencodeminecraftneoforge.common.toml.title": "opencode-minecraft-neoforge Configs", - "opencodeminecraftneoforge.configuration.items": "Item List", - "opencodeminecraftneoforge.configuration.logDirtBlock": "Log Dirt Block", - "opencodeminecraftneoforge.configuration.magicNumberIntroduction": "Magic Number Text", - "opencodeminecraftneoforge.configuration.magicNumber": "Magic Number" -} diff --git a/src/main/resources/opencode.mixins.json b/src/main/resources/opencode.mixins.json index 3adf947..b38d694 100644 --- a/src/main/resources/opencode.mixins.json +++ b/src/main/resources/opencode.mixins.json @@ -1,7 +1,7 @@ { "required": true, "package": "com.opencode.minecraft.mixin", - "compatibilityLevel": "JAVA_21", + "compatibilityLevel": "JAVA_17", "refmap": "opencode.refmap.json", "client": [ "IntegratedServerMixin", diff --git a/src/main/resources/opencodeminecraftneoforge.mixins.json b/src/main/resources/opencodeminecraftneoforge.mixins.json deleted file mode 100644 index ccab122..0000000 --- a/src/main/resources/opencodeminecraftneoforge.mixins.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "required": true, - "package": "com.example.opencodeneoforge.mixin", - "compatibilityLevel": "JAVA_21", - "mixins": [], - "injectors": { - "defaultRequire": 1 - }, - "overwrites": { - "requireAnnotations": true - } -} \ No newline at end of file diff --git a/src/main/templates/META-INF/neoforge.mods.toml b/src/main/templates/META-INF/neoforge.mods.toml deleted file mode 100644 index 0cddfb0..0000000 --- a/src/main/templates/META-INF/neoforge.mods.toml +++ /dev/null @@ -1,30 +0,0 @@ -modLoader="javafml" -loaderVersion="[4,)" -license="${mod_license}" - -[[mods]] -modId="${mod_id}" -version="${mod_version}" -displayName="${mod_name}" -description=''' -An OpenCode client for Minecraft single player with game pause integration -''' -authors="OpenCode" -displayURL="https://github.com/opencodedev/opencode" - -[[mixins]] -config="opencode.mixins.json" - -[[dependencies.opencode]] - modId="neoforge" - type="required" - versionRange="${neo_version}" - ordering="NONE" - side="CLIENT" - -[[dependencies.opencode]] - modId="minecraft" - type="required" - versionRange="${minecraft_version_range}" - ordering="NONE" - side="CLIENT"