Skip to content

Commit

Permalink
Syntax highlight more docstrings
Browse files Browse the repository at this point in the history
This is going to conflict horribly with MC 1.21 (where we started using
@snippet), but hopefully this still helps.
  • Loading branch information
SquidDev committed Nov 13, 2024
1 parent bdffabc commit ad52117
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public static PacketNetwork getWirelessNetwork(MinecraftServer server) {
* 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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* {@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".
Expand All @@ -42,9 +42,9 @@
* 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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public final Upgrade<R> simpleWithCustomItem(ResourceLocation id, R serialiser,
* 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);
* }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* 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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
* <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();
* }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
*
* <h2>Example</h2>
*
* <pre>{@code
* <pre class="language language-java">{@code
* public class MyPeripheral implements IPeripheral {
* private final AttachedComputerSet computers = new ComputerCollection();
*
Expand Down

0 comments on commit ad52117

Please sign in to comment.