Jump to content

Recommended Posts

Posted

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?

Posted

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?

Posted

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.

Posted

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

Posted

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

Posted

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.

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.