FactionsFly [Factions, Towny, PlotSquared, uSkyBlock, ASkyBlock, Kingdoms+] [New Warmup feature]

 FactionsFly [Factions, Towny, PlotSquared, uSkyBlock, ASkyBlock, Kingdoms+] [New Warmup feature] 1.5.2

FactionsFly [Factions, Towny, PlotSquared, uSkyBlock, ASkyBlock, Kingdoms+] [New Warmup feature]
Tested Minecraft Versions:
  • 1.7
  • 1.8
  • 1.9
  • 1.10
About
A plugin which allows users to use "/fly" in their own or allied faction land.This flight is disabled once they step outside land which they would typically be allowed flight.

This plugin replaces the Essentials /fly command. This does change permission nodes, which you can read about below. There is no more complexity than Essentials, however, so my hope is that this should not be a problem. All customers are encouraged to seek support from me if they have issues with the plugin.

Also, be assured, development is done with great attention to detail. Glitches are tested extensively and have rarely been reported with all features of the plugin. This is, to the best of my knowledge, a secure plugin which cannot be easily exploited because of it's simplicity. If you have any problems please shoot me an email at: [email protected]

Support
Email: [email protected]
Skype: jordg.cjail

Requirements
For Factions

all factions plugins should work, if you find any issues please pm me and I'll have them fixed asap.
For Towny
I've tested the plugin with the most recent Towny Advanced, but it's assumed that all versions should work fine. Let me know if you run into any problems and I'll take a look.
For PlotSquared
I've yet to test this plugin on anything but the default PlotSquared setup. Please let me know if you have any issues. Used the latest version in my testing.
For uSkyBlock
The latest uSkyblock is what I've tested- works fine.
For ASkyBlock
I tested 2.9.7.4 for this plugin, and I assume every version above that should work fine. Most versions before should probably work, but if not please let me know!
For Kingdoms+
I tested version 7.4, but I assume this should work with all recent versions. Anything that's broken, just let me know! Also supports enemies like factions.

For the plugin in general
Java 1.7+ (Java 7+)

Permissions
ffly.fly
This permission grants the user access to /fly

ffly.others
This permission grants access to /fly [name]
Note, using this command grants the target fly everywhere

ffly.bypass
This permission grants the user access to fly anywhere

ffly.height.?
You can configure many ffly.height permissions in the config.yml. A player who has many of these will always take the highest value they can

ffly.wilderness|safezone|ally|yours|neutral|enemy
You can configure these permissions in the config.yml. If a permission is commented out of the config, it is given to all users with ffly.fly by default.

ffly.ground
Gives access to the ground command

ffly.instant
Allows you to fly without a warmup if the feature is enabled

Commands
/fly
Enables your flight so long as you're able to

/fly (with ffly.bypass perm)
Enables your flight

/fly [name] (requires ffly.others)
Toggles another user's flight

/ground all
Grounds all users

/ground [name]
Grounds a specific user

Configuration

formats.yml allows you to edit all messages in the plugin to your liking, as most servers have a certain style for their message formats (or may want to support another language)

formats.yml contents
Code (Text):

flight-toggled: "&7Your flight has been &a{{state}}"
flight-toggled-other: "&7You have &a{{state}}&7 {{target}}'s flight"
other-warning: "&e&lWARNING&7 If you toggle another user's flight, that user will be able to fly anywhere."
bypass-warning: "&a&lNOTICE&7 Flight was changed by an operator, your flight will not be affected by factions"
creative-warn: "&e&lWARNING&7 You are in creative mode, your flight will not be affected by Factions"
prefix: "&8&l> &r"
no-toggle-others: "&cYou do not have permission to toggle other player's fly"
max-height: "&cYou cannot go past the max height"
grounded: "&7You have &agrounded {{player}}&7!"
ender-pearl: "&cYou cannot ender pearl while flying!"
flight-warmup: "&7Stand still for &a{{time}} seconds&7 for your flight to enable!"
flight-warmup-moved: "&cYou moved too much! Your flight will not be toggled."

enemy-in-radius: "&cAn enemy is too nearby to fly."
not-in-own-space: "&cYou are not in your own or allied faction territory."

config.yml contents


Code (Text):

enemy-radius: 32 #Flight will be disabled if an enemy is within this radius

#For towny & PlotSquared, this has no effect

#Comment these permissions out (place a # before them) to disable them (and give access to everyone with ffly.fly)
wilderness-perm: ffly.wilderness #With this permission, you will be allowed to fly in the wilderness
safezone-perm: ffly.safezone #With this permission, you can fly in a safezone
#allied-perm: ffly.ally #With this permission, you can fly in allied lands
#yours-perm: ffly.yours #With this permission, you can fly in your faction's claims
neutral-perm: ffly.neutral
enemy-perm: ffly.enemy #With this permission, you can fly in enemy territory

fly-height-perms: #All of this is circumvented by ffly.bypass
default: -1 #If you have no permission, this is the max height
#ffly.height.name, so if you give a player ffly.height.high they can go to 128
high: 128 #If you have one of these permissions, this is the highest you can fly
medium: 92
tiny: 64


allow-ender-pearl-while-flying: false #If we should allow kids to pearl

commands-on-flight-disable: [] #The motivation behind this was simple, people with skyblock wanted people to return to their island when people had their flight disabled. These commands will be run from the player's perspective
#- is #the /is command
#You can put {{player}} in here and it'l execute that
soft-fall: true #If this is false, then the user will simply fall from their height, instead of being teleported to the nearest ground. The best reason to disable this option is if you have a teleport command above

fly-warmup: 0 #You must stand still and not be harmed for 10 seconds in order to fly (unless you have ffly.bypass or ffly.instant)
#Set this to 0 or remove it from your config to disable it

You can set enemy-radius to a non-positive value to disable this feature (0, -1, etc)

API Usage
I've put a lot of care into making this plugin not break as time goes on. You can always expect this method to exist.

Code (Text):
FlyCommand#setFly(Player target, boolean toState, boolean bypass)
The first parameter is the player who's flight you are trying to toggle

The second parameter is the desired flight state. If it is false, the player will have their flight disabled (this will respect all configuration options, they will be grounded safely if that feature is enabled). If it is true, the player will be set to fly mode and all rules in FactionsFly will apply to this user.

The third parameter is a bypass parameter. It is used if an operator toggles flight in the /fly command, and forces the user to the desired flight state and bypasses all other rules for Factions Fly (you can fly outside territory regardless of permission level). You typically want this as false.

For convenience, I also provide this overloaded method which defaults bypass to false.

Code (Text):
FlyCommand#setFly(Player player, boolean toState)
There is also an event fired whenever either of those methods are called. This event is:

Code (Text):
me.twister915.ffly.FlightToggleEvent
The event implements Bukkit's Cancellable and the value you set for cancelled is respected. If you cancel the event, the player's flight will not toggle. No message will be sent by FactionsFlight- you are required to send a message your event handler if you wish to.

If you wish to fiddle with my plugin any further, integrate it into your server, or access the API I provide for checking if users are "able to fly," you can get access to everything through the singleton

Code (Text):
FactionsFly#getInstance
You may explore the methods on this instance through your IDE. Everything here may break at any time, and although I don't discourage you from using it, I do encourage you to abstract around it in case I make any breaking changes to the internal API. I will likely be changing the way that the TerritoryHook works.

If you have any questions, please send me a message and I'd be glad to work with you!

Also, note, the following dependency is downloaded at runtime from the maven central repository. If you wish to work with the plugin's internal API, you'll likely need this: in your classpath

group id = io.reactivex
artifact id = rxjava
version = 1.0.16

everything else required has been shaded into the final plugin jar

Latest reviews

update?

Similar resources

BlackSpigot General Chat
Rules Help Users
    I @ iTz_RockGamez: https://www.blackspigot.com/downloads/dtltradersplus.15466/ I'm trying to download version...
    Top