Posted May 14, 20169 yr I have some lambas expression in my code and some try multi-catch statements and when I do gradlew build to export my mode it fails because some of the stuff I did is not supported in source 1.6. How can I use a latter version of java?
May 15, 20169 yr Add these lines to your build.gradle. Note that ForgeGradle can't reobfuscate lambdas (see this issue), so you need to create wrapper interfaces like this one. Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
May 15, 20169 yr Author So I exported my mod and and I don't understand why it does not work the same between the eclipse version and the real version of minecraft? I mean some things works but for example in my eclipse version I can hurt entities by doing a right click, but it does no damage when running on the real version. I think that has something to do wih server stuff. Do we have to "install server" with the forge installer?
May 15, 20169 yr Did you build it by running the build Gradle task? You should create a new thread for this issue and post your code and the FML log. Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
May 15, 20169 yr CAN you require J8 in your mod? Yes. SHOULD you? No, Minecraft targets J6, so should you. Simple as that. I do Forge for free, however the servers to run it arn't free, so anything is appreciated. Consider supporting the team on Patreon
May 15, 20169 yr Author I deleted my lambdas expressions and srcCompat = JavaVersion.VERSION_1_8 targetCompat = JavaVersion.VERSION_1_8 and yes I use gradlew build. I now have an error when I build, the error in the code is if (amount > 0.0F && (boolean)method.invoke(attackedEntity, source)) which says "incompatible types: Object cannot be converted to boolean I didn't have the problem in eclipse, but I fixed it by putting srcCompat = JavaVersion.VERSION_1_7 targetCompat = JavaVersion.VERSION_1_7 in the build.gradle, it now generate the jar but the mod still act different than the eclipse one. Also I don't know where the FML log are
May 15, 20169 yr Casting an object to a primitive type should compile under Java 7 or 8 (and does for me), I'm not sure why it wasn't working for you. You can find the FML log in <gameDirectory>/logs/fml-client-latest.log. In the development environment, <gameDirectory> is the value of the minecraft.runDir variable in build.gradle (defaults to run). Again I suggest creating a new thread for your issue since it's likely not directly related to Java 8. Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
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.