mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-04-16 15:53:18 +00:00
Syntax highlight more docstrings
This is going to conflict horribly with MC 1.21 (where we started using @snippet), but hopefully this still helps.
This commit is contained in:
parent
bdffabc08e
commit
ad52117f0f
@ -173,7 +173,7 @@ public final class ComputerCraftAPI {
|
||||
* This may be used with {@link IComputerSystem#getComponent(ComputerComponent)} to only attach APIs to specific
|
||||
* computers. For example, one can add an additional API just to turtles with the following code:
|
||||
*
|
||||
* <pre>{@code
|
||||
* <pre class="language language-java">{@code
|
||||
* ComputerCraftAPI.registerAPIFactory(computer -> {
|
||||
* // Read the turtle component.
|
||||
* var turtle = computer.getComponent(ComputerComponents.TURTLE);
|
||||
|
@ -28,7 +28,7 @@ import java.util.function.Function;
|
||||
* {@link #simple(Function)} or {@link #simpleWithCustomItem(BiFunction)} to create a basic upgrade serialiser.
|
||||
*
|
||||
* <h2>Example (Forge)</h2>
|
||||
* <pre>{@code
|
||||
* <pre class="language language-java">{@code
|
||||
* static final DeferredRegister<TurtleUpgradeSerialiser<?>> SERIALISERS = DeferredRegister.create( TurtleUpgradeSerialiser.TYPE, "my_mod" );
|
||||
*
|
||||
* // Register a new upgrade serialiser called "my_upgrade".
|
||||
@ -42,9 +42,9 @@ import java.util.function.Function;
|
||||
* We can then define a new upgrade using JSON by placing the following in
|
||||
* {@literal data/<my_mod>/computercraft/turtle_upgrades/<my_upgrade_id>.json}}.
|
||||
*
|
||||
* <pre>{@code
|
||||
* <pre class="language language-json">{@code
|
||||
* {
|
||||
* "type": my_mod:my_upgrade",
|
||||
* "type": "my_mod:my_upgrade",
|
||||
* }
|
||||
* }</pre>
|
||||
* <p>
|
||||
|
@ -86,7 +86,7 @@ public abstract class UpgradeDataProvider<T extends UpgradeBase, R extends Upgra
|
||||
* Add all turtle or pocket computer upgrades.
|
||||
* <p>
|
||||
* <strong>Example usage:</strong>
|
||||
* <pre>{@code
|
||||
* <pre class="language language-java">{@code
|
||||
* protected void addUpgrades(Consumer<Upgrade<TurtleUpgradeSerialiser<?>>> addUpgrade) {
|
||||
* simple(new ResourceLocation("mymod", "speaker"), SPEAKER_SERIALISER.get()).add(addUpgrade);
|
||||
* }
|
||||
|
@ -11,7 +11,7 @@ package dan200.computercraft.api.lua;
|
||||
* the given type, rather than requiring an exact type.
|
||||
*
|
||||
* <h2>Example:</h2>
|
||||
* <pre>{@code
|
||||
* <pre class="language language-java">{@code
|
||||
* @LuaFunction
|
||||
* public final void doSomething(Coerced<String> myString) {
|
||||
* var value = myString.value();
|
||||
|
@ -21,9 +21,9 @@ import dan200.computercraft.api.peripheral.IPeripheral;
|
||||
* <p>
|
||||
* For example, the main CC: Tweaked mod defines a generic source for inventories, which works on {@code IItemHandler}s:
|
||||
*
|
||||
* <pre>{@code
|
||||
* <pre class="language language-java">{@code
|
||||
* public class InventoryMethods implements GenericSource {
|
||||
* \@LuaFunction(mainThread = true)
|
||||
* @LuaFunction(mainThread = true)
|
||||
* public int size(IItemHandler inventory) {
|
||||
* return inventory.getSlots();
|
||||
* }
|
||||
|
@ -27,7 +27,7 @@ import java.util.function.Consumer;
|
||||
*
|
||||
* <h2>Example</h2>
|
||||
*
|
||||
* <pre>{@code
|
||||
* <pre class="language language-java">{@code
|
||||
* public class MyPeripheral implements IPeripheral {
|
||||
* private final AttachedComputerSet computers = new ComputerCollection();
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user