Jump to content

Majd123mc

Members
  • Posts

    52
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Majd123mc's Achievements

Stone Miner

Stone Miner (3/8)

3

Reputation

  1. Excuse me for the lateness! I have notifications turned off. What @Hypervisor linked is another solution that could work. What I did was I put the code before processResources like this:
  2. @NyanNyanNyan It seems like you are using a JRE instead of a JDK. What IDE are you using? IntelliJ, Eclipse, none? If you're in IntelliJ, press Ctrl+Alt+Shift+S, click "SDKs", click the "+", click "Download JDK". Once it has downloaded, make sure you change it in "Project" > "Project SDK:"
  3. You're going to need to spawn multiple particles. You can use a for-loop for that. Pseudo code: for (int i = 0; i < detail /* how much to spawn */; i++) { world.addParticle(/* Particle info goes here ... */, /* X: */ (destX / detail) * i); } (That won't actually work you will need to make your own adjustments
  4. After researching for a while in the source code of ForgeGradle, I have found this code to be a lot more realiable: // Fix the classpath the right way and once and for all afterEvaluate { // Collect deps in runtimeClasspath but NOT in minecraft def deps = (configurations.runtimeClasspath - configurations.minecraft).join(';') // Add deps to classpath minecraft.runs.each { run -> run.token 'minecraft_classpath', deps } }
  5. May I ask what your solution was? Unless you mean you used ModList instead.
  6. @matezz I had the same problem where it would not load my dependencies in runClient, and the following code in build.gradle did it for me: (I've edited the code here from the old one since this one is more reliable, scroll down a little for the older code) // Fix the classpath the right way and once and for all afterEvaluate { // Collect deps in runtimeClasspath but NOT in minecraft def deps = (configurations.runtimeClasspath - configurations.minecraft).join(';') // Add deps to classpath minecraft.runs.each { run -> run.token 'minecraft_classpath', deps } } Older worse code:
  7. Check the post I put on the other topic (here). Do not do this because forge will not be able to include them when players install your mod on their computer.
  8. @noSkill You will have to create a fat jar instead. A quick google search will show you plenty of results. HOWEVER, in 1.18.1 ANY external dependencies, when debugging using the debug tool in IntelliJ, the libraries don't load AT ALL. Which has nothing to do with fat-jaring and is a *bug*. But if you want to package other libraries in your mod, you will need to create a fat jar. I've found this resource to be useful: https://gist.github.com/Commoble/ddc75e819a690198c15d26564d139333 *P.S. I was not able to test if the Jar-in-Jar method works still, it MAY work in 1.18.1 but I cannot verify that because of the bug. There is a chance it still works so you can test it out and if it works for you, great! If it doesn't, then use the fat jar method instead.*
  9. Yes, but that does not solve the issue that when running the runClient task, it COMPLETELY ignores all dependencies. ALL of them. Your example is in 1.12.2, which does not exhibit this issue. It only seems to be there in 1.18.1. Hate to disturb you, but @diesieben07, if you have any idea why and how to solve this issue I will be greatly appreciative.
  10. For future readers, this is that post: https://forums.minecraftforge.net/topic/107092-1181-how-to-add-external-dependency-to-forgegradle/ Also, duplicated by it.
  11. And.... that's exactly the problem I'm facing. Well, at least thanks diesieben07 for pointing to me to use ModList.get().getAllScanData which solves my problem. As for the dependency issue, I guess I'll wait until I really need a solution. Thanks!
  12. If it really matters, I had an automatic registry system. Annotate the deferredregister field and it would be found and registered. Sure, it is innefficient but this should apply to any other library, right?
  13. Hi, I am trying to include Reflections into my mod. I tried using shadowJar, but it seems whether or not I use it I face the same problem. When I debug runClient with IntelliJ, it just doesn't pick up on the dependency and I get a NoClassDefFoundError no matter what. If I build a jar using shadowJar and then copy it into the mods folder and launch Minecraft through the launcher, I get a different error but there is no NoClassDefFoundError indicating this is a problem with IntelliJ. How do I use external libraries with ForgeGradle and IntelliJ?
  14. Hello, I am using the Reflections library for my mod. However, when I try to include it using the old ContainedDeps method in 1.18.1, it seems to not work anymore. Am I doing something wrong, or is this method obsolete now? Should I use shading instead? pack-libs.gradle // Create configuration configurations { packLib implementation.extendsFrom packLib } // afterEvaluate is necessary so that packLib isn't resolved before it is used afterEvaluate { jar { // Copy libraries from (configurations.packLib) { into 'META-INF/libraries' } // Add libraries into manifest //noinspection GroovyAssignabilityCheck manifest { attributes([ "ContainedDeps": configurations.packLib.collect { it.name}.join(' ') ]) } } } build.gradle ... // Allows us to pack libraries into jar to be loaded by forge apply from: 'pack-libs.gradle' ... dependencies { ... packLib 'org.reflections:reflections:0.10.2' } To clarify, I'm not getting a compilation error, I'm getting a NoClassDefFoundError. Also, when I build the jar and check inside it, the jars do seem to be there in META-INF/libraries and the ContainedDeps is correct: ContainedDeps: reflections-0.10.2.jar javassist-3.28.0-GA.jar jsr305-3 .0.2.jar slf4j-api-1.7.32.jar
×
×
  • Create New...

Important Information

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