···11+---
22+layout: main.njk
33+title: Actions
44+55+eleventyNavigation:
66+ key: Actions
77+ parent: Data Driven GUIs
88+---
99+1010+An action looks something like this:
1111+1212+```json
1313+{
1414+ "type": "ddg:open_screen",
1515+ "action": {
1616+ "screen": "ddg:screen/example.xml",
1717+ "title": "Hello, World!"
1818+ }
1919+}
2020+```
2121+2222+### Advanced
2323+2424+#### Actions with Classes (Coming Soon™)
2525+2626+You can call classes that implement `JavaAction`. This is useful for actions that require more complex logic or state.
2727+2828+Example:
2929+```json
3030+{
3131+ "type": "ddg:java_action",
3232+ "parent": "ddg:editbox_value",
3333+ "action": {
3434+ "class": "me.theclashfruit.ddg.example.EditBoxValueAction"
3535+ }
3636+}
3737+```
3838+3939+`EditBoxValueAction.java`:
4040+```java
4141+package me.theclashfruit.ddg.example;
4242+4343+import java.util.HashMap;
4444+import java.util.Map;
4545+4646+import me.theclashfruit.ddg.api.action.JavaAction;
4747+4848+public class EditBoxValueAction implements JavaAction {
4949+ @Override
5050+ public Map<String, Runnable> getFields() {
5151+ Map<String, Runnable> action = new HashMap<>();
5252+ action.put("returns", () -> "Hello World!");
5353+5454+ return action;
5555+ }
5656+}
5757+```
+26
src/ddg/components/button.md
···11+---
22+layout: main.njk
33+title: Button
44+55+eleventyNavigation:
66+ key: Button
77+ parent: Components
88+---
99+1010+Just a silly little button.
1111+1212+## Example
1313+1414+```xml
1515+<Button action="ddg:close_menu">Close</Button>
1616+```
1717+## Attributes
1818+1919+| Attribute | Type | Description |
2020+|-----------|--------------|---------------------------------------------------|
2121+| `position`| `(int; int)` | The position of the button in the menu. |
2222+| `action` | `string` | The action to perform when the button is clicked. |
2323+| `width` | `int` | The width of the button in pixels. |
2424+| `height` | `int` | The height of the button in pixels. |
2525+2626+\* Required.
+33
src/ddg/components/editbox.md
···11+---
22+layout: main.njk
33+title: EditBox
44+55+eleventyNavigation:
66+ key: EditBox
77+ parent: Components
88+---
99+1010+An edit box for entering text.
1111+1212+## Example
1313+1414+```xml
1515+<EditBox id="config" width="300" height="200" placeholder="Enter you thoughts here..." />
1616+```
1717+1818+## Attributes
1919+2020+| Attribute | Type | Description |
2121+|----------------|--------------------------|-------------------------------------------|
2222+| `position` | `(int; int)` | The position of the edit box in the menu. |
2323+| `id` | `string` | The id of the edit box. |
2424+| `width`* | `int` | The width of the edit box in pixels. |
2525+| `height`* | `int` | The height of the edit box in pixels. |
2626+| `placeholder`* | `string` | The placeholder text for the edit box. |
2727+| `value` | `string` or `action`[^1] | The default value of the edit box. |
2828+2929+\* Required.
3030+3131+---
3232+3333+[^1]: An action that inherits from `ddg:editbox_value` can be used to set the value of the edit box. The action must return a string.
+26
src/ddg/components/grid.md
···11+---
22+layout: main.njk
33+title: Grid
44+55+eleventyNavigation:
66+ key: Grid
77+ parent: Components
88+---
99+1010+A grid layout for arranging components in a menu.
1111+1212+## Example
1313+1414+```xml
1515+<Grid row-gap="8">
1616+ ...
1717+</Grid>
1818+```
1919+## Attributes
2020+2121+| Attribute | Type | Description |
2222+|-----------------------------------|--------------|---------------------------------------------------|
2323+| `position` | `(int; int)` | The position of the grid in the menu. |
2424+| `gap` or `row-gap` & `column-gap` | `int` | The gap between the rows & columns in the grid. |
2525+2626+\* Required.
+22
src/ddg/components/index.md
···11+---
22+layout: main.njk
33+title: Components
44+55+eleventyNavigation:
66+ key: Components
77+ parent: Data Driven GUIs
88+---
99+1010+A list of components that can be used in the menu.
1111+1212+* [Button](button)
1313+* [EditBox](editbox)
1414+* [Grid](grid)
1515+* [Layout](layout)
1616+* [Tab](tab)
1717+* [TabLayout](tablayout)
1818+* [Text](text)
1919+2020+## Descriptor Components
2121+2222+Descriptor components are components that can only be used inside of a specific parent component. For example, `Tabs` and `Pages` can only be used inside of `TabLayout`. They are not standalone components and cannot be used outside of their designated parent component.
+33
src/ddg/components/layout.md
···11+---
22+layout: main.njk
33+title: Layout
44+55+eleventyNavigation:
66+ key: Layout
77+ parent: Components
88+---
99+1010+Either a `HorizontalLayout` or a `VerticalLayout`.
1111+1212+## Example
1313+1414+```xml
1515+<HorizontalLayout gap="8">
1616+ <!-- ... -->
1717+</HorizontalLayout>
1818+```
1919+2020+```xml
2121+<VerticalLayout>
2222+ <!-- ... -->
2323+</VerticalLayout>
2424+```
2525+2626+## Attributes
2727+2828+| Attribute | Type | Description |
2929+|-----------|--------------|---------------------------------------------|
3030+| `position`| `(int; int)` | The position of the layout in the menu. |
3131+| `gap` | `int` | The gap between the elements in the layout. |
3232+3333+\* Required.
+28
src/ddg/components/tab.md
···11+---
22+layout: main.njk
33+title: Tab
44+55+eleventyNavigation:
66+ key: Tab
77+ parent: Components
88+---
99+1010+A tab button component.
1111+1212+> Note: Not yet available. This is a work in progress and will be available in a future release.
1313+1414+## Example
1515+1616+```xml
1717+<Tab action="ddg:close_menu">Tab Title</Tab>
1818+```
1919+## Attributes
2020+2121+| Attribute | Type | Description |
2222+|-----------|--------------|------------------------------------------------|
2323+| `position`| `(int; int)` | The position of the tab in the menu. |
2424+| `action` | `string` | The action to perform when the tab is clicked. |
2525+| `width` | `int` | The width of the tab in pixels. |
2626+| `height` | `int` | The height of the tab in pixels. |
2727+2828+\* Required.
+42
src/ddg/components/tablayout.md
···11+---
22+layout: main.njk
33+title: TabLayout
44+55+eleventyNavigation:
66+ key: TabLayout
77+ parent: Components
88+---
99+1010+A layout for arranging components in a tabbed interface.
1111+1212+> Note: Not yet available. This is a work in progress and will be available in a future release.
1313+1414+## Example
1515+1616+```xml
1717+<TabLayout>
1818+ <Tabs>
1919+ <Tab id="one">Tab 1</Tab>
2020+ <Tab id="two">Tab 2</Tab>
2121+ </Tabs>
2222+ <Pages>
2323+ <HorizontalLayout id="one">
2424+ <Text>Content for Tab 1</Text>
2525+ </HorizontalLayout>
2626+ <VerticalLayout id="two">
2727+ <Text>Content for Tab 2</Text>
2828+ </VerticalLayout>
2929+ </Pages>
3030+</TabLayout>
3131+```
3232+3333+> **Note**: `Tabs` and `Pages` are so called "[descriptor](/ddg/components/#descriptor-components)" components and thus can only be used inside of `TabLayout`.
3434+3535+## Attributes
3636+3737+| Attribute | Type | Description |
3838+|-----------|--------------|---------------------------------------------|
3939+| `position`| `(int; int)` | The position of the layout in the menu. |
4040+| `gap` | `int` | The gap between the elements in the layout. |
4141+4242+\* Required.
+23
src/ddg/components/text.md
···11+---
22+layout: main.njk
33+title: Text
44+55+eleventyNavigation:
66+ key: Text
77+ parent: Components
88+---
99+1010+Some text.
1111+1212+## Example
1313+1414+```xml
1515+<Text>Close</Text>
1616+```
1717+## Attributes
1818+1919+| Attribute | Type | Description |
2020+|-----------|--------------|---------------------------------------------------|
2121+| `position`| `(int; int)` | The position of the text in the menu. |
2222+2323+\* Required.
+81
src/ddg/index.md
···11+---
22+layout: main.njk
33+title: Data Driven GUIs
44+55+eleventyNavigation:
66+ key: Data Driven GUIs
77+---
88+99+Developer docs for the Data Driven GUIs mod.
1010+1111+## Getting Started
1212+1313+### Import The Library
1414+1515+Add the repository and dependency to your `build.gradle.kts`:
1616+1717+<details>
1818+ <summary>Stable (Releases Repo)</summary>
1919+2020+```kotlin
2121+maven {
2222+ name = "TheClashFruit's Maven Releases"
2323+ url = uri("https://mvn.theclashfruit.me/releases")
2424+}
2525+```
2626+</details>
2727+2828+<details>
2929+ <summary>Beta, Alpha (Snapshots Repo)</summary>
3030+3131+```kotlin
3232+maven {
3333+ name = "TheClashFruit's Maven Snapshots"
3434+ url = uri("https://mvn.theclashfruit.me/snapshots")
3535+}
3636+```
3737+</details>
3838+3939+```kotlin
4040+implementation("me.theclashfruit:ddg-$mc_version-fabric:$version")
4141+```
4242+4343+## Creating a GUI
4444+4545+The menus are stored in `data/modid/screen/<menu_name>.xml` and the actions are stored in `data/modid/action/<action>.json`.
4646+4747+An example menu would look like this:
4848+```xml
4949+<Root> <!-- Evaluated like html and puts elements bellow one another. (Uhh I forgor so not yet™) -->
5050+ <Button postion="(10;10)" width="100" height="20">Either a translation key or a string.</Button>
5151+ <!-- ^^^^^^^^^^^^^^^^^ If a position is defined it fill be a "fixed" element. -->
5252+ <Button action="modid:action">Another button</Button> <!-- The default button size is `200x20`. -->
5353+ <!-- ^^^^^^^^^^^^^^^^^^^^^ Actions can be defined with action and the id for the action file. -->
5454+5555+ <Text>Some text</Text>
5656+</Root>
5757+```
5858+5959+> You can kind of think of it like a web page, where the root element is the body and the elements are like divs, buttons, inputs and paragraphs.
6060+6161+Some built in action types are:
6262+* `ddg:open_menu` - Opens a menu.
6363+<!--
6464+* `ddg:close_menu` - Closes the current menu. — Can also be called directly from the menu.
6565+* `ddg:run_command` - Runs a command.
6666+-->
6767+6868+## Opening a Menu From a Server
6969+7070+**From a mod using the mod's api**:
7171+```java
7272+ServerPlayNetworking.send(player, new OpenCustomScreenPayload(Identifier.of("modid", "menu_name"), "title"));
7373+```
7474+7575+**With a command with the mod installed**:
7676+```plaintext
7777+/ddg open <screen> <title> [<player>]
7878+7979+# Example:
8080+/ddg open modid:screen/menu_name.xml "Title"
8181+```
+9-1
src/index.md
···11-# Hello, World!
11+---
22+layout: main.njk
33+title: Home
44+55+eleventyNavigation:
66+ key: Home
77+---
88+99+Here you will be able to find the documentation for my projects.
···11+---
22+layout: main.njk
33+title: Kotrinth
44+55+badges:
66+ - url: https://img.shields.io/maven-metadata/v?metadataUrl=https%3A%2F%2Fmvn.theclashfruit.me%2Fsnapshots%2Fme%2Ftheclashfruit%2Fkotrinth%2Fmaven-metadata.xml&label=Snapshots%20Version
77+ alt: Snapshots
88+ - url: https://img.shields.io/maven-metadata/v?metadataUrl=https%3A%2F%2Fmvn.theclashfruit.me%2Freleases%2Fme%2Ftheclashfruit%2Fkotrinth%2Fmaven-metadata.xml&label=Releases%20Version
99+ alt: Releases
1010+1111+eleventyNavigation:
1212+ key: Kotrinth
1313+---
1414+1515+A Modrinth API wrapper for Kotlin.
1616+1717+## Getting Started
1818+1919+### Usage
2020+2121+#### Import Kotrinth
2222+2323+Add the repository and dependency to your `build.gradle.kts`:
2424+2525+<details>
2626+ <summary>Beta, Alpha (Snapshots Repo)</summary>
2727+2828+```kotlin
2929+maven {
3030+ name = "TheClashFruit's Maven Snapshots"
3131+ url = uri("https://mvn.theclashfruit.me/snapshots")
3232+}
3333+```
3434+</details>
3535+3636+<details>
3737+ <summary>Stable (Releases Repo)</summary>
3838+3939+```kotlin
4040+maven {
4141+ name = "TheClashFruit's Maven Releases"
4242+ url = uri("https://mvn.theclashfruit.me/releases")
4343+}
4444+```
4545+</details>
4646+4747+```kotlin
4848+implementation("me.theclashfruit:kotrinth:$version")
4949+```
5050+5151+#### Example
5252+5353+```kotlin
5454+package com.example
5555+5656+import me.theclashfruit.kotrinth.Kotrinth
5757+5858+suspend fun main() {
5959+ // Create a new Kotrinth instance.
6060+ val kotrinth = Kotrinth(
6161+ appName = "Example",
6262+ appVersion = "1.0.0",
6363+ appContact = "admin@example.com"
6464+ )
6565+6666+ // Get a user by their username.
6767+ val user = kotrinth.v2.user("TheClashFruit")
6868+6969+ // Print the user's id.
7070+ println(user.id)
7171+}
7272+```
7373+7474+---
7575+7676+### Cloning
7777+7878+This repository doesn't use any special stuff, so we can clone it in to old-fashioned way of `git clone https://github.com/TheClashFruit/Kotrinth.git`.
7979+8080+### Building
8181+8282+Building is also straight forward, open the project in your desired code editor, IDE or just a terminal then just run `./gradlew build` in a terminal.
8383+8484+## Contributing
8585+8686+You can read the [CONTRIBUTING.md](https://github.com/TheClashFruit/Kotrinth/blob/main/CONTRIBUTING.md) file for details on the project's code of conduct, and the process for submitting pull requests to this project, have fun!
8787+8888+## License
8989+9090+This project is licensed under MIT, if you want to learn more check the [LICENSE](https://github.com/TheClashFruit/Kotrinth/blob/main/LICENSE) file.
+84
src/kotrinth/oauth.md
···11+---
22+layout: main.njk
33+title: OAuth
44+55+eleventyNavigation:
66+ key: OAuth
77+ parent: Kotrinth
88+---
99+1010+> OAuth is going to be in Modrinth's v3 api which is currently
1111+> under development, thus marking it experimental.
1212+1313+Using Modrinth's OAuth with Kotrinth.
1414+1515+## Setup Guide
1616+1717+### 1. Set Up the OAuth Class
1818+1919+```kotlin
2020+package com.example
2121+2222+import me.theclashfruit.kotrinth.v2.Kotrinth
2323+import me.theclashfruit.kotrinth.experimental.OAuth
2424+2525+suspend fun main() {
2626+ // ...
2727+2828+ // Create a new OAuth instance.
2929+ val oauth = OAuth(
3030+ kotrinth,
3131+ clientId = "...",
3232+ clientSecret = "..."
3333+ )
3434+}
3535+```
3636+3737+### 2. Create the Auth Uri
3838+3939+```kotlin
4040+package com.example
4141+4242+import me.theclashfruit.kotrinth.v2.Kotrinth
4343+import me.theclashfruit.kotrinth.experimental.OAuth
4444+import me.theclashfruit.kotrinth.enums.Scope
4545+4646+suspend fun main() {
4747+ // ...
4848+4949+ // Create the uri.
5050+ val uri = oauth.createAuthUrl(
5151+ "https://example.com/api/auth",
5252+ setOf(
5353+ Scope.USER_READ_EMAIL,
5454+ Scope.USER_READ,
5555+ Scope.USER_WRITE
5656+ )
5757+ )
5858+5959+ // Print the uri.
6060+ println(uri)
6161+}
6262+```
6363+6464+### 3. Get the Auth Token
6565+6666+```kotlin
6767+package com.example
6868+6969+import me.theclashfruit.kotrinth.v2.Kotrinth
7070+import me.theclashfruit.kotrinth.experimental.OAuth
7171+import me.theclashfruit.kotrinth.enums.Scope
7272+7373+suspend fun main() {
7474+ // ...
7575+7676+ // Get the auth token.
7777+ val res = oauth.token("https://example.com/api/auth", code)
7878+7979+ // Print the token.
8080+ if (res != null) {
8181+ println(res.accessToken)
8282+ }
8383+}
8484+```
···11+---
22+layout: mod.njk
33+44+title: Cluttered Creative
55+description: Unable to find anything in the new inventory layout? Well then this mod is for you! It brings the old creative inventory layout (pre 1.19.3) to 1.20+.
66+77+mod:
88+ game: minecraft
99+ downloads:
1010+ - platform: Modrinth
1111+ link: https://modrinth.com/mod/cluttered-creative
1212+ - platform: CurseForge
1313+ link: https://www.curseforge.com/minecraft/mc-mods/cluttered-creative
1414+1515+eleventyNavigation:
1616+ key: Cluttered Creative
1717+ parent: Mods
1818+---
1919+2020+## FAQ
2121+2222+### Mod Compatibility
2323+Probably not compatible with mods that add items to the default item groups, however a compatibility layer is planned.
2424+2525+### Missing Items
2626+I'm doing my best to include all items including new ones from 1.20 but I might miss some so please report them on the issues page or my Discord server.
2727+2828+## Known Issues
2929+3030+### Custom Item Groups
3131+If there is only one custom item group then the page selector will not show, most likely due to the fact that this inventory has one less tab. I'm working on a fix.
3232+3333+## Screenshot
3434+3535+
+73
src/mods/create-piss-n-shit.md
···11+---
22+layout: mod.njk
33+44+title: 'Create: Piss & Shit'
55+description: A Create add-on that adds piss and shit to the game with interesting mechanics!
66+77+mod:
88+ game: minecraft
99+ downloads:
1010+ - platform: Modrinth
1111+ link: https://modrinth.com/mod/create-pns
1212+ - platform: CurseForge
1313+ link: https://www.curseforge.com/minecraft/mc-mods/create-pns
1414+1515+eleventyNavigation:
1616+ key: 'Create: Piss & Shit'
1717+ parent: Mods
1818+---
1919+2020+## Blocks & Items
2121+2222+* Piss
2323+* Piss Bucket
2424+* Piss Bottle
2525+* Shit
2626+* Holy Shit
2727+* Shit Block
2828+* Mechanical Toilet
2929+3030+3131+<!-- ## Effects
3232+3333+* Diarrhea - Makes you need to shit more.
3434+* Constipation - Makes you unable to shit. -->
3535+3636+## Advancements
3737+3838+* Shitty Encounter - Obtain some shit by emptying your bowels or stumbling upon some.
3939+ * The Pope - Sanctify a piece of shit.
4040+ * Shit³ - Craft a block of shit.
4141+ * Chemical Attack - Craft a shit candle.
4242+* Yellow Liquid - Obtain a bottle of piss.
4343+ * Piss³ - Obtain a bucket of piss.
4444+* Mechanical Marvel - Craft a mechanical toilet.
4545+ <!-- * It Sucks - Connect a mechanical toilet to rotational power. -->
4646+ * Flush(ed) - Use your newly operational mechanical toilet. <!-- :flushed: -->
4747+4848+## Testimonials
4949+5050+> C:P&S Revolutionized how I can unload my constipated character.
5151+> \- [@lupancham](https://lupancham.net/)
5252+5353+> “It’s actually made with piss & shit”
5454+> \- [@polycord](https://http.cat/404)
5555+5656+> "I did not consent to having this testimonial included"
5757+> "also that's disgusting"
5858+> \- [@rowandev](https://modrinth.com/user/RowanDev)
5959+6060+> This mod significantly improves my game performance
6161+> \- [@worldwidepixel](https://worldwidepixel.ca)
6262+6363+> Approved by Pridecraft Studios
6464+> \- [@blrryfacee](https://blurry.gay)
6565+6666+Thanks for the [CRSS](https://crss.cc) discord members for reviewing the mod!
6767+6868+## FAQ
6969+7070+* Forge when?
7171+ * never
7272+* Is this for real?
7373+ * yes
+38
src/mods/ddg.md
···11+---
22+layout: mod.njk
33+44+title: Data Driven GUIs
55+description: A library to make making GUIs easier using xml & json files.
66+77+mod:
88+ game: minecraft
99+ downloads:
1010+ - platform: Modrinth
1111+ link: https://modrinth.com/mod/ddg
1212+ - platform: CurseForge
1313+ link: https://www.curseforge.com/minecraft/mc-mods/ddg
1414+1515+eleventyNavigation:
1616+ title: Data Driven GUIs
1717+ key: ddg
1818+ parent: Mods
1919+---
2020+2121+This mod mainly aims to make making GUIs as painless as possible, but with this it also allows resource packs to modify GUIs or even create new ones. The mod however currently doesn't allow the modification of the default GUIs in Minecraft.
2222+2323+### Features
2424+2525+* **XML Based GUIs**: Write your GUIs like you would a web page.
2626+* **JSON Based Actions**: Make buttons do actions.
2727+* **Uses Built-in Widgets**: No web rendering shenanigans.
2828+* **Custom Server Packet**: Offers servers to open custom GUIs they have created with their resourcepacks.
2929+3030+### Usage
3131+3232+#### For Users
3333+3434+You just need to install this mod if a mod depends on it or a server requires you to do so.
3535+3636+#### For Developers
3737+3838+It's a straight forward proceess to depend on this mod and you can learn more at https://docs.theclashfruit.me/ddg.
+9
src/mods/index.md
···11+---
22+layout: main.njk
33+title: Mods
44+55+eleventyNavigation:
66+ key: Mods
77+---
88+99+Just a little category for my mods.
+69
src/mods/lattice.md
···11+---
22+layout: mod.njk
33+44+title: Lattice
55+description: A Simple (for now) Discord chat bridge for Hytale.
66+77+mod:
88+ game: hytale
99+ downloads:
1010+ - platform: Modtale
1111+ link: https://modtale.net/mod/lattice
1212+ - platform: CurseForge
1313+ link: https://www.curseforge.com/hytale/mods/lattice
1414+1515+eleventyNavigation:
1616+ key: Lattice
1717+ parent: Mods
1818+---
1919+2020+## Setup
2121+2222+Required Dependencies:
2323+- [PlaceholderAPI](https://placeholderapi.com/downloads/)
2424+- [TinyMessage](https://github.com/Zoltus/TinyMessage)
2525+2626+Download the Player placeholders for PlaceholderAPI: `/papi ecloud download Player`.
2727+2828+### 1. Install The Mod
2929+3030+Put the jar file into the `mods` folder.
3131+3232+Then run the server with mod installed to generate the config file, it should generate it at `mods/TheClashFruit_Lattice/Lattice.json`.
3333+3434+The config file should look something like this:
3535+3636+```json
3737+{
3838+ "Enabled": false,
3939+ "Discord": {
4040+ "Token": "your_token_here",
4141+ "ChannelId": "",
4242+ "WebhookId": "",
4343+ "Messages": {
4444+ "Join": "%s joined %s.",
4545+ "Leave": "%s left."
4646+ }
4747+ },
4848+ "ChatPrefix": "[Discord]",
4949+ "ChatPrefixColour": "#5865F2"
5050+}
5151+```
5252+5353+### 2. Create a Discord Bot
5454+5555+Create your bot on the discord developer portal and also enable `Message Content Intent` for your bot then paste the token into the config where it says `your_token_here`.
5656+5757+Don't forget to invite your bot, here is a template for the invite link: `https://discord.com/oauth2/authorize?client_id={client_id}&permissions=536938496&scope=bot+applications.commands`; Just replace `{client_id}` with your bot's client id.
5858+5959+### 3. Create a Channel & Webhook
6060+6161+Create your channel and copy its id into the channel id in the config. Then go into the settings for the channel and create a webhook and copy it's url, which should look something like `https://discord.com/api/webhooks/1460971511903948851/ydte1zUhNKBVzvpUlsAyGDrdAb83HvYRIl_KiDYhgKJ1x4kgMNCfMfAl3TGklrsegGmo`[^1], copy it's numerical part, here it's `1460971511903948851` and paste it into the config for the `WebhookId`.
6262+6363+### 4. Restart The Server
6464+6565+Set `Enabled` to true and restart the server and chat with people on Discord :3
6666+6767+(I suck at writing docs)
6868+6969+[^1]: No that webhook is deleted and I also mangled the token a bit :3