EssentialsX

EssentialsX

2M Downloads

Essentials cancels 'p.setAllowFlight(true);' if you don't have the Fly permission

TheRealDomm opened this issue ยท 6 comments

commented

Information

Full output of /ess version:

Server Version: 1.8.8-R0.1-SNAPSHOT git-Spigot-db6de12-18fbb24 (MC: 1.8.8)
EssentialsX Version: 2.16.0.34
LuckPerms Version: 4.3.11
Vault Version: 1.5.6-b49

Log & Config
https://gist.github.com/TheRealDomm/05336485fd7706fa676b141f2327f0fe

Help request

Problem
Essentials always overrides my p.setAllowFlight(true); wich I'am using for another Plugin (FlyPerk on Players Plot). When I remove Essentials or add them the permission "essentials.fly" it just works fine.

What I have tried
Seeting the permission "essentials.fly" => works but I don't wan't to give all them players this Node.
Removed Essentials.

Thanks in advance for your help an keep going like this with your plugin. There is nothing better than this plugin!

TheRealDomm

commented

Thanks for opening a support request.

The only place that EssentialsX changes the fly state are when the player logs in:

if (user.isAuthorized("essentials.fly.safelogin")) {
user.getBase().setFallDistance(0);
if (LocationUtil.shouldFly(user.getLocation())) {
user.getBase().setAllowFlight(true);
user.getBase().setFlying(true);
if (ess.getSettings().isSendFlyEnableOnJoin()) {
user.getBase().sendMessage(tl("flyMode", tl("enabled"), user.getDisplayName()));
}
}
}

...and when the player changes world:

@EventHandler(priority = EventPriority.NORMAL)
public void onPlayerChangedWorldFlyReset(final PlayerChangedWorldEvent event) {
final User user = ess.getUser(event.getPlayer());
if (user.getBase().getGameMode() != GameMode.CREATIVE
// COMPAT: String compare for 1.7.10
&& !user.getBase().getGameMode().name().equals("SPECTATOR")
&& !user.isAuthorized("essentials.fly")) {
user.getBase().setFallDistance(0f);
user.getBase().setAllowFlight(false);
}
if (!user.isAuthorized("essentials.speed")) {
user.getBase().setFlySpeed(0.1f);
user.getBase().setWalkSpeed(0.2f);
} else {
if (user.getBase().getFlySpeed() > ess.getSettings().getMaxFlySpeed() && !user.isAuthorized("essentials.speed.bypass")) {
user.getBase().setFlySpeed((float) ess.getSettings().getMaxFlySpeed());
} else {
user.getBase().setFlySpeed(user.getBase().getFlySpeed() * 0.99999f);
}
if (user.getBase().getWalkSpeed() > ess.getSettings().getMaxWalkSpeed() && !user.isAuthorized("essentials.speed.bypass")) {
user.getBase().setWalkSpeed((float) ess.getSettings().getMaxWalkSpeed());
} else {
user.getBase().setWalkSpeed(user.getBase().getWalkSpeed() * 0.99999f);
}
}
}

Are you sure you don't have another plugin hooking into EssentialsX? In addition, using /ess debug can you see a essentials.fly permission check when you call player.setAllowFlight?

commented

Im not sure if any other plugins hook into EssentialsX i think mine is the only one. So this Issue happens when I listen on PlayerEnterPlotEvent from PlotSquared. Fly plan i to set players with the right permission fly on their plots my code is pasted here
I delayed the PlotEnterEvent before it is fired for 5 seconds an then it works for some seconds but when you dont have the permission for /fly allow flight will be always removed. :(

//edit: ess debug gives no change

commented

sure i will set this up

commented

Hmm now it works i don't have a clue why...
I will test it later in my productive system and then we will see... I really thought it must be Essentials because of this strage thing with the permissionnode essentials.fly

commented

Can you replicate this with only EssentialsX, PlotSquared and your plugin (plus Vault and LP) installed?

commented

Closing due to lack of response. Feel free to respond if this is an issue with EssentialsX.