Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Hey guys,

I've a problem: I want to write my minecraft forge modification in scala, I've installed Scala IDE for Eclipse and Its done. But I can't add a scala nature to the Minecraft project. If I click on 'add scala nature', It don't do something.

Please help me,

~Santa

I suppose you've used proper tutorial for deploying Forge 1.7 build environment.

Then you should know that Eclipse project is generated from Gradle and thus changes to it won't do any good.

Next, you'd have build.gradle look this way:

repositories {
... // repos config, not our case
}

apply plugin: 'scala' // Here our hero comes
apply plugin: 'forge'

... // rest of Gradle config

and then re-generate Eclipse project with

gradlew eclipse

Also, you need to respect default source layout for Scala or override it

http://www.gradle.org/docs/current/userguide/java_plugin.html

http://www.gradle.org/docs/current/userguide/scala_plugin.html

Last, to see Scala cookes in Eclipse you need to use Scala perspective. Though you should know this if you intend to write in Scala.

 

One of good examples would be ForgeMultipart: https://github.com/Chicken-Bones/ForgeMultipart

It's in Scala, it's a coremod, it's for 1.7 and it's using ForgeGradle.

 

Last advice. Store your launch config as shared and keep it versioned. ForgeGradle doesn't create proper run configurations for you.

 

If you gonna learn Scala by writing your first mod then I wouldn't recommend doing this because Scala is rather complicated and has steep learnring curve. I'd recommend attending these Scala courses on Coursera:

https://www.coursera.org/course/progfun

https://www.coursera.org/course/reactive

Minalien made a great tutorial for using Scala and the IntelliJ IDEA IDE: http://minalien.com/tutorial-setting-up-forgegradle-for-intellij-idea-scala/

if (user.hasKnowledgeOfJava) {

    if (user.question.hasCode) {

        return interpetHelpfulResponse(user.getQuestion());

    } else {

        return "Could you post your code please?";

    }

} else {

    return "Learn some freaking Java!";

}

No , It doesn't work. While I create the source folder, eclipse thinks the scala code was java code. How can I fix this?

As I said above, Eclipse project is generated from Gradle. Assume it as some generated code. Next, re-check info on Gradle's Scala plugin. You'll see that your sources should be in src/main/scala. Or override Scala source location manually. Investigate ForgeMultipart's build.gradle. Otherwise, specify exactly what you do, what you expect to happen and what went wrong.

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.