From e0eb9be1bad41b3b73b486e979420fa23314ef42 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Thu, 6 Jan 2011 02:50:44 -0500 Subject: [PATCH] Fixed CraftPlayer.isOnline By: Tahg --- .../java/org/bukkit/craftbukkit/CraftPlayer.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftPlayer.java b/paper-server/src/main/java/org/bukkit/craftbukkit/CraftPlayer.java index a8a368dc97..7fc7ace765 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftPlayer.java +++ b/paper-server/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; }