Skip to content
Permalink
Browse files

Fixed the adapt function for Actor -> Bukkit not working for players …

…or command blocks
  • Loading branch information
me4502 committed Jan 4, 2020
1 parent 3ed02aa commit e198718a1ebe839e90729c170103ca86e2a6931b
@@ -148,6 +148,11 @@ public static BukkitPlayer adapt(Player player) {
* @return The Bukkit command sender
*/
public static CommandSender adapt(Actor actor) {
if (actor instanceof com.sk89q.worldedit.entity.Player) {
return adapt((com.sk89q.worldedit.entity.Player) actor);
} else if (actor instanceof BukkitBlockCommandSender) {
return ((BukkitBlockCommandSender) actor).getSender();
}
return ((BukkitCommandSender) actor).getSender();
}

@@ -139,6 +139,10 @@ public boolean hasPermission(String permission) {
return sender.hasPermission(permission);
}

public BlockCommandSender getSender() {
return this.sender;
}

@Override
public SessionKey getSessionKey() {
return new SessionKey() {

0 comments on commit e198718

Please sign in to comment.
You can’t perform that action at this time.