Spigot JReferrals | 1.8.X - 1.13.X | Grow Your Playerbase! RELEASE-2.4.0

Reward your players while growing your servers playerbase!

  1. Jaffaaaa submitted a new resource:

    JReferrals | 1.8.X - 1.13.X | Grow Your Playerbase! - Reward your players while growing your servers playerbase!

    Read more about this resource...
  2. Possible to add screenshots to see what it looks like?
  3. Will do. Gimme 10 minutes.
  4. Added :)
  5. Soon yes :).
  6. I can't resist to check your plugin...
    I recognized some things, you could do better:
    Code (Java):
    // class main:
    Logger logger = Logger.getLogger("Minecraft");
    Don't do that... use the logger bukkit provides for your plugin, that's why JavaPlugin#getLogger exists.

    Code (Java):
    // class main:
    logger.info("[" + pdfFile.getName() + "]" + " plugin has been enabled :). (Version." + pdfFile.getVersion() + ")");
    logger.info(pdfFile.getName() + " has been disabled :(. (Version." + pdfFile.getVersion());
    Don't do that, bukkit already generates this message, having it twice is useless and annoying.

    Code (Java):
    // class reload:
    Player player = (Player) sender;
    You need to check if sender actually is a player before trying to cast it!
    Have you ever executed the command by console? This would throw an exception!

    Code (Java):
    // class reload:
    player.sendMessage(ChatColor.translateAlternateColorCodes('&', ((main) main.getPlugin(main.class)).getConfig().getString("prefix")) + ChatColor.DARK_RED + " Warning: " + ChatColor.RED
    + "Reload is not fully supported, espcially to the PlayerDatabase. Please restart the server for full support.");
    This doesn't make sense to me. Do you actually know what you are trying to say by this sentence? In your case reloading the config is everything which is needed to reload your plugin... so there is no possible problem i could see in any way.

    Code (Java):
    // class jrefer
    if (((main) main.getPlugin(main.class)).getConfig().getString("ipcheck").equalsIgnoreCase("True")
                                && Bukkit.getPlayer(username).isOnline() && player.getAddress().getHostName()
                                        .equals(Bukkit.getPlayer(username).getAddress().getHostName())) {
    // blablabla
    You're blocking duplicated IPs? Very often People of the same family are on the same server, guess what they're living in the same house, so they got the same IP. Why won't you let sisters / brothers "refer"?

    General stuff:
    • You're breaking the java naming convention by using lowercase classes.
    • You're very very very often using "((main) main.getPlugin(main.class)).getConfig()". That's too often. It's way better (due to performance and software structure) to pass things like that by the constructor of the class instead of searching it over and over again to pick it out.
    • Why are all messages pre-defined in the source code? It's way better to read Messages out of a language file (e.g. messages.yml) and let users define their messages (this is the first step to become multilangual).
    • The whole Thing doesn't look good planned. It doesn't look planned at all. It looks like you just writing code without thinking before. Instead you're fixing it afterwards until it somewhen finally works. You should think about a proper software architecture before starting writing any code. (What you do is called spaghetti code)
    • What i mean by the point before is easily to see by the jrefer#onCommand over and over nested IFs and indent as far as you can see. How about writing some extra Methods to split bigger logic in understandable pieces?
    • As far as i can see, the guy someone is trying to "refer" doesn't get a notification? I would suggest this.
    Because of all this i'll rate as 2/5... you could do better.
    • Optimistic Optimistic x 1
  7. Point 1 + 2: Fixed logger, no more double enable messages.

    Point 3. There is a if statement to stop all senders who arent players right above.
    Code (Java):
    if (!(sender instanceof Player)) {
                    sender.sendMessage("You must be a player to use this command.");
                    return false;
    Point 4. I said it wasn't compatible with PlayerDatabase because in case someone tried to change a string in a players file such as hasReferred.

    Point 5. Thats why you can turn IP check off :)

    Thanks for the review, hope you understand. :)