[AB-246] changing parameter handling to only actually evaluate the necessary parameter handlers, this helps avoiding providing the wrong parameter to the actual command

This commit is contained in:
Sheldan
2021-05-02 17:40:52 +02:00
parent 23dd02312a
commit 2a5c462c35
43 changed files with 210 additions and 92 deletions

View File

@@ -33,10 +33,11 @@ public class TrackedEmoteParameterHandler implements CommandParameterHandler {
/**
* This {@link CommandParameterHandler} only handles {@link TrackedEmote}
* @param clazz The desired {@link Class} of a parameter
* @param value
* @return Whether or not the given {@link Class} will be handled by this {@link CommandParameterHandler}
*/
@Override
public boolean handles(Class clazz) {
public boolean handles(Class clazz, UnparsedCommandParameterPiece value) {
return clazz.equals(TrackedEmote.class);
}

View File

@@ -37,10 +37,11 @@ public class TrackedEmoteParameterParameterHandler implements CommandParameterHa
/**
* This {@link CommandParameterHandler} only handles {@link TrackEmoteParameter}
* @param clazz The desired {@link Class} of a parameter
* @param value
* @return Whether or not the given {@link Class} will be handled by this {@link CommandParameterHandler}
*/
@Override
public boolean handles(Class clazz) {
public boolean handles(Class clazz, UnparsedCommandParameterPiece value) {
return clazz.equals(TrackEmoteParameter.class);
}