Skip to content

Commit 2889651

Browse files
authored
Merge pull request #19 from kylepls/commands
Merge in commands simplification
2 parents d0292ec + 4bf93ac commit 2889651

File tree

22 files changed

+325
-344
lines changed

22 files changed

+325
-344
lines changed

mcspring-api/mcspring-base/pom.xml

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>mcspring-api</artifactId>
77
<groupId>in.kyle.mcspring</groupId>
8-
<version>0.0.8</version>
8+
<version>0.0.9</version>
99
</parent>
1010

1111
<modelVersion>4.0.0</modelVersion>
@@ -63,17 +63,4 @@
6363
<artifactId>lombok</artifactId>
6464
</dependency>
6565
</dependencies>
66-
67-
<build>
68-
<plugins>
69-
<plugin>
70-
<groupId>org.apache.maven.plugins</groupId>
71-
<artifactId>maven-source-plugin</artifactId>
72-
</plugin>
73-
<plugin>
74-
<groupId>org.apache.maven.plugins</groupId>
75-
<artifactId>maven-javadoc-plugin</artifactId>
76-
</plugin>
77-
</plugins>
78-
</build>
7966
</project>

mcspring-api/mcspring-jar-loader/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
44
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
55
<parent>
6-
<artifactId>mcspring-parent</artifactId>
6+
<artifactId>mcspring-api</artifactId>
77
<groupId>in.kyle.mcspring</groupId>
8-
<version>0.0.8</version>
8+
<version>0.0.9</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

@@ -25,4 +25,4 @@
2525
<artifactId>spring-boot-loader</artifactId>
2626
</dependency>
2727
</dependencies>
28-
</project>
28+
</project>

mcspring-api/mcspring-subcommands/pom.xml

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>mcspring-api</artifactId>
77
<groupId>in.kyle.mcspring</groupId>
8-
<version>0.0.8</version>
8+
<version>0.0.9</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

@@ -33,17 +33,4 @@
3333
<scope>test</scope>
3434
</dependency>
3535
</dependencies>
36-
37-
<build>
38-
<plugins>
39-
<plugin>
40-
<groupId>org.apache.maven.plugins</groupId>
41-
<artifactId>maven-source-plugin</artifactId>
42-
</plugin>
43-
<plugin>
44-
<groupId>org.apache.maven.plugins</groupId>
45-
<artifactId>maven-javadoc-plugin</artifactId>
46-
</plugin>
47-
</plugins>
48-
</build>
4936
</project>

mcspring-api/mcspring-subcommands/src/main/java/in/kyle/mcspring/command/TabCommandFactory.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package in.kyle.mcspring.command;
22

3+
import in.kyle.mcspring.subcommands.PluginCommand;
34
import org.bukkit.command.Command;
4-
import org.bukkit.command.PluginCommand;
55
import org.bukkit.command.TabCompleter;
66
import org.bukkit.plugin.Plugin;
77
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
@@ -33,16 +33,16 @@ public TabCommandFactory(SimpleMethodInjection injection,
3333

3434
@Override
3535
public Command makeCommand(Method method, Object object, String name) {
36-
var command = (PluginCommand) super.makeCommand(method, object, name);
36+
var command = (org.bukkit.command.PluginCommand) super.makeCommand(method, object, name);
3737
if (method.getParameterCount() == 1 && method.getParameters()[0].getType()
38-
.isAssignableFrom(in.kyle.mcspring.subcommands.PluginCommand.class)) {
38+
.isAssignableFrom(PluginCommand.class)) {
3939
command.setTabCompleter(makeTabCompleter(method, object));
4040
}
4141
return command;
4242
}
4343

44-
private Consumer<in.kyle.mcspring.subcommands.PluginCommand> methodToConsumer(Method method,
45-
Object object) {
44+
private Consumer<PluginCommand> methodToConsumer(Method method,
45+
Object object) {
4646
return pluginCommand -> {
4747
method.setAccessible(true);
4848
invoke(method, object, pluginCommand);
@@ -52,7 +52,7 @@ private Consumer<in.kyle.mcspring.subcommands.PluginCommand> methodToConsumer(Me
5252
@SneakyThrows
5353
private Object invoke(Method method,
5454
Object object,
55-
in.kyle.mcspring.subcommands.PluginCommand command) {
55+
PluginCommand command) {
5656
return method.invoke(object, command);
5757
}
5858

0 commit comments

Comments
 (0)