Skip to content

How to use API

Apehum edited this page Jul 31, 2022 · 5 revisions

Adding Plasmo Voice to the project

Maven

<project>
    <repositories>
        <repository>
            <id>plasmo-repo</id>
            <url>https://repo.plo.su</url>
        </repository>
    </repositories>
    
    <dependencies>
        <dependency>
            <groupId>su.plo.voice</groupId>
            <artifactId>spigot</artifactId>
            <version>1.0.11</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>
</project>

Groovy DSL

repositories {
    maven { url 'https://repo.plo.su/' }
}

dependencies {
    compileOnly 'su.plo.voice:spigot:1.0.11'
}

Kotlin DSL

repositories {
    maven {
        url = uri("https://repo.plo.su")
    }
}

dependencies {
    compileOnly("su.plo.voice:spigot:1.0.11")
}

Obtaining an instance of the API

Using the Bukkit ServicesManager

RegisteredServiceProvider<PlasmoVoiceAPI> provider = Bukkit.getServicesManager().getRegistration(PlasmoVoiceAPI.class);
if (provider != null) {
    PlasmoVoiceAPI api = provider.getProvider();
}

Using the singleton (static access)

PlasmoVoiceAPI api = PlasmoVoice.getInstance();

Methods

See this: PlasmoVoiceAPI