mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2024-12-14 04:00:30 +00:00
A couple of documentation improvements
- Add some missing to the turtle API docs - Version history for peripheral and redstone. I /think/ this is complete.
This commit is contained in:
parent
bdd38fb061
commit
01ddb2b4e4
@ -72,6 +72,7 @@ public class RedstoneAPI implements ILuaAPI
|
||||
* "back".
|
||||
*
|
||||
* @return A table of valid sides.
|
||||
* @cc.since 1.2
|
||||
*/
|
||||
@LuaFunction
|
||||
public final String[] getSides()
|
||||
@ -122,6 +123,7 @@ public class RedstoneAPI implements ILuaAPI
|
||||
* @param side The side to set.
|
||||
* @param value The signal strength between 0 and 15.
|
||||
* @throws LuaException If {@code value} is not betwene 0 and 15.
|
||||
* @cc.since 1.51
|
||||
*/
|
||||
@LuaFunction( { "setAnalogOutput", "setAnalogueOutput" } )
|
||||
public final void setAnalogOutput( ComputerSide side, int value ) throws LuaException
|
||||
@ -136,6 +138,7 @@ public class RedstoneAPI implements ILuaAPI
|
||||
* @param side The side to get.
|
||||
* @return The output signal strength, between 0 and 15.
|
||||
* @see #setAnalogOutput
|
||||
* @cc.since 1.51
|
||||
*/
|
||||
@LuaFunction( { "getAnalogOutput", "getAnalogueOutput" } )
|
||||
public final int getAnalogOutput( ComputerSide side )
|
||||
@ -148,6 +151,7 @@ public class RedstoneAPI implements ILuaAPI
|
||||
*
|
||||
* @param side The side to get.
|
||||
* @return The input signal strength, between 0 and 15.
|
||||
* @cc.since 1.51
|
||||
*/
|
||||
@LuaFunction( { "getAnalogInput", "getAnalogueInput" } )
|
||||
public final int getAnalogInput( ComputerSide side )
|
||||
|
@ -515,8 +515,8 @@ public class TurtleAPI implements ILuaAPI
|
||||
/**
|
||||
* Refuel this turtle.
|
||||
*
|
||||
* While most actions a turtle can perform (such as digging or placing blocks), moving consumes fuel from the
|
||||
* turtle's internal buffer. If a turtle has no fuel, it will not move.
|
||||
* While most actions a turtle can perform (such as digging or placing blocks) are free, moving consumes fuel from
|
||||
* the turtle's internal buffer. If a turtle has no fuel, it will not move.
|
||||
*
|
||||
* {@link #refuel} refuels the turtle, consuming fuel items (such as coal or lava buckets) from the currently
|
||||
* selected slot and converting them into energy. This finishes once the turtle is fully refuelled or all items have
|
||||
|
@ -11,6 +11,8 @@
|
||||
-- Peripheral functions are called *methods*, a term borrowed from Java.
|
||||
--
|
||||
-- @module peripheral
|
||||
-- @since 1.3
|
||||
-- @changed 1.51 Add support for wired modems.
|
||||
|
||||
local expect = dofile("rom/modules/main/cc/expect.lua").expect
|
||||
|
||||
@ -24,6 +26,7 @@ local sides = rs.getSides()
|
||||
-- Modem, then it'll be reported according to its name on the wired network.
|
||||
--
|
||||
-- @treturn { string... } A list of the names of all attached peripherals.
|
||||
-- @since 1.51
|
||||
function getNames()
|
||||
local results = {}
|
||||
for n = 1, #sides do
|
||||
@ -69,6 +72,7 @@ end
|
||||
-- @tparam string|table peripheral The name of the peripheral to find, or a
|
||||
-- wrapped peripheral instance.
|
||||
-- @treturn string|nil The peripheral's type, or `nil` if it is not present.
|
||||
-- @changed 1.88.0 Accepts a wrapped peripheral as an argument.
|
||||
function getType(peripheral)
|
||||
expect(1, peripheral, "string", "table")
|
||||
if type(peripheral) == "string" then -- Peripheral name passed
|
||||
@ -118,6 +122,7 @@ end
|
||||
--
|
||||
-- @tparam table peripheral The peripheral to get the name of.
|
||||
-- @treturn string The name of the given peripheral.
|
||||
-- @since 1.88.0
|
||||
function getName(peripheral)
|
||||
expect(1, peripheral, "table")
|
||||
local mt = getmetatable(peripheral)
|
||||
@ -209,6 +214,7 @@ and returns if it should be included in the result.
|
||||
@usage This abuses the `filter` argument to call @{rednet.open} on every modem.
|
||||
|
||||
peripheral.find("modem", rednet.open)
|
||||
@since 1.6
|
||||
]]
|
||||
function find(ty, filter)
|
||||
expect(1, ty, "string")
|
||||
|
Loading…
Reference in New Issue
Block a user