Difference between revisions of "Redstone (API)"

From ComputerCraft Wiki
Jump to: navigation, search
(BOLDness)
Line 5: Line 5:
 
The redstone API contains methods to control attached RedPower cables/bundled cables
 
The redstone API contains methods to control attached RedPower cables/bundled cables
  
Note: Currently the redstone API has issues in SMP in some circumstances where the Minecraft server is running Linux. This appears to occur when the RedPower mod loads after ComputerCraft on the server. It is currently confirmed to occur on Ubuntu 11.10 but may occur on other systems as well. Some users have suggested prefixing the RedPower core zip with "A" or "A1". The "A1" prefix is confirmed(rafter109) to work on Ubuntu 10.04 using the ext4 file system.
+
Note: Currently the redstone API has issues in SMP in some circumstances where the Minecraft server is running Linux. This appears to occur when the RedPower mod loads after ComputerCraft on the server. It is currently confirmed to occur on Ubuntu 11.10 but may occur on other systems as well.
 +
*TO Authors: This CAN be fixed, using BaseMod.getPriorities(). It allows you to specify that ComputerCraft must be loaded before/after RedPower; see the ModLoader javadoc for details.
  
 
== Methods ==
 
== Methods ==

Revision as of 02:28, 3 May 2012


Description

The redstone API contains methods to control attached RedPower cables/bundled cables

Note: Currently the redstone API has issues in SMP in some circumstances where the Minecraft server is running Linux. This appears to occur when the RedPower mod loads after ComputerCraft on the server. It is currently confirmed to occur on Ubuntu 11.10 but may occur on other systems as well.

  • TO Authors: This CAN be fixed, using BaseMod.getPriorities(). It allows you to specify that ComputerCraft must be loaded before/after RedPower; see the ModLoader javadoc for details.

Methods

Method name Description
getSides() Returns an array of possible sides
getInput(string side) Returns the current redstone input signal state on side
setOutput(string side, boolean value) Set or reset a redstone signal on side
getOutput(string side) Returns the current redstone output signal on side
getBundledInput(string side) Returns the state of a redpower wire inside a bundle connected to side
getBundledOutput(string side) Returns the set of redpower wires inside a bundle on side that are being driven high by the local console (not those that are driven high by another device on the bundle but not driven high by the local console)
setBundledOutput(string side, int colors) Sets one or multiple colored signals in a redpower bundled wire connected to Side
testBundledInput(string side, int color) Returns true or false whether or not a colored signal is active in a redpower bundled wire connected to Side