Edited the post, July 30th, 2015, and added the source code for anyone who wants to play with it/update/do anything you want with it. No restrictions.
The Story
One day recently I found myself in my 1.5.2 Minecraft world working with my friends on a most epic build and wanted to control some redstone based stuff from a central location around a rather large 5 story mansion. I already had a large LAN network around the entire house connecting many (many) monitors to a central computer, so using the LAN network to get my redstone signal where I wanted it seemed most logical. Without any type of redstone wires to aid me it seemed I would have to just use more computers and have them communicate. After setting up a few computers on the network to read and output redstone I realized that was quite inconvenient as well to have to program the extra computer to do their job and communicate with the central computer, especially after getting used to wires of a more bundled nature. At that point I decided I wanted a peripheral based solution to connect to LAN cables that could output or read a redstone signal. I set searching the forums for such a mod but came up empty handed, so I headed off on an adventure into Eclipse. Within a couple days RedIO was born and already working the magic I wanted on the most epic build my friends and I are bringing to fruition.
The Block
In Minecraft the block is called the Redstone I/O. It is simple a peripheral that is meant to be connected to a LAN cable and can be used to read a redstone signal (with strength), output a redstone signal (also with strength, if desired) or throw an event on a change in redstone (turns on, off, or changes strength). The block can read/output only from one side indicated by the red cross. The red bits all around the block light up if the block is either receiving a signal or outputting a signal. This is a simple way of reading the redstone strength from redstone books placed on the bookcase in my other mod, BiblioCraft. The LAN modem can connect to any side.
If you have a mod installed that adds a tool such as any wrench (BC, IC2, TE, etc), the crowbar from railcraft and the tape measure from bibliocraft, than any one of these tools can be used to rotate the Redstone IO. Just simply right click the block with the tool in your hand.
The Recipe
Eight smooth stone and a redstone block:
The Code
The Redstone I/O exposes 3 methods and throw an event.
For the duration of this explanation, I will pretend I wrapped the Redstone IO. They use the name io, lowercase, in their names.
so if:
redio = peripheral.wrap("io_1")
redio.set(true) -- enables a redstone signal with strength 15
redio.set(false) -- disables the redstone signal
redio.set(10) -- outputs a redstone signal of 10
redio.set(0) -- disables the redstone signal
redio.get() -- returns true/false if there is a redstone signal or not (any strength)
redio.analogGet() -- returns an integer from 0-15 of the redstone strength
Then for our event:
event, state, strength, id = os.pullEvent("red_io") -- pulls an event with 4 return values
-- event returns: red_io
-- state returns true/false if there is redstone
-- strength returns an integer from 0-15 indicating the redstone strength
-- id returns the id of the peripheral the threw the event
The accuracy of state and strength may still be a bit buggy in returning either the state before or after the change, so no worries if that is off, I am aware of it.The Download
For Minecraft v1.6.2/v1.6.4 and ComputerCraft v1.57
Download Here: http://adf.ly/ZHYOJ
Built and compiled on Forge release 7.8.0.712 and ComputerCraft v1.53. Also tested on forge release 7.8.0.734
Download Here For Minecraft v1.5.x: http://adfoc.us/12433425426632
Source code for RedIO v1.1 can be found here: www.bibliocraftmod.com/downloadables/RedIO[v1.1]-SRC.zip
No restrictions on this, do whatever you want with this source code.
The Changelog
-v1.1 - Updated for Minecraft v1.6.x. Straight port, no new features.
-v.1.0 - Initial release. Contains single block, the Redstone I/O
Mod Packs
I don't mind if this is used in a mod pack as long as proper credit is given and there is a link back to this page. I would prefer my download link be used if possible, but I also understand the need for a simpler distrubution system from packs, so this isn't a requirment.