mirror of
https://github.com/PaperMC/Paper.git
synced 2025-02-27 14:34:57 +01:00
Added function to get player ip
This commit is contained in:
parent
95c53f09fc
commit
45c7013116
1 changed files with 11 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue