Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Arnox

Members
  • Posts

    16
  • Joined

  • Last visited

Everything posted by Arnox

  1. Arnox

    Documentation

    And those "pretty docs" are what attract people to make content for Forge in the first place. I can't write anything to the github pages myself because obviously I'm not sure what to put down. I like to think I know how to write technical documents, but I also need to know what the hell I'm talking about. I (or someone) need to sit down with at least one dev and go through at least some basics with them. Like, for example, what does Forge always expect a mod to have? What file structure does Forge expect? What are some examples of very simple mods, and how would they all work under the hood basically? Although, of course, you should be able to understand what a function does by looking at it, it doesn't answer other more pressing questions about the Forge API as a whole. Hell, if I just had a week with a dev where we just devoted a few hours to hammering out the documentation, then I'm sure we could make a huge dent, if not entirely complete it. I absolutely get that Forge is a big project and it needs a lot of time, but if these documentation needs aren't met, then many people are just gonna get frustrated and go work on something else. And you don't want that. You obviously want more people to use your API. I also get that documentation isn't exactly a glamorous job. It's a very underappreciated part of making an API. But I think it will absolutely pay off in the end. It would address a lot of threads that are constantly getting made in the Modding Support sub-forum asking things that good documentation could easily answer. It saves your users time and it saves you time as well. Everyone's happy.
  2. I seem to be at a loss for making 1.16.x mods in general since there doesn't seem to be a lot of documentation at all. Now, I do understand that Forge for 1.16.x is still early days, but even for 1.15.x, the official documentation seems content to only go over broad concepts with no examples and what seems like key pieces of information left out. Further, many of the tutorials you find for modding only seem to tell you WHAT to do, but not, most importantly, how things are working under the hood for Forge and Minecraft. Would the main Forge contributors be open to discussion about sitting down and expanding the documentation? I am willing to contribute here in this regard.
  3. I was following along with this guide, but as you can see, it's a bit old. Namely, it's for 1.15.2. Now, it seemed to be working all the way up to the very end: Eclipse says the bolded method is undefined for the type FMLServerStartingEvent.
  4. FINALLYYYYYYYYY The Hell is over. It's done. It works now. Finally... Thank you so much. ❤️ I guess my only question now is... Why is the command different when I run it in the command prompt as opposed to in the IDE?
  5. bin main com arnox exmod2 ExampleMod2$RegistryEvents.class ExampleMod2.class META-INF pack.mcmeta
  6. I think I ran into this before. Try just rebooting your computer. It worked for me last time.
  7. Deleted and reinstalled Eclipse entirely. Deleted the entire project files and redownloaded them (1.16.2 this time). Imported the Gradle Project. Did a test Client run before editing. Works just fine. Edited the package name to "com.arnox.exmod". Edited the modid in the ExampleMod.java file and all the modid's in the mods.toml file. Still errors out in the exact same way. Editing the build.gradle file to remove examplemod and then rerunning genEclipseruns and then another test Client run STILL gives the same error. Guys, I really think this is a bug... EDIT: I tried just deleting the original mod package wholesale and creating it entirely from scratch (com.arnox.exmod2) and copied the contents of the old Java file to the new one. STILL THE SAME ERROR. WHAT THE HELL? It always sees com.example.examplemod. It never goes away! Please tell me other people are getting this error too.
  8. In the src/main/java directory? I'm afraid there's only what is shown in the screenshot. src/main/java/com/arnox/exmod/ExampleMod.java to be exact.
  9. Done. Still erroring out with the same error. Jar still has the same folders and files as listed in the last post. More and more, I'm starting to think this is a gradle bug or something.
  10. Refactored com.Arnox.ExampleMod to com.arnox.exmod. Edited the specified part in the build.gradle file to this: version = '0.0.1' group = 'com.arnox.exmod' // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = 'exmod' Executed the build setup "init" and "wrapper" gradle tasks. Still erroring out with the same error. Assembled jar file (exmod-0.0.1) now looks like this: com Arnox exmod ExampleMod.class examplemod ExampleMod.class example examplemod ExampleMod$RegistryEvents.class ExampleMod.class META-INF MANIFEST.MF mods.toml pack.mcmeta
  11. A small bit of good news. Looking through the console log, I found this: I have no idea where the hell it's finding that though. There's nothing in the above directory besides mods.toml and pack.mcmeta. The plot thickens too when I build the project and then look into the libs folder, open "modid-1.0.jar" and then I get this: com Arnox examplemod ExampleMod.class example examplemod ExampleMod$RegistryEvents.class ExampleMod.class META-INF MANIFEST.MF mods.toml pack.mcmeta
  12. buildscript { repositories { maven { url = 'https://files.minecraftforge.net/maven' } jcenter() mavenCentral() } dependencies { classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true } } apply plugin: 'net.minecraftforge.gradle' // Only edit below this line, the above code adds and enables the necessary things for Forge to be setup. apply plugin: 'eclipse' apply plugin: 'maven-publish' version = '1.0' group = 'com.yourname.modid' // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = 'modid' sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly. println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch')) minecraft { // The mappings can be changed at any time, and must be in the following format. // snapshot_YYYYMMDD Snapshot are built nightly. // stable_# Stables are built at the discretion of the MCP team. // Use non-default mappings at your own risk. they may not always work. // Simply re-run your setup task after changing the mappings to update your workspace. mappings channel: 'snapshot', version: '20200514-1.16' // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable. // accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') // Default run configurations. // These can be tweaked, removed, or duplicated as needed. runs { client { workingDirectory project.file('run') // Recommended logging data for a userdev environment property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' // Recommended logging level for the console property 'forge.logging.console.level', 'debug' mods { exmod { source sourceSets.main } } } server { workingDirectory project.file('run') // Recommended logging data for a userdev environment property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' // Recommended logging level for the console property 'forge.logging.console.level', 'debug' mods { exmod { source sourceSets.main } } } data { workingDirectory project.file('run') // Recommended logging data for a userdev environment property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' // Recommended logging level for the console property 'forge.logging.console.level', 'debug' args '--mod', 'exmod', '--all', '--output', file('src/generated/resources/') mods { exmod { source sourceSets.main } } } } } dependencies { // Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed // that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied. // The userdev artifact is a special name and will get all sorts of transformations applied to it. minecraft 'net.minecraftforge:forge:1.16.1-32.0.106' // You may put jars on which you depend on in ./libs or you may define them like so.. // compile "some.group:artifact:version:classifier" // compile "some.group:artifact:version" // Real examples // compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env // compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env // The 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime. // provided 'com.mod-buildcraft:buildcraft:6.0.8:dev' // These dependencies get remapped to your current MCP mappings // deobf 'com.mod-buildcraft:buildcraft:6.0.8:dev' // For more info... // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html // http://www.gradle.org/docs/current/userguide/dependency_management.html } // Example for how to get properties into the manifest for reading by the runtime.. jar { manifest { attributes([ "Specification-Title": "ExMod", "Specification-Vendor": "examplemodsareus", "Specification-Version": "1", // We are version 1 of ourselves "Implementation-Title": project.name, "Implementation-Version": "${version}", "Implementation-Vendor" :"examplemodsareus", "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ") ]) } } // Example configuration to allow publishing using the maven-publish task // This is the preferred method to reobfuscate your jar file jar.finalizedBy('reobfJar') // However if you are in a multi-project build, dev time needs unobfed jar files, so you can delay the obfuscation until publishing by doing //publish.dependsOn('reobfJar') publishing { publications { mavenJava(MavenPublication) { artifact jar } } repositories { maven { url "file:///${project.projectDir}/mcmodsrepo" } } } I also took the time to replace all instances of "examplemod" (lowercase only) as well with "exmod". Still no difference.
  13. I would recommend restarting and doing the same thing as in the OP except this time, import the project files first. Then import the gradle tasks in Eclipse. This will give a nice list at the bottom window (Gradle Tasks) which you can use to easily access Gradle functions. And then execute the genEclipseRuns option listed in the bottom window.
  14. mods.toml file: # This is the 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="[32,)" #mandatory This is typically bumped every Minecraft version by Forge. See our download page for lists of versions. # 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="All rights reserved" # A URL to refer people to when problems occur with this mod issueTrackerURL="https://intosanctuary.com/" #optional # A list of mods - how many allowed here is determined by the individual mod loader [[mods]] #mandatory # The modid of the mod modId="exmod" #mandatory # The version number of the mod - there's a few well known ${} variables useable here or just hardcode it version="1.16.1-0.0.1" #mandatory # A display name for the mod displayName="Example Mod" #mandatory # A URL to query for updates for this mod. See the JSON update specification <here> updateJSONURL="http://myurl.me/" #optional # A URL for the "homepage" for this mod, displayed in the mod UI displayURL="https://intosanctuary.com/" #optional # A file name (in the root of the mod JAR) containing a logo for display logoFile="" #optional # A text field displayed in the mod UI credits="Thanks goes to all who have made outstanding Minecraft modding tutorials!" #optional # A text field displayed in the mod UI authors="Arnox" #optional # The description text for the mod (multi line!) (#mandatory) description=''' Does stuff.''' # A dependency - use the . to indicate dependency for a specific modid. Dependencies are optional. [[dependencies.exmod]] #optional # the modid of the dependency modId="forge" #mandatory # Does this dependency have to exist - if not, ordering below must be specified mandatory=true #mandatory # The version range of the dependency versionRange="[32,)" #mandatory # An ordering relationship for the dependency - BEFORE or AFTER required if the relationship is not mandatory ordering="NONE" # Side this dependency is applied on - BOTH, CLIENT or SERVER side="BOTH" # Here's another dependency [[dependencies.exmod]] modId="minecraft" mandatory=true versionRange="[1.16.1]" ordering="NONE" side="BOTH" ExampleMod.java file: package com.Arnox.ExampleMod; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; // The value here should match an entry in the META-INF/mods.toml file @Mod("exmod") public class ExampleMod { // Directly reference a log4j logger. private static final Logger LOGGER = LogManager.getLogger(); public ExampleMod() { // Register the setup method for modloading FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setup); // Register the doClientStuff method for modloading FMLJavaModLoadingContext.get().getModEventBus().addListener(this::doClientStuff); // Register ourselves for server and other game events we are interested in MinecraftForge.EVENT_BUS.register(this); } private void setup(final FMLCommonSetupEvent event) { // some preinit code } private void doClientStuff(final FMLClientSetupEvent event) { // do something that can only be done on the client } } As you can see, there isn't anything here at all. Yet, even though there's only these two files, no matter what I do, I can't get it to run properly. There is no "examplemod" modid anywhere in these files, and yet, it still complains about it. For the love of everything, please help me get this to work. This is insanely frustrating. I haven't even written anything yet. Working on 1.16.1, Forge version 32.0.106. Using the Eclipse Java IDE, AdoptOpenJDK 8.0.265.01-Hotspot, and JRE 1.8.
×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.