### Add Simple Voice Chat Runtime Dependency (Forge/Neoforge Dev) Source: https://github.com/henkelmax/modrepo/blob/master/docs/minecraft/voicechat/api/getting_started.md For setting up a development environment with Simple Voice Chat installed, add the Modrinth Maven Repository to your build.gradle. Then, include the Simple Voice Chat mod itself as a runtimeOnly dependency, using `fg.deobf` for Forge to handle obfuscation. Replace `${voicechat_version}` with the desired mod version. ```Groovy repositories { ... maven { name = "Modrinth" url = "https://api.modrinth.com/maven" content { includeGroup "maven.modrinth" } } } dependencies { ... // For Neoforge runtimeOnly "maven.modrinth:simple-voice-chat:neoforge-${voicechat_version}" // For Forge runtimeOnly fg.deobf("maven.modrinth:simple-voice-chat:forge-${voicechat_version}") } ``` -------------------------------- ### Setup ModRepo Project Source: https://github.com/henkelmax/modrepo/blob/master/readme.md This snippet provides the necessary commands to set up, develop, and build the ModRepo project locally. It covers installing dependencies, running a development server with hot reload, and creating a production build. ```bash # Install dependencies yarn install # Serve with hot reload yarn dev # Build for production yarn build ``` -------------------------------- ### Importing Hoster Data (JavaScript) Source: https://github.com/henkelmax/modrepo/blob/master/docs/minecraft/voicechat/wiki/server_hosting/[hoster].md Imports the 'data' object from the './hosters.data' file. This data likely contains information about different server hosters used by the page. ```JavaScript import { data } from './hosters.data' ``` -------------------------------- ### Add Modrinth Repository and Runtime Dependency to build.gradle (Quilt) Source: https://github.com/henkelmax/modrepo/blob/master/docs/minecraft/voicechat/api/getting_started.md Adds the Modrinth Maven repository to build.gradle and includes Simple Voice Chat as a `modRuntimeOnly` dependency. This setup is used to have the voice chat mod available in the development environment for testing. ```Groovy repositories { ... maven { name = "Modrinth" url = "https://api.modrinth.com/maven" content { includeGroup "maven.modrinth" } } } dependencies { ... modRuntimeOnly "maven.modrinth:simple-voice-chat:quilt-${voicechat_version}" } ``` -------------------------------- ### Vue Script Setup Initialization Source: https://github.com/henkelmax/modrepo/blob/master/docs/minecraft/voicechat/wiki/support.md Initializes reactive variables using Vue's `ref` for managing popup visibility and the support key value. Imports the `ref` function from the 'vue' library. ```javascript import { ref } from 'vue'; let supportKey = ref(generateSupportKey()); let showNotReadPopup = ref(false); let showReadWikiPopup = ref(false); let showSupportKeyPopup = ref(false); ``` -------------------------------- ### Add Modrinth Maven Repository (Groovy) Source: https://github.com/henkelmax/modrepo/blob/master/docs/minecraft/voicechat/api/getting_started.md Adds the Modrinth Maven repository to the build.gradle file. This repository is used to fetch the Simple Voice Chat mod itself for development environments, allowing you to test your API integration. ```Groovy repositories { ... maven { name = "Modrinth" url = "https://api.modrinth.com/maven" content { includeGroup "maven.modrinth" } } } ``` -------------------------------- ### Implement VoicechatPlugin Interface (Quilt) Source: https://github.com/henkelmax/modrepo/blob/master/docs/minecraft/voicechat/api/getting_started.md Creates a Java class that implements the `de.maxhenkel.voicechat.api.VoicechatPlugin` interface. This class serves as the entry point for registering voice chat related functionality within the mod. ```Java package com.example.yourmod; import de.maxhenkel.voicechat.api.VoicechatPlugin; public class TestPlugin implements VoicechatPlugin { ... } ``` -------------------------------- ### Add Maven Repository to build.gradle (Quilt) Source: https://github.com/henkelmax/modrepo/blob/master/docs/minecraft/voicechat/api/getting_started.md Adds the public Maven repository from maxhenkel.de to the project's repositories block in build.gradle, allowing access to the voice chat API artifact. ```Groovy repositories { ... maven { url = 'https://maven.maxhenkel.de/repository/public' } } ``` -------------------------------- ### Add Voice Chat Dependency Constraint (fabric.mod.json) Source: https://github.com/henkelmax/modrepo/blob/master/docs/minecraft/voicechat/api/getting_started.md Adds a dependency entry for "voicechat" in the `depends` section of `fabric.mod.json`. This ensures that the mod will only load if a compatible version of Simple Voice Chat is installed, preventing crashes with older versions. ```JSON { "schemaVersion": 1, ... "depends": { ... "voicechat": ">=${minecraft_version}-${voicechat_api_version}" } } ``` -------------------------------- ### Create Voice Chat Plugin Class (Java) Source: https://github.com/henkelmax/modrepo/blob/master/docs/minecraft/voicechat/api/getting_started.md Defines a Java class that implements the `de.maxhenkel.voicechat.api.VoicechatPlugin` interface. This class serves as the main entry point for interacting with the Simple Voice Chat API from your mod. ```Java package com.example.yourmod; import de.maxhenkel.voicechat.api.VoicechatPlugin; public class TestPlugin implements VoicechatPlugin { ... } ``` -------------------------------- ### Register Voice Chat Entrypoint (fabric.mod.json) Source: https://github.com/henkelmax/modrepo/blob/master/docs/minecraft/voicechat/api/getting_started.md Adds a "voicechat" entrypoint to the `entrypoints` section in `fabric.mod.json`. This entrypoint points to the custom class implementing `VoicechatPlugin`, allowing Simple Voice Chat to discover and load your plugin. ```JSON { "schemaVersion": 1, ... "entrypoints": { "main": [ ... ], "voicechat": [ "com.example.yourmod.TestPlugin" ] }, ... } ``` -------------------------------- ### Add Simple Voice Chat API Maven Repository (Groovy) Source: https://github.com/henkelmax/modrepo/blob/master/docs/minecraft/voicechat/api/getting_started.md Adds the public Maven repository hosted by maxhenkel.de to the project's build.gradle file, allowing access to the Simple Voice Chat API artifacts. This is a necessary step before declaring the API dependency. ```Groovy repositories { ... maven { url = 'https://maven.maxhenkel.de/repository/public' } } ``` -------------------------------- ### Importing Data and Initializing Ref - Vue Script Setup Source: https://github.com/henkelmax/modrepo/blob/master/docs/minecraft/voicechat/wiki/server_setup_mc_hosting.md This script block imports the 'ref' function from Vue and 'data' from a local search index file. It then initializes a reactive reference named 'index' with the imported data, making it available for use in the component's template. ```JavaScript import { ref } from 'vue' import { data } from './server_hosting/search_index.data' const index = ref(data) ``` -------------------------------- ### Add Voicechat API Dependency (Forge/Neoforge) Source: https://github.com/henkelmax/modrepo/blob/master/docs/minecraft/voicechat/api/getting_started.md After adding the repository, declare the voicechat-api dependency in the dependencies block of your build.gradle. Replace `${voicechat_api_version}` with the specific API version you intend to target. This makes the API classes available to your mod during compilation. ```Groovy dependencies { ... implementation "de.maxhenkel.voicechat:voicechat-api:${voicechat_api_version}" } ``` -------------------------------- ### Register Voice Chat Plugin Entrypoint in quilt.mod.json (Quilt) Source: https://github.com/henkelmax/modrepo/blob/master/docs/minecraft/voicechat/api/getting_started.md Adds a "voicechat" entrypoint to the `entrypoints` section in quilt.mod.json. This entrypoint specifies the fully qualified name of the class that implements `VoicechatPlugin`, allowing the voice chat mod to discover and load the plugin. ```JSON { "schemaVersion": 1, ... "entrypoints": { "init": [ ... ], "voicechat": [ "com.example.yourmod.TestPlugin" ] }, ... } ``` -------------------------------- ### Add Simple Voice Chat API Dependency (Groovy) Source: https://github.com/henkelmax/modrepo/blob/master/docs/minecraft/voicechat/api/getting_started.md Declares the Simple Voice Chat API as an implementation dependency in the build.gradle file. The `voicechat_api_version` variable should be set to the desired API version. This makes the API classes available to your mod. ```Groovy dependencies { ... implementation "de.maxhenkel.voicechat:voicechat-api:${voicechat_api_version}" } ``` -------------------------------- ### Add Voicechat API Dependency (Bukkit/Spigot/Paper) Source: https://github.com/henkelmax/modrepo/blob/master/docs/minecraft/voicechat/api/getting_started.md After adding the repository, declare the voicechat-api dependency in the dependencies block of your build.gradle. Replace `${voicechat_api_version}` with the specific API version you intend to target. This makes the API classes available to your plugin during compilation. ```Groovy dependencies { ... implementation "de.maxhenkel.voicechat:voicechat-api:${voicechat_api_version}" } ``` -------------------------------- ### Add Voice Chat API Dependency to build.gradle (Quilt) Source: https://github.com/henkelmax/modrepo/blob/master/docs/minecraft/voicechat/api/getting_started.md Adds the voicechat-api dependency to the project's dependencies block in build.gradle using the specified voicechat_api_version. This makes the API classes available for compilation. ```Groovy dependencies { ... implementation "de.maxhenkel.voicechat:voicechat-api:${voicechat_api_version}" } ``` -------------------------------- ### Implement Voicechat Plugin Class (Bukkit/Spigot/Paper) Source: https://github.com/henkelmax/modrepo/blob/master/docs/minecraft/voicechat/api/getting_started.md To create your custom voice chat plugin implementation for Bukkit/Spigot/Paper, create a Java class that implements the `de.maxhenkel.voicechat.api.VoicechatPlugin` interface. This class will contain the logic for your voice chat integration. ```Java package com.example.yourplugin; import de.maxhenkel.voicechat.api.VoicechatPlugin; public class TestPlugin implements VoicechatPlugin { ... } ``` -------------------------------- ### Check Wiki Read Status (Vue.js) Source: https://github.com/henkelmax/modrepo/blob/master/docs/minecraft/voicechat/wiki/support.md Defines a function to determine if the user has visited the required wiki pages. It parses the 'visitedTabs' item from `localStorage` and checks if the 'setup', 'troubleshooting', and 'faq' identifiers are present in the stored array. ```javascript function hasReadWiki() { const visitedTabs = JSON.parse(localStorage.visitedTabs || '[]'); return visitedTabs.includes("setup") && visitedTabs.includes("troubleshooting") && visitedTabs.includes("faq"); } ``` -------------------------------- ### Register Voicechat Plugin Class (Forge/Neoforge) Source: https://github.com/henkelmax/modrepo/blob/master/docs/minecraft/voicechat/api/getting_started.md To register your custom voice chat plugin implementation for Forge/Neoforge, create a Java class that implements the `de.maxhenkel.voicechat.api.VoicechatPlugin` interface. Crucially, this class must be annotated with `@de.maxhenkel.voicechat.api.ForgeVoicechatPlugin` to be discovered and loaded by Simple Voice Chat. ```Java package com.example.yourmod; import de.maxhenkel.voicechat.api.ForgeVoicechatPlugin; import de.maxhenkel.voicechat.api.VoicechatPlugin; @ForgeVoicechatPlugin public class TestPlugin implements VoicechatPlugin { ... } ``` -------------------------------- ### Add Voicechat API Maven Repository (Forge/Neoforge) Source: https://github.com/henkelmax/modrepo/blob/master/docs/minecraft/voicechat/api/getting_started.md To add the Simple Voice Chat API dependency to your Forge or Neoforge mod, include the public Maven repository hosted by maxhenkel.de in your build.gradle file's repositories block. This allows your build system to locate and download the API artifact. ```Groovy repositories { ... maven { url = 'https://maven.maxhenkel.de/repository/public' } } ``` -------------------------------- ### Add Voicechat API Maven Repository (Bukkit/Spigot/Paper) Source: https://github.com/henkelmax/modrepo/blob/master/docs/minecraft/voicechat/api/getting_started.md To add the Simple Voice Chat API dependency to your Bukkit, Spigot, or Paper plugin, include the public Maven repository hosted by maxhenkel.de in your build.gradle file's repositories block. This allows your build system to locate and download the API artifact. ```Groovy repositories { ... maven { url = 'https://maven.maxhenkel.de/repository/public' } } ``` -------------------------------- ### Add Voicechat Dependency to plugin.yml (Bukkit/Spigot/Paper) Source: https://github.com/henkelmax/modrepo/blob/master/docs/minecraft/voicechat/api/getting_started.md To declare that your Bukkit/Spigot/Paper plugin depends on Simple Voice Chat, add 'voicechat' to the 'depend' list in your plugin.yml file. This ensures that Simple Voice Chat is loaded before your plugin, preventing potential startup issues. ```YAML ... depend: [ voicechat ] ``` -------------------------------- ### Register Voicechat Plugin Service (Bukkit/Spigot/Paper) Source: https://github.com/henkelmax/modrepo/blob/master/docs/minecraft/voicechat/api/getting_started.md In your main Bukkit/Spigot/Paper plugin class, typically within the `onEnable` method, retrieve the `BukkitVoicechatService` from the server's services manager. If the service is available, register an instance of your `VoicechatPlugin` implementation with it. This makes your plugin known to Simple Voice Chat. ```Java package com.example.yourplugin; import de.maxhenkel.voicechat.api.BukkitVoicechatService; import org.bukkit.plugin.java.JavaPlugin; public final class MyPlugin extends JavaPlugin { @Override public void onEnable() { BukkitVoicechatService service = getServer().getServicesManager().load(BukkitVoicechatService.class); if (service != null) { service.registerPlugin(new TestPlugin()); } } ... } ``` -------------------------------- ### Add Simple Voice Chat Runtime Dependency (Groovy) Source: https://github.com/henkelmax/modrepo/blob/master/docs/minecraft/voicechat/api/getting_started.md Declares the Simple Voice Chat mod as a `modRuntimeOnly` dependency in build.gradle. This makes the mod available during development and testing but does not include it in the final mod distribution. The `voicechat_version` variable should specify the mod version. ```Groovy dependencies { ... modRuntimeOnly "maven.modrinth:simple-voice-chat:fabric-${voicechat_version}" } ``` -------------------------------- ### Rendering Client-Side Component - Vue Template Source: https://github.com/henkelmax/modrepo/blob/master/docs/minecraft/voicechat/wiki/server_setup_mc_hosting.md This code snippet uses the Vue wrapper component. It ensures that the component nested inside it, , is only rendered on the client side after the initial server-side rendering (SSR) hydration, preventing potential SSR issues. ```Vue ``` -------------------------------- ### Setting Voice Chat Port Source: https://github.com/henkelmax/modrepo/blob/master/docs/minecraft/voicechat/wiki/server_setup.md Example configuration setting to change the voice chat server port in the mod's server configuration file. This line should be added or modified in the server config. ```Configuration port=24454 ``` -------------------------------- ### Add Voice Chat Dependency to quilt.mod.json (Quilt) Source: https://github.com/henkelmax/modrepo/blob/master/docs/minecraft/voicechat/api/getting_started.md Adds a dependency entry for "voicechat" in the quilt.mod.json file. This ensures the mod requires a compatible version of Simple Voice Chat to prevent crashes with outdated versions. The version constraint uses placeholders for minecraft_version and voicechat_api_version. ```JSON { "schemaVersion": 1, ... "depends": { ... { "id": "voicechat", "version": ">=${minecraft_version}-${voicechat_api_version}" } } } ``` -------------------------------- ### Add Voicechat Dependency to mods.toml (Forge/Neoforge) Source: https://github.com/henkelmax/modrepo/blob/master/docs/minecraft/voicechat/api/getting_started.md To ensure compatibility and prevent crashes with outdated voice chat versions, add a mandatory dependency entry for 'voicechat' in your mod's mods.toml file. Configure the versionRange to require a version compatible with your targeted API version. This ensures your mod only loads when a suitable Simple Voice Chat version is present. ```TOML modLoader="javafml" ... [[mods]] ... [[dependencies.yourmod]] modId="voicechat" mandatory=true versionRange="[${minecraft_version}-${voicechat_api_version},)" ordering="AFTER" side="BOTH" ``` -------------------------------- ### Example Moved Config File (TOML) Source: https://github.com/henkelmax/modrepo/blob/master/docs/minecraft/voicechat/wiki/troubleshooting.md This snippet shows the content of an old configuration file after the config location was changed in version 2.4.0+. It indicates that the config has been moved and points to the new location. ```toml # This config has been moved to config/voicechat/voicechat-client.properties moved = true ``` -------------------------------- ### Button Styling (CSS) Source: https://github.com/henkelmax/modrepo/blob/master/docs/minecraft/voicechat/wiki/support.md Provides scoped CSS rules to style the 'Generate a support key' button. It defines properties for appearance (border-radius, background, padding, color) and layout (display, justify-content), including a hover effect. ```css .button { border-radius: 8px; background-color: var(--vp-c-brand); padding: 0.5rem; display: flex; justify-content: center; transition: all 0.2s ease-in-out; color: #fff; } .button:hover { background-color: #3da170; } ``` -------------------------------- ### Defining FAQ Data in Vue.js Script Setup Source: https://github.com/henkelmax/modrepo/blob/master/docs/minecraft/gravestone/faq.md This JavaScript snippet, used within a Vue.js `