Welcome to the Hangar Open Beta. Please report any issue you encounter on GitHub!
Cross-Server Messaging Platform for Velocity with API and LuckPerms integration.
Technical Details:
Java
Recommended Version: 17
Tested Versions: 16, 17
API
Do not shade message into your plugin. It will always be present in its plugin form at runtime.
Including:
Maven
<repository>
<id>oskarsmc-repo</id>
<url>https://repository.oskarsmc.com/releases</url>
</repository>
<dependency>
<groupId>com.oskarsmc</groupId>
<artifactId>message</artifactId>
<version>1.2.0</version>
</dependency>
Gradle Kotlin DSL
maven("https:/repository.oskarsmc.com/releases")
implementation("com.oskarsmc:message:1.2.0")
Usage:
JavaDocs
Javadocs are not published anywhere yet. A javadoc jar is published alongside each artifact.
Example
import com.google.inject.Inject;
import com.oskarsmc.message.event.MessageEvent;
import com.oskarsmc.message.event.StringResult;
import com.velocitypowered.api.event.Subscribe;
import com.velocitypowered.api.plugin.Plugin;
import org.jetbrains.annotations.NotNull;
@Plugin(
id = "testvelocityplugin",
name = "TestVelocityPlugin",
version = "1.0.0"
)
public class TestVelocityPlugin {
@Subscribe
private void MessageEvent(@NotNull MessageEvent event) {
if (event.originalMessage().contains("poop")) { // Check if message contains a very naughty word.
event.setResult(StringResult.denied()); // Don't send naughty words to people.
}
}
}