mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-29 12:27:59 +01:00
Added function to get player ip
By: Tahg <tahgtahv@gmail.com>
This commit is contained in:
parent
e0eb9be1ba
commit
c8094f4225
@ -1,5 +1,7 @@
|
|||||||
package org.bukkit.craftbukkit;
|
package org.bukkit.craftbukkit;
|
||||||
|
|
||||||
|
import java.net.InetSocketAddress;
|
||||||
|
import java.net.SocketAddress;
|
||||||
import net.minecraft.server.EntityPlayer;
|
import net.minecraft.server.EntityPlayer;
|
||||||
import net.minecraft.server.EntityPlayerMP;
|
import net.minecraft.server.EntityPlayerMP;
|
||||||
import net.minecraft.server.Packet3Chat;
|
import net.minecraft.server.Packet3Chat;
|
||||||
@ -28,6 +30,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public InetSocketAddress getAddress() {
|
||||||
|
SocketAddress addr = entity.a.b.b();
|
||||||
|
if (addr instanceof InetSocketAddress) {
|
||||||
|
return (InetSocketAddress) addr;
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EntityPlayerMP getHandle() {
|
public EntityPlayerMP getHandle() {
|
||||||
return entity;
|
return entity;
|
||||||
|
Loading…
Reference in New Issue
Block a user