Mineuniverse
Log in Register
Plugins

iPAVGeoGrabber

An add-on for iPAV that allows it to grab IP geo data off of specific websites.
by Seirako
Download Claim this project
1,024 downloads
0 likes
Updated Jun 30, 2026
0 hypes
Admin Tools Informational

iPAV Geo-Grabber

An add-on for iPAV v2.6 and higher that allows it to gather address locations off of the web

What It Does

The goal of this add-on plugin is to gather the city, state, and country of a player's IP address when iPAV requests it. It does this by downloading the HTML data of up to 4 specific sources. The following four websites have been selected as sources for the geo location data:

REMEMBER: iPAVGeoGrabber will download a webpage from one or all of these sites when it attempts to get a player's location data!
If you do not trust any of these sites for any reason, DO NOT USE THIS PLUGIN!

How It Does It

When a user logs in, iPAV will first try to detect if iPAVGeoGrabber is loaded on the minecraft server. If it is, it will interact with iPAVGeoGrabber's API which will schedule an asynchronous BukkitTask. This makes the following things that happen run separately to the main server thread instead of being part of the main thread. That way there isn't any lag (even though it would likely be minor) when the HTML page is being downloaded. Now that any possible lag from connecting to the source websites has been avoided, iPAVGeoGrabber will make a connection with one of the four websites listed above. A 5 second timeout is given to the connection so that the async task doesn't spend long trying to get the data. When it does successfully connect, iPAVGeoGrabber will start to read each line of the webpage while doing tests to see if the city, state, or country is contained on that line. If it is, the piece of data is taken from the line and the iPAVGeoGrabber continues looking for the rest of the data. Once it finds the three pieces of information (or if it gets to the end of the webpage), it will close the connection stream. If it hasn't found any data (or if the current website timed out), the next website in the list is checked for the data we want. If it did find any of the data we want, iPAVGeoGrabber will inform iPAV that it finished searching for the geo location and that iPAV can now display that data to the server administrators.

For a more detailed explanation of what iPAVGeoGrabber is doing, there's nothing better than seeing the actual source code. You can view it through the links posted below.

Source Code

iPAVGeoGrabber.java
<sub>Paste-Version of iPAVGeoGrabber.java for better legibility</sub>

GeoData.java
<sub>Paste-Version of GeoData.java for better legibility</sub>

DataSource.java
<sub>Paste-Version of DataSource.java for better legibility</sub>

plugin.yml

Note: If you wish to compile these source files yourself, you must include iPAV v2.6 as an external jar reference in addition to the standard Bukkit reference required for Bukkit plugins.

iPAV GeoGrabber v1.0
MC 1.8.1, 1.8
Release 2015-02-19 Get

More from Seirako

Command Delay
8,556
iPyronic's Sign Editor
4,745
iPyronic's Admin Chat
2,811
iP Address Viewer
20,054

You Might Also Like

AdBolt Advertising Network
Make money from your Minecraft server by running ads!
9,992
Mineload
Mineload
9,978
BeastTP
BeastTP v1.0 - Teleportation Made Easy! -[Permissions][1317]
9,966
RegionManager
generate regions with just one command!
9,950
TimeKeeper
Keep the Server-Playtime per Day
9,948
SimpleAdmin
simple way to ban/kick unwanted players from your server
9,945