mirror of
https://github.com/ME1312/SubServers-2.git
synced 2024-11-22 10:15:52 +01:00
Updated SubAPI (markdown)
parent
194ae8b796
commit
551ed619b4
12
SubAPI.md
12
SubAPI.md
@ -1,10 +1,6 @@
|
||||
# SubAPI
|
||||
This page will go over how to properly use SubAPI.
|
||||
|
||||
## SubServers.Bungee
|
||||
This will show how to use SubAPI for SubServers.Bungee. For more detailed information visit this page:<br>
|
||||
[http://subservers.ME1312.net/Javadoc/SubServers.Bungee/](http://subservers.ME1312.net/Javadoc/SubServers.Bungee/)
|
||||
|
||||
### Using SubAPI as a Soft Dependancy
|
||||
A "Soft Dependancy" is where your plugin will use SubServers, but it is not required for your plugin to function properly.
|
||||
|
||||
@ -26,12 +22,16 @@ public boolean isSubServers2() {
|
||||
So what happens here is:<br>
|
||||
1. If there is any sort of error getting these classes, return false.<br>
|
||||
2. If the SubServers Version is less than 2.11.2a, return false.<br>
|
||||
3. Otherwise, your good to go (return true)<br><br>
|
||||
3. Otherwise, your good to go (returns true)<br><br>
|
||||
|
||||
__Pro-Tips for using SubServers as a Soft-Dependancy:__
|
||||
* Make sure SubServers is available using the above method before accessing SubServers classes
|
||||
* Never use imports for classes starting with "net.ME1312" or "org.json"<br>`new Version(1);` is now `new net.ME1312.SubServers.Bungee.Library.Version.Version(1);`<br>`SubAPI.getInstance();` is now `net.ME1312.SubServers.Bungee.SubAPI.getInstance();`
|
||||
|
||||
## SubServers.Bungee
|
||||
This will show how to use SubAPI for SubServers.Bungee. For more detailed information visit this page:<br>
|
||||
[http://subservers.ME1312.net/Javadoc/SubServers.Bungee/](http://subservers.ME1312.net/Javadoc/SubServers.Bungee/)
|
||||
|
||||
### Using SubAPI for Bungee
|
||||
Most of SubAPI can be accessed using this simple method `SubAPI.getInstance()`, however there's a bit more to it than just that. SubServers.Bungee works by extending BungeeCord classes to add more functionality, and overriding the methods to serve the extended classes. Knowing this, you can use it to your advantage.
|
||||
|
||||
@ -67,7 +67,7 @@ This will show how to use SubAPI for SubServers.Host. For more detailed informat
|
||||
### Creating your plugin
|
||||
To use SubAPI here, you must create a SubPlugin. This section will detail how this is done, step by step.
|
||||
|
||||
__package.yml:__<br>
|
||||
__package.xml:__<br>
|
||||
On the root of your jar you must have a file named package.yml or SubAPI won't be able to find your plugin. You can specify multiple main classes by adding multiple `<class>` elements.
|
||||
```
|
||||
<package>
|
||||
|
Loading…
Reference in New Issue
Block a user