public class SelectorHandlerManager
extends java.lang.Object
SelectorHandler
to a prefix
This class handles calls to the EntitySelector
methods matchEntities
,
matchesMultiplePlayers
and isSelector
.SelectorHandler
to a broader domain (not just a single selector), you should take care of possible shadowing conflicts yourself.
For this you can use the information provided by selectorHandlers
and registeringMods
.Modifier and Type | Field and Description |
---|---|
static java.util.NavigableMap<java.lang.String,java.lang.String> |
registeringMods |
static java.util.NavigableMap<java.lang.String,SelectorHandler> |
selectorHandlers |
Modifier and Type | Method and Description |
---|---|
static SelectorHandler |
getHandler(java.lang.String selectorStr)
Returns the best matching handler for the given string.
|
static boolean |
isSelector(java.lang.String selectorStr) |
static <T extends Entity> |
matchEntities(ICommandSender sender,
java.lang.String token,
java.lang.Class<? extends T> targetClass) |
static boolean |
matchesMultiplePlayers(java.lang.String selectorStr) |
static void |
register(java.lang.String prefix,
SelectorHandler handler)
|
public static final java.util.NavigableMap<java.lang.String,SelectorHandler> selectorHandlers
public static final java.util.NavigableMap<java.lang.String,java.lang.String> registeringMods
public static void register(java.lang.String prefix, SelectorHandler handler)
prefix
- The domain the specified handler
is registered for.
If you want to register just a single selector, prefix
has the form '@{selectorName}'public static SelectorHandler getHandler(java.lang.String selectorStr)
public static <T extends Entity> java.util.List<T> matchEntities(ICommandSender sender, java.lang.String token, java.lang.Class<? extends T> targetClass) throws CommandException
CommandException
public static boolean matchesMultiplePlayers(java.lang.String selectorStr) throws CommandException
CommandException
public static boolean isSelector(java.lang.String selectorStr)