←  Peripherals and Turtle Upgrades

ComputerCraft | Programmable Computers for Minecraft

»

Creating Peripherals and Turtle Upgrades (...

Zinal's Photo Zinal 02 Feb 2013

Is there any way to download the 1.46 API version? I'm trying to make a turtle upgrade for an FTB Server but FTB (Beta Pack A) is using version 1.46 of ComputerCraft, not 1.48.

Oh, as a side-note (Might have to do with the version change): ITurtleUpgrade.createPeripheral is giving me an AbstractError, which i found very wierd
Quote

ee_man's Photo ee_man 30 Mar 2013

I don't have permission to edit this list (http://www.computerc...tle_Upgrade_IDs)
My mod (http://www.minecraft.../topic/1715756-) use 245 and 246 ids
Quote

Cloudy's Photo Cloudy 30 Mar 2013

Then request permission on the forum thread... check the wiki discussion forum.
Quote

Shnupbups's Photo Shnupbups 30 Mar 2013

View Postee_man, on 30 March 2013 - 08:34 AM, said:

I don't have permission to edit this list (http://www.computerc...tle_Upgrade_IDs)
My mod (http://www.minecraft.../topic/1715756-) use 245 and 246 ids
I have added them for you.
Quote

ee_man's Photo ee_man 08 Apr 2013

View PostShnupbups100, on 30 March 2013 - 11:16 AM, said:

View Postee_man, on 30 March 2013 - 08:34 AM, said:

I don't have permission to edit this list (http://www.computerc...tle_Upgrade_IDs)
My mod (http://www.minecraft.../topic/1715756-) use 245 and 246 ids
I have added them for you.
Thanks
Quote

Khalory's Photo Khalory 10 Apr 2013

This seems pretty stupid since I've already managed to get the API ready to use but... Where is the documentation? I can't find it inside the download so am I just blind or is it somewhere else?
Quote

Cloudy's Photo Cloudy 10 Apr 2013

View PostKhalory, on 10 April 2013 - 05:33 AM, said:

This seems pretty stupid since I've already managed to get the API ready to use but... Where is the documentation? I can't find it inside the download so am I just blind or is it somewhere else?

It is javadoc comments in the API source.
Quote

Khalory's Photo Khalory 10 Apr 2013

View PostCloudy, on 10 April 2013 - 07:30 AM, said:

It is javadoc comments in the API source.

The API I have doesn't have them so maybe I wasn't supposed to do what I did? I opened up the main ComputerCraft download and decompiled and deobfuscated the API that was inside but there are no javadocs in what I have. Is there a separate, already deobfuscated source elsewhere that has the javadocs?
Quote

Espen's Photo Espen 10 Apr 2013

View PostKhalory, on 10 April 2013 - 08:02 AM, said:

The API I have doesn't have them so maybe I wasn't supposed to do what I did? I opened up the main ComputerCraft download and decompiled and deobfuscated the API that was inside but there are no javadocs in what I have. Is there a separate, already deobfuscated source elsewhere that has the javadocs?
The API source files (including comments) are within the ComputerCraft zip file under "api\src".
Copy the contents from that folder into your Mod's project.

However when you're packing up your mod for release, you needn't and shouldn't include the API!
Edited by Espen, 10 April 2013 - 08:29 AM.
Quote

Khalory's Photo Khalory 10 Apr 2013

View PostEspen, on 10 April 2013 - 08:26 AM, said:

The API source files (including comments) are within the ComputerCraft zip file under "api\src".
Copy the contents from that folder into your Mod's project.

However when you're packing up your mod for release, you needn't and shouldn't include the API!

Thanks to your help I found out that I was just using a version of the download that was before the api\src folder was added to the .zip file. I can definitely find the newest version of the API, thanks.
Quote

gudenau's Photo gudenau 27 Jun 2013

I can not add my ids to the wiki page, why is this?
Quote

Xfel's Photo Xfel 02 Jul 2013

View PostCloudy, on 30 March 2013 - 11:02 AM, said:

Then request permission on the forum thread... check the wiki discussion forum.
Quote

JustPingo's Photo JustPingo 02 Sep 2013

Hi !
When I put the API, there's no computer when I launch the game with eclipse, and if I put CC in jars' mods folder, it crash.
What should I do please ?

Thanks in advance.
Quote

GammaPaladin's Photo GammaPaladin 25 Sep 2013

Sooooooo... I'm working on a peripheral for my own convenience, mostly, and I'm having a slight problem. I'm returning an Object[] with 3 Integers in the array, but for some reason, when I call the function, I only get the first Integer's value.

This is my callMethod block. It only has one method for now, but I plan to add a few later, hence the switch.
@Override
	public Object[] callMethod(IComputerAccess computer, int method,
			Object[] arguments) throws Exception
	{
		if (computer == data.controller)
		{
			switch (method)
			{
				case 0:
					return getPos();
					
			}
		}
		return null;
	}

That's working, because getPos() is called. Here is the getPos function:
private Integer[] getPos()
	{
		
		Integer x = new Integer(xCoord);
		Integer y = new Integer(yCoord);
		Integer z = new Integer(zCoord);
		
		OverNet.log(Level.INFO, "Coordinates: (" + x.toString() + ", " + y.toString() + ", " + z.toString() + ")");
		
		Integer[] pos = new Integer[3];
		pos[0] = x;
		pos[1] = y;
		pos[2] = z;
		
		return pos;
	}

I know the array initialization is ugly, I was just trying to do it in the most basic way possible to ferret out any possible problems. The log statement works, I get the correct xyz coordinates displayed in the log:
2013-09-25 17:31:48 [INFO] [OverNet] Coordinates: (1106, 4, 1534)

But if I try:
local gps = peripheral.wrap("right")

print(textutils.serialize(gps.locate()))

I just get 1106.

I'm sure I've missed something obvious, so I figured I'd see if anyone can spot whatever it is I've missed.
Quote

tikiking1's Photo tikiking1 29 Sep 2013

Is there any way to make a custom computer? I'm thinking of making a PDA-style item, and none of the classes in the Javadoc seem like they'd help. Would I have to decompile the "actual" mod and use whichever class makes the GUI?
Quote

sockeye's Photo sockeye 06 Nov 2013

I created a peripheral. Please add Turtle ID 70 as Crop Manager turtle and give me permission to create a post about my mod here. My mod is here.
Quote

M4sh3dP0t4t03's Photo M4sh3dP0t4t03 20 Dec 2013

View PostGammaPaladin, on 25 September 2013 - 07:46 PM, said:

Snip snip
The array that you return isn't returned as a table in Lua, but instead as a list. So either you could do:
--Lua side fix
local gps = peripheral.wrap("right")
local x, y, z = gps.locate()
Or Java side:
@Override
        public Object[] callMethod(IComputerAccess computer, int method,
                        Object[] arguments) throws Exception
        {
                if (computer == data.controller)
                {
                        switch (method)
                        {
                                case 0:
                                        return new Object[] {getPos()};

                        }
                }
                return null;
        }
Quote

_CR_'s Photo _CR_ 15 Apr 2014

Hi, I just registered 'cause I've recently developed a mod that adds a turtle chunkloader and I wanted to post it here. I've seen I can't start a new topic, can you please give me the rights to do so?
I also wanted to ask before releasing the mod: I have to follow some logic in choosing the turtle upgrade ID other then looking on the wiki if it's already used? thanks :)
Quote

Cranium's Photo Cranium 15 Apr 2014

You actually should be able to create a topic as a New Member.
Take a look at the forum guidelines in the announcements, and it explains the restrictions on new members.
Quote

Lyqyd's Photo Lyqyd 15 Apr 2014

The Peripherals section may not have the topic creation permissions for new members because it's a relatively rare situation, so I probably didn't think of it when changing around the new members restrictions last time. I'll adjust them later this evening.

As for the upgrade ID, be sure to reserve your number in the wiki when you publish the mod. If you don't already have edit permissions, you could post in the sticky post in the wiki discussion section.
Quote