Jump to content

Using an Api with forge


Creeperologist

Recommended Posts

well I've done of modding in the past but I recently took an interest in using various api to interconnect one of the mods I have been working on since 1.3

 

I'm currently trying to use thaumcraft 3's api, and considering looking into industrial craft and such as well in the future but for now what I'm trying to figure out for either is the same

 

what is it that you must do in the setup to be able to use an external api

 

I know there is information on the tutorials page however it appears as though things are no longer the the same as they were, and I have yet to find a working guide for the current setup

 

 

 

 

Most people spend their time fearing what they already know, but unfortunately what they really have to fear is what they don't know

Link to comment
Share on other sites

After you install Forge, go to your MCP/src/Minecraft/ folder. Post the unzipped API in there. It's instantly accessible and usable within Eclipse or whichever other editor you use.

 

For Thaumcraft's API specifically (and GregTech's), there will be various errors within the API files themselves as you open Eclipse. Find any errored lines within the affected classes, and literally delete the lines/methods until there's no more errors. The API files themselves won't be included in your mod, so provided the methods themselves aren't deleted from the API, you should get no reobf errors and it should function correctly in-game.

 

Note that the APIs will be dumped into your reobf folder. Ignore them completely. This is because the updatemd5 script is being skipped because, meh, it's effort to make it work if you use any API outside of Forestry's.

Link to comment
Share on other sites

  • 2 weeks later...

Since I can't seem to find this anywhere, what about for APIs that don't distribute their source docs? Like RenderPlayer API and Player API? Obviously some people have used these in their mods already, but no reference on how to decompile them.

 

Far be it form me to complain about an API that someone is releasing for free out to the masses, but the installation instructions for modders is....lacking?

 

I'm a fairly new modder but a long-time programmer, and I'm finding myself less than gruntled on the modding documentation in general; but back to topic, does anyone know how to get these APIs into the project?

"The Gentle Way... My @$$!"

-average new judo student upon learning the meaning of the word Judo in Japanese

Link to comment
Share on other sites

I am also trying to make a mod with a parent mod - even having the source to the api does not make it possible to actually run the mod in the development client.  As far as I can tell, you need to decompile the mod with the minecraft source, but as Forge does all that for you in one step, I'm not sure how it is *supposed* to be done.

 

If you have the API, but not the API *source*, you should be able to include the API as an external jar using Eclipe's Project > Properties > Libraries menu.  This won't help you with getting your development client working, as below, but it should make it so you have access to the types and so forth provided by the API Jar file.

 

I have been collecting some information about how to do this at http://www.minecraftforge.net/wiki/Developing_Addons_for_Existing_Mods. Perhaps it will be of help to you.  If not, if you figure it out, perhaps you can add to this.

 

I agree about the state of the documentation, although the Generic Mod documentation was very helpful for getting started.  My impression is that the community is still very fractured.  Some of the major mod creators tend to look down on people who create mods that use their mods, and others get pissy about it.  Then there is BuildCraft!  But, I don't need pipes.  So.

Link to comment
Share on other sites

I'll dig into that info, I hadn't come across it yet. If I figure anything out here, I'll post my solution. If I didn't keep getting sidetracked with these nuisance issues... and all this trying has pretty much screwed up my development environment beyond repair. Probably going to have to begin at scratch again. :P

"The Gentle Way... My @$$!"

-average new judo student upon learning the meaning of the word Judo in Japanese

Link to comment
Share on other sites

Ok, I believe I've found the solution. I had figured out a little bit on my own, but then came across the APiI developer's FAQ on another API which filled in the holes for me. Here's the scoop.

 

1) install forge as usual

2) run install.bat(sh) etc...

3) rename /src to /src_forge

4) replace the minecraft.jar file located in the /mcp/jars directory with one modded with the API you need to decompile

5) run mcp/cleanup.bat(sh)

6) run mcp/decompile.bat(sh)

7) copy the appropriate source files to the correct /src_forge/ directory

8) rename or delete /src (to /src_decompile/ or something)

9) rename /src_forge back to /src

 

That's it.

Thank you to Divisor for producing these APIs as well as the instructions I've paraphrased above. I found these on his Player API forum post, though I do not believe they were on his RenderPlayer API forum post (which was the API I first targeted).

 

Some people may think, "well duh...." but my feeling is the more times it's spelled out online, the more likely someone will find it when they search.

 

I guess a similar process can be followed for other APIs when src is not included. Let me know if this hits the spot, I'll be testing the whole process tonight.

"The Gentle Way... My @$$!"

-average new judo student upon learning the meaning of the word Judo in Japanese

Link to comment
Share on other sites

Followup...

Imported the files specified by Divisor in his instructions, but had so many errors in the java, I didn't know even where to start. over a hundred. a few looked like easy fixes, but the rest appeared to be too complicated for me as a mere mortal to attempt to fix.

 

<PSA>

API developers, please release the .java files if you intend to make your API widely used.

</PSA>

"The Gentle Way... My @$$!"

-average new judo student upon learning the meaning of the word Judo in Japanese

Link to comment
Share on other sites

I don't really understand step 4 of the instructions.  The external mod can't have modified minecraft.jar itself, right?  It should just add other jar files to the minecraft system.  Otherwise how could you have more than one mod at a time?

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.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I have created a custom entity that extends "TamableAnimal", but I am wanting to have it spawn in the ocean. I have it spawning right now, but it spawns way too frequently even with weight set to 1. I am guessing it is because it is rolling in the spawn pool of land animals since TameableAnimal extends Animal and is different than WaterAnimal, and since no land animals spawn in the ocean it just fills every inch up with my custom entity. I have followed basic tutorials for spawning entities with Forge, but I feel like I am missing something about how to change what spawn pool this custom entity ends up in. Is it possible to change that or do I need to refactor it to be based off of WaterAnimal to get those spawn? My biome modifier JSON file: { "type": "forge:add_spawns", "biomes": "#minecraft:is_ocean", "spawners": { "type": "darwinsmysticalmounts:water_wyvern", "weight": 20, "minCount": 1, "maxCount": 1 } } My client event: event.register(ModEntityTypes.WATER_WYVERN.get(), SpawnPlacements.Type.NO_RESTRICTIONS, Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, WaterWyvernEntity::checkWaterWyvernSpawnRules, SpawnPlacementRegisterEvent.Operation.REPLACE); And the actual custom spawn rule that makes it spawn in the water: public static boolean checkWaterWyvernSpawnRules(EntityType<WaterWyvernEntity> pAnimal, LevelAccessor pLevel, MobSpawnType pSpawnType, BlockPos pPos, RandomSource pRandom) { return pPos.getY() > pLevel.getSeaLevel() - 16 && pLevel.getFluidState(pPos.below()).is(FluidTags.WATER); }  
    • Starting today, I am unable to load my modded minecraft world. Forge crash log initially said it was a specific mod called Doggy Talents, which I disabled. Then it blamed JEI, and when that was disabled it blamed another mod so I assume it's something more than a specific mod. Minecraft launcher log claims "Exit Code 1". Nothing had changed since last night when it was working fine Forge Log: https://pastebin.com/S1GiBGVJ Client Log: https://pastebin.com/aLwuGUNL  
    • “Courage doesn’t mean you don’t get afraid. Courage means you don’t let fear stop you.” This mantra has been my guiding light throughout my life as a military doctor. After years of serving my country, I dedicated myself to healing others and making a positive impact on the lives of my fellow soldiers and their families. My commitment to service extended beyond the battlefield; I was determined to secure a stable future for my own family. With my hard-earned savings, I invested $470,000 in cryptocurrency, believing it would provide the financial foundation we needed. However, one fateful day during a particularly intense deployment, everything changed. While treating a patient amid an attack, my phone slipped from my hands and crashed to the ground. In the chaos, I realized I hadn’t backed up my cryptocurrency wallet recovery phrase, thinking I had plenty of time to do so later. When I attempted to access my funds that night, panic surged through me—I could no longer access my wallet. My dreams of financial security and stability were vanishing right before my eyes. The betrayal I felt was profound. It was as if I had not only failed myself but also my family, who relied on me to provide for them. Each day at the hospital reminded me of my commitment to healing, and now I was left feeling helpless in the face of adversity. I feared losing everything I had worked so hard for, and the emotional toll was unbearable.  In my desperation, I reached out to trusted colleagues and friends. One fellow veteran mentioned TECH CYBER FORCE RECOVERY Tool, a reputable team known for their expertise in recovering lost digital assets. REACH OUT TO THEM WWW.techcyberforcerecovery.info https://wa.me/message/BJPIMH5UTNLKL1 
    • I am using AMD, yes. I downloaded the website's drivers and am still having the issue. I also used the Cleanup Utility just in case. 
    • I can't figure out how to upload it any other way, so I made a google drive link; hopefully that works https://drive.google.com/file/d/165vmAMoLtb55wzwYHh3vBfHlJ-Wrgm_y/view?usp=sharing
  • Topics

×
×
  • Create New...

Important Information

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