1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-09-05 03:47:56 +00:00

Standardised item details docs a little

Sort of closes #2125. I've really struggled to find a way to make it
clear that the information returned here is a snapshot of the current
item, and not a live view and/or proxy. Most wordings I've tried end up
feeling really clunky — given that this is a relatively rare
misunderstanding, let's not stress about this too much.
This commit is contained in:
Jonathan Coates
2025-03-16 10:25:57 +00:00
parent 27f2ab364c
commit 594738a022
4 changed files with 11 additions and 12 deletions

View File

@@ -88,8 +88,8 @@ You'll first need to [set up a development environment as above](#setting-up-a-d
Once this is set up, you can now run `./gradlew docWebsite`. This generates documentation from our Lua and Java code, Once this is set up, you can now run `./gradlew docWebsite`. This generates documentation from our Lua and Java code,
writing the resulting HTML into `./projects/web/build/site`, which can then be opened in a browser. When iterating on writing the resulting HTML into `./projects/web/build/site`, which can then be opened in a browser. When iterating on
documentation, you can instead run `./gradlew docWebsite -t`, which will rebuild documentation every time you change a documentation, you can instead run `./gradlew :web:assemble -x :web:compileTeaVM -t`, which will rebuild documentation
file. every time you change a file.
Documentation is built using [illuaminate] which, while not currently documented (somewhat ironic), is largely the same Documentation is built using [illuaminate] which, while not currently documented (somewhat ironic), is largely the same
as [ldoc][ldoc]. Documentation comments are written in Markdown, though note that we do not support many GitHub-specific as [ldoc][ldoc]. Documentation comments are written in Markdown, though note that we do not support many GitHub-specific

View File

@@ -41,9 +41,9 @@ public abstract class AbstractFluidMethods<T> implements GenericPeripheral {
* The returned table is sparse, and so empty tanks will be `nil` - it is recommended to loop over using [`pairs`] * The returned table is sparse, and so empty tanks will be `nil` - it is recommended to loop over using [`pairs`]
* rather than [`ipairs`]. * rather than [`ipairs`].
* *
* @param fluids The current fluid handler. * @param fluids The current fluid storage.
* @return All tanks. * @return All tanks.
* @cc.treturn { (table|nil)... } All tanks in this fluid storage. * @cc.treturn { (table|nil)... } Basic information about all fluids in this fluid storage.
*/ */
@LuaFunction(mainThread = true) @LuaFunction(mainThread = true)
public abstract Map<Integer, Map<String, ?>> tanks(T fluids); public abstract Map<Integer, Map<String, ?>> tanks(T fluids);

View File

@@ -56,8 +56,8 @@ public abstract class AbstractInventoryMethods<T> implements GenericPeripheral {
* rather than [`ipairs`]. * rather than [`ipairs`].
* *
* @param inventory The current inventory. * @param inventory The current inventory.
* @return All items in this inventory. * @return Basic information about all items in this inventory.
* @cc.treturn { (table|nil)... } All items in this inventory. * @cc.treturn { (table|nil)... } Basic information about all items in this inventory.
* @cc.usage Find an adjacent chest and print all items in it. * @cc.usage Find an adjacent chest and print all items in it.
* *
* <pre>{@code * <pre>{@code
@@ -89,9 +89,8 @@ public abstract class AbstractInventoryMethods<T> implements GenericPeripheral {
* *
* @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.
* @return Information about the item in this slot, or {@code nil} if not present. * @return Information about the item in this slot, or {@code nil} if it is empty.
* @throws LuaException If the slot is out of range. * @throws LuaException If the slot is out of range.
* @cc.treturn table Information about the item in this slot, or {@code nil} if not present.
* @cc.usage Print some information about the first in a chest. * @cc.usage Print some information about the first in a chest.
* *
* <pre>{@code * <pre>{@code
@@ -109,7 +108,7 @@ public abstract class AbstractInventoryMethods<T> implements GenericPeripheral {
*/ */
@Nullable @Nullable
@LuaFunction(mainThread = true) @LuaFunction(mainThread = true)
public abstract Map<String, ?> getItemDetail(T inventory, int slot) throws LuaException; public abstract Map<?, ?> getItemDetail(T inventory, int slot) throws LuaException;
/** /**
* Get the maximum number of items which can be stored in this slot. * Get the maximum number of items which can be stored in this slot.

View File

@@ -694,7 +694,7 @@ public class TurtleAPI implements ILuaAPI {
* This returns information about the currently equipped item, in the same form as * This returns information about the currently equipped item, in the same form as
* {@link #getItemDetail(ILuaContext, Optional, Optional)}. * {@link #getItemDetail(ILuaContext, Optional, Optional)}.
* *
* @return Details about the currently equipped item, or {@code nil} if no upgrade is equipped. * @return Information about the currently equipped item, or {@code nil} if no upgrade is equipped.
* @see #equipLeft() * @see #equipLeft()
* @cc.since 1.116.0 * @cc.since 1.116.0
*/ */
@@ -710,7 +710,7 @@ public class TurtleAPI implements ILuaAPI {
* This returns information about the currently equipped item, in the same form as * This returns information about the currently equipped item, in the same form as
* {@link #getItemDetail(ILuaContext, Optional, Optional)}. * {@link #getItemDetail(ILuaContext, Optional, Optional)}.
* *
* @return Details about the currently equipped item, or {@code nil} if no upgrade is equipped. * @return Information about the currently equipped item, or {@code nil} if no upgrade is equipped.
* @see #equipRight() * @see #equipRight()
* @cc.since 1.116.0 * @cc.since 1.116.0
*/ */
@@ -781,7 +781,7 @@ public class TurtleAPI implements ILuaAPI {
* more information about the item at the cost of taking longer to run. * more information about the item at the cost of taking longer to run.
* @return The command result. * @return The command result.
* @throws LuaException If the slot is out of range. * @throws LuaException If the slot is out of range.
* @cc.treturn nil|table Information about the given slot, or {@code nil} if it is empty. * @cc.treturn nil|table Information about the item in this slot, or {@code nil} if it is empty.
* @cc.since 1.64 * @cc.since 1.64
* @cc.changed 1.90.0 Added detailed parameter. * @cc.changed 1.90.0 Added detailed parameter.
* @cc.usage Print the current slot, assuming it contains 13 dirt. * @cc.usage Print the current slot, assuming it contains 13 dirt.