1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2024-12-24 17:10:31 +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:
Jonathan Coates 2023-08-23 18:10:01 +01:00
parent 12ee47ff19
commit 2055052a57
No known key found for this signature in database
GPG Key ID: B9E431FF07C98D06
27 changed files with 156 additions and 196 deletions

View File

@ -25,16 +25,15 @@ We are going to build our GPS constellation as shown in the image above. You wil
modems or 4 ender modems. Try not to mix ender and wireless modems together as you might get some odd behavior when your modems or 4 ender modems. Try not to mix ender and wireless modems together as you might get some odd behavior when your
requesting computers are out of range. requesting computers are out of range.
:::tip Ender modems vs wireless modems > [Ender modems vs wireless modems][!TIP]
Ender modems have a very large range, which makes them very useful for setting up GPS hosts. If you do this then you > Ender modems have a very large range, which makes them very useful for setting up GPS hosts. If you do this then you
will likely only need one GPS constellation for the whole dimension (such as the Overworld or Nether). > will likely only need one GPS constellation for the whole dimension (such as the Overworld or Nether).
>
If you do use wireless modems then you may find that you need multiple GPS constellations to cover your needs. > If you do use wireless modems then you may find that you need multiple GPS constellations to cover your needs.
>
A computer needs a wireless or ender modem and to be in range of a GPS constellation that is in the same dimension as it > A computer needs a wireless or ender modem and to be in range of a GPS constellation that is in the same dimension as
to use the GPS API. The reason for this is that ComputerCraft mimics real-life GPS by making use of the distance > it to use the GPS API. The reason for this is that ComputerCraft mimics real-life GPS by making use of the distance
parameter of @{modem_message|modem messages} and some maths. > parameter of @{modem_message|modem messages} and some maths.
:::
Locate where you want to place your GPS constellation. You will need an area at least 6 blocks high, 6 blocks wide, and Locate where you want to place your GPS constellation. You will need an area at least 6 blocks high, 6 blocks wide, and
6 blocks deep (6x6x6). If you are using wireless modems then you may want to build your constellation as high as you can 6 blocks deep (6x6x6). If you are using wireless modems then you may want to build your constellation as high as you can
@ -79,18 +78,16 @@ To hide Minecraft's debug screen, press <kbd>F3</kbd> again.
Create similar startup files for the other computers in your constellation, making sure to input the each computer's own Create similar startup files for the other computers in your constellation, making sure to input the each computer's own
coordinates. coordinates.
:::caution Modem messages come from the computer's position, not the modem's > [Modem messages come from the computer's position, not the modem's][!WARNING]
Wireless modems transmit from the block that they are attached to *not* the block space that they occupy, the > Wireless modems transmit from the block that they are attached to *not* the block space that they occupy, the
coordinates that you input into your GPS host should be the position of the computer and not the position of the modem. > coordinates that you input into your GPS host should be the position of the computer and not the position of the modem.
:::
Congratulations, your constellation is now fully set up! You can test it by placing another computer close by, placing a Congratulations, your constellation is now fully set up! You can test it by placing another computer close by, placing a
wireless modem on it, and running the `gps locate` program (or calling the @{gps.locate} function). wireless modem on it, and running the `gps locate` program (or calling the @{gps.locate} function).
:::info Why use Minecraft's coordinates? > [Why use Minecraft's coordinates?][!INFO]
CC doesn't care if you use Minecraft's coordinate system, so long as all of the GPS hosts with overlapping ranges use > CC doesn't care if you use Minecraft's coordinate system, so long as all of the GPS hosts with overlapping ranges use
the same reference point (requesting computers will get confused if hosts have different reference points). However, > the same reference point (requesting computers will get confused if hosts have different reference points). However,
using MC's coordinate system does provide a nice standard to adopt server-wide. It also is consistent with how command > using MC's coordinate system does provide a nice standard to adopt server-wide. It also is consistent with how command
computers get their location, they use MC's command system to get their block which returns that in MC's coordinate > computers get their location, they use MC's command system to get their block which returns that in MC's coordinate
system. > system.
:::

View File

@ -189,10 +189,9 @@ for chunk in io.lines("data/example.dfpwm", 16 * 1024) do
end end
``` ```
:::note Confused? > [Confused?][!NOTE]
Don't worry if you don't understand this example. It's quite advanced, and does use some ideas that this guide doesn't > Don't worry if you don't understand this example. It's quite advanced, and does use some ideas that this guide doesn't
cover. That said, don't be afraid to ask on [GitHub Discussions] or [IRC] either! > cover. That said, don't be afraid to ask on [GitHub Discussions] or [IRC] either!
:::
It's worth noting that the examples of audio processing we've mentioned here are about manipulating the _amplitude_ of It's worth noting that the examples of audio processing we've mentioned here are about manipulating the _amplitude_ of
the wave. If you wanted to modify the _frequency_ (for instance, shifting the pitch), things get rather more complex. the wave. If you wanted to modify the _frequency_ (for instance, shifting the pitch), things get rather more complex.

View File

@ -16,19 +16,17 @@ rounded up to the nearest multiple of 0.05 seconds. If you are using coroutines
or the @{parallel|parallel API}, it will only pause execution of the current or the @{parallel|parallel API}, it will only pause execution of the current
thread, not the whole program. thread, not the whole program.
:::tip > [!TIP]
Because sleep internally uses timers, it is a function that yields. This means > Because sleep internally uses timers, it is a function that yields. This means
that you can use it to prevent "Too long without yielding" errors. However, as > that you can use it to prevent "Too long without yielding" errors. However, as
the minimum sleep time is 0.05 seconds, it will slow your program down. > the minimum sleep time is 0.05 seconds, it will slow your program down.
:::
:::caution > [!WARNING]
Internally, this function queues and waits for a timer event (using > Internally, this function queues and waits for a timer event (using
@{os.startTimer}), however it does not listen for any other events. This means > @{os.startTimer}), however it does not listen for any other events. This means
that any event that occurs while sleeping will be entirely discarded. If you > that any event that occurs while sleeping will be entirely discarded. If you
need to receive events while sleeping, consider using @{os.startTimer|timers}, > need to receive events while sleeping, consider using @{os.startTimer|timers},
or the @{parallel|parallel API}. > or the @{parallel|parallel API}.
:::
@tparam number time The number of seconds to sleep for, rounded up to the @tparam number time The number of seconds to sleep for, rounded up to the
nearest multiple of 0.05. nearest multiple of 0.05.

View File

@ -12,7 +12,6 @@
/projects/core/src/test/resources/test-rom /projects/core/src/test/resources/test-rom
/projects/web/src/mount) /projects/web/src/mount)
(doc (doc
; Also defined in projects/web/build.gradle.kts ; Also defined in projects/web/build.gradle.kts
(destination /projects/web/build/illuaminate) (destination /projects/web/build/illuaminate)
@ -50,6 +49,7 @@
(at / (at /
(linters (linters
syntax:string-index syntax:string-index
doc:docusaurus-admonition
;; It'd be nice to avoid this, but right now there's a lot of instances of ;; It'd be nice to avoid this, but right now there's a lot of instances of
;; it. ;; it.

View File

@ -21,10 +21,9 @@ import java.util.Set;
/** /**
* Modems allow you to send messages between computers over long distances. * Modems allow you to send messages between computers over long distances.
* <p> * <p>
* :::tip * > [!TIP]
* Modems provide a fairly basic set of methods, which makes them very flexible but often hard to work with. The * > 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. * > {@literal @}{rednet} API is built on top of modems, and provides a more user-friendly interface.
* :::
* <p> * <p>
* ## Sending and receiving messages * ## 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 * 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} * Sends a modem message on a certain channel. Modems listening on the channel will queue a {@code modem_message}
* event on adjacent computers. * event on adjacent computers.
* <p> * <p>
* :::note * > [!NOTE]
* The channel does not need be open to send a message. * > The channel does not need be open to send a message.
* :::
* *
* @param channel The channel to send messages on. * @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 * @param replyChannel The channel that responses to this message should be sent on. This can be the same as

View File

@ -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 * If this computer is attached to the network, it _will not_ be included in
* this list. * this list.
* <p> * <p>
* :::note * > [!NOTE]
* This function only appears on wired modems. Check {@link #isWireless} returns false before calling it. * > This function only appears on wired modems. Check {@link #isWireless} returns false before calling it.
* :::
* *
* @param computer The calling computer. * @param computer The calling computer.
* @return Remote peripheral names on the network. * @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. * Determine if a peripheral is available on this wired network.
* <p> * <p>
* :::note * > [!NOTE]
* This function only appears on wired modems. Check {@link #isWireless} returns false before calling it. * > This function only appears on wired modems. Check {@link #isWireless} returns false before calling it.
* :::
* *
* @param computer The calling computer. * @param computer The calling computer.
* @param name The peripheral's name. * @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. * Get the type of a peripheral is available on this wired network.
* <p> * <p>
* :::note * > [!NOTE]
* This function only appears on wired modems. Check {@link #isWireless} returns false before calling it. * > This function only appears on wired modems. Check {@link #isWireless} returns false before calling it.
* :::
* *
* @param computer The calling computer. * @param computer The calling computer.
* @param name The peripheral's name. * @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. * Check a peripheral is of a particular type.
* <p> * <p>
* :::note * > [!NOTE]
* This function only appears on wired modems. Check {@link #isWireless} returns false before calling it. * > This function only appears on wired modems. Check {@link #isWireless} returns false before calling it.
* :::
* *
* @param computer The calling computer. * @param computer The calling computer.
* @param name The peripheral's name. * @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. * Get all available methods for the remote peripheral with the given name.
* <p> * <p>
* :::note * > [!NOTE]
* This function only appears on wired modems. Check {@link #isWireless} returns false before calling it. * > This function only appears on wired modems. Check {@link #isWireless} returns false before calling it.
* :::
* *
* @param computer The calling computer. * @param computer The calling computer.
* @param name The peripheral's name. * @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. * Call a method on a peripheral on this wired network.
* <p> * <p>
* :::note * > [!NOTE]
* This function only appears on wired modems. Check {@link #isWireless} returns false before calling it. * > This function only appears on wired modems. Check {@link #isWireless} returns false before calling it.
* :::
* *
* @param computer The calling computer. * @param computer The calling computer.
* @param context The Lua context we're executing in. * @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 * may be used by other computers on the network to wrap this computer as a
* peripheral. * peripheral.
* <p> * <p>
* :::note * > [!NOTE]
* This function only appears on wired modems. Check {@link #isWireless} returns false before calling it. * > This function only appears on wired modems. Check {@link #isWireless} returns false before calling it.
* :::
* *
* @return The current computer's name. * @return The current computer's name.
* @cc.treturn string|nil The current computer's name on the wired network. * @cc.treturn string|nil The current computer's name on the wired network.

View File

@ -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 * 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. * a @{speaker_audio_empty} event before trying again.
* <p> * <p>
* :::note * > [!NOTE]
* The speaker only buffers a single call to {@link #playAudio} at once. This means if you try to play a small * > 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 * > 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 * > (up to 128×1024), as this reduces the chances of audio stuttering or halting, especially when the server or
* computer is lagging. * > computer is lagging.
* :::
* <p> * <p>
* {@literal @}{speaker_audio} provides a more complete guide to using speakers * {@literal @}{speaker_audio} provides a more complete guide to using speakers
* *

View File

@ -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 * {@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. * to turn the turtle using @{turtle.turnLeft}/@{turtle.turnRight} and then move forward or backwards.
* <p> * <p>
* :::info * > [!INFO]
* The name "turtle" comes from [Turtle graphics], which originated from the Logo programming language. Here you'd move * > The name "turtle" comes from [Turtle graphics], which originated from the Logo programming language. Here you'd
* a turtle with various commands like "move 10" and "turn left", much like ComputerCraft's turtles! * > move a turtle with various commands like "move 10" and "turn left", much like ComputerCraft's turtles!
* :::
* <p> * <p>
* Moving a turtle (though not turning it) consumes *fuel*. If a turtle does not have any @{turtle.refuel|fuel}, it * 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 * 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. * check is if you've fuelled your turtle.
* <p> * <p>
* :::tip Handling errors * > [Handling errors][!TIP]
* Many turtle functions can fail in various ways. For instance, a turtle cannot move forward if there's already a block * > Many turtle functions can fail in various ways. For instance, a turtle cannot move forward if there's already a
* there. Instead of erroring, functions which can fail either return @{true} if they succeed, or @{false} and some * > block there. Instead of erroring, functions which can fail either return @{true} if they succeed, or @{false} and
* error message if they fail. * > 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 * > 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()`), * > functions, or wrap them in @{assert} (for instance, use `assert(turtle.forward())` rather than `turtle.forward()`),
* so the program doesn't misbehave. * > so the program doesn't misbehave.
* :::
* <p> * <p>
* ## Turtle upgrades * ## Turtle upgrades
* While a normal turtle can move about the world and place blocks, its functionality is limited. Thankfully, turtles * While a normal turtle can move about the world and place blocks, its functionality is limited. Thankfully, turtles

View File

@ -37,10 +37,9 @@ import java.util.function.Function;
* {@link #copy} and {@link #delete}.</li> * {@link #copy} and {@link #delete}.</li>
* </ul> * </ul>
* <p> * <p>
* :::note * > [!NOTE]
* All functions in the API work on absolute paths, and do not take the @{shell.dir|current directory} into account. * > All functions in the API work on absolute paths, and do not take the @{shell.dir|current directory} into account.
* You can use @{shell.resolve} to convert a relative path into an absolute one. * > You can use @{shell.resolve} to convert a relative path into an absolute one.
* :::
* <p> * <p>
* ## Mounts * ## Mounts
* While a computer can only have one hard drive and filesystem, other filesystems may be "mounted" inside it. For * While a computer can only have one hard drive and filesystem, other filesystems may be "mounted" inside it. For

View File

@ -353,13 +353,12 @@ public class OSAPI implements ILuaAPI {
* * If called with {@code local}, returns the number of milliseconds since 1 * * If called with {@code local}, returns the number of milliseconds since 1
* January 1970 in the server's local timezone. * January 1970 in the server's local timezone.
* <p> * <p>
* :::info * > [!INFO]
* The {@code ingame} time zone assumes that one Minecraft day consists of 86,400,000 * > The {@code ingame} time zone assumes that one Minecraft day consists of 86,400,000
* milliseconds. Since one in-game day is much faster than a real day (20 minutes), this * > milliseconds. Since one in-game day is much faster than a real day (20 minutes), this
* will change quicker than real time - one real second is equal to 72000 in-game * > will change quicker than real time - one real second is equal to 72000 in-game
* milliseconds. If you wish to convert this value to real time, divide by 72000; to * > milliseconds. If you wish to convert this value to real time, divide by 72000; to
* convert to ticks (where a day is 24000 ticks), divide by 3600. * > convert to ticks (where a day is 24000 ticks), divide by 3600.
* :::
* *
* @param args The locale to get the milliseconds for. Defaults to {@code ingame} if not set. * @param args The locale to get the milliseconds for. Defaults to {@code ingame} if not set.
* @return The milliseconds since the epoch depending on the selected locale. * @return The milliseconds since the epoch depending on the selected locale.

View File

@ -5,10 +5,9 @@
--[[- Execute [Minecraft commands][mc] and gather data from the results from --[[- Execute [Minecraft commands][mc] and gather data from the results from
a command computer. a command computer.
:::note > [!NOTE]
This API is only available on Command computers. It is not accessible to normal > This API is only available on Command computers. It is not accessible to normal
players. > players.
:::
While one may use @{commands.exec} directly to execute a command, the While one may use @{commands.exec} directly to execute a command, the
commands API also provides helper methods to execute every command. For commands API also provides helper methods to execute every command. For

View File

@ -9,10 +9,9 @@ locally attached drive, specify “side” as one of the six sides (e.g. `left`)
use a remote disk drive, specify its name as printed when enabling its modem use a remote disk drive, specify its name as printed when enabling its modem
(e.g. `drive_0`). (e.g. `drive_0`).
:::tip > [!TIP]
All computers (except command computers), turtles and pocket computers can be > All computers (except command computers), turtles and pocket computers can be
placed within a disk drive to access it's internal storage like a disk. > placed within a disk drive to access it's internal storage like a disk.
:::
@module disk @module disk
@since 1.2 @since 1.2

View File

@ -12,11 +12,10 @@ and the fourth should be either above or below the other three. The three in a
plane should not be in a line with each other. You can set up hosts using the plane should not be in a line with each other. You can set up hosts using the
gps program. gps program.
:::note > [!NOTE]
When entering in the coordinates for the host you need to put in the `x`, `y`, > When entering in the coordinates for the host you need to put in the `x`, `y`,
and `z` coordinates of the block that the modem is connected to, not the modem. > and `z` coordinates of the block that the modem is connected to, not the modem.
All modem distances are measured from the block that the modem is placed on. > All modem distances are measured from the block that the modem is placed on.
:::
Also note that you may choose which axes x, y, or z refers to - so long as your Also note that you may choose which axes x, y, or z refers to - so long as your
systems have the same definition as any GPS servers that're in range, it works systems have the same definition as any GPS servers that're in range, it works

View File

@ -17,25 +17,23 @@ etc) can safely be used in one without affecting the event queue accessed by
the other. the other.
:::caution > [!WARNING]
When using this API, be careful to pass the functions you want to run in > When using this API, be careful to pass the functions you want to run in
parallel, and _not_ the result of calling those functions. > parallel, and _not_ the result of calling those functions.
>
For instance, the following is correct: > For instance, the following is correct:
>
```lua > ```lua
local function do_sleep() sleep(1) end > local function do_sleep() sleep(1) end
parallel.waitForAny(do_sleep, rednet.receive) > parallel.waitForAny(do_sleep, rednet.receive)
``` > ```
>
but the following is **NOT**: > but the following is **NOT**:
>
```lua > ```lua
local function do_sleep() sleep(1) end > local function do_sleep() sleep(1) end
parallel.waitForAny(do_sleep(), rednet.receive) > parallel.waitForAny(do_sleep(), rednet.receive)
``` > ```
:::
@module parallel @module parallel
@since 1.2 @since 1.2

View File

@ -35,11 +35,10 @@ Once you have the name of a peripheral, you can call functions on it using the
@{peripheral.call} function. This takes the name of our peripheral, the name of @{peripheral.call} function. This takes the name of our peripheral, the name of
the function we want to call, and then its arguments. the function we want to call, and then its arguments.
:::info > [!INFO]
Some bits of the peripheral API call peripheral functions *methods* instead > Some bits of the peripheral API call peripheral functions *methods* instead
(for example, the @{peripheral.getMethods} function). Don't worry, they're the > (for example, the @{peripheral.getMethods} function). Don't worry, they're the
same thing! > same thing!
:::
Let's say we have a monitor above our computer (and so "top") and want to Let's say we have a monitor above our computer (and so "top") and want to
@{monitor.write|write some text to it}. We'd write the following: @{monitor.write|write some text to it}. We'd write the following:

View File

@ -16,15 +16,14 @@ Once rednet is opened, you can send messages using @{rednet.send} and receive
them using @{rednet.receive}. It's also possible to send a message to _every_ them using @{rednet.receive}. It's also possible to send a message to _every_
rednet-using computer using @{rednet.broadcast}. rednet-using computer using @{rednet.broadcast}.
:::caution Network security > [Network security][!WARNING]
>
While rednet provides a friendly way to send messages to specific computers, it > While rednet provides a friendly way to send messages to specific computers, it
doesn't provide any guarantees about security. Other computers could be > doesn't provide any guarantees about security. Other computers could be
listening in to your messages, or even pretending to send messages from other computers! > listening in to your messages, or even pretending to send messages from other computers!
>
If you're playing on a multi-player server (or at least one where you don't > If you're playing on a multi-player server (or at least one where you don't
trust other players), it's worth encrypting or signing your rednet messages. > trust other players), it's worth encrypting or signing your rednet messages.
:::
## Protocols and hostnames ## Protocols and hostnames
Several rednet messages accept "protocol"s - simple string names describing what Several rednet messages accept "protocol"s - simple string names describing what

View File

@ -8,10 +8,9 @@ When a computer starts, it reads the current value of settings from the
`/.settings` file. These values then may be @{settings.get|read} or `/.settings` file. These values then may be @{settings.get|read} or
@{settings.set|modified}. @{settings.set|modified}.
:::caution > [!WARNING]
Calling @{settings.set} does _not_ update the settings file by default. You > Calling @{settings.set} does _not_ update the settings file by default. You
_must_ call @{settings.save} to persist values. > _must_ call @{settings.save} to persist values.
:::
@module settings @module settings
@since 1.78 @since 1.78
@ -113,10 +112,9 @@ end
--[[- Set the value of a setting. --[[- Set the value of a setting.
:::caution > [!WARNING]
Calling @{settings.set} does _not_ update the settings file by default. You > Calling @{settings.set} does _not_ update the settings file by default. You
_must_ call @{settings.save} to persist values. > _must_ call @{settings.save} to persist values.
:::
@tparam string name The name of the setting to set @tparam string name The name of the setting to set
@param value The setting's value. This cannot be `nil`, and must be @param value The setting's value. This cannot be `nil`, and must be

View File

@ -95,10 +95,9 @@ end
The returned encoder is itself a function. This function accepts a table of amplitude data between -128 and 127 and The returned encoder is itself a function. This function accepts a table of amplitude data between -128 and 127 and
returns the encoded DFPWM data. returns the encoded DFPWM data.
:::caution Reusing encoders > [Reusing encoders][!WARNING]
Encoders have lots of internal state which tracks the state of the current stream. If you reuse an encoder for multiple > Encoders have lots of internal state which tracks the state of the current stream. If you reuse an encoder for multiple
streams, or use different encoders for the same stream, the resulting audio may not sound correct. > streams, or use different encoders for the same stream, the resulting audio may not sound correct.
:::
@treturn function(pcm: { number... }):string The encoder function @treturn function(pcm: { number... }):string The encoder function
@see encode A helper function for encoding an entire file of audio at once. @see encode A helper function for encoding an entire file of audio at once.
@ -138,10 +137,9 @@ end
The returned decoder is itself a function. This function accepts a string and returns a table of amplitudes, each value The returned decoder is itself a function. This function accepts a string and returns a table of amplitudes, each value
between -128 and 127. between -128 and 127.
:::caution Reusing decoders > [Reusing decoders][!WARNING]
Decoders have lots of internal state which tracks the state of the current stream. If you reuse an decoder for multiple > Decoders have lots of internal state which tracks the state of the current stream. If you reuse an decoder for
streams, or use different decoders for the same stream, the resulting audio may not sound correct. > multiple streams, or use different decoders for the same stream, the resulting audio may not sound correct.
:::
@treturn function(dfpwm: string):{ number... } The encoder function @treturn function(dfpwm: string):{ number... } The encoder function
@see decode A helper function for decoding an entire file of audio at once. @see decode A helper function for decoding an entire file of audio at once.

View File

@ -4,10 +4,9 @@
--[[- A pretty-printer for Lua errors. --[[- A pretty-printer for Lua errors.
:::warning > [!DANGER]
This is an internal module and SHOULD NOT be used in your own code. It may > This is an internal module and SHOULD NOT be used in your own code. It may
be removed or changed at any time. > be removed or changed at any time.
:::
This consumes a list of messages and "annotations" and displays the error to the This consumes a list of messages and "annotations" and displays the error to the
terminal. terminal.

View File

@ -4,10 +4,9 @@
--[[- Internal tools for working with errors. --[[- Internal tools for working with errors.
:::warning > [!DANGER]
This is an internal module and SHOULD NOT be used in your own code. It may > This is an internal module and SHOULD NOT be used in your own code. It may
be removed or changed at any time. > be removed or changed at any time.
:::
@local @local
]] ]]

View File

@ -4,10 +4,9 @@
--[[- Upload a list of files, as received by the @{event!file_transfer} event. --[[- Upload a list of files, as received by the @{event!file_transfer} event.
:::warning > [!DANGER]
This is an internal module and SHOULD NOT be used in your own code. It may > This is an internal module and SHOULD NOT be used in your own code. It may
be removed or changed at any time. > be removed or changed at any time.
:::
@local @local
]] ]]

View File

@ -4,10 +4,9 @@
--[[- The error messages reported by our lexer and parser. --[[- The error messages reported by our lexer and parser.
:::warning > [!DANGER]
This is an internal module and SHOULD NOT be used in your own code. It may > This is an internal module and SHOULD NOT be used in your own code. It may
be removed or changed at any time. > be removed or changed at any time.
:::
This provides a list of factory methods which take source positions and produce This provides a list of factory methods which take source positions and produce
appropriate error messages targeting that location. These error messages can appropriate error messages targeting that location. These error messages can

View File

@ -4,10 +4,9 @@
--[[- The main entrypoint to our Lua parser --[[- The main entrypoint to our Lua parser
:::warning > [!DANGER]
This is an internal module and SHOULD NOT be used in your own code. It may > This is an internal module and SHOULD NOT be used in your own code. It may
be removed or changed at any time. > be removed or changed at any time.
:::
@local @local
]] ]]

View File

@ -4,10 +4,9 @@
--[[- A lexer for Lua source code. --[[- A lexer for Lua source code.
:::warning > [!DANGER]
This is an internal module and SHOULD NOT be used in your own code. It may > This is an internal module and SHOULD NOT be used in your own code. It may
be removed or changed at any time. > be removed or changed at any time.
:::
This module provides utilities for lexing Lua code, returning tokens compatible This module provides utilities for lexing Lua code, returning tokens compatible
with @{cc.internal.syntax.parser}. While all lexers are roughly the same, there with @{cc.internal.syntax.parser}. While all lexers are roughly the same, there

View File

@ -4,10 +4,9 @@
--[[- A parser for Lua programs and expressions. --[[- A parser for Lua programs and expressions.
:::warning > [!DANGER]
This is an internal module and SHOULD NOT be used in your own code. It may > This is an internal module and SHOULD NOT be used in your own code. It may
be removed or changed at any time. > be removed or changed at any time.
:::
Most of the code in this module is automatically generated from the Lua grammar, Most of the code in this module is automatically generated from the Lua grammar,
hence being mostly unreadable! hence being mostly unreadable!

View File

@ -15,10 +15,9 @@ import net.minecraftforge.energy.IEnergyStorage;
* <p> * <p>
* This works with energy storage blocks, as well as generators and machines which consume energy. * This works with energy storage blocks, as well as generators and machines which consume energy.
* <p> * <p>
* :::note * > [!NOTE]
* Due to limitations with Forge's energy API, it is not possible to measure throughput (i.e. RF * > Due to limitations with Forge's energy API, it is not possible to measure throughput (i.e. RF
* used/generated per tick). * > used/generated per tick).
* :::
* *
* @cc.module energy_storage * @cc.module energy_storage
* @cc.since 1.94.0 * @cc.since 1.94.0

View File

@ -102,12 +102,11 @@ public class InventoryMethods implements GenericPeripheral {
* recommended to print it out using @{textutils.serialize} or in the Lua * recommended to print it out using @{textutils.serialize} or in the Lua
* REPL, to explore what is available. * REPL, to explore what is available.
* <p> * <p>
* :::info Deprecated fields * > [Deprecated fields][!INFO]
* Older versions of CC: Tweaked exposed an {@code itemGroups} field, listing the * > Older versions of CC: Tweaked exposed an {@code itemGroups} field, listing the
* creative tabs an item was available under. This information is no longer available on * > creative tabs an item was available under. This information is no longer available on
* more recent versions of the game, and so this field will always be empty. Do not use this * > more recent versions of the game, and so this field will always be empty. Do not use this
* field in new code! * > field in new code!
* :::
* *
* @param inventory The current inventory. * @param inventory The current inventory.
* @param slot The slot to get information about. * @param slot The slot to get information about.