-
Notifications
You must be signed in to change notification settings - Fork 0
[Developer]Using MQEasy API
jingwenMC edited this page Jan 21, 2023
·
10 revisions
Compatable: 2.0.x
It's very easy to integrate your plugin into MQEasy.
<repositories>
<!--...-->
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories><dependency>
<groupId>com.github.jingwenMC</groupId>
<artifactId>MQEasy</artifactId>
<version>v2.0.1</version>
<scope>provided</scope>
</dependency>Gradle:
repositories {
//...
maven { url 'https://jitpack.io' }
}dependencies {
//...
compileOnly 'com.github.jingwenMC:MQEasy:v2.0.1'
}public class MQEasyListener extends MQEasyPlugin {
@Override
public MQEasyPluginInfo getPluginInfo() {
//If you are coding on Bukkit, you can just import "top.jingwenmc.mqeasy.api.plugin.BukkitMQEasyPluginInfo"
//and use "return new BukkitMQEasyPluginInfo(YourPlugin.getInstance());"
return new MQEasyPluginInfo() {
@Override
public String getName() {
return "Example";
}
@Override
public List<String> getAuthors() {
List<String> list = new ArrayList<>();
list.add("Example");
return list;
}
@Override
public String getVersion() {
return "Example";
}
@Override
public String getDescription() {
return "Example";
}
@Override
public String getWebsite() {
return "www.example.com";
}
};
}
@Override
public void onReceiveNoReturn(MessageType messageType, String s, CommonMessage<String> commonMessage) {
//Your code
}
@Override
public Receipt onReceiveNeedReturn(MessageType messageType, String s, CommonMessage<String> commonMessage) {
//Your code
}
}MQEasyPlugin mqEasyListener = new MQEasyListener();
@Override
public void onEnable() {
//...
MQEasyApi.registerPlugin(mqEasyListener);
//...
}
public MQEasyPlugin getMQEasyListener() {
return mqEasyListener;
}getMQEasyListener().getApi().sendMessageToServerNoReturn("your_server","Hello, MQEasy!");
//More can be found at: https://jingwenmc.github.io/MQEasy/top/jingwenmc/mqeasy/api/MQEasyApi.htmlIf you have any question, feel free to open an issue, or contact me by email: jingwenmc@foxmail.com.
Further Reading:
MQEasy Javadoc: https://jingwenmc.github.io/MQEasy/