mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-28 05:25:42 +01:00
Actually push the CraftOfflinePlayer implementation!
This commit is contained in:
parent
0206757029
commit
2547c46099
40
src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java
Normal file
40
src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java
Normal file
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user