Jump to content

[Eclipse] Proper way of creating sub-mod addons etc.


SiriusWolf

Recommended Posts

Hey there, because I use 2 entirely different versions of forge this has never been an issue.

But now that I've released my 1.8 version there's things I want to add, but not as a part of the main mod.

 

Mods like TE, Mekanism, Growthcraft, etc. all have addons that require a base mod.

What is the proper way to have multiple mods and addons in a single forge copy

but only build them one at a time and be dependent?

 

I've tried fooling with the package structure and such, and even tried it the way I'd do this task in C# (VS)

but it all builds together.

a.k.a. Sirius

width=400 height=82http://i.imgur.com/QRtYi6e.png[/img]

Link to comment
Share on other sites

I am also interested in this.  I know Reika has a gradle.build file that does it for him (I've got a copy, but I can't decipher it in order to use it).

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

I am also interested in this.  I know Reika has a gradle.build file that does it for him (I've got a copy, but I can't decipher it in order to use it).

 

http://goo.gl/TSNMvo

It seems to be that bottom half that matters, directing gradle to build 3 separate libraries that all depend on 1 of them.

I've never played with the build file and didn't get it enough when I first looked at it when I began modding, but I'd really like

to be able to release the next couple of batches of stuff for my mod in parts rather than have another 5-10 config file options

the average user probably doesn't look at anyway. lol

a.k.a. Sirius

width=400 height=82http://i.imgur.com/QRtYi6e.png[/img]

Link to comment
Share on other sites

I'll have to mess around with it when I get a chance.  I haven't even looked at my code in three days.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

This is an excellent question, and it is one of those things that some people seem to just magically know how to do... for example, I had no idea that /src/api/java/ was a special folder (it didn't even exist). I suppose it's a feature of Gradle to link those files automatically?

 

Then there's all sorts of magic that is evidently possible with build.gradle, but there are probably whole books devoted to that subject - the online documentation certainly isn't a quick read.

 

For us non-Gradle experts, it would be really nice to have a 'Gradle for Modders' information page, somewhere we can quickly learn about the most common modding-related tasks so we don't all have to become experts in Gradle and can focus instead on adding content to our mods.

Link to comment
Share on other sites

Ha, Finally its my time to shine!

 

I did this a while ago to try out the submod system. I will post some step by step instructions in a few hours.

However, when I wrote them I never intended to share them and I never really tried if everything works (looks like it does, though)

Here could be your advertisement!

Link to comment
Share on other sites

Couple things.

 

To do a task, run "gradlew [name of task]" e.g. "gradlew fullBuild"

 

You can define variables in the build.gradle file like so:

 

def libVersion = "1.3.0"
def oresVersion = "0.3.0"
def hazardsVersion = "0.2.0"
def wildlifeVersion = "0.2.0"

 

There's supposedly a way to wrap those in the build's extended properties, eg.

ext {
   mySpecialProperty = "1234"
}

But I can't seem to reference it properly (that part is fine, the reference throws a build error) per section 13.5.2.

 

I'm also getting a build failure doing the

releaseJars

task, which is responsible for renaming the zip files as jar files ("file is in use by another process") but the file is renamed correctly (as well as every other step completing successfully).  Here's the debug output:

 

12:07:25.447 [iNFO] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] :releaseJars (Thread[main,5,main]) started.
12:07:25.454 [LIFECYCLE] [class org.gradle.TaskExecutionLogger] :releaseJars
12:07:25.454 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter]
                                     Starting to execute task ':releaseJars'
12:07:25.471 [DEBUG] [org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter]
                                     Determining if task ':releaseJars' is up-to-date
12:07:31.718 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter]
                                     Finished executing task ':releaseJars'
12:07:31.737 [iNFO] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] :releaseJars (Thread[main,5,main]) completed. Took 6.283 secs.
12:07:31.753 [DEBUG] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] Task worker [Thread[main,5,main]] finished, busy: 36.296 secs, idle: 0.289 secs
12:07:31.784 [ERROR] [org.gradle.BuildExceptionReporter]
12:07:31.800 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.

 

Lastly don't forget to include/exclude your assets folder(s) as needed in the from zipTree(...) section:

 

exclude 'assets/**'
include 'assets/submod1/**'
include 'assets/submod2**'
etc

 

Anyway, here's my build.gradle

http://pastebin.com/hVGQqPcr

Note that I have a few include/exclude listing based on my setup which is not exactly ideal.  I was simply taking the path of least resistance (adding the extra include/exclude line rather than moving things to new folders and having the build file move them back to where they're needed).

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

As a side note, I set up bat files to run the build commands for me, rather than using a command line (where I have to copy-paste the folder directory before I can do anything).

 

gradlew fullBuild
pause

 

The 'pause' should hold the window open (until you press any key) but I've had mixed results.  If it doesn't work, do this instead:

start /wait  fullBuild

 

It'll create a second command window, but it'll be forced to stay open after the process completes.  Either close it or type "exit"

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Or I can double-click a batch file.  I type the command once, and bam!

width=571 height=464http://imgs.xkcd.com/comics/is_it_worth_the_time.png[/img]

I save 5 seconds, I do it about once a week, and it took me less than 21 minutes to write.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Hello, I don't have much experience with forge but I have some java knowledge, I want to add a button that says "Explore New Packs" to the Pause Screen that opens when we enter a world in the game and press the "esc" button, but I couldn't understand it (or I don't know how to use it), although I did research from artificial intelligence or different places. I was told that I can do it using mixins but I have no idea how to do it, can you explain step by step
    • We need the crash report or debug.log, as explained in the FAQ
    • i have the decocraft mod and i can see all of them. i can click right click and place the items but as soon as i put it down it disappears. im so sad it doesnt work and i dont know how to fix it. i used cursed forge to launch minecraft as well.
    • Me and my friend wanted to make a custom mod pack hosted on aternos. I downloaded the same mods as the server then started the server and my minecraft and I joined the server without issues. Then I sent the mods to my friend compressed in a zip folder (i don’t know if that has anything to do with the issue). He unpacked it put it in his mod folder and started it but couldn't join the server and got this issue:   internal exception: java.lang.runtimeexception: server not initialized yet! call IMDLib.entityHandler (modid)   Also we are using curseforge launcher to manage the mods on client side. But as I said it works on my side but not with my friend, that’s why it doesn’t make sense   Mod list:   xplosives-1.2.0.jar whisperwoods-1.18.2-2.1.0-forge.jar waystones-forge-1.18.2-10.2.2.jar voicechat-forge-1.18.2-2.4.32.jar trashslot-forge-1.18.2-11.0.3.jar towns_and_towers_forge-1.10.0.1+1.18.2.jar torchmaster-18.2.1.jar ToolBelt-1.18.2-1.18.9.jar toms_storage-1.18.2-1.4.4.jar swingthroughgrass-1.18.2-1.9.1.jar strictly_origins_v5.1_1.18.2.jar starlight-1.0.2+forge.546ae87.jar SpartanWeaponry-1.18.2-3.0.4.jar SimpleQuarry-1.18.2-18.2.5.jar simpleplanes-1.18.2-5.2.2.jar secretrooms-1.18.2-1.1.5.jar right-click-harvest-3.2.0+1.18.2-forge.jar REIPluginCompatibilities-forge-8.0.89.jar RoughlyEnough|tems-8.3.681-forge.jar RegionsUnexploredForge-0.4.1_1+1.18.2.jar TerraBlender-forge-1.18.2-1.2.0.126.jar Recall_Potion_v1.0.3-1.18.2.jar Quark-3.2-358.jar PickleTweaks-1.18.2-6.1.2.jar Pehkui-3.7.11+1.18.2-forge.jar Origins-1.18.2-1.4.1.4-unified.jar naturalist-forge-1.1.1-1.18.2.jar mysticaloaktree-1.18.2-1.2.jar selene-1.18.2-1.17.14.jar MysticalAgradditions-1.18.2-5.1.4.jar MysticalAgriculture-1.18.2-5.1.5.jar MultiMine-1.18.7.jar moyai-1.18.2-1.1.4.jar ModernDynamicSurroundings-5.0.0.4.jar lootbeams-1.18.1-release-july1722.jar journeymap-1.18.2-5.9.7-forge.jar ironfurnaces-1.18.2-3.3.3.jar ironchest-1.18.2-13.2.11.jar industrial-foregoing-1.18.2-3.3.1.6-10.jar titanium-1.18.2-3.5.11-45.jar immersive_armors-1.5.6+1.18.2-forge.jar hardcorerevival-forge-1.18.2-8.0.1.jar HammerLib-1.18.2-18.2.16. jar gravestone-1.18.2-1.0.1.jar geckolib-forge-1.18-3.0.57.jar findme-3.0.6-forge.jar faithfulbackrooms3.0.0.7.jar elevatorid-1.18.2-1.8.4.jar EasyMagic-v3.3.0-1.18.2-Forge.jar PuzzlesLib-v3.5.9-1.18.2-Forge.jar easy_villagers-1.18.2-1.0.11.jar easy_mob_farm_1.18.2-7.1.0.jar DynamicTrees-1.18.2-1.0.4.jar dragonseeker-1.1.1-1.18.2.jar iceandfire-2.1.12-1.18.2.jar Cucumber-1.18.2-5.1.5 jar cloth-config-6.5.116-forge.jar citadel-1.11.3-1.18.2.jar chunkloaders-1.2.8a-forge-mc1.18.jar supermartijn642configlib-1.1.8-forge-mc1.18.jar supermartijn642corelib-1.1.17-forge-mc1.18.jar cave_dweller-1.18.2-1.6.4.jar carryon-1.18.2-1.17.1.12.jar caelus-forge-1.18.1-3.0.0.2.jar BotanyTrees-Forge-1.18.2-4.0.13.jar BotanyPots-Forge-1.18.2-8.1.29.jar Bookshelf-Forge-1.18.2-13.3.56.jar balm-3.2.6.jar AutoRegLib-1.7-53.jar ars_nouveau-1.18.2-2.9.0.jar curios-forge-1.18.2-5.0.9.2.jar Patchouli-1.18.2-71.1.jar architectury-4.12.94-forge.jar almostunified-forge-1.18.2-0.3.10.jar [1.18.2] SecurityCraft v1.9.8.jar
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.