diff options
author | Dinnerbone <dinnerbone@dinnerbone.com> | 2011-09-03 00:49:10 +0100 |
---|---|---|
committer | Dinnerbone <dinnerbone@dinnerbone.com> | 2011-09-03 00:49:10 +0100 |
commit | 2547c46099539783db12f85cf4961b981650eaf8 (patch) | |
tree | 780257fa29337975f2dc80b78ad04cc0bd38fb62 /src/main/java | |
parent | 02067570299cbaed0d8274ab532ad228e7e845a5 (diff) | |
download | craftbukkit-2547c46099539783db12f85cf4961b981650eaf8.tar craftbukkit-2547c46099539783db12f85cf4961b981650eaf8.tar.gz craftbukkit-2547c46099539783db12f85cf4961b981650eaf8.tar.lz craftbukkit-2547c46099539783db12f85cf4961b981650eaf8.tar.xz craftbukkit-2547c46099539783db12f85cf4961b981650eaf8.zip |
Actually push the CraftOfflinePlayer implementation!
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java new file mode 100644 index 00000000..01a9ec1c --- /dev/null +++ b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java @@ -0,0 +1,40 @@ +package org.bukkit.craftbukkit; + +import org.bukkit.OfflinePlayer; +import org.bukkit.Server; + +public class CraftOfflinePlayer implements OfflinePlayer { + private final String name; + private final CraftServer server; + + protected CraftOfflinePlayer(CraftServer server, String name) { + this.server = server; + this.name = name; + } + + public boolean isOnline() { + return false; + } + + public String getName() { + return name; + } + + public Server getServer() { + return server; + } + + public boolean isOp() { + return server.getHandle().isOp(getName()); + } + + public void setOp(boolean value) { + if (value == isOp()) return; + + if (value) { + server.getHandle().e(getName()); + } else { + server.getHandle().f(getName()); + } + } +} |