Hypera Development
SupportGitHubProducts
  • Introduction
  • Products
    • UltraStaffChatPro
      • Features
      • Commands
      • Permissions
      • Integrations
      • Configuration
        • config.yml
        • messages.yml
      • Common Issues
        • Chat Signing
        • No Permission
      • Guides
        • Installation
        • Discord Integration
      • Developer API
      • Legal
        • Terms of Service
        • Privacy Policy
    • UltraStaffChat
      • Features
      • Installation
      • Permissions
      • Configuration
  • More
    • Support
Powered by GitBook

Copyright © 2024 Joshua Sing <[email protected]>. All Rights Reserved.

On this page
  • Getting started
  • Project Dependency
  • Plugin Dependency
  • Examples

Was this helpful?

  1. Products
  2. UltraStaffChatPro

Developer API

Getting started

The current API version is: 2.0.0

Project Dependency

pom.xml
<repositories>
    <repository>
    <id>hypera-releases</id>
    <url>https://repo.hypera.dev/releases/</url>
  </repository>
</repositories>

<dependencies>
    <dependency>
    <groupId>dev.hypera</groupId>
    <artifactId>UltraStaffChatPro-API</artifactId>
    <version></version>
  </dependency>
</dependencies>
build.gradle.kts
repositories {
    maven("https://repo.hypera.dev/releases/")
}

dependencies {
    compileOnly("dev.hypera:UltraStaffChatPro-API:")
}
build.gradle
repositories {
    maven {
        url 'https://repo.hypera.dev/releases/'
    }
}

dependencies {
    compileOnly 'dev.hypera:UltraStaffChatPro-API:'
}

Plugin Dependency

In order to use UltraStaffChatPro's API, you must declare UltraStaffChatPro as a dependency of your plugin. This causes UltraStaffChatPro to be loaded before your plugin, making it possible for your plugin to use UltraStaffChatPro's API.

If you don't declare UltraStaffChatPro as a dependency of your plugin, errors are likely to occur when you attempt to use the API.

Declare UltraStaffChatPro as a dependency in your paper-plugin.yml file. PaperMC Documentation

paper-plugin.yml
dependencies:
  server:
    UltraStaffChatPro:
      load: BEFORE
      required: true # Set to `false` if your plugin does not require UltraStaffChatPro.
      join-classpath: true

Declare UltraStaffChatPro as a dependency in your plugin.yml file.

plugin.yml
depend: ["UltraStaffChatPro"]
 
# If your plugin does not require UltraStaffChatPro,
# use 'softdepend' instead of 'depend':
softdepend: ["UltraStaffChatPro"]

Declare ultrastaffchatpro as a dependency in your @Plugin annotation. Velocity documentation

@Plugin(
  id = "myplugin",
  name = "My Plugin",
  version = "0.1.0",
  dependencies = {
    // Add `optional = true` if your plugin does not require UltraStaffChatPro.
    @Dependency(id = "ultrastaffchatpro")
  }
)

Declare UltraStaffChatPro as a dependency in your bungee.yml (or plugin.yml) file.

bungee.yml
depends: ["UltraStaffChatPro"]
 
# If your plugin does not require UltraStaffChatPro, use 'softDepends' instead of 'depends':
softDepends: ["UltraStaffChatPro"]

Examples

MyPlugin.java
public final class MyPlugin extends JavaPlugin {
 
    @Override
    public void onEnable() {
        // Register your plugin with UltraStaffChatPro's API.
        APIPlugin plugin = UltraStaffChatProAPI.getInstance()
            .registerPlugin("MyPlugin", "0.1.0-SNAPSHOT", "Me, Myself and I");
 
        // Register an event listener
        UltraStaffChatProAPI.getInstance().registerListener(plugin, new MyListener());
    }
 
}
MyListener.java
public final class MyListener implements UltraStaffChatProListener {
 
    @USCPEventHandler
    public void onMessage(UltraStaffChatProMessageEvent event) {
        // Do something with the message...
    }
 
    @USCPEventHandler
	public void onJoinMessage(UltraStaffChatProJoinMessageEvent event) {
		if (event.getUser().getName().equalsIgnoreCase("Steve")) {
			event.setCancelled(true);
		}
	}
 
}
// Send a message
UltraStaffChatProAPI.getInstance().getMessageManager()
    .sendMessage(MessageBuilder.create(
        UserBuilder.create("Steve", UUID.randomUUID()).build(),
        "Hi, my name is Steve."
    ).build());
 
// Toggle global mute in StaffChat
UltraStaffChatProAPI.getInstance().getStateManager().toggleGlobalMute(null);
PreviousDiscord IntegrationNextLegal

Last updated 11 months ago

Was this helpful?