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

[MC 1.7.10] [CC 1.73] ComputerCraftFramework

Started by Eyeballcode, 25 May 2015 - 01:40 PM
Eyeballcode #1
Posted 25 May 2015 - 03:40 PM
Downloads
——————
Download it from here.

API is here.
——————
Requirements: Minecraft Forge, ComputerCraft
——————

What this mod is about:

If you make CC peripherals, you need plenty of code for each peripheral. This mod aims to simplify that by making it only needing a few lines of code. An example will be:


@PeripheralTarget(name = "chest", targetClass = TileEntityChest.class)
public class ChestPeripheral {
  @LuaMethod(luaName = "runSomething")
  public double something(boolean someBool, String someString, double someDouble) {
	return someDouble;
  }
}

Now you need to send

FMLInterModComms.sendMessage("ComputerCraftFramework", "register", ChestPeripheral.class.getName())
.

Now in ComputerCraft, the Chest block will be a peripheral! It is that easy to add more peripherals, this took just 8 lines of code!

In your computer, enter

chest = peripheral.find("chest")
sucess, something = chest.runSomething(true, "Hello World!", 100)
print(something)
and your output will be 100.


Here are some things I want to add in the future:
-IMount
-Turtle Upgrade
-Media Providers
-Maybe this (Meaning @LuaMethod could have a field declared as: type = { PeripheralType.Computer, PeripheralType.Turtle })

Warning: If your computer is slow, this may impact the calling speed of functions as it has heavy use of reflection.

NOTE: This idea came from OpenPeripheral.
Edited on 27 May 2015 - 05:06 PM
masterdisasterHD #2
Posted 26 August 2015 - 11:54 AM
Does this work with cc 1.74?
Eyeballcode #3
Posted 14 October 2015 - 09:33 AM
Does this work with cc 1.74?

I haven't played Minecraft CC for a whille, let me check.
Waitdev_ #4
Posted 14 October 2015 - 12:12 PM
what programming language? java?
H4X0RZ #5
Posted 14 October 2015 - 05:18 PM
what programming language? java?

Peripherals are generally written in Java.