On this page you will find all the information needed to integrate TempFly in your own Plugin. For example if you create an adventure part, where flying should not be allowed, then you can simply disable the Fly Mode or Flying.
Since this is a premium plugin, I won't make the source code public. So if you bought the plugin and got the jar, here is how you can do that.
The simplest way is to add the TempFly.jar as an external library to your library.
On Eclipse: Right click on the Project -> Properties -> Java Build Path -> Add External Jar.
Finally, you need to define TempFly at least as softDepend or as Depend. Choose one of them. More information can be found here.
plugin.yml
depend = ['TempFly']
softDepend = ['TempFly']
To use the jar without problems in your plugin, create (if not already) a directory for the dependencies in your project folder. In my case "libs". After that put the newest Version of TempFly in it.
All that is then left to do, is to add the following part into your build.gradle.
dependencies {
compileOnly files('libs/TempFly.jar')
}
I stopped working with Maven, but it should be similar.
Don't forget to add the plugin to the plugin.yml as well.
Using the static Method TempFly.getFlyManager()
allows you to access the following:
Checks if the Players Fly Mode is currently on.
Activates the Fly Mode of the Player. Meaning that using double spacebar would make him fly.
Deactivates the Fly Mode of the Player.
Checks if the Players is in the Air flying, while using Tempfly. Not the creative mode.
Sets the Player Flying. False if it should be disabled. This is not the fly Mode. The Player can use double space without problems again.
The same as above but additionally with a Reason.
Sets the Players Fly time.
Adds Fly time to the Players.
Removes Fly time to the Players.
Gets the Players Fly time.
Returns the Time in Milliseconds.
Gets the Player Fly time formatted like it was defined in the config.
Gets the Time formatted like it was defined in the config.
True if the given World was set as a blacklisted World, where flying is not allowed.
True if the given WorldGuard Region was set as a blacklisted Region, where flying is not allowed.
True if the given PlotSquared Plot allows flying.
Player Combat Timer run out or Player died.
Player quit the server while being in combat.
The player started to be in a combat.
Player starts flying using TempFly.
Player stops flying after using TempFly.
Player bought fly time in the Shop.
Player bought a Particle in the Shop.
Player changed the Particle Status to on/off.