diff options
Diffstat (limited to 'src/main/java/org')
-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()); + } + } +} |