Do you want to have 1 plugin for two and more platforms?
This is tutorial how to do it!
- Create your file Important file
- Add Dependencies
- Add Main class for
Spigot
, andBungee
- Look at Resources files to add remaining
.yml
files - Have fun!
We need to create new File.
File directory like pom.xml
, but with name <plugin name>.iml
The File
<?xml version="1.0" encoding="UTF-8"?>
<module version="4">
<component name="FacetManager">
<facet type="minecraft" name="Minecraft">
<configuration>
<autoDetectTypes>
// Here we can type our platforms, that we want to register
// Here we want to register Spigot and Bungee platform
<platformType>SPIGOT</platformType>
<platformType>BUNGEECORD</platformType>
</autoDetectTypes>
</configuration>
</facet>
</component>
</module>
Maven
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
<repository>
<id>bungeecord-repo</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</repository>
<dependency>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-api</artifactId>
<version>VERSION</version>
<type>jar</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>VERSION</version>
<scope>provided</scope>
</dependency>
Gradle
allprojects {
repositories {
...
maven { url = 'https://oss.sonatype.org/content/repositories/snapshots' }
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
}
}
dependencies {
compileOnly 'net.md-5:bungeecord-api:VERSION'
compileOnly 'org.spigotmc:spigot-api:VERSION'
}
Spigot
// Normal main class for Spigot plugin
public class Spigot extends JavaPlugin {
@Override
public void onEnable() {
Bukkit.getLogger().log(Level.INFO, "Cool plugin from Spigot!");
}
@Override
public void onDisable() {
}
}
Bungee
// Normal main class for Spigot plugin
public class Bungee extends Plugin {
@Override
public void onEnable() {
getProxy().getLogger().log(Level.INFO, "Cool plugin from Bungee!");
}
@Override
public void onDisable() {
}
}
Spigot
name: <Plugin name>
author: <Author>
version: VERSION
main: <Path to main><Main class name>
database: <true|false> (can be skipped)
commands:
yourcmd:
Bungee
name: <Plugin name>
author: <Author>
version: VERSION
main: <Path to main><Main class name>
database: <true|false> (can be skipped)
commands:
yourcmd:
ForestChannelAPI is licensed under the permissive MIT license. Please
see LICENSE.txt
for more information.