Jump to content

Recommended Posts

Posted (edited)

Hey, I have programmed a little test-mod where i wanted to test the discord-rich-presence-library with minecraft.

First i had problems with declaring the lib in the dependencies, but i finally got it working and no errors appear when testing. But as i exported it via CMD with the "gradlew build" command and tested it with forge it crashes when starting and i always get the same crashlog:crash-2020-10-22_21.25.25-client.txt. I think there is still something wrong with declaring the lib in the dependencies in my build.gradlebuild.gradle file.

Thanks.

Edited by Paulsen
Posted

Declaring a dependency doesn't pack it into your mod

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

Look into the Gradle plugin called "Shadow"

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

It's not only for Gradle 6+, it has older versions for older Gradle

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)

I applied several examples from https://plugins.gradle.org/search?term=shadow that compiled correctly, but none of them worked, i still get the same error. Maybe i imported them wrong. I only added the lines in the build.gradle-file like this: 

plugins {
    id "com.github.johnrengelman.plugin-shadow" version "2.0.3"
}

apply plugin: "com.github.johnrengelman.plugin-shadow"

 

The jar-library btw. is this one: https://github.com/Vatuu/discord-rpc

Edited by Paulsen
Posted

I've been programming java for quite some years and i have never worked with gradle before, and i admit taht most of the time i don't have a clue what i'm doing other than copy paste possible solutions for this problem. I've tried to use the plugin, but it doesn't work and i have still no idea why!

Posted

I added a shadowJar{ } in my build.gradlebuild.gradle. In this Block i sho uld be able to define what my plugin is doing. I think i have to define my classes, as its described in the docs, but the library i importet from github doesn't work with intellij.

Posted

Yes I called shadowJar right after i applied the plugin. I also changed the compile to runtime, just like my discord-library in the dependencies. I can defenetly say that something is working because now the built file is smaller than before. But it still doesn't work in Forge sadly. 

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.