This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
zwap1233's profile picture

how do i test my pheripheral?

Started by zwap1233, 21 July 2012 - 11:22 AM
zwap1233 #1
Posted 21 July 2012 - 01:22 PM
i have 2 questions.
1. like the title says how do i test my pheripheral? after making the class and adding the ccapi and instaling forge(that went all well) do i just start recompile.bat or do i first have to remove the api? and is there a easier way?

2. what class must implement the IPheripheral iterface? the basemod class or the block class i made?

zwap1233
Xtansia #2
Posted 21 July 2012 - 01:57 PM
Your TileEntity class must implement IPeripheral
Xfel #3
Posted 21 July 2012 - 04:42 PM
You need the api classes exactly while compiling. Without them, it won't work.
If you use eclipse, you can run it without bothering with the scripts. However, you could only test your block's appearance and behavior without computers around, not more.

To test properly, you will of course need computercraft around too. So, you have to reobfuscate it and put it into your local minecraft installation. That is a lot of work, and you can't properly debug obfuscated code, but it's the only way. You might consider writing a batch script for recompiling, reobfuscating and installing the mod files.
blystad #4
Posted 01 August 2012 - 09:16 PM
Actually, there is a 2nd way, and it is possible to do it with debugging, but it requires a lot of work before/unless Dan200/Cloudy releases a open source version of ComputerCraft. It involves decompiling the ComputerCraft files, and then deobfuscating them, similar to what we have to do at the moment with Minecraft.

Decompiling them is easy, "jd gui" can do that. Deobfuscating is (a lot) more work though. Similar to what MCP is currently doing with Minecraft, it has to be done on these files as well, but only on those functions that are communicating directly with Minecraft functions, or refering to Minecraft items. Dan200, have said he doesn't mind this for the sake of having sane development, https://twitter.com/DanTwoHundred/status/230672377846042624

I sincerily do hope it will be released as an open source mod sooner rather then later, and I have voiced this with Dan200, but he doesn't feel ready for it just yet. If it was open source, it would be very easy to make periphials and testing them, as you could just add the source to your Eclipse project, and it would work. I've done this already with Not Enough Items and a few other mods.
Cloudy #5
Posted 02 August 2012 - 03:17 AM
That's always an option - you can get MCP to deobsfucate things for you. Just don't expect any support from us if using that method.
immibis #6
Posted 15 August 2012 - 05:28 AM
Has anyone tried Bearded Octo Nemesis for this purpose?

(Edit: It deobfuscates a mod)
Xfel #7
Posted 15 August 2012 - 06:44 AM
Just done. Well, it seems to work. I didn't test it to full extend, however, as I currently have a working setup. Would this work for 1.3.1, too?
immibis #8
Posted 15 August 2012 - 07:11 AM
Just done. Well, it seems to work. I didn't test it to full extend, however, as I currently have a working setup. Would this work for 1.3.1, too?
Depends on whether MCP changed the way it works.