make velocity work

This commit is contained in:
kento2 2026-08-03 12:50:38 +02:00
parent 1429286ce8
commit ef32f9dbc4
5 changed files with 66 additions and 83 deletions

92
.idea/workspace.xml generated
View file

@ -9,7 +9,7 @@
</component> </component>
<component name="BazelProjectProperties"> <component name="BazelProjectProperties">
<option name="bazelProject" value="true" /> <option name="bazelProject" value="true" />
<option name="defaultJdkName" value="KenCommandAPI-jdk-e101e" /> <option name="defaultJdkName" value="rules_jvm_external-jdk-b3ed7" />
<option name="initialized" value="true" /> <option name="initialized" value="true" />
<option name="rootDirUrl" value="file://$PROJECT_DIR$" /> <option name="rootDirUrl" value="file://$PROJECT_DIR$" />
</component> </component>
@ -37,12 +37,11 @@
</option> </option>
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="6414223f-1761-4683-97f5-9dab59d6c44a" name="Changes" comment="BAZEL + some code"> <list default="true" id="6414223f-1761-4683-97f5-9dab59d6c44a" name="Changes" comment="works">
<change beforePath="$PROJECT_DIR$/.bazelrc" beforeDir="false" afterPath="$PROJECT_DIR$/.bazelrc" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/README.md" beforeDir="false" afterPath="$PROJECT_DIR$/README.md" afterDir="false" /> <change beforePath="$PROJECT_DIR$/MODULE.bazel" beforeDir="false" afterPath="$PROJECT_DIR$/MODULE.bazel" afterDir="false" />
<change beforePath="$PROJECT_DIR$/kencommandapi-bukkit/BUILD" beforeDir="false" afterPath="$PROJECT_DIR$/kencommandapi-bukkit/BUILD" afterDir="false" /> <change beforePath="$PROJECT_DIR$/kencommandapi-velocity/BUILD" beforeDir="false" afterPath="$PROJECT_DIR$/kencommandapi-velocity/BUILD" afterDir="false" />
<change beforePath="$PROJECT_DIR$/kencommandapi-core/BUILD" beforeDir="false" afterPath="$PROJECT_DIR$/kencommandapi-core/BUILD" afterDir="false" /> <change beforePath="$PROJECT_DIR$/kencommandapi-velocity/build.gradle.kts" beforeDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -171,7 +170,7 @@
"bazel.project.detector.is.bazel.project": "true", "bazel.project.detector.is.bazel.project": "true",
"git-widget-placeholder": "master", "git-widget-placeholder": "master",
"kotlin-language-version-configured": "true", "kotlin-language-version-configured": "true",
"last_opened_file_path": "/home/a/src/scrow/KenCommandAPI/gradle", "last_opened_file_path": "/home/a/src/random/rules_jvm_external",
"project.structure.last.edited": "Modules", "project.structure.last.edited": "Modules",
"project.structure.proportion": "0.15", "project.structure.proportion": "0.15",
"project.structure.side.proportion": "0.6268199", "project.structure.side.proportion": "0.6268199",
@ -188,11 +187,11 @@
<recent name="de.kencommand.api" /> <recent name="de.kencommand.api" />
</key> </key>
<key name="CopyFile.RECENT_KEYS"> <key name="CopyFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/kencommandapi-velocity" />
<recent name="$PROJECT_DIR$/gradle" /> <recent name="$PROJECT_DIR$/gradle" />
<recent name="$PROJECT_DIR$/kencommandapi-core/src/test/java/a" /> <recent name="$PROJECT_DIR$/kencommandapi-core/src/test/java/a" />
<recent name="$PROJECT_DIR$/kencommandapi-core" /> <recent name="$PROJECT_DIR$/kencommandapi-core" />
<recent name="$PROJECT_DIR$/kencommandapi-velocity/src/main/java/de/kentoj/kencommandapi" /> <recent name="$PROJECT_DIR$/kencommandapi-velocity/src/main/java/de/kentoj/kencommandapi" />
<recent name="$PROJECT_DIR$/src/main/java/de/kencommand/api" />
</key> </key>
<key name="MoveFile.RECENT_KEYS"> <key name="MoveFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/third_party" /> <recent name="$PROJECT_DIR$/third_party" />
@ -228,9 +227,21 @@
<command value="bazel build //kencommandapi-bukkit:bukkit" /> <command value="bazel build //kencommandapi-bukkit:bukkit" />
<command value="bazel build //kencommandapi-bukkit:bukkit --nojava_header_compilation" /> <command value="bazel build //kencommandapi-bukkit:bukkit --nojava_header_compilation" />
<command value="bazel clean" /> <command value="bazel clean" />
<command value="bazel sync --only=maven --verbose_failures" />
<command value="bazel build //kencommandapi-core:core-lib" />
<command value="bazel build //kencommandapi-core:core-lib --verbose" />
<command value="bazel build //kencommandapi-core:core-lib -v" />
<command value="bazel build //kencommandapi-core:core-lib --help" />
<command value="bazel build -v //kencommandapi-core:core-lib " />
<command value="bazel -v build //kencommandapi-core:core-lib " />
<command value="bazel -v build //kencommandapi-core:core-lib --subcommands " />
<command value="bazel build //kencommandapi-core:core-lib --subcommands " />
<command value="bazel build //kencommandapi-core:core-lib --subcommands --verbose_failures" />
<command value="bazel clean --expunge" />
<command value="bazel shutdown" />
</option> </option>
</component> </component>
<component name="RunManager" selected="Bazel.Run //kencommandapi-bukkit:bukkit.publish"> <component name="RunManager" selected="Bazel.Run //kencommandapi-velocity:velocity.publish">
<configuration name="Run //kencommandapi-bukkit:bukkit.publish" type="BazelRunConfigurationType" temporary="true"> <configuration name="Run //kencommandapi-bukkit:bukkit.publish" type="BazelRunConfigurationType" temporary="true">
<bsp-state handler-provider-id="GenericRunHandlerProvider"> <bsp-state handler-provider-id="GenericRunHandlerProvider">
<bsp-target>@//kencommandapi-bukkit:bukkit.publish</bsp-target> <bsp-target>@//kencommandapi-bukkit:bukkit.publish</bsp-target>
@ -238,6 +249,13 @@
</bsp-state> </bsp-state>
<method v="2" /> <method v="2" />
</configuration> </configuration>
<configuration name="Run //kencommandapi-core:core.publish" type="BazelRunConfigurationType" temporary="true">
<bsp-state handler-provider-id="GenericRunHandlerProvider">
<bsp-target>@//kencommandapi-core:core.publish</bsp-target>
<handler-state />
</bsp-state>
<method v="2" />
</configuration>
<configuration name="Run //kencommandapi-core:export.publish" type="BazelRunConfigurationType" temporary="true"> <configuration name="Run //kencommandapi-core:export.publish" type="BazelRunConfigurationType" temporary="true">
<bsp-state handler-provider-id="GenericRunHandlerProvider"> <bsp-state handler-provider-id="GenericRunHandlerProvider">
<bsp-target>@//kencommandapi-core:export.publish</bsp-target> <bsp-target>@//kencommandapi-core:export.publish</bsp-target>
@ -245,26 +263,11 @@
</bsp-state> </bsp-state>
<method v="2" /> <method v="2" />
</configuration> </configuration>
<configuration name="KenCommandAPI [clean]" type="GradleRunConfiguration" factoryName="Gradle" temporary="true"> <configuration name="Run //kencommandapi-velocity:velocity.publish" type="BazelRunConfigurationType" temporary="true">
<ExternalSystemSettings> <bsp-state handler-provider-id="GenericRunHandlerProvider">
<option name="executionName" /> <bsp-target>@//kencommandapi-velocity:velocity.publish</bsp-target>
<option name="externalProjectPath" value="$PROJECT_DIR$" /> <handler-state />
<option name="externalSystemIdString" value="GRADLE" /> </bsp-state>
<option name="scriptParameters" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="clean" />
</list>
</option>
<option name="vmOptions" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<RunAsTest>false</RunAsTest>
<method v="2" /> <method v="2" />
</configuration> </configuration>
<configuration name="KenCommandAPI [publishAllPublicationsToScrowRepository]" type="GradleRunConfiguration" factoryName="Gradle" temporary="true"> <configuration name="KenCommandAPI [publishAllPublicationsToScrowRepository]" type="GradleRunConfiguration" factoryName="Gradle" temporary="true">
@ -289,28 +292,6 @@
<RunAsTest>false</RunAsTest> <RunAsTest>false</RunAsTest>
<method v="2" /> <method v="2" />
</configuration> </configuration>
<configuration name="KenCommandAPI [publish]" type="GradleRunConfiguration" factoryName="Gradle" temporary="true">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="publish" />
</list>
</option>
<option name="vmOptions" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<RunAsTest>false</RunAsTest>
<method v="2" />
</configuration>
<configuration default="true" type="JetRunConfigurationType"> <configuration default="true" type="JetRunConfigurationType">
<module name="build-logic.convention.main" /> <module name="build-logic.convention.main" />
<method v="2"> <method v="2">
@ -324,10 +305,10 @@
</configuration> </configuration>
<recent_temporary> <recent_temporary>
<list> <list>
<item itemvalue="Bazel.Run //kencommandapi-velocity:velocity.publish" />
<item itemvalue="Bazel.Run //kencommandapi-bukkit:bukkit.publish" />
<item itemvalue="Bazel.Run //kencommandapi-core:core.publish" />
<item itemvalue="Bazel.Run //kencommandapi-bukkit:bukkit.publish" /> <item itemvalue="Bazel.Run //kencommandapi-bukkit:bukkit.publish" />
<item itemvalue="Bazel.Run //kencommandapi-core:export.publish" />
<item itemvalue="Bazel.Run //kencommandapi-core:export.publish" />
<item itemvalue="Bazel.Run //kencommandapi-core:export.publish" />
<item itemvalue="Bazel.Run //kencommandapi-core:export.publish" /> <item itemvalue="Bazel.Run //kencommandapi-core:export.publish" />
</list> </list>
</recent_temporary> </recent_temporary>
@ -593,6 +574,7 @@
<MESSAGE value="use version catalog" /> <MESSAGE value="use version catalog" />
<MESSAGE value="BAZEL" /> <MESSAGE value="BAZEL" />
<MESSAGE value="BAZEL + some code" /> <MESSAGE value="BAZEL + some code" />
<option name="LAST_COMMIT_MESSAGE" value="BAZEL + some code" /> <MESSAGE value="works" />
<option name="LAST_COMMIT_MESSAGE" value="works" />
</component> </component>
</project> </project>

View file

@ -1,6 +1,11 @@
bazel_dep(name = "rules_java", version = "9.7.0") bazel_dep(name = "rules_java", version = "9.7.0")
bazel_dep(name = "rules_jvm_external", version = "7.1") bazel_dep(name = "rules_jvm_external", version = "7.1")
git_override(
module_name = "rules_jvm_external",
remote = "http://forge.kentoj.de/scrow/rules_jvm_external.git",
)
maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven") maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
maven.install( maven.install(
name = "maven", name = "maven",
@ -14,10 +19,12 @@ maven.install(
"org.slf4j:slf4j-simple:2.0.18", "org.slf4j:slf4j-simple:2.0.18",
"net.kyori:adventure-api:5.2.0", "net.kyori:adventure-api:5.2.0",
"io.papermc.paper:paper-api:[26.2.build,)", "io.papermc.paper:paper-api:[26.2.build,)",
"com.velocitypowered:velocity-api:4.1.0-20260802.091736-8",
], ],
repositories = [ repositories = [
"https://repo.papermc.io/repository/maven-public/", "https://repo.papermc.io/repository/maven-public/",
] ],
known_contributing_modules = ["protobuf"],
) )
use_repo(maven, "maven") use_repo(maven, "maven")

View file

@ -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" ],
)

View file

@ -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"])
}
}
}

View file

@ -14,14 +14,14 @@ public class PlayerArgumentType implements ArgumentType<CommandSource, Player> {
private final ProxyServer server; private final ProxyServer server;
@Override @Override
public Player parseInput(String string) { public Player parseInputUnchecked(String input) {
var player = server.getPlayer(string).orElse(null); var player = server.getPlayer(input).orElse(null);
if (player == null) throw new IllegalArgumentException("Player not online"); if (player == null) throw new IllegalArgumentException("Player not online");
return player; return player;
} }
@Override @Override
public SuggestionProvider<CommandSource> defaultSuggestionProvider() { public SuggestionProvider<CommandSource> getDefaultSuggestionProvider() {
return new PlayerSuggestionProvider(server); return new PlayerSuggestionProvider(server);
} }
} }