neopixeldev / hypixel-api-java

Asynchronous Java wrapper for the Hypixel API
MIT License
6 stars 2 forks source link

Support for Java 8 #57

Closed TheNullicorn closed 2 years ago

TheNullicorn commented 2 years ago

Is your feature request related to a problem? Please describe. The majority of Hypixel's players play on Minecraft 1.8.9, and as such, its the primary version for mods on Hypixel. The problem is that 1.8.9 runs on Java 8, which obviously doesn't support Java 11's HttpClient (which was planned to be used instead of apache).

Describe the solution you'd like As nice as Java's 11's built-in HttpClient is, I don't see any issue with using an external library. Preferably it would be one with a low binary footprint (to keep jars that depend on our wrapper small) and support for some kind of RequestBuilder flow to accommodate for #47, assuming we go through with the solution there.

Describe alternatives you've considered Of course we could just not support those in Java 8 environments, but I'm fairly certain we'd be blocking a good chunk of potential users by doing so.

Netwyn commented 2 years ago

Honestly, you're probably right. I was hoping there would be some form of forward-compatible (that's actually a word) way to run Java 17 code on Java 8, but Google isn't yielding any answers today. Java isn't really my field of expertise, I do more C++ than Java, so I'm going to leave this debate up to someone else here.

unpluggedsam commented 2 years ago

This looks good to me: https://github.com/googleapis/google-http-java-client

unpluggedsam commented 2 years ago

So @TheNullicorn just went to sleep and I have some time on my hands so I'm going to relay what he suggested over discord.

After looking over mvnrepository.com he thinks we should go with OkHttp, or less ideally Jetty.

The rest of the options had flaws: