So, I tried using the PlayerLoginEvent, and for now I just had it set up to get the ip (getAddress().getAddress().getHostAddress()) and to get the player name, and then log the player and IP. That's it. However, when I do that, I get this mess:
2012-03-23 05:33:53 [SEVERE] Could not pass event PlayerLoginEvent to Blip
org.bukkit.event.EventException
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:303)
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62)
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:459)
at net.minecraft.server.ServerConfigurationManager.attemptLogin(ServerConfigurationManager.java:229)
at net.minecraft.server.NetLoginHandler.b(NetLoginHandler.java:102)
at net.minecraft.server.NetLoginHandler.a(NetLoginHandler.java:94)
at net.minecraft.server.Packet1Login.handle(SourceFile:68)
at net.minecraft.server.NetworkManager.b(NetworkManager.java:229)
at net.minecraft.server.NetLoginHandler.a(NetLoginHandler.java:48)
at net.minecraft.server.NetworkListenThread.a(NetworkListenThread.java:61)
at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:554)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:452)
at net.minecraft.server.ThreadServerApplication.run(SourceFile:490)
Caused by: java.lang.NullPointerException
at me.offluffy.blip.LoginListener.onPlayerLogin(LoginListener.java:24)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:301)
... 12 more
Since it says something it wrong with line 24, this is line 24 in LoginListener.java
String ip = playerName.getAddress().getAddress().getHostAddress();
I would venture to guess I'm doing this wrong XD Since I did figure out this line from a forum post that wasn't in english. Imma mess around with this line a bit, but if you have an idea as to what is wrong before I can fix it (if I fix it), please let me know XD
EDIT:
Scratch that I suppose. As it so happens, I have to make sure the Result is ALLOWED before I can get the IP (via getKickMessage()), like this:
if (event.getResult().equals(Result.ALLOWED)) {
ip = event.getKickMessage();
}