-
-
Notifications
You must be signed in to change notification settings - Fork 259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Init Folia support #2346
Init Folia support #2346
Conversation
src/main/java/com/comphenix/protocol/updater/SpigotUpdater.java
Outdated
Show resolved
Hide resolved
I have doubts that just replacing the scheduler is enough. furthermore, you shouldn't be reformatting the whole project and that folia check should be placed next to the spigot check in the util class here https://github.com/dmulloy2/ProtocolLib/blob/master/src/main/java/com/comphenix/protocol/utility/Util.java#L24 I am also not sure if raising the target compability is ok. |
@MiniDigger my thoughts exactly |
ok, I will improve the code based on your recommendations, but my task was to make the plugin run and work without errors) |
i'm not sure what you mean as far as "task." we're not going to merge something done halfway |
ok |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hard to tell what the actual diff is
src/main/java/com/comphenix/protocol/events/SerializedOfflinePlayer.java
Outdated
Show resolved
Hide resolved
src/main/java/com/comphenix/protocol/updater/SpigotUpdater.java
Outdated
Show resolved
Hide resolved
I did not understand what you meant in the last 3 remarks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
target compatibility needs to stay 1.8. please undo changes to formatting in the files edited
So first of all thank you for your contribution! Overall the actual code changes look good to me. However, you completely reformatted all the files you edited leading to a huge diff that is hard to read. While you edited only a small part of some files, Git interprets this as an almost complete rewrite of the file as all the whitespaces and tabs were changed. I would suggest you start from scratch again and apply all your changes without reformatting the file (i.e. dont press CTRL + ALT + SHIT + LIFT in IntelliJ). Also, as @dmulloy2 mentioned, I am a little curious if it makes sense to compile ProtocolLib against folia. Maybe it would be better to use reflections for the global region scheduler access which, apparently, is the only access to the Folia API. What do the others think on this? Regarding the formatting of the code, are there any plans to completely reformat the project to a consistent code style (especially regarding Tabs vs. Spaces) in a saperate commit? @dmulloy2 |
I completely agree here, adding Folia as a dependency has no advantage for us, and raising the Target Java version even less. I'm curious if there is any advantage at all to using the region scheduler. Anyway for the basic processing of packages it would be enough to run everything in one executor (maybe it has a limit of one thread for the non-async processing part? That would fit the current Bukkit behavior best). Furthermore I would like to know if the converters that use |
@mani1232 i've gone through, cleaned up the diff, and changed it to (mostly) use reflection. just need to grab the lastSeen and lastLogin reflectively if we still need those. also would be good to do some testing and see what happens if you try to get an entity in a packet thread |
Not working [20:29:18 INFO]: [ProtocolLib] Enabling ProtocolLib v5.0.0-SNAPSHOT |
src/main/java/com/comphenix/protocol/utility/SchedulerUtil.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Huynh Tien <huynhqtienvtag@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good enough for a first shot at support. we can always fix bugs after some real world use
I'm not sure if it works perfectly, but it works