Skip to content
This repository has been archived by the owner on Dec 6, 2024. It is now read-only.

Commit

Permalink
Allow types implementing the CommandSender in the ReflectiveSubComman…
Browse files Browse the repository at this point in the history
…dExecutor
  • Loading branch information
einrobin committed Jul 14, 2020
1 parent cc37f58 commit aef3d8b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Maven:
<dependency>
<groupId>com.github.derrop</groupId>
<artifactId>simplecommand</artifactId>
<version>1.1-RELEASE</version>
<version>1.2-RELEASE</version>
</dependency>
```

Expand All @@ -27,7 +27,7 @@ maven {
url 'https://jitpack.io'
}
compile group: 'com.github.derrop', name: 'simplecommand', version: '1.1-RELEASE'
compile group: 'com.github.derrop', name: 'simplecommand', version: '1.2-RELEASE'
```
<br>

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.github.derrop</groupId>
<artifactId>simplecommand</artifactId>
<version>1.0-RELEASE</version>
<version>1.2-RELEASE</version>

<build>
<plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public void setCommand(UsableCommand command) {

private void validateParameters(Method method) {
for (Parameter parameter : method.getParameters()) {
if (Arrays.stream(ALLOWED_PARAMETERS).noneMatch(allowed -> allowed.getType().equals(parameter.getType()))) {
if (Arrays.stream(ALLOWED_PARAMETERS).noneMatch(allowed -> allowed.getType().isAssignableFrom(parameter.getType()))) {
throw new IllegalArgumentException("Parameter " + parameter.getName() + "@" + parameter.getType().getSimpleName() + " is not allowed on sub commands");
}
}
Expand Down

0 comments on commit aef3d8b

Please sign in to comment.