Jump to content




MultiPeripheral - Framework for ComputerCraft


14 replies to this topic

#1 Engineer

  • Members
  • 1,378 posts
  • LocationThe Netherlands

Posted 01 March 2014 - 09:08 PM

MultiPeripheral 1.0Beta is out!

Hello community!

This is my very first mod which I made for MineCraft. Specifically this is made for ComputerCraft, obviously.
This is more of a framework than a mod, because it only does things 'behind the scenes' of ComputerCraft. This framework solves the problem which CC has with its API: only one peripheral can be mount per block (which can be caused by multiple mods). Well, I solved that, which should be obvious by the name of the mod.

This mod does not only allow more peripherals on one block, it also gives OpenPeripheral inspired annotations for the implementation of IPeripheral's (actual peripherals), or ILuaObject's (tables with methods). In short, a great way to hook into CC's API via my framework. It makes you type less ;)

More information on the API can be found on the github's wiki, which has yet to be written. For now you can use the JavaDoc, which I tried to make obvious. You can PM me for questions about the API until the wiki has been written, which is going to contain examples and excessive explanation.

This mod is open source and licensed under the GNUv3 license. A short overview what the license allows/disallows you can be found here: choose a license. The source can be found on GitHub.

If you find any bug or issue with the mod, preferably open an issue on the Hub. You can post them here as well, but that is going to be discouraged.. :P

Let's get on to the Lua part, which is probably the most interesting for you guys. You can find a brief description in the spoiler, but this is going to move to the GitHub wiki in the end.

The Lua Side

This mod has been made for CC1.6pr0 and should stay stable for some quite some time, though that depends on the Dan200.

Downloads can be found here. Always use the latest stable version and use the beta's at your own risk. This is a warning too, I dont take responsibility for damage to worlds etc. etc. But that shouldnt happen, if it happens throw me a bug report and log!

Enjoy!

Edited by Engineer, 09 March 2014 - 07:10 PM.


#2 Alice

  • Members
  • 429 posts
  • LocationBehind you.

Posted 02 March 2014 - 01:22 AM

I'm unable to test it currently because I'm on my bad laptop.
Are you able to access the peripheral's GUI when it's in the MultiPeripheral?

#3 Engineer

  • Members
  • 1,378 posts
  • LocationThe Netherlands

Posted 02 March 2014 - 02:09 AM

View PostDeath, on 02 March 2014 - 01:22 AM, said:

I'm unable to test it currently because I'm on my bad laptop.
Are you able to access the peripheral's GUI when it's in the MultiPeripheral?
Err.. I would have to ask you how you define 'accessing the GUI.' Because it is a bit vague to me what you are asking. If you are talking about lua-side that's a definite no.

After thinking a while I figered you probably meant that two peripherals (both a block), which has both gui's, can be melted to one peripheral.

For that my answer is no, and I'm going to explain why:
If you want to make a peripheral on a block, you have to implement an interface to your TileEntity which says 'I'm a peripheral.'
You can also add peripherals on blocks which you haven't made yourself (thus, you don't have access to them). Then you can register that to computercraft and it gets handled.

When a computer gets next to this 'external TileEntity' it calls a loop, and if the peripheral is valid it gets returned. The problem with this is that there can be more than that 1 peripheral, but those never get used. That is where MultiPeripheral kicks in, it adds those together.

An example mod which uses this cc api is OpenPeripheral, and I originally wanted to make a similair mod but with my twist. Then I stumped on the annoying error above, and decided to make it work for everybody so to speak.

My side project is my original goal what I wanted to achieve, and compitble with OpenPeripheral. Thanks to MultiPeripheral, it is compatible with OpenPeripheral and this 'java-side' mod is my core which I finally finished after two weeks.

I learnt a lot in the process, and this is just the beginning of something that can make CC even more awesome than it already is.

If this was not your question, please expand your question to a more specific question.

#4 Engineer

  • Members
  • 1,378 posts
  • LocationThe Netherlands

Posted 03 March 2014 - 03:55 AM

I am thinking about making a block which can combine two or more peripherals at once. The block will open a gui with slots where you then can put that block. And I'm talking about the real deal, it will allow to open all those GUI's of those blocks! Probably with another GUI with all blocks. I'll see how this is going to be :P

Should I implement this yes or no? One yes is more than enough for me!

#5 Alice

  • Members
  • 429 posts
  • LocationBehind you.

Posted 03 March 2014 - 04:14 AM

Yes, but add a config that can change how many peripherals you can add in with a non-editable maximum too make sure it's not too OP. c:<

#6 Engineer

  • Members
  • 1,378 posts
  • LocationThe Netherlands

Posted 03 March 2014 - 04:30 AM

View PostDeath, on 03 March 2014 - 04:14 AM, said:

Yes, but add a config that can change how many peripherals you can add in with a non-editable maximum too make sure it's not too OP. c:<
Well, I was more thinking about infinitely expandable. Because the blocks are not actually placed.... Or are they? Hmm.. I'm getting ideas..

I'm going to start development soon!

#7 CometWolf

  • Members
  • 1,283 posts

Posted 03 March 2014 - 05:35 PM

View PostDeath, on 03 March 2014 - 04:14 AM, said:

Yes, but add a config that can change how many peripherals you can add in with a non-editable maximum too make sure it's not too OP. c:<
I don't think the OP argument really pans out here, seeing as you can just setup cables and connect as many peripherals as you want already anyways. It would however be a nice addition for those of us who like to keep things tidy!

#8 Alice

  • Members
  • 429 posts
  • LocationBehind you.

Posted 03 March 2014 - 06:05 PM

View PostCometWolf, on 03 March 2014 - 05:35 PM, said:

I don't think the OP argument really pans out here, seeing as you can just setup cables and connect as many peripherals as you want already anyways. It would however be a nice addition for those of us who like to keep things tidy!
But with each peripheral added to the network you need A: cables and B: modems. We were talking about it and we're probably doing something around a six to eight maximum

#9 CometWolf

  • Members
  • 1,283 posts

Posted 03 March 2014 - 06:50 PM

8 cables and modems would be like 68 cobble and 10 restone, how cheap is this thing gonna be?

#10 Engineer

  • Members
  • 1,378 posts
  • LocationThe Netherlands

Posted 03 March 2014 - 07:18 PM

The recipe is not really cheap for the actual block. It definitely will cost.

But that is not my main issue I'm going to have to deal with, first I need to get a concept going with actual code.

#11 Engineer

  • Members
  • 1,378 posts
  • LocationThe Netherlands

Posted 06 March 2014 - 11:02 AM

If you used this mod in pr0 (which I frankly dont expect), and want to use it in pr1 it is necessary to replace your computers. I dont know why, but it fixed my problem :)

By the way, Im starting development on the peripheral block this weekend, because tuesday my wishdom tooth got pulled and it hurts like crazy. Not really in the mood for coding...

#12 Engineer

  • Members
  • 1,378 posts
  • LocationThe Netherlands

Posted 09 March 2014 - 07:12 PM

View PostEngineer, on 03 March 2014 - 03:55 AM, said:

I am thinking about making a block which can combine two or more peripherals at once. The block will open a gui with slots where you then can put that block. And I'm talking about the real deal, it will allow to open all those GUI's of those blocks! Probably with another GUI with all blocks. I'll see how this is going to be :P

Im scrapping this. Mostly due to my interest that is somewhere else and it is really a pain to simulate a block while it hasnt been placed down.

#13 Inumel

  • Members
  • 120 posts

Posted 10 March 2014 - 08:00 AM

View PostEngineer, on 09 March 2014 - 07:12 PM, said:

View PostEngineer, on 03 March 2014 - 03:55 AM, said:

I am thinking about making a block which can combine two or more peripherals at once. The block will open a gui with slots where you then can put that block. And I'm talking about the real deal, it will allow to open all those GUI's of those blocks! Probably with another GUI with all blocks. I'll see how this is going to be :P

Im scrapping this. Mostly due to my interest that is somewhere else and it is really a pain to simulate a block while it hasnt been placed down.

Dang, that sounded very promising! Oh well, can't wait to see what else you cook up :)

#14 Alice

  • Members
  • 429 posts
  • LocationBehind you.

Posted 10 March 2014 - 05:10 PM

View PostEngineer, on 09 March 2014 - 07:12 PM, said:

View PostEngineer, on 03 March 2014 - 03:55 AM, said:

I am thinking about making a block which can combine two or more peripherals at once. The block will open a gui with slots where you then can put that block. And I'm talking about the real deal, it will allow to open all those GUI's of those blocks! Probably with another GUI with all blocks. I'll see how this is going to be :P

Im scrapping this. Mostly due to my interest that is somewhere else and it is really a pain to simulate a block while it hasnt been placed down.
...I was so hopeful for this. Time to watch someone else do it :P
Such a great idea, shame you're giving up on it.

#15 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,459 posts

Posted 13 March 2014 - 09:02 PM

Locked by request.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users