mrgeneralq / sleep-most

Control the amount of percentage of sleeping players required to make it day. 100K+ downloads on spigot!
https://www.spigotmc.org/resources/sleep-most-1-14-4-configurable-messages-and-percentage.60623/
30 stars 12 forks source link

More AFK Detection #149

Closed Bakayarouz closed 1 year ago

Bakayarouz commented 1 year ago

I'm suggesting for useAFK to also detect Purpur's AFK system

https://purpurmc.org/javadoc/org/bukkit/entity/Player.html#isAfk()

https://github.com/PurpurMC/Purpur#api

I.. kinda don't use any plugin that has AFK function since Purpur already has them included and they're a great fork t hat has more optimization patches over Paper too :)

mrgeneralq commented 1 year ago

Hello @Bakayarouz , thank you for your suggestion. However changing the source application being used to a fork of the current software (spigot) would be a high risk change. This would basically mean that any functionality specific to purper would only work with purper or forks of purper.

As a result, many of our servers (not being on purper) will have issues as this is piece of code will be unknown to spigot servers. This is also the reason why bukkit is not fully supported for sleep-most, because spigot is a fork of bukkit, not the other way around.

Bakayarouz commented 1 year ago

Would it be not possible to detect the server jar running and if it is enable a module that detects Purpur AFK system?

Something like { Player.class.getMethod("isAFK"); // do whatever } catch {NoSuchMethodError e} { // no method, probably disable? }

mrgeneralq commented 1 year ago

Hello @Bakayarouz That would be an option indeed, but we need to check how we will further integrate this with the calculations. There can only be one AFK plugin master and there are upcoming AFK plugins for suggestions.

Bakayarouz commented 1 year ago

Welp, I hope it'll happen one day! you guys are doing great job

mrgeneralq commented 1 year ago

Hello @Bakayarouz

At this point nothing is confirmed that we will do this. But we keep you posted.

Kind regards

Quinten

mrgeneralq commented 1 year ago

Hello @Bakayarouz

I am still looking if this is going to be implemented. Thank you for your patience.

Kind regards

Quinten

mrgeneralq commented 1 year ago

Hello @Bakayarouz

I will now try to implement it with Purper. I'll keep you posted.

Kind regards

Quinten

mrgeneralq commented 1 year ago

@Bakayarouz , this request is now implemented and will be available in the next (5.2.0) update. Thank you for your suggestion.