1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-10-28 12:27:39 +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:
Jonathan Coates
2024-11-13 11:00:46 +00:00
parent bdffabc08e
commit ad52117f0f
6 changed files with 9 additions and 9 deletions

View File

@@ -173,7 +173,7 @@ public final class ComputerCraftAPI {
* This may be used with {@link IComputerSystem#getComponent(ComputerComponent)} to only attach APIs to specific * 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: * 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 -> { * ComputerCraftAPI.registerAPIFactory(computer -> {
* // Read the turtle component. * // Read the turtle component.
* var turtle = computer.getComponent(ComputerComponents.TURTLE); * var turtle = computer.getComponent(ComputerComponents.TURTLE);

View File

@@ -28,7 +28,7 @@ import java.util.function.Function;
* {@link #simple(Function)} or {@link #simpleWithCustomItem(BiFunction)} to create a basic upgrade serialiser. * {@link #simple(Function)} or {@link #simpleWithCustomItem(BiFunction)} to create a basic upgrade serialiser.
* *
* <h2>Example (Forge)</h2> * <h2>Example (Forge)</h2>
* <pre>{@code * <pre class="language language-java">{@code
* static final DeferredRegister<TurtleUpgradeSerialiser<?>> SERIALISERS = DeferredRegister.create( TurtleUpgradeSerialiser.TYPE, "my_mod" ); * static final DeferredRegister<TurtleUpgradeSerialiser<?>> SERIALISERS = DeferredRegister.create( TurtleUpgradeSerialiser.TYPE, "my_mod" );
* *
* // Register a new upgrade serialiser called "my_upgrade". * // 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 * 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}}. * {@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> * }</pre>
* <p> * <p>

View File

@@ -86,7 +86,7 @@ public abstract class UpgradeDataProvider<T extends UpgradeBase, R extends Upgra
* Add all turtle or pocket computer upgrades. * Add all turtle or pocket computer upgrades.
* <p> * <p>
* <strong>Example usage:</strong> * <strong>Example usage:</strong>
* <pre>{@code * <pre class="language language-java">{@code
* protected void addUpgrades(Consumer<Upgrade<TurtleUpgradeSerialiser<?>>> addUpgrade) { * protected void addUpgrades(Consumer<Upgrade<TurtleUpgradeSerialiser<?>>> addUpgrade) {
* simple(new ResourceLocation("mymod", "speaker"), SPEAKER_SERIALISER.get()).add(addUpgrade); * simple(new ResourceLocation("mymod", "speaker"), SPEAKER_SERIALISER.get()).add(addUpgrade);
* } * }

View File

@@ -11,7 +11,7 @@ package dan200.computercraft.api.lua;
* the given type, rather than requiring an exact type. * the given type, rather than requiring an exact type.
* *
* <h2>Example:</h2> * <h2>Example:</h2>
* <pre>{@code * <pre class="language language-java">{@code
* @LuaFunction * @LuaFunction
* public final void doSomething(Coerced<String> myString) { * public final void doSomething(Coerced<String> myString) {
* var value = myString.value(); * var value = myString.value();

View File

@@ -21,9 +21,9 @@ import dan200.computercraft.api.peripheral.IPeripheral;
* <p> * <p>
* For example, the main CC: Tweaked mod defines a generic source for inventories, which works on {@code IItemHandler}s: * 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 { * public class InventoryMethods implements GenericSource {
* \@LuaFunction(mainThread = true) * @LuaFunction(mainThread = true)
* public int size(IItemHandler inventory) { * public int size(IItemHandler inventory) {
* return inventory.getSlots(); * return inventory.getSlots();
* } * }

View File

@@ -27,7 +27,7 @@ import java.util.function.Consumer;
* *
* <h2>Example</h2> * <h2>Example</h2>
* *
* <pre>{@code * <pre class="language language-java">{@code
* public class MyPeripheral implements IPeripheral { * public class MyPeripheral implements IPeripheral {
* private final AttachedComputerSet computers = new ComputerCollection(); * private final AttachedComputerSet computers = new ComputerCollection();
* *