MLG-Fortress / PopulationDensity

The now-official repository of the PopulationDensity Bukkit plugin
https://dev.bukkit.org/projects/population-density
10 stars 10 forks source link

Unable to visit when flying / flying breaks #59

Closed MCRakaan closed 5 years ago

MCRakaan commented 6 years ago

Running paperspigot latest version. Essentialsx and populationdensity seem to get in a confict when players have fly, and are flying.

When both the Lauchanddrop settings are true and a player is flying. Player gets to the vistit. But it breaks flying until a relog is done.

When disabled fly remains, but when flying players are unable to visit

Am i missing a setting? Or is populationdensity becoming a plugin that try's to do more then it was ment to do?

RoboMWM commented 6 years ago

Need output of /version populationdensity and /version

RoboMWM commented 6 years ago

Or is populationdensity becoming a plugin that try's to do more then it was ment to do?

This feature is actually something added by Big_Scary, the original author. I added a config for it. He added something to prevent players from taking advantage of it using elytras, but this should only affect the gliding property, not flying iirc. But I need the version output regardless.

Also, afaik EssX isn't fully 1.13 compatible, but either way I'd expect toggling /fly to work.

spooner01 commented 6 years ago

Using CMI this issue is the same so i dont think its an essentials issue. Flying is stopped when players use /visit for about 10 minutes or so. Relogging works sometimes, players on my server have resorted to keeping an elytra around just to use after visiting. If you use /visit {regionname} and glide away before landing on the new post flight is enabled again as soon as the player is 5-6 blocks away from the post along x/z axis.

CMI plugin version: 8.0.21.0-> 8.0.21.2 Server version: Spigot 1.13.1-R0.1-SNAPSHOT PopulatonDensity 5.11.2

RoboMWM commented 6 years ago

CMI is a pretty terrible premium plugin by a guy who doesn't have very good software development practices.

If anyone can find out the steps to reliably reproduce this that'd be great (e.g. what exact state does the player need to be in and etc.), then I can start looking in the code where there might be an issue.

Spoonerj1 commented 5 years ago

Issue may have been resolved in latest release, I haven't been able to test extensively yet

RoboMWM commented 5 years ago

Are you sure you're using this version or dogeveloper's fork? Paste output of /version PopulationDensity

Spoonerj1 commented 5 years ago

Definitely using this version lol. I made sure to be on 5.11.2

Muspah commented 5 years ago

Only players in operator mode can teleport while flying. Tested on Paper 597 with PD 5.11.2 (d14f08e manual build). No other plugins are needed, fly inherited from gamemode creative also breaks it.

Muspah commented 5 years ago

To be more specific: https://github.com/TechFortress/PopulationDensity/blob/master/src/me/ryanhamshire/PopulationDensity/PopulationDensity.java#L1128

RoboMWM commented 5 years ago

Hmm, that solves one part of this issue. Presumably that's there to prevent a player spamming /visit to the same post to remain in the air. Could probably add a check there (!player#isFlying perhaps?).

Spoonerj1 commented 5 years ago

Having this issue in 1.14.2 still. Using Spigot build 2349, and the latest public version of popDen

RoboMWM commented 5 years ago

If anyone can find out the steps to reliably reproduce this that'd be great (e.g. what exact state does the player need to be in and etc.), then I can start looking in the code where there might be an issue.

Spoonerj1 commented 5 years ago

Player state needed: Survival, with permission for /fly How to reproduce: Join the server and use /visit or any other region post related command.

This is a really easy thing to reproduce as it has happened on every iteration of test server I've had, no matter how flight is allowed.

RoboMWM commented 5 years ago

I still don't have a list of steps. Is it like this?

  1. Have LaunchAndDropPlayers set to true in config.
  2. Player initially is not able to fly such that player#getAllowFlight is false (i.e. double-tapping spacebar does not result in flight)
  3. /visit a region
  4. After landing, toggle /fly such that player#getAllowFlight should return true (i.e. double-tapping spacebar should result in player in fly mode). However, the player is not able to enter fly mode, as if player#getAllowFlight is false.
RoboMWM commented 5 years ago

When disabled fly remains, but when flying players are unable to visit

I'm assuming you mean the config @MCRakaan?

@Muspah what was your config?

I have a feeling this issue should be split into two because there are two separate (related, but separate) issues here being conflated.

Spoonerj1 commented 5 years ago

Yes it is literally exactly like this. It takes no effort to reproduce this. You can use any plugin that allows a player to use /fly.

Have LaunchAndDropPlayers set to true in config. Player initially is not able to fly such that player#getAllowFlight is false (i.e. double-tapping spacebar does not result in flight) /visit a region After landing, toggle /fly such that player#getAllowFlight should return true (i.e. double-tapping spacebar should result in player in fly mode). However, the player is not able to enter fly mode, as if player#getAllowFlight is false

RoboMWM commented 5 years ago

When I don't have a server that's running PopulationDensity and a plugin that allows for /fly, then yes it does take effort to setup this scenario.

RoboMWM commented 5 years ago

FYI, testing and reproducing issues is the one of the most time-consuming part of nearly all software development. That's why there are dedicated positions for testing software. So, the more information that can be provided, especially in a step-by-step format, the better.

There is an event that is called when a player attempts to toggle flight. This event is only canceled if the player currently has fall damage immunity - i.e., they have not yet landed. So in all of these cases (which doesn't seem to be mentioned anywhere), the player who used to be able to toggle fly mode but no longer can, never had a case where they would receive fall damage.

Now, I'm not entirely sure why flight is blocked (if a player can toggle flight normally anyways then it's useless to prevent this while they're falling), but the same is true for preventing elytra gliding (which obviously is allowed normally, provided the player is wearing an elytra). Judging by the names of the methods, it's likely Big_Scary presumed that elytra gliding corresponded to PlayerToggleFlightEvent, while entities used EngityToggleGlideEvent.