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

Learning by example

Started by kazagistar, 04 June 2012 - 11:41 PM
kazagistar #1
Posted 05 June 2012 - 01:41 AM
I really want to start building some CC peripherals, and I have strong background in Java, but I have not made any minecraft mods before. Instead of trying to learn the minecraft API from the ground up, is there any existing peripheral mod whose source I could look at, so I could just learn by example?
Xfel #2
Posted 05 June 2012 - 07:30 AM
hmm, I'm thinking about releasing the source of the ARP mod, but there is a little problem with the licenses…
xuma202 #3
Posted 08 June 2012 - 10:42 PM
Well I can serve the SC for the CCPDA Peripheral. I know it's not good at all. But it was the first thing I'd ever made in Java. But It might help you.

http://www.mediafire.com/?4hrbajn8vj9713b

If you have any questions ask.
kazagistar #4
Posted 09 June 2012 - 06:11 AM
This is exactly what I was looking for, thanks! I'll see if I can't start pulling out some peripheral modding this weekend.
Megolas #5
Posted 09 June 2012 - 11:53 AM
Actually, its the first time im making a non-bukkit mod, and i wondered, am i supposed to place these files in the minecraft source of mcp? What packages do i import? Thanks!
xuma202 #6
Posted 09 June 2012 - 02:17 PM
Once you've decompiled your minecraft.jar with Modloader via MCForge. You place the java files into mcpsrcminecraftnetminecraftsrc
Make sure you also put the ComputerCraft peripheral API in the right spot.
When debugging you'll always have to re obfuscate and then put the files into a folder which you place in your .minecraft/mods folder
Megolas #7
Posted 09 June 2012 - 03:56 PM
so cant i edit it with eclipse as a project? I need all of the other files too?
Megolas #8
Posted 09 June 2012 - 04:22 PM
and how do i add the computer API?
xuma202 #9
Posted 09 June 2012 - 06:35 PM
The download includes the source files for the two interfaces you need to interact with to make peripherals, and includes complete, thorough javadoc documentation. To make a mod, add these files to your MCP install, and implement IPeripheral on your TileEntity. You do not need to and should not distribute the class files for these files with your mod.

If all goes well, then when you re-obfuscate your mod and install alongside ComputerCraft, and place your block alongside a computer, and the computer will be able to access it via the "peripheral" API in Lua.


Feel free to post any questions about the API you have in this thread, but please read the documenation first, and be aware that this API is designed for users who already know how to produce mods for Minecraft, so we won't help you with basic mod setup.
Megolas #10
Posted 09 June 2012 - 07:46 PM
I tried, i placed the file in there and it didnt import it :
Cloudy #11
Posted 09 June 2012 - 07:53 PM
add the dan200 folder included with the API into the libs folder of MCP - then add to your buildpath in MCP. Should work.