From 45c70131167d6757956f2dd5e0f77cea6620e0b5 Mon Sep 17 00:00:00 2001 From: Tahg Date: Sun, 9 Jan 2011 15:01:09 -0500 Subject: [PATCH] Added function to get player ip --- src/main/java/org/bukkit/craftbukkit/CraftPlayer.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main/java/org/bukkit/craftbukkit/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/CraftPlayer.java index 7fc7ace765..195f437496 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftPlayer.java @@ -1,5 +1,7 @@ package org.bukkit.craftbukkit; +import java.net.InetSocketAddress; +import java.net.SocketAddress; import net.minecraft.server.EntityPlayer; import net.minecraft.server.EntityPlayerMP; import net.minecraft.server.Packet3Chat; @@ -28,6 +30,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { return false; } + public InetSocketAddress getAddress() { + SocketAddress addr = entity.a.b.b(); + if (addr instanceof InetSocketAddress) { + return (InetSocketAddress) addr; + } else { + return null; + } + } + @Override public EntityPlayerMP getHandle() { return entity;