Jump to content

Recommended Posts

Posted
  On 8/29/2020 at 10:30 AM, Maxi07 said:

I think, now I have finally got the solution!

 

After I saw the topic "[1.14.4] How add JEI to own mod?", I focused on trying to find out how other mods do this.

The problem is clear: eclipse has found no source code. And I think this is not a bug, there is just no source code.

As far as I know, the faltDir behaves like a regular maven repository. At any mod I have looked (forge too), there is either a [jar name]-sources.jar (it is like the regular jar, but every .class file is the .java file) or the jar not only contains the .class file, but also the .java files. For example the mezz.jei repo at https://dvs1.progwml6.com/files/maven/

 

Lines from my build.gradle:

// 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: '20200723-1.16.1'
// 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.

The is the comment "an Srg named sources jar is made by default". The fact that it is srg named should not matter, because it gets mapped. But the fact that a [jar name]-sources.jar is created is interesting.

 

If I were right right, I would just have to find this [jar name]-sources.jar.

And is where I need your help. Where is the sources.jar? Or do I have to add makeObfSourceJar = true (maybe the default is not working)

Expand  

Just to make sure we stay on topic, here is my main question

Posted (edited)

By the way, I now switched from a flatDir to a maven (similar like Ommina said), because it is a bit simpler for me.

And I also learned a bit new about maven and gradle. I am 99.99% sure I need the sources.jar. I already looked where eclipse found the source for minecraft and forge, it's the sources.jar.

image.png.8d301780eed47efd472f604a8be30587.pngWith these files my maven looks almost like the one from other mods, except the sources.jar (and sources.jar.sha1/md5).

So when I run publish the [jar name]-sources.jar has to be geratend too!

 

I already tried adding the line 

makeObfSourceJar = true

but then is crashed

 

@DaemonUmbra and everyone, do you have any idea how to do this?

 

Sorry for bad english at this post

Edited by Maxi07
Posted

I don't, from what Lex has said he originally made a dependency configuration that deobfed and added sources, then other people changed it to the current fg.deobf() tool and somehow the sources thing was lost, I'll look into how I might restore that

This is my Forum Signature, I am currently attempting to transform it into a small guide for fixing easier issues using spoiler blocks to keep things tidy.

 

As the most common issue I feel I should put this outside the main bulk:

The only official source for Forge is https://files.minecraftforge.net, and the only site I trust for getting mods is CurseForge.

If you use any site other than these, please take a look at the StopModReposts project and install their browser extension, I would also advise running a virus scan.

 

For players asking for assistance with Forge please expand the spoiler below and read the appropriate section(s) in its/their entirety.

  Reveal hidden contents

 

Posted (edited)
  On 8/31/2020 at 10:17 PM, DaemonUmbra said:

from what Lex has said he originally made a dependency configuration that deobfed and added sources

Expand  

But, restoring the source code, via decompiling will never be better then the original.

If using a source.jar works, why not using it? The source.jar is just not generating. But other modders manage it to generate it on publish (example: https://dvs1.progwml6.com/files/maven/mezz/jei/jei-1.16.1/7.0.1.10/), so it is possible. The Question is just how?

And the default build.gradle seems to be broken:

// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.

because it is not made by default

Edited by Maxi07
Posted

It's supposed to get the sources jar and deobf that, I'm looking into it

This is my Forum Signature, I am currently attempting to transform it into a small guide for fixing easier issues using spoiler blocks to keep things tidy.

 

As the most common issue I feel I should put this outside the main bulk:

The only official source for Forge is https://files.minecraftforge.net, and the only site I trust for getting mods is CurseForge.

If you use any site other than these, please take a look at the StopModReposts project and install their browser extension, I would also advise running a virus scan.

 

For players asking for assistance with Forge please expand the spoiler below and read the appropriate section(s) in its/their entirety.

  Reveal hidden contents

 

Posted

No, sorry

This is my Forum Signature, I am currently attempting to transform it into a small guide for fixing easier issues using spoiler blocks to keep things tidy.

 

As the most common issue I feel I should put this outside the main bulk:

The only official source for Forge is https://files.minecraftforge.net, and the only site I trust for getting mods is CurseForge.

If you use any site other than these, please take a look at the StopModReposts project and install their browser extension, I would also advise running a virus scan.

 

For players asking for assistance with Forge please expand the spoiler below and read the appropriate section(s) in its/their entirety.

  Reveal hidden contents

 

Posted

This are my current thoughts and experiments to this:

 

I added

task sourceJar(type: Jar) {
	classifier = 'sources'
	from sourceSets.main.allJava
}

to my build.gradle and "artifact sourceJar" to the publish

 

Now a source jar is generated on publish. But, unlike the jar, it is not reobfed (srg)

 

What I expect to happen is the following: 

1. On publish the jar and the sources.jar get generated and reobfed (not only the jar)

2. GenEclipseRuns copies the files to .gradle\caches\forge_gradle\deobf_dependencies and mappes them. So the file is now [jar_name]_mapped_snapshot_20200723-1.16.1.jar. And the obfed sources.jar gets mapped too and is then [jar_name]_mapped_snapshot_20200723-1.16.1-sources.jar

3. GenEclipseRuns then should tell eclipse that the jar is the lib and that the source can be found in the sources.jar (I can tell eclipse manually where to find the source and javadoc files, but only if it is a java project and not a gradle project)

 

Does this makes sense and is good system? (I am sorry, if this is completly stupid)

If it is:

neither 1, nor 2, nor 3 are happening

 

I dont know if this is the system you are already working on.

 

-------------------------------------------------------------------------------

 

@DaemonUmbra

What is your current progress?

What have you already done?

Is there any way I can help speeding this up or an alternative?

 

And thanks for trying to help me!

Posted

Lex and several others claim it works fine on Eclipse and while it does appear to be broken in intellij, intellij has a decompiler built-in so I'm going to save my sanity and stop looking at the horror that is this codebase.

This is my Forum Signature, I am currently attempting to transform it into a small guide for fixing easier issues using spoiler blocks to keep things tidy.

 

As the most common issue I feel I should put this outside the main bulk:

The only official source for Forge is https://files.minecraftforge.net, and the only site I trust for getting mods is CurseForge.

If you use any site other than these, please take a look at the StopModReposts project and install their browser extension, I would also advise running a virus scan.

 

For players asking for assistance with Forge please expand the spoiler below and read the appropriate section(s) in its/their entirety.

  Reveal hidden contents

 

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




×
×
  • Create New...

Important Information

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