mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-04 12:06:41 +00:00
Changed command pipeline to use Actor over LocalPlayer.
This commit is contained in:
@ -97,6 +97,24 @@ public class WorldEditBinding extends BindingHelper {
|
||||
return worldEdit.getSessionManager().get(sender);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets an {@link Actor} from a {@link ArgumentStack}.
|
||||
*
|
||||
* @param context the context
|
||||
* @return a local player
|
||||
* @throws ParameterException on error
|
||||
*/
|
||||
@BindingMatch(type = Actor.class,
|
||||
behavior = BindingBehavior.PROVIDES)
|
||||
public Actor getActor(ArgumentStack context) throws ParameterException {
|
||||
Actor sender = context.getContext().getLocals().get(Actor.class);
|
||||
if (sender == null) {
|
||||
throw new ParameterException("Missing 'Actor'");
|
||||
} else {
|
||||
return sender;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets an {@link Player} from a {@link ArgumentStack}.
|
||||
*
|
||||
|
Reference in New Issue
Block a user