mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-01-23 07:26:58 +00:00
Add example to turtle.inspect
A pretty common but non-trivial API, so worth having something. Even if not perfect.
This commit is contained in:
parent
d6e3c9a7fa
commit
4f0d311df7
@ -661,6 +661,18 @@ public class TurtleAPI implements ILuaAPI
|
|||||||
* @return The turtle command result.
|
* @return The turtle command result.
|
||||||
* @cc.treturn boolean Whether there is a block in front of the turtle.
|
* @cc.treturn boolean Whether there is a block in front of the turtle.
|
||||||
* @cc.treturn table|string Information about the block in front, or a message explaining that there is no block.
|
* @cc.treturn table|string Information about the block in front, or a message explaining that there is no block.
|
||||||
|
* @cc.usage <pre>{@code
|
||||||
|
* local has_block, data = turtle.inspect()
|
||||||
|
* if has_block then
|
||||||
|
* print(textutils.serialize(data))
|
||||||
|
* -- {
|
||||||
|
* -- name = "minecraft:oak_log",
|
||||||
|
* -- state = { axis = "x" },
|
||||||
|
* -- tags = { ["minecraft:logs"] = true, ... },
|
||||||
|
* -- }
|
||||||
|
* else
|
||||||
|
* print("No block in front of the turtle")
|
||||||
|
* end}</pre>
|
||||||
*/
|
*/
|
||||||
@LuaFunction
|
@LuaFunction
|
||||||
public final MethodResult inspect()
|
public final MethodResult inspect()
|
||||||
|
Loading…
Reference in New Issue
Block a user