mirror of
https://github.com/EngineHub/WorldEdit.git
synced 2025-03-13 13:57:48 +08:00
Fixed the adapt function for Actor -> Bukkit not working for players or command blocks
This commit is contained in:
parent
3ed02aa1a8
commit
e198718a1e
@ -148,6 +148,11 @@ public class BukkitAdapter {
|
||||
* @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 class BukkitBlockCommandSender extends AbstractNonPlayerActor implements
|
||||
return sender.hasPermission(permission);
|
||||
}
|
||||
|
||||
public BlockCommandSender getSender() {
|
||||
return this.sender;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SessionKey getSessionKey() {
|
||||
return new SessionKey() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user