2 posts
Posted 20 November 2013 - 10:22 AM
At first I believed it to be an error with OpenPeripherals, so I loaded up a new instance of Minecraft with only ComputerCraft installed.
I am unable to wrap a CommandBlock as a peripheral or use any of it's methods. OpenPeripherals won't even see it as a valid block for the listMethods().
In both instances I tested the CommandBlock to make sure they worked properly without the computer.
Has the API been changed and the wiki not been updated or is it a bug?
Versions:
Minecraft: 1.6.4
FML: 9.11.1.953
ComputerCraft: 1.57
OpenPeripherals: 0.2.1-forge9.11.0.898-snapshot-95
8543 posts
Posted 20 November 2013 - 10:46 AM
You must enable the use of command blocks in the ComputerCraft configuration file.
Please don't rely on OpenP's listMethods. The better way to quickly print a list of peripheral methods is this:
textutils.tabulate(peripheral.getMethods(side))
7508 posts
Location
Australia
Posted 20 November 2013 - 10:54 AM
OpenPeripherals won't even see it as a valid block for the listMethods().
Well of course not, if its a vanilla ComputerCraft peripheral then OpenPeripheral definitely won't do anything with it.
However I can tell you right now that even once you enable command blocks in the ComputerCraft config you still won't be able to use it due to a a
known problem with OpenPeripheral and the ComputerCraft API. We've done everything we could in OpenPeripheral to tell the ComputerCraft API that we did not want to handle the Command Block, but due to a flaw in the logic of the ComputerCraft API, it caused problems. I was talking to dan about this a month or so ago on IRC and the bug has been fixed in the API and will be in the next version of CC.
Edited on 20 November 2013 - 09:54 AM
2 posts
Posted 20 November 2013 - 11:32 AM
Thank you very much for the quick responses :)/>
Enabling command blocks in the computer config has allowed me to see the methods via textutils.tabulate, and I am able to use the set/run Command without issue.
However when trying to read the current command using getCommand I get:
"lua:52: net.minecraft.tileentity.TileEntityCommandBlock.func_82353_c()Ljava/lang/String;"
Shouldn't be a big issue for what I'm trying to do but is there something I need to do differently to read from the CommandBlock?