make velocity work
This commit is contained in:
parent
1429286ce8
commit
ef32f9dbc4
5 changed files with 66 additions and 83 deletions
|
|
@ -0,0 +1,18 @@
|
|||
load("@rules_jvm_external//:defs.bzl", "artifact", "java_export")
|
||||
|
||||
java_export(
|
||||
name = "velocity",
|
||||
maven_coordinates = "de.kentoj.scrow:kencommandapi-velocity:0.34-SNAPSHOT",
|
||||
srcs = glob(["src/main/**/*.java"]),
|
||||
deps = [
|
||||
"//kencommandapi-core:core",
|
||||
artifact("org.projectlombok:lombok"),
|
||||
artifact("org.jetbrains:annotations"),
|
||||
artifact("com.velocitypowered:velocity-api"),
|
||||
],
|
||||
exports = [
|
||||
"//kencommandapi-core:core",
|
||||
],
|
||||
plugins = [ "//third_party:lombok_plugin" ],
|
||||
|
||||
)
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
plugins {
|
||||
id("java")
|
||||
id("scrow.scrow-publish")
|
||||
id("scrow.base-dependencies")
|
||||
id("scrow.java-library")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
annotationProcessor(libs.velocity.api)
|
||||
compileOnly(libs.velocity.api)
|
||||
|
||||
api(project(":kencommandapi-core"))
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
create<MavenPublication>("KenCommandAPI") {
|
||||
groupId = rootProject.group.toString()
|
||||
version = rootProject.version.toString()
|
||||
artifactId = project.name
|
||||
from(components["java"])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -14,14 +14,14 @@ public class PlayerArgumentType implements ArgumentType<CommandSource, Player> {
|
|||
private final ProxyServer server;
|
||||
|
||||
@Override
|
||||
public Player parseInput(String string) {
|
||||
var player = server.getPlayer(string).orElse(null);
|
||||
public Player parseInputUnchecked(String input) {
|
||||
var player = server.getPlayer(input).orElse(null);
|
||||
if (player == null) throw new IllegalArgumentException("Player not online");
|
||||
return player;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SuggestionProvider<CommandSource> defaultSuggestionProvider() {
|
||||
public SuggestionProvider<CommandSource> getDefaultSuggestionProvider() {
|
||||
return new PlayerSuggestionProvider(server);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue