[Free / Open Source] QueryAPI | A Simple Solution to Getting Server Data

Inviss

Management / Head of Development @ AkumaMC
Supreme
Feedback score
21
Posts
734
Reactions
267
Resources
3
I actually made this plugin about a month ago, I just forgot to make a thread...

Anyways, when I was starting out as a developer I seem to recall wanting a simple utility to just get certain information from a server without messing around with Bungee Messaging Channels, but I found nothing. This is why I made this. I'm hoping it'll help both experienced and new developers get any server data they may need with ease.

I made this to help teach Void how to code, so if a few things are done in a weird way I was likely just showing him the different ways of doing the same thing.

Everything is explained in the github README, but I'll give you a quick rundown here:
- Put QueryAPI-Bukkit into all of your servers (that you want to be able to retrieve information from)
- Connect them all to the same redis instance and channel
- Give them all an individual name/id in config.yml, so that it doesn't get confused
- You're done, you can now implement it into a project and be able to pull data from servers

It syncs data on its own thread using redis, so don't worry about any lag!

Source: https://github.com/InvisRaidinq/QueryAPI-Bukkit
Releases (JAR Download): https://github.com/InvisRaidinq/QueryAPI-Bukkit/releases
Got any questions? Join this discord: https://discord.gg/Mz8aUjY

Please report issues using https://github.com/InvisRaidinq/QueryAPI-Bukkit/issues rather than making a ticket on the above discord, as it's supposed to be a community project, not just maintained by me! PRs are much appreciated too!

Basic Usage (From the README, make sure to read that for an in-depth understanding):
r7o3dc37.png
 
Type
Offering
PebbleHost
High performance, consistent uptime and fast support. Minecraft hosting that just works.

I_Luv_Cowz

Feedback score
5
Posts
292
Reactions
120
Resources
4
Completely random, but statics should be named ALL_CAPITAL.
https://www.oracle.com/java/technologies/javase/codeconventions-namingconventions.html

Singletons (as seen in your QueryAPI class) are also prime examples of static abuse, which I consider bad practice (other developers may disagree). Its something thats been talked about for over a decade, but I personally think that they violate almost every OOP rule/best practice there is.

Incorrect (current):
Code:
private static QueryAPI apiInstance;
Correct (should be):
Code:
private static QueryAPI API_INSTANCE;

Overall, pretty cool project, would just recommend generifying and following best practices especially while creating open sourced projects.
 
Last edited:

Inviss

Management / Head of Development @ AkumaMC
Supreme
Feedback score
21
Posts
734
Reactions
267
Resources
3
Completely random, but statics should be named ALL_CAPITAL.
https://www.oracle.com/java/technologies/javase/codeconventions-namingconventions.html

Singletons (as seen in your QueryAPI class) are also prime examples of static abuse, which I consider bad practice (other developers may disagree). Its something thats been talked about for over a decade, but I personally think that they violate almost every OOP rule/best practice there is.

Incorrect (current):
Code:
private static QueryAPI apiInstance;
Correct (should be):
Code:
private static QueryAPI API_INSTANCE;

Overall, pretty cool project, would just recommend generifying and following best practices especially while creating open sourced projects.
Shoot, my bad, not sure why I didn't do it there! You could have just made a PR for that, but I'll update it either way!

The only place that static is used is in the QueryAPI class is so that it can be easily accessed by other developers in their plugins. It retains a single instance so that it remained synced across plugins, rather than developers having to create instances all over the place. If you can think of a better way to do it then please make a PR, and I'd be happy to review it.
 
Last edited:

NV6

the opensource person(?)
Premium
Feedback score
8
Posts
383
Reactions
223
Resources
1
Completely random, but statics should be named ALL_CAPITAL.
https://www.oracle.com/java/technologies/javase/codeconventions-namingconventions.html

Singletons (as seen in your QueryAPI class) are also prime examples of static abuse, which I consider bad practice (other developers may disagree). Its something thats been talked about for over a decade, but I personally think that they violate almost every OOP rule/best practice there is.

Incorrect (current):
Code:
private static QueryAPI apiInstance;
Correct (should be):
Code:
private static QueryAPI API_INSTANCE;

Overall, pretty cool project, would just recommend generifying and following best practices especially while creating open sourced projects.
Quite sure that naming convention is just for constants (static final).

and I don't see anything wrong using static in this place, especially for a public API.
 

Inviss

Management / Head of Development @ AkumaMC
Supreme
Feedback score
21
Posts
734
Reactions
267
Resources
3
Quite sure that naming convention is just for constants (static final).

and I don't see anything wrong using static in this place, especially for a public API.
I also thought it was only for constants, but I presumed I was wrong as someone wouldn't comment it on a public thread if they weren't sure.
 
Top