diff options
author | Tahg <tahgtahv@gmail.com> | 2011-01-06 02:50:44 -0500 |
---|---|---|
committer | Tahg <tahgtahv@gmail.com> | 2011-01-06 02:50:44 -0500 |
commit | 95c53f09fc0d14b93525dcedc66e84811b25a03e (patch) | |
tree | 4470eb60dbd627db92e08f241bef52bfc7ff3efc /src/main/java/org | |
parent | a0c449559a15b90677007052da779eca4ed27d31 (diff) | |
download | craftbukkit-95c53f09fc0d14b93525dcedc66e84811b25a03e.tar craftbukkit-95c53f09fc0d14b93525dcedc66e84811b25a03e.tar.gz craftbukkit-95c53f09fc0d14b93525dcedc66e84811b25a03e.tar.lz craftbukkit-95c53f09fc0d14b93525dcedc66e84811b25a03e.tar.xz craftbukkit-95c53f09fc0d14b93525dcedc66e84811b25a03e.zip |
Fixed CraftPlayer.isOnline
Diffstat (limited to 'src/main/java/org')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/CraftPlayer.java | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/CraftPlayer.java index a8a368dc..7fc7ace7 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftPlayer.java @@ -1,4 +1,3 @@ - package org.bukkit.craftbukkit; import net.minecraft.server.EntityPlayer; @@ -8,6 +7,7 @@ import org.bukkit.Location; import org.bukkit.Player; public class CraftPlayer extends CraftHumanEntity implements Player { + private EntityPlayerMP entity; public CraftPlayer(CraftServer server, EntityPlayerMP entity) { @@ -15,17 +15,26 @@ public class CraftPlayer extends CraftHumanEntity implements Player { this.entity = entity; } - public boolean isOnline() { + public boolean isOp() { return server.getHandle().g(getName()); } + public boolean isOnline() { + for (EntityPlayerMP player : server.getHandle().b) { + if (player.aw.equalsIgnoreCase(getName())) { + return true; + } + } + return false; + } + @Override public EntityPlayerMP getHandle() { return entity; } public void setHandle(final EntityPlayerMP entity) { - super.setHandle((EntityPlayer)entity); + super.setHandle((EntityPlayer) entity); this.entity = entity; } |