Country on Join - Bukkit Edition 1.3.0

Broadcasts join messages mentioning the country from which the players connects. Multi-language.

  1. LinceMaquinola
    Tested Minecraft Versions:
    • 1.8
    • 1.9
    • 1.10
    • 1.11
    • 1.12
    • 1.13
    • 1.14
    • 1.15
    • 1.16
    Source Code:
    https://github.com/KirillBorunov/CountryOnJoin-Bukkit
    Contributors:
    @R_Josef, https://github.com/Redstone-ray, https://github.com/skmd0
    Languages Supported:
    Español (Spanish), Русский (Russian), 汉语 (Simplified Chinese)
    Welcome! This is the Bukkit version of my Country On Join for Bungee.

    What it do?

    It broadcasts join messages mentioning the country from which the players connects. Like this:
    Capture1.PNG

    And provides a command and placeholders to get the country information about a player.
    Multi-language & customizable messages

    The default available languages are:
    English
    Español (Spanish)

    Русский (Russian)
    汉语 (Simplified Chinese)
    Thank you @R_Josef and Redstone-ray
    And you can create your own translation just creating a new file in the folder of "messages" and/or in the folder "countrynames".
    Configuration

    This is the configuration file:
    Code (Text):
    # Do you like to replace the original MC join message or broadcast an aditional one?
    # Set to true to replace the original MC message.
    # Set to false for just broadcast a new message. (also you can use this to workaround another plugin that is cancelling/modifying the join messages)
    replaceDefaultJoinMessage: true

    # If could not get the country for the player (e.g. internal network) and replaceDefaultJoinMessage is set to false.
    # Set to true to broadcast the join message anyway.
    # Set to false for no join message.
    broadcastOnUnknownCountry: true

    # If could not get the country for the player and the broadcastOnUnknownCountry is set to true.
    # Set to true to broadcast the join message without the country version.
    # Set to false to broadcast the normal join message using the 'unknown' country name.
    broadcastAltJoinMsgOnUnknownCountry: true

    # The messages file to use.
    # See in the 'messages' folder for available cultures in the filenames: messages/messages.<culture>.yml
    messages-culture: "en-US"

    # The country names file to use.
    # See in the 'countrynames' folder for available cultures in the filenames: countrynames/countrynames.<culture>.yml
    countrynames-culture: "en-US"

    # Allow this plugin to use the PlaceholdersAPI for provide some placeholders for use in other plugins.
    # If there is no PlaceholderAPI plugin installed on the server then this setting is ignored.
    enablePlaceholderAPIHook: true

    # The GeoIP database file name to load.
    # Use this to load a different database than the provided by the plugin. For example, if you update the database manually.
    geoIPDB: "GeoLite2-Country.mmdb"

    # Spam the console with useful information for error reporting. Should be disabled on production environment.
    debug: false
     
    Commands

    Code (Text):
    /countryonjoin reload
    You can reload the changes in the configuration without restarting the server.

    Code (Text):
    /country <player>
    You can get country information about an online player.
    Permissions

    Code (Text):
    countryonjoin.hide
    You can hide the country for the player. It affects the placeholders also. (default: false)

    Code (Text):
    countryonjoin.command.reload
    Access to the command "/countryonjoin reload". (default: false)

    Code (Text):
    countryonjoin.command.country
    Access to the command "/country". (default: false)
    Placeholders

    This plugin supports placeholders (PlaceholderAPI).
    Its optional and works only if PlaceholderAPI is present on the sever (and can be disabled via config).

    Code (Text):
    %countryonjoin_player_country_code%
    You can get the country ISO code of a player.

    Code (Text):
    %countryonjoin_player_country_name%
    You can get the country name of a player.
    No auto-update
    No statistics send
    No special requirements

    Installation

    1. Drop the downloaded JAR file in your Bukkit/Spigot plugins folder and restart the server. If you are going to use placeholders then install the PlaceholderAPI also.
    2. Open the config.yml file and change it as needed and save the changes.
    3. Type countryonjoin reload in the console. Or give the countryonjoin.command.reload permission to a player and type the command /countryonjoin reload ingame as a player.
    4. Done!

    F.A.Q.

    Why it not shows my country?
    Maybe you are connecting from the internal network... it will not work because the plugin needs your public (internet) IP.
    Or you need to review your network setup. Are the server getting the real player IP?
    If you are using BungeeCord proxy then you need to configure the IP forward or use the "Bungee Edition" of this plugin.
    Another cause is if you added the "*" permission to the player. If you do that you are including the permission "countryonjoin.hide" and it will hide the country.


    How it works?
    This product includes GeoLite2 data created by MaxMind, available from http://www.maxmind.com

    Do I need to update the database?
    In the maxmind site states "GeoLite2 databases are updated on the first Tuesday of each month." so you can download the new database from here (the "GeoLite2 Country" in the format "MaxMind DB binary, gzipped"), extract it, and rename if (for example: GeoLite2-Country_custom.mmdb) and place the file in the plugin folder. Edit the config.yml file to change geoIPDB setting to file name you used (for example: GeoLite2-Country_custom.mmdb).
    More info here.


    How can I create a new translation?
    Create the new file in folder "messages" with the pattern "messages.<culture>_custom.yml" and a new file in the folder "countrynames" with the pattern "countrynames.<culture>_custom.yml" (where culture_custom is the id you will set in the config.yml). Then copy the contents from an existing file for use it as a base for your translation. When done change the config.yml to the new culture id. And reload the configuration or restart the server.
    Do not modify the default files, you will lose the changes!
    More info here.


    Why the join message is duplicated?
    Look at the "config.yml" file and configure it to replace the original MC message.

    Its not working, no join message is shown
    Maybe you have another plugin that is blocking or modifying the join messages. In that case you can try to configure in the "config.yml" file to NOT replace the original MC join message.

    Why the JAR file is big?
    Because it includes a large GeoIP database and all the needed libraries for querying it without external dependencies.

    Can I use it with BungeeCord?
    Yes, if you have configured IP forwarding. But you will need this plugin in every server. Instead you can use the "Bungee Edition" of this plugin.

    Server throws a warning "Unable to load JDK7 types (annotations, java.nio.file.Path): no Java7 support added".
    You can safely ignore that warning. It is coming from a third party dependency and I cannot suppress it at the moment.
    Plans for future versions
    This list is unordered. No priorities set at the moment. You can suggest new features or changes on the discussion section or in the github. And you are welcome to help with the development!​
    • Make it smaller. I'm working on a tool to convert the GeoIP database to a custom scheme and remove the "unneeded" data from it. This should make the plugin a lot smaller, less ram consumption and may be faster lookups. The tool will be open source also and the plugin will still recognize the original MaxMinds db if present and newer.
    • Remove the "Unable to load JDK7 types (annotations, java.nio.file.Path): no Java7 support added" warning.
    • Add cache. As we now support placeholders and a command to get the country information, the lookups may be invoked multiple times, but the player address will not be changed while he is online. So we can cache the country information and associate it to the player.
    • Show the nickname (provided by other plugins) instead of the username on the join messages.
    • Optimization. Make the lookups on a separate thread and may be add a timeout.
    • Translations. Let to translate other plugin messages, like the ones used in the "/country" command.
    • Statistics? Let the server owner know which countries play more.
    • Make a better update system, detect if db file is newer and let use the original file name. Update the config.yml with new entries.
    And this is the list of what i'm not considering to add to this plugin at the moment:​
    • Country white/black listing. This feature is already available on other plugins and I personally think that this should be done at router level.

    I tested it only on the mentioned game versions. Please share your results on other versions.

    It is open source and unlicensed (public domain).

Recent Reviews

  1. MelaniumAS
    MelaniumAS
    5/5,
    Version: 1.3.0
    Esta el momento no veo como funciona este plugin.
    todo me sale:
    Player country is unknown


    en fin no me sirve el plugin
    1. LinceMaquinola
      Author's Response
      Por favor describa su problema en la solapa de "Discusion" ya que aqui en el review solo se puede dejar un mensaje. Yo no se si usted ha hecho la prueba con jugadores reales o solo con los de la LAN (en LAN no funciona ya que son IP privadas), o tal vez usted utiliza BungeeCord sin haber configurado IP Forward. Por eso recomiendo que describa los mas detalladamente si configuracion/aquitectura y las pruebas que ha realizado asi le podre ayudar mejor.
  2. Narcox5
    Narcox5
    5/5,
    Version: 1.3.0
    Add permission for see join message. :((( Thanks for this <3 :D ............................
    1. LinceMaquinola
      Author's Response
      Thank you for review. Can you provide more detail about your feature request on the discussion tab? I cannot understand what do you mean
  3. mds818
    mds818
    5/5,
    Version: 1.2.0
    Is it possible to disable the login message if the player had vanished on login?
    1. LinceMaquinola
      Author's Response
      How do you vanish? Can you explain in discussion?
  4. Fabb_Ex3
    Fabb_Ex3
    5/5,
    Version: 1.2.0
    Das it work on 1.14.4 1.15.2 ? I have 65 server on 1.14.4 all and none of them on 1.12.2-1.13.2 :/
    1. LinceMaquinola
      Author's Response
      Working from 1.9 to 1.16
  5. marvinbudiono
    marvinbudiono
    1/5,
    Version: 1.2.0
    why not working on my server? can you fix it ?
    why not working on my server? can you fix it ?
    1. LinceMaquinola
      Author's Response
      What problem do you have? please explain in the discussion tab.
  6. happyhappy61
    happyhappy61
    5/5,
    Version: 1.2.0
    Great plugin for checking player's location. Nevertheless, it seems that there is a translation error in Simplified Chinese which says "Republic of China" as "Taiwan Province". As a Hongkonger, I cannot accept a translation which involves political factors. If you can contact that translator, please do so. Anyway, thanks for your work :D
    1. LinceMaquinola
      Author's Response
      Sorry for that, will try to fix it, or if you can help please do so in the discussion tab.
  7. camcamhow
    camcamhow
    5/5,
    Version: 1.2.0
    Works that's all that matters
    also why do these reviews need to be so long
    80 characters is quite a lot
  8. Velasco83
    Velasco83
    5/5,
    Version: 1.1.1
    Working perfect without issues in 1.13.1
    Simple and easy to configure and translate.
    Very recomended for all server types.
  9. Achaius
    Achaius
    5/5,
    Version: 1.1.1
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Nice! Works great, cool idea! Thank you for awesome plugin :)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~