How can you Import Forge Mods into Eclipse - eclipse

Specifically I'm trying to edit this mod: https://www.curseforge.com/minecraft/mc-mods/naruto-anime-mod-plus/files/3050483
I'm not just trying to edit the config, I want to add custom stuff as well.

You can't do it easily because the mods is NOT open-source. In fact, it's All right reserved, so you are not allowed to do it. So do at your own risk.
1) Get the source code
You can ask to the original dev, but it's sure it will decline your question.
Else, you have to decompile the jar thanks to utilities like javadecompilers.com.
2) Create a new Java Project in eclipse
Create a blank java project
3) Copy/paste the code in your eclipse project
*The code obtain thanks to decompilation
4) Before using it, you should fix all decompilation issue.
Finally, I think it's a better idea to create a new one, specially because it will be faster to upgrade it in 1.17 or make more edition.

Related

discover which Eclipse projects are opened

Is there any way to discover programatically (but not in PDE code) which eclipse projects are opened?
I was hoping that would exist a .metadata anywhere telling me that, but couldn't find any non binary data.
The closer I got was something like:
"$WORKSPACE.metadata/.plugins/org.eclipse.core.resources/.projects/%s/org.eclipse.jdt.core/state.dat" where %s refers to the project name
I think m2eclipse uses that guy for some kind of control, because on a m2project this file gets removed as soon as the projects build.
Also, i found some information on .metadata/.plugins/org.eclipse.ui.workbench/workingsets.xml but none of them give me the full info I was hoping to find.
Does anyone knows how to solve it?
I was trying on eclipse 3.7.
On eclipse 4.3 , at least, its possible to parse $WORKSPACE/.metadata/.plugins/org.eclipse.ui.workbench/workingsets.xml and look up whether the desired project has a factoryID="org.eclipse.jdt.ui.PersistableJavaElementFactory", meaning it is opened.
I Didn't try this on 4.2 tough, maybe it works there as well.
To do it "programmatically", you call the APIs from the org.eclipse.core.resources plug-in. Otherwise, you are doing it wrong.

Eclipse - New Project

I need to modify project creation in eclipse. I would like to add my own project creation. For example, when developer selectes File->New->Project, I want my option (i.e, XYZ Java Project) under to be available. Is this possible ? If yes, i am looking for some direction to begin with ?
Thanks.
To begin with you need to contribute your own Eclipse Plug in. Download Eclipse plugin developers IDE from this Location.
You can contribute a Custom Project Wizard through Extensions.
Define your Project Nature
For reference you can check this example Create a Custom Project in Eclipse – New Project Wizard: the Behavior
Hope this helps !!
Yes you can. A robust way to do this is to make an eclipse plugin so that it gets added to the menu. I was just looking into this myself a couple of days ago and this is what I found.
Here are some links:
O'Reilly
Better yet though, let me just show you an answer about this: https://stackoverflow.com/a/299316/879485
If you use Maven you can have a look at archetypes. Maven also has the ability to create Eclipse projects. With this you should have all the tools necessary to automate whatever project layout you need to have.

Play 2.0 with Eclipse 3.6, Scala template editing

I´m new to Play and Scala world, so I´m needing some help to figure out how can I edit the scala template files using Eclipse. I already installed scala ide 2.9 but when I try to edit the index.scala.html, the contents of the file aren´t editable...
Please can anyone help me?
I experienced this just recently, too, but lucky for you I made the full migration from IntelliJ to Eclipse.
There is some setting up you need to do with the Scala templates, but one of the easiest ways to get it done is following these steps:
Step 1: Add file extensions
http://help.eclipse.org/helios/index.jsp?topic=%2Forg.eclipse.platform.doc.user%2Ftasks%2Ftasks-51.xhtml
Be sure that your file extensions are properly added to the file associations.
Step 2:
Look at the associated editor. In the image above you'll see that the only associated editor with *.htm is Web Browser. So you'll need to hit the "Add..." button to add the Scala editor. Don't forget to set it as default :)
Step 3:
Right-click on your Scala template and be sure that you are choosing the right editor. You can also use this to switch between editors.
Hope this helps!

How to programmatically get information in Eclipse

I'm developing an Eclipse Plug-in.
I need to programmatically get both filepath and filename of the selected/active file in the eclipse editor.
Also need to programmatically add an existing file (located outside the project) to the project and then open it on the editor.
I'm a totally beginner with Eclipse, so complete solution would be appreciated.
You question is quite general, but this should clear things up a bit:
Eclipse Plugin Development Tutorial
About adding a file to the project, you have to read the documentation and find where eclipse handles projects. I think that if you have a reference to the project it should be easy.
Hope it helps =)
Your editor is most likely inheriting from IEditorPart, so you should be able to call getEditorInput(), which then may or may not turn out to be a FileEditorInput, for example. From there, you can get at the underlying details of the file.
For your second problem, you can use IProject.create() and then e.g. do an IFile.createLink() and use a local filesystem path, or copy the file using IFile.appendContents().
Have you tried the solution proposed in http://www.eclipse.org/forums/index.php/mv/msg/97927/300308/#msg_300308?

How to create an Intellij and Eclipse compatible code style and code formatting configuration (for java code)?

Few weeks ago I tried Intellij and I found it really awesome. Now, at my project there are two programmers (including me) using Intellij and few other programmers who are going to keep using Eclipse. Since this project is already very large and it's going to grow a lot, we need to use compatible Code Style and Code Formatting between Intellij and Eclipse. We do not want to have problems when one user edits some file and reformats it before saving. With Eclipse "alone" we used to have some exported configuration, and before anybody starts to work, the first step is just to import this configuration. We already tried to use External Code Formatter, but it didn't work on Intellij 9.
So, I have a bunch of questions here:
Is there any way to import eclipse formatting configuration on Intellij 9?
Anybody could share their experience managing this kind of situation? Do you guys have any other suggestion to manage this situation?
There is an updated plugin for IDEA, called Eclipse Code Formatter:
http://plugins.intellij.net/plugin/?idea&id=6546
I would recommend someone spends the time to configure their IntelliJ's code style to be the same as Eclipse. This will take a little time and effort but once it is done, you can export it just like in eclipse so that any other IDEA users can import it.
You could also search online to see if anyone has already done this and you can simply download the code style config and use it.
The only alternative I can think of would be to find a standardized code style template that is available for both eclipse and IntelliJ, like the Recommended Sun Java Code Style.
There seems to be a plugin for that (emerged from this discussion).