As a dependency ​
In order to use ChatPlugin's API in your plugins, it is required to include it as one of their dependencies. To do so, you have to either use Maven or Gradle to build your project.
Configuring the build tool ​
Add the following snippets of code to your pom.xml
, build.gradle
or build.gradle.kts
depending on your current environment.
<dependencies>
<dependency>
<groupId>me.remigio07.chatplugin</groupId>
<artifactId>api</artifactId>
<version>1.X.x</version>
<scope>provided</scope>
</dependency>
</dependencies>
repositories {
mavenCentral()
}
dependencies {
compileOnly 'me.remigio07.chatplugin:api:1.X.x'
}
repositories {
mavenCentral()
}
dependencies {
compileOnly("me.remigio07.chatplugin:api:1.X.x")
}
Replace 1.X.x
with the latest version of ChatPlugin available. It can be found in the footer of every wiki page, including this one.
Modifying the plugin's description file ​
To make ChatPlugin's classes load before your plugin's ones, you have to declare its dependency. Every environment uses a different file for this.
Bukkit (plugin.yml
) ​
name: TestPlugin
main: me.remigio07.testplugin.BukkitPlugin
version: 0.1
depend: [ChatPlugin] # the plugin will load only if ChatPlugin is installed and throw an error otherwise
softdepend: [ChatPlugin] # the plugin will load regardless, but after ChatPlugin if it is installed
Here, you can choose whether to use depend
or softdepend
.
Sponge (mcmod.info
) ​
[
{
"modid": "testplugin",
"name": "TestPlugin",
"version": "0.1",
"dependencies": [
"chatplugin@[1.X.x,)"
]
}
]
That particular writing indicates that at least ChatPlugin v1.X.x is required.
BungeeCord (bungee.yml
) ​
name: TestPlugin
main: me.remigio07.testplugin.BungeeCordPlugin
version: 0.1
depends: [ChatPlugin] # the plugin will load only if ChatPlugin is installed and throw an error otherwise
softDepends: [ChatPlugin] # the plugin will load regardless, but after ChatPlugin if it is installed
Here, you can choose whether to use depends
or softDepends
.
Velocity (velocity-plugin.json
) ​
{
"id": "testplugin",
"name": "TestPlugin",
"main": "me.remigio07.testplugin.VelocityPlugin",
"version": "0.1",
"dependencies": [
{
"id": "chatplugin",
"optional": true,
}
]
}
Here, you can choose whether to specify true
or false
at optional
. In the first case, the plugin will load regardless of ChatPlugin's presence, but will do it after its initialization if present; in the second case it will load only if it is installed.
Using the API ​
To find out the available methods, how to obtain instances, etc., refer to the Development/API page.
It is possible to browse the latest version's Javadocs on my website.
ChatPlugin - Un plugin completo ma leggero che gestisce semplicemente troppe funzionalità !
Questa wiki è attualmente aggiornata alla versione 1.9.10.
© 2024  Remigio07
Si prega di segnalare imprecisioni ed errori di ortografia come descritto a Home/Reporting issues.