-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add structure of server api, write setup * add instructions for input prompt, server switch prompt, permissions, labymod version, interaction menu, gamemode, emotes, discord rpc & server banner * add instructions for economy display, introduce packet creating and protocol usage * fix copyright * move contributors to index * add TabListFlags, Addon Recommendations & Marker * add voicechat integration * add integrations * improve index * move cache disclaimer to infobox * improve wording * dev.labymod.net
- Loading branch information
1 parent
14b8624
commit e1472f2
Showing
35 changed files
with
1,885 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,12 @@ | ||
# LabyMod4 API Wiki | ||
# LabyMod 4 Developer Portal | ||
|
||
Click <a href="/pages/addon/">here</a> to get to the wiki of our new addon API. | ||
Welcome to the Developer Portal of LabyMod 4. <br/> | ||
This website serves as a hub for everything related to the LabyMod 4, directed at developers. Whether you're looking for | ||
information on how to create addons or utilize our server API, you'll find it here. | ||
|
||
Have you found something missing from this wiki that you think is important, or are you unhappy with something? | ||
Please fork our wiki repository, add/improve it and create a pull request | ||
<a href="https://github.com/LabyMod/labymod4-api-wiki" target="_blank">here</a>. | ||
Please fork our wiki repository, add/improve it and create a pull request | ||
<a href="https://github.com/LabyMod/labymod4-api-wiki" target="_blank">here</a>. | ||
|
||
If you have any questions or need help, feel free to join | ||
our [Discord server for Developers](https://discord.gg/labymod). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
The VoiceChat integration provides a way to manage the voice chat server-side. | ||
|
||
## Adding the Dependency | ||
|
||
The VoiceChat integration is shipped with all official [server platform integration artifacts](http://localhost:8080/pages/server/#adding-the-labymod-4-server-api-as-a-dependency). If you are using the `core` artifact, you can add the following dependency to your project: | ||
|
||
???+ danger "Important Note" | ||
|
||
For the examples below, `VERSION` with the version you want to use. The latest version can be found here: <a href="https://github.com/LabyMod/labymod4-server-api-integrations/releases" target="_blank" style="display: inline-flex;-ms-transform: translateY(25%);transform: translateY(25%);">![GitHub Release](https://img.shields.io/github/v/release/LabyMod/labymod4-server-api-integrations?label=%20)</a> | ||
|
||
=== ":octicons-file-code-16: Gradle (Kotlin DSL)" | ||
|
||
```kotlin | ||
dependencies { | ||
compileOnly("net.labymod.serverapi.integration:voicechat:VERSION") | ||
} | ||
``` | ||
|
||
=== ":octicons-file-code-16: Gradle (Groovy)" | ||
|
||
```groovy | ||
dependencies { | ||
compileOnly "net.labymod.serverapi.integration:voicechat:VERSION" | ||
} | ||
``` | ||
|
||
=== ":octicons-file-code-16: Maven" | ||
|
||
```xml | ||
<dependencies> | ||
<dependency> | ||
<groupId>net.labymod.serverapi.integration</groupId> | ||
<artifactId>voicechat</artifactId> | ||
<version>VERSION</version> | ||
</dependency> | ||
</dependencies> | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
The `VoiceChatMutePacket` is a client-bound packet provided by the VoiceChat integration, that allows servers to mute any player in the voice chat on their server. | ||
|
||
## Creating the Mute Model | ||
|
||
The packet uses the `VoiceChatMute` model, which can be created with `VoiceChatMute.create`. | ||
|
||
```java | ||
// Create the mute model | ||
// For a permanent mute, remove the timestamp parameter | ||
VoiceChatMute voiceChatMute = VoiceChatMute.create( | ||
uniqueId, // The UUID of the player to mute | ||
"Example Mute Reason", // The reason for the mute. Can be null | ||
System.currentTimeMillis() + 60000 // The timestamp until the mute expires. | ||
); | ||
``` | ||
|
||
## Sending the Packet | ||
|
||
The packet can either be sent via the `VoiceChatPlayer` or the `AddonProtocol` of the `VoiceChatIntegration` | ||
|
||
If you are using the `VoiceChatPlayer` to mute a player, the mute will automatically be sent to every LabyMod player on | ||
the server. LabyMod players connecting to the server will also be sent every mute that is currently active automatically. | ||
|
||
### Via VoiceChatPlayer (Recommended) | ||
|
||
```java | ||
// Get the LabyModPlayer | ||
LabyModPlayer labyModPlayer = LabyModProtocolService.get().getPlayer(uniqueId); | ||
|
||
// Get the VoiceChatPlayer | ||
VoiceChatPlayer voiceChatPlayer = labyModPlayer.getIntegrationPlayer(VoiceChatPlayer.class); | ||
|
||
// Mute the player | ||
voiceChatPlayer.mute(voiceChatMute); | ||
``` | ||
|
||
### Via the AddonProtocol | ||
|
||
While not recommended, it is also possible to send the mutes directly via the `AddonProtocol` of the `VoiceChatIntegration`. | ||
|
||
???+ danger "Important Note" | ||
|
||
When sending mutes directly via the `AddonProtocol` of the `VoiceChatIntegration`, you will have to store all mutes yourself and send them to every player manually. | ||
|
||
```java | ||
// Create or get a List of mutes (array is also possible) | ||
List<VoiceChatMute> mutes = new ArrayList<>(); | ||
|
||
// Add all mutes that you want to send to the player | ||
mutes.add(voiceChatMute); | ||
|
||
// Get the VoiceChatIntegration | ||
// #getOrRegisterIntegration is a fail-safe method to get the integration, even | ||
// if the integration has not been registered. Alternatively, you can use | ||
// #getIntegration, which will return null if the integration has not been registered. | ||
VoiceChatIntegration voiceChatIntegration = LabyModProtocolService.get().getOrRegisterIntegration( | ||
VoiceChatIntegration.class, | ||
VoiceChatIntegration::new | ||
); | ||
|
||
// Get the AddonProtocol | ||
AddonProtocol addonProtocol = voiceChatIntegration.voiceChatProtocol(); | ||
|
||
// Send the packet | ||
addonProtocol.sendPacket(uniqueId, new VoiceChatMutePacket(mutes)); | ||
``` | ||
|
||
### Via the LabyMod Player | ||
|
||
While not recommended, it is also possible to send the packet directly via the `LabyModPlayer`. This will basically skip the "protocol-getting" process, as it will search for the protocol automatically. | ||
|
||
???+ danger "Important Note" | ||
|
||
When sending mutes directly via the `LabyModPlayer`, you will have to store all mutes yourself and send them to every player manually. | ||
|
||
```java | ||
// Create or get a List of mutes (array is also possible) | ||
List<VoiceChatMute> mutes = new ArrayList<>(); | ||
|
||
// Add all mutes that you want to send to the player | ||
mutes.add(voiceChatMute); | ||
|
||
// Get the LabyModPlayer | ||
LabyModPlayer labyModPlayer = LabyModProtocolService.get().getPlayer(uniqueId); | ||
|
||
// Send the packet | ||
labyModPlayer.sendPacket(new VoiceChatMutePacket(mutes)); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
The `VoiceChatOpenChannelsPacket` is a client-bound packet provided by the VoiceChat integration, that allows servers to open the voice channels popup. | ||
|
||
## Sending the Packet | ||
|
||
The packet can either be sent via the `VoiceChatPlayer` or the `AddonProtocol` of the `VoiceChatIntegration` | ||
|
||
### Via VoiceChatPlayer | ||
|
||
```java | ||
// Get the LabyModPlayer | ||
LabyModPlayer labyModPlayer = LabyModProtocolService.get().getPlayer(uniqueId); | ||
|
||
// Get the VoiceChatPlayer | ||
VoiceChatPlayer voiceChatPlayer = labyModPlayer.getIntegrationPlayer(VoiceChatPlayer.class); | ||
|
||
// Mute the player | ||
voiceChatPlayer.openVoiceChatChannels(); | ||
``` | ||
|
||
### Via the AddonProtocol | ||
|
||
```java | ||
// Get the VoiceChatIntegration | ||
// #getOrRegisterIntegration is a fail-safe method to get the integration, even | ||
// if the integration has not been registered. Alternatively, you can use | ||
// #getIntegration, which will return null if the integration has not been registered. | ||
VoiceChatIntegration voiceChatIntegration = LabyModProtocolService.get().getOrRegisterIntegration( | ||
VoiceChatIntegration.class, | ||
VoiceChatIntegration::new | ||
); | ||
|
||
// Get the AddonProtocol | ||
AddonProtocol addonProtocol = voiceChatIntegration.voiceChatProtocol(); | ||
|
||
// Send the packet | ||
addonProtocol.sendPacket(uniqueId, new VoiceChatOpenChannelsPacket()); | ||
``` | ||
|
||
### Via the LabyMod Player | ||
|
||
While not recommended, it is also possible to send the packet directly via the `LabyModPlayer`. This will basically skip the "protocol-getting" process, as it will search for the protocol automatically. <br/> | ||
|
||
```java | ||
// Get the LabyModPlayer | ||
LabyModPlayer labyModPlayer = LabyModProtocolService.get().getPlayer(uniqueId); | ||
|
||
// Send the packet | ||
labyModPlayer.sendPacket(new VoiceChatOpenChannelsPacket()); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
The `VoiceChatUnmutePacket` is a client-bound packet provided by the VoiceChat integration, that allows servers to remove the server-bound mute from a player in the voice chat. | ||
|
||
## Sending the Packet | ||
|
||
The packet can either be sent via the `VoiceChatPlayer` or the `AddonProtocol` of the `VoiceChatIntegration` | ||
|
||
If you are using the `VoiceChatPlayer` to unmute a player, the unmute will automatically be sent to every LabyMod player on | ||
the server. | ||
|
||
### Via VoiceChatPlayer (Recommended) | ||
|
||
```java | ||
// Get the LabyModPlayer | ||
LabyModPlayer labyModPlayer = LabyModProtocolService.get().getPlayer(uniqueId); | ||
|
||
// Get the VoiceChatPlayer | ||
VoiceChatPlayer voiceChatPlayer = labyModPlayer.getIntegrationPlayer(VoiceChatPlayer.class); | ||
|
||
// Mute the player | ||
voiceChatPlayer.unmute(); | ||
``` | ||
|
||
### Via the AddonProtocol | ||
|
||
While not recommended, it is also possible to send the unmutes directly via the `AddonProtocol` of the `VoiceChatIntegration`. | ||
|
||
???+ danger "Important Note" | ||
|
||
When sending (un)mutes directly via the `AddonProtocol` of the `VoiceChatIntegration`, you will have to store all mutes yourself and send them to every player manually. | ||
|
||
```java | ||
// Get the VoiceChatIntegration | ||
// #getOrRegisterIntegration is a fail-safe method to get the integration, even | ||
// if the integration has not been registered. Alternatively, you can use | ||
// #getIntegration, which will return null if the integration has not been registered. | ||
VoiceChatIntegration voiceChatIntegration = LabyModProtocolService.get().getOrRegisterIntegration( | ||
VoiceChatIntegration.class, | ||
VoiceChatIntegration::new | ||
); | ||
|
||
// Get the AddonProtocol | ||
AddonProtocol addonProtocol = voiceChatIntegration.voiceChatProtocol(); | ||
|
||
// Send the packet | ||
addonProtocol.sendPacket(uniqueId, new VoiceChatUnmutePacket(uniqueId)); | ||
``` | ||
|
||
### Via the LabyMod Player | ||
|
||
While not recommended, it is also possible to send the packet directly via the `LabyModPlayer`. This will basically skip the "protocol-getting" process, as it will search for the protocol automatically. | ||
|
||
???+ danger "Important Note" | ||
|
||
When sending (un)mutes directly via the `LabyModPlayer`, you will have to store all mutes yourself and send them to every player manually. | ||
|
||
```java | ||
// Get the LabyModPlayer | ||
LabyModPlayer labyModPlayer = LabyModProtocolService.get().getPlayer(uniqueId); | ||
|
||
// Send the packet | ||
labyModPlayer.sendPacket(new VoiceChatUnmutePacket(uniqueId)); | ||
``` |
Oops, something went wrong.