Jump to content




Running ComputerCraft from Eclipse (Question) [SOLVED]


  • This topic is locked This topic is locked
15 replies to this topic

#1 Bubba

    Use Code Tags!

  • Moderators
  • 1,142 posts
  • LocationRHIT

Posted 11 November 2012 - 06:13 PM

Hello guys,

I was recently reading some posts in this forum about using BON to run ComputerCraft from Eclipse. As of yet I have not managed to make this work. I've deobfuscated using the BON utility and output that to a jar file called 'ComputerCraft'. I then go into eclipse, open the properties, select the Libraries tab, and add that file as an External Jar. Everything looks fine until I try to run it, which is when I get this error.

Spoiler

Picture
Spoiler
I can add the peripheral libraries to my project with no issue; it is only when I attempt to deobfuscate ComputerCraft and run it from Eclipse that I run into errors.
Any help would be much appreciated.

#2 someone9999

  • New Members
  • 19 posts

Posted 11 November 2012 - 09:23 PM

I don't know if this is the best way, but instead of linking the jar in eclipse, try dropping the deobfuscated jar into the mods folder under the jars folder in your work directory where all the scripts are.

mcp-directory/jars/mod/deobfuscated-computer-craft.jar

This method worked for me better than linking it in eclipse

Remeber that you still need to make sure that you set the width and height fields in the GuiOptions class to public.

Edit: GuiButton class. Sorry.

#3 Cloudy

    Ex-Developer

  • Members
  • 2,543 posts

Posted 11 November 2012 - 10:34 PM

Also try removing the API from the workspace. It's probably conflicting with the API inside CC.

#4 Bubba

    Use Code Tags!

  • Moderators
  • 1,142 posts
  • LocationRHIT

Posted 12 November 2012 - 05:19 AM

Thanks for replying guys. Unfortunately I'm still running into issues. The width and height fields do not seem to be declared in the GuiOptions class - they're declared in the GuiScreen class. Maybe I'm just too noobish at java to understand what you're asking me to do, or maybe I have a newer version of MCP/Minecraft. The width and height fields are already set to public in the GuiScreen class.

EDIT: I went back and looked at immibis' original post and saw that he said you need to edit the GuiButton class. I don't know if this is what you meant, but either way it still did not work.

 someone9999, on 11 November 2012 - 09:23 PM, said:

I don't know if this is the best way, but instead of linking the jar in eclipse, try dropping the deobfuscated jar into the mods folder under the jars folder in your work directory where all the scripts are.

mcp-directory/jars/mod/deobfuscated-computer-craft.jar

This method worked for me better than linking it in eclipse

By this do you mean I should put it under:
MCP-dir/eclipse/Minecraft/mods/deobfuscated-computer-craft.jar?
Putting it into the regular mcp/jars/mod/ directory had no effect.

#5 Orwell

    Self-Destructive

  • Members
  • 1,091 posts

Posted 12 November 2012 - 06:04 AM

I always put the deobfuscated jar file in 'mcp/lib/', nothing in 'mcp/jar/mods'. And then I reference to it as library from eclipse and change the width and height fields in GuiButton to public as stated before.. Maybe you could try that?

#6 Bubba

    Use Code Tags!

  • Moderators
  • 1,142 posts
  • LocationRHIT

Posted 12 November 2012 - 06:35 AM

 Orwell, on 12 November 2012 - 06:04 AM, said:

I always put the deobfuscated jar file in 'mcp/lib/', nothing in 'mcp/jar/mods'. And then I reference to it as library from eclipse and change the width and height fields in GuiButton to public as stated before.. Maybe you could try that?

Still getting the same error log. Do I need to decompile it again after I put the deobfuscated file into mcp/lib?

#7 Bubba

    Use Code Tags!

  • Moderators
  • 1,142 posts
  • LocationRHIT

Posted 12 November 2012 - 07:36 AM

Okay well I've tried to decompile it with the deobfuscated jar in mcp/lib and then add that as a library from eclipse but I continue to get the same error. Here are some screenshots of what I'm doing.
Spoiler

Am I doing something wrong here?

#8 someone9999

  • New Members
  • 19 posts

Posted 12 November 2012 - 08:57 AM

2012-11-11 00:09:14 [INFO] [ForgeModLoader] Forge Mod Loaderversion 4.4.2.440 for Minecraft 1.4.4 loading

Your running a incompatible version of minecraft for computer craft 1.4.6, as computer craft 1.4.6 is released for minecraft 1.4.2. When you deobfuscated it, it deobfuscated wrong because the mappings are different in 1.4.4 than in 1.4.2 and MCP for 1.4.4 isn't released yet.

Try setting up a workspace for minecraft 1.4.2 instead of 1.4.4, and that should fix the problem you are having.

#9 Bubba

    Use Code Tags!

  • Moderators
  • 1,142 posts
  • LocationRHIT

Posted 12 November 2012 - 09:05 AM

I don't know why the error log says Minecraft 1.4.4, but I am using Minecraft 1.4.2. Maybe that is a bug with forge or MCP? 1.4.4 is still in pre-release stages (which I have not tried), and I got this jar freshly download from my .minecraft/bin file.

EDIT: Unless the Forge installation is for minecraft 1.4.4 and it automatically downloaded Minecraft 1.4.4... Let me try to download an older version of Forge and see if that works.

EDIT2: Okay, the forge version I was using was version .363. The current stable version is version .341. I'm decompiling with Version .341 right now, so I'll see how that works.

#10 Bubba

    Use Code Tags!

  • Moderators
  • 1,142 posts
  • LocationRHIT

Posted 12 November 2012 - 09:24 AM

Nope. Still get the same error message (with the exception of it saying Minecraft 1.4.2 now). Here is the error log again.
Spoiler


#11 Cloudy

    Ex-Developer

  • Members
  • 2,543 posts

Posted 12 November 2012 - 09:49 AM

Remove the API source.

#12 Bubba

    Use Code Tags!

  • Moderators
  • 1,142 posts
  • LocationRHIT

Posted 12 November 2012 - 09:55 AM

I didn't put the API into eclipse at all. Unless you mean remove it from the reobfuscated jar file, in which case how would I do that?

#13 Bubba

    Use Code Tags!

  • Moderators
  • 1,142 posts
  • LocationRHIT

Posted 12 November 2012 - 10:02 AM

Finally figured it out! I forgot to run BON again after downgrading to forge version 341. Everything is working now. Thank you guys so much for your patience :unsure:/>

In case anyone would like to do this again and have trouble following all that went on here, here is a step-by-step tutorial:

1) Download MCP for the current ComputerCraft supported version of Minecraft
2) Download Forge Source for the current ComputerCraft supported version of MCP
3) Download Bearded Octo Nemesis
4) Install Forge into your MCP folder
5) Run BON on the ComputerCraft mod. Drag the resulting file into your MCP/lib/ folder.
6) Open eclipse and set the workspace to your MCP/eclipse/ folder.
7) Add the deobfuscated ComputerCraft jar/zip file to the referenced libraries.
8) Change the width and height variables to public in net.minecraft.src.GuiButton
9) Enjoy ^_^/>

#14 sirdabalot

  • Members
  • 115 posts

Posted 12 November 2012 - 10:22 AM

 Challenge.Accepted, on 12 November 2012 - 10:02 AM, said:

In case anyone would like to do this again and have trouble following all that went on here, here is a step-by-step tutorial:

That should be in a pinned topic to help simpletons like me.

#15 Fochis

  • Members
  • 3 posts

Posted 23 January 2013 - 11:33 PM

If you can't craft your peripherals, change the @Mod line in your main file mod like this:

@Mod(modid = "yourmod", name = "yourmodname", version = "1.0",dependencies = "required-after:CCTurtle")

I was 2 days looking for ways to craft my peripherals :)

Edited by Fochis, 24 January 2013 - 01:27 AM.


#16 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 24 January 2013 - 04:26 AM

I don't see how that is relevant to the rest of the two-month-old topic. Locked.





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users