Everything posted by Majd123mc
-
1.18.1 How to add external dependency to ForgeGradle.
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:
-
I am just trying to compile a mod and I have been having this problem for 2 days, nothing I do seem to work. If anyone can help
@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:"
-
(1.16.5 MCP) spawn particles like a laser
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
-
1.18.1 How to add external dependency to ForgeGradle.
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 } }
-
1.18.1 How to add external dependency to ForgeGradle.
May I ask what your solution was? Unless you mean you used ModList instead.
-
1.18.1 How to add external dependency to ForgeGradle.
@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:
-
how to pack dependencies in jar?
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.
-
[CLOSED] [1.18.1] META-INF/libraries not working
@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.*
-
1.18.1 How to add external dependency to ForgeGradle.
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.
-
[DUPLICATE] [1.18.1] [IntelliJ] libraries not working
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.
-
1.18.1 How to add external dependency to ForgeGradle.
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!
-
[DUPLICATE] [1.18.1] [IntelliJ] libraries not working
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?
-
[DUPLICATE] [1.18.1] [IntelliJ] libraries not working
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?
-
[CLOSED] [1.18.1] META-INF/libraries not working
Yup, it's no longer supported.
-
[CLOSED] [1.18.1] META-INF/libraries not working
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
-
[1.18.1] Best way to check if a block is an ore
What? What version of Minecraft are you using? I've checked and #forge/ores links to each ore in #forge/ores/<ore>.json which link to #minecraft:<ore>_ore.json e.g. #minecraft:diamond_ore.json: { "replace": false, "values": [ "minecraft:diamond_ore", "minecraft:deepslate_diamond_ore" ] }
-
The constructor BlockItem is not defined
Remove new Item(); New code: () -> new BlockItem(BlockInit.COMPRESSED_SOULS_BLOCK.get(), new Item.Properties().tab(CreativeModeTab.TAB_MISC)));
-
Possible to use TTF File format for Custom Font?
As diesieben07 has said, yes there is a (surprisingly) vanilla way to do it. HOWEVER I have noticed that it doesn't look very nice and it it looks very rasterized. If you want it to look better with higher quality, you will need to do your own research on how to use LWJGL to draw ttf fonts.
-
Account Authentication (Migrated)
No.
-
Communication between spigot and forge.
Sorry if I'm not giving enough information, I'm not exactly knowledgeable in this topic. But you can catch sent packets on the server (spigot) using something like ProtocolLib. And to send them (forge) you can use SimpleImpl. (Make sure you have a set id, and that the spigot plugin and forge mod have the same id for the packet) (Maybe add some sort of id at the beginning of the packet that is shared between the mod and spigot?)
-
[1.18.1] Prevent mob (living entity) from attacking / moving
Maybe you can use entity.setNoAi(true)?
-
Decompile java classes without field_ and func_
No. In the mod you decompiled. It might look something like this: class MyItem extends Item { public void someFunc() { func_a123(); } } Now what I get is you want to know what "func_a123" is. It is obfuscated because it is a vanilla function. Search for "func_a123" in the build/createMcpToSrg/output.tsrg file. You can find this file in any mod you built, it doesn't matter (as long as it is the same version of Minecraft)
-
Decompile java classes without field_ and func_
Oh, then it's probably the reobfuscation process. Because minecraft is obfuscated, the deobfuscated function calls lead to nowhere, so they are converted. Anyways, to find what they truly mean, look inside any of your mod projects (IntelliJ) > build > createMcpToSrg > output.tsrg. Then Ctrl + F to get the function's deobfuscated name
-
Decompile java classes without field_ and func_
Hold on, there might be a chance that the mod files aren't being the ones obfuscated, but simply the vanilla function calls are. @ElTotisPro50 Are all the functions and methods like this? Or are only some of them
-
Cannot download fastutil library
NOTE THAT: If you now send over your mod to someone else, they will have to install fastutil manually. If you want it to be included automatically, please check out this post: https://forums.minecraftforge.net/topic/104978-problems-with-shadowing-javafxopenjfx-into-my-mod-jar/?do=findComment&comment=479029
IPS spam blocked by CleanTalk.