mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-10-26 11:27:38 +00:00
Switch to GitHub-style admonitions/alerts
As these are just a custom syntax on top of blockquotes, these work much better with text editors.
This commit is contained in:
@@ -21,10 +21,9 @@ import java.util.Set;
|
||||
/**
|
||||
* Modems allow you to send messages between computers over long distances.
|
||||
* <p>
|
||||
* :::tip
|
||||
* Modems provide a fairly basic set of methods, which makes them very flexible but often hard to work with. The
|
||||
* {@literal @}{rednet} API is built on top of modems, and provides a more user-friendly interface.
|
||||
* :::
|
||||
* > [!TIP]
|
||||
* > Modems provide a fairly basic set of methods, which makes them very flexible but often hard to work with. The
|
||||
* > {@literal @}{rednet} API is built on top of modems, and provides a more user-friendly interface.
|
||||
* <p>
|
||||
* ## Sending and receiving messages
|
||||
* Modems operate on a series of channels, a bit like frequencies on a radio. Any modem can send a message on a
|
||||
@@ -198,9 +197,8 @@ public abstract class ModemPeripheral implements IPeripheral, PacketSender, Pack
|
||||
* Sends a modem message on a certain channel. Modems listening on the channel will queue a {@code modem_message}
|
||||
* event on adjacent computers.
|
||||
* <p>
|
||||
* :::note
|
||||
* The channel does not need be open to send a message.
|
||||
* :::
|
||||
* > [!NOTE]
|
||||
* > The channel does not need be open to send a message.
|
||||
*
|
||||
* @param channel The channel to send messages on.
|
||||
* @param replyChannel The channel that responses to this message should be sent on. This can be the same as
|
||||
|
||||
@@ -80,9 +80,8 @@ public abstract class WiredModemPeripheral extends ModemPeripheral implements Wi
|
||||
* If this computer is attached to the network, it _will not_ be included in
|
||||
* this list.
|
||||
* <p>
|
||||
* :::note
|
||||
* This function only appears on wired modems. Check {@link #isWireless} returns false before calling it.
|
||||
* :::
|
||||
* > [!NOTE]
|
||||
* > This function only appears on wired modems. Check {@link #isWireless} returns false before calling it.
|
||||
*
|
||||
* @param computer The calling computer.
|
||||
* @return Remote peripheral names on the network.
|
||||
@@ -96,9 +95,8 @@ public abstract class WiredModemPeripheral extends ModemPeripheral implements Wi
|
||||
/**
|
||||
* Determine if a peripheral is available on this wired network.
|
||||
* <p>
|
||||
* :::note
|
||||
* This function only appears on wired modems. Check {@link #isWireless} returns false before calling it.
|
||||
* :::
|
||||
* > [!NOTE]
|
||||
* > This function only appears on wired modems. Check {@link #isWireless} returns false before calling it.
|
||||
*
|
||||
* @param computer The calling computer.
|
||||
* @param name The peripheral's name.
|
||||
@@ -113,9 +111,8 @@ public abstract class WiredModemPeripheral extends ModemPeripheral implements Wi
|
||||
/**
|
||||
* Get the type of a peripheral is available on this wired network.
|
||||
* <p>
|
||||
* :::note
|
||||
* This function only appears on wired modems. Check {@link #isWireless} returns false before calling it.
|
||||
* :::
|
||||
* > [!NOTE]
|
||||
* > This function only appears on wired modems. Check {@link #isWireless} returns false before calling it.
|
||||
*
|
||||
* @param computer The calling computer.
|
||||
* @param name The peripheral's name.
|
||||
@@ -133,9 +130,8 @@ public abstract class WiredModemPeripheral extends ModemPeripheral implements Wi
|
||||
/**
|
||||
* Check a peripheral is of a particular type.
|
||||
* <p>
|
||||
* :::note
|
||||
* This function only appears on wired modems. Check {@link #isWireless} returns false before calling it.
|
||||
* :::
|
||||
* > [!NOTE]
|
||||
* > This function only appears on wired modems. Check {@link #isWireless} returns false before calling it.
|
||||
*
|
||||
* @param computer The calling computer.
|
||||
* @param name The peripheral's name.
|
||||
@@ -154,9 +150,8 @@ public abstract class WiredModemPeripheral extends ModemPeripheral implements Wi
|
||||
/**
|
||||
* Get all available methods for the remote peripheral with the given name.
|
||||
* <p>
|
||||
* :::note
|
||||
* This function only appears on wired modems. Check {@link #isWireless} returns false before calling it.
|
||||
* :::
|
||||
* > [!NOTE]
|
||||
* > This function only appears on wired modems. Check {@link #isWireless} returns false before calling it.
|
||||
*
|
||||
* @param computer The calling computer.
|
||||
* @param name The peripheral's name.
|
||||
@@ -175,9 +170,8 @@ public abstract class WiredModemPeripheral extends ModemPeripheral implements Wi
|
||||
/**
|
||||
* Call a method on a peripheral on this wired network.
|
||||
* <p>
|
||||
* :::note
|
||||
* This function only appears on wired modems. Check {@link #isWireless} returns false before calling it.
|
||||
* :::
|
||||
* > [!NOTE]
|
||||
* > This function only appears on wired modems. Check {@link #isWireless} returns false before calling it.
|
||||
*
|
||||
* @param computer The calling computer.
|
||||
* @param context The Lua context we're executing in.
|
||||
@@ -205,9 +199,8 @@ public abstract class WiredModemPeripheral extends ModemPeripheral implements Wi
|
||||
* may be used by other computers on the network to wrap this computer as a
|
||||
* peripheral.
|
||||
* <p>
|
||||
* :::note
|
||||
* This function only appears on wired modems. Check {@link #isWireless} returns false before calling it.
|
||||
* :::
|
||||
* > [!NOTE]
|
||||
* > This function only appears on wired modems. Check {@link #isWireless} returns false before calling it.
|
||||
*
|
||||
* @return The current computer's name.
|
||||
* @cc.treturn string|nil The current computer's name on the wired network.
|
||||
|
||||
@@ -274,12 +274,11 @@ public abstract class SpeakerPeripheral implements IPeripheral {
|
||||
* and played back at 48kHz. If this buffer is full, this function will return {@literal false}. You should wait for
|
||||
* a @{speaker_audio_empty} event before trying again.
|
||||
* <p>
|
||||
* :::note
|
||||
* The speaker only buffers a single call to {@link #playAudio} at once. This means if you try to play a small
|
||||
* number of samples, you'll have a lot of stutter. You should try to play as many samples in one call as possible
|
||||
* (up to 128×1024), as this reduces the chances of audio stuttering or halting, especially when the server or
|
||||
* computer is lagging.
|
||||
* :::
|
||||
* > [!NOTE]
|
||||
* > The speaker only buffers a single call to {@link #playAudio} at once. This means if you try to play a small
|
||||
* > number of samples, you'll have a lot of stutter. You should try to play as many samples in one call as possible
|
||||
* > (up to 128×1024), as this reduces the chances of audio stuttering or halting, especially when the server or
|
||||
* > computer is lagging.
|
||||
* <p>
|
||||
* {@literal @}{speaker_audio} provides a more complete guide to using speakers
|
||||
*
|
||||
|
||||
@@ -27,24 +27,22 @@ import java.util.Optional;
|
||||
* {@literal @}{turtle.down} move it up and down (as one might expect!). In order to move left or right, you first need
|
||||
* to turn the turtle using @{turtle.turnLeft}/@{turtle.turnRight} and then move forward or backwards.
|
||||
* <p>
|
||||
* :::info
|
||||
* The name "turtle" comes from [Turtle graphics], which originated from the Logo programming language. Here you'd move
|
||||
* a turtle with various commands like "move 10" and "turn left", much like ComputerCraft's turtles!
|
||||
* :::
|
||||
* > [!INFO]
|
||||
* > The name "turtle" comes from [Turtle graphics], which originated from the Logo programming language. Here you'd
|
||||
* > move a turtle with various commands like "move 10" and "turn left", much like ComputerCraft's turtles!
|
||||
* <p>
|
||||
* Moving a turtle (though not turning it) consumes *fuel*. If a turtle does not have any @{turtle.refuel|fuel}, it
|
||||
* won't move, and the movement functions will return @{false}. If your turtle isn't going anywhere, the first thing to
|
||||
* check is if you've fuelled your turtle.
|
||||
* <p>
|
||||
* :::tip Handling errors
|
||||
* Many turtle functions can fail in various ways. For instance, a turtle cannot move forward if there's already a block
|
||||
* there. Instead of erroring, functions which can fail either return @{true} if they succeed, or @{false} and some
|
||||
* error message if they fail.
|
||||
* <p>
|
||||
* Unexpected failures can often lead to strange behaviour. It's often a good idea to check the return values of these
|
||||
* functions, or wrap them in @{assert} (for instance, use `assert(turtle.forward())` rather than `turtle.forward()`),
|
||||
* so the program doesn't misbehave.
|
||||
* :::
|
||||
* > [Handling errors][!TIP]
|
||||
* > Many turtle functions can fail in various ways. For instance, a turtle cannot move forward if there's already a
|
||||
* > block there. Instead of erroring, functions which can fail either return @{true} if they succeed, or @{false} and
|
||||
* > some error message if they fail.
|
||||
* >
|
||||
* > Unexpected failures can often lead to strange behaviour. It's often a good idea to check the return values of these
|
||||
* > functions, or wrap them in @{assert} (for instance, use `assert(turtle.forward())` rather than `turtle.forward()`),
|
||||
* > so the program doesn't misbehave.
|
||||
* <p>
|
||||
* ## Turtle upgrades
|
||||
* While a normal turtle can move about the world and place blocks, its functionality is limited. Thankfully, turtles
|
||||
|
||||
Reference in New Issue
Block a user