will try smth

This commit is contained in:
kento2 2026-04-15 18:39:41 +02:00
parent f5109f9789
commit 7bfbe48729
28 changed files with 150 additions and 111 deletions

6
.idea/gradle.xml generated
View file

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleMigrationSettings" migrationVersion="1" />
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
@ -8,9 +9,14 @@
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/kencommandapi-bukkit" />
<option value="$PROJECT_DIR$/kencommandapi-core" />
</set>
</option>
</GradleProjectSettings>
<GradleProjectSettings>
<option name="externalProjectPath" value="$PROJECT_DIR$/kencommandapi-core" />
</GradleProjectSettings>
</option>
</component>
</project>

2
.idea/misc.xml generated
View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="21" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" project-jdk-name="21" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

View file

@ -1,24 +0,0 @@
plugins {
id("java")
id("io.freefair.lombok") version "9.2.0"
}
group = "de.kentoj"
version = "1.0-SNAPSHOT"
repositories {
mavenCentral()
}
dependencies {
testImplementation(platform("org.junit:junit-bom:5.10.0"))
testImplementation("org.junit.jupiter:junit-jupiter")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
// https://mvnrepository.com/artifact/org.jetbrains/annotations
implementation("org.jetbrains:annotations:26.0.2-1")
}
tasks.test {
useJUnitPlatform()
}

View file

@ -0,0 +1,8 @@
package de.kentoj.kencommandapi;
import de.kentoj.kencommandapi.api.KenCommandApi;
public class BukkitKenCommandApi extends KenCommandApiImpl<> {
private final KenCommandApi<>
}

View file

@ -0,0 +1,47 @@
val scrowToken = providers.gradleProperty("scrowMavenToken")
.orElse(providers.environmentVariable("SCROW_MAVEN_TOKEN")).get()
plugins {
id("java")
id("maven-publish")
id("io.freefair.lombok") version "9.2.0"
}
group = "de.kentoj"
version = "1.0-SNAPSHOT"
repositories {
mavenCentral()
}
dependencies {
// https://mvnrepository.com/artifact/org.jetbrains/annotations
implementation("org.jetbrains:annotations:26.0.2-1")
}
publishing {
publications {
create<MavenPublication>("KenCommandAPI") {
groupId = project.group.toString()
artifactId = project.name
version = project.version.toString()
from(components["java"])
}
}
repositories {
maven {
name = "scrow"
url = uri("http://forge.kentoj.de/api/packages/scrow/maven")
isAllowInsecureProtocol = true
credentials(HttpHeaderCredentials::class) {
name = "Authorization"
value = "token $scrowToken"
}
authentication {
create<HttpHeaderAuthentication>("header")
}
}
}
}

View file

@ -1,8 +1,8 @@
package de.kencommand;
package de.kentoj.kencommandapi;
import de.kencommand.api.KenCommandApi;
import de.kencommand.api.structure.argument.types.IntegerArgumentType;
import de.kencommand.impl.KenCommandApiImpl;
import de.kentoj.kencommandapi.api.KenCommandApi;
import de.kentoj.kencommandapi.api.structure.argument.types.IntegerArgumentType;
import de.kentoj.kencommandapi.impl.KenCommandApiImpl;
import java.io.PrintStream;
@ -22,6 +22,6 @@ public class Main {
addNode.addArgument(api.createArgument("amount", IntegerArgumentType.create()));
root.addLiteral(addNode);
api.invoke(root, System.out, new String[] { "add", "100" });
api.invoke(root, System.out, new String[]{"add", "100"});
}
}

View file

@ -0,0 +1,14 @@
package de.kentoj.kencommandapi.api;
import de.kentoj.kencommandapi.api.structure.argument.ArgumentType;
import de.kentoj.kencommandapi.api.structure.argument.CommandArgument;
import de.kentoj.kencommandapi.api.structure.node.CommandNode;
public interface KenCommandApi<T> {
CommandNode<T> createNode(String... name);
<V> CommandArgument<T, V> createArgument(String id, ArgumentType<V> type);
void invoke(CommandNode<T> node, T sender, String[] args);
}

View file

@ -1,4 +1,4 @@
package de.kencommand.api.processing;
package de.kentoj.kencommandapi.api.processing;
public interface CommandContext<T> {

View file

@ -0,0 +1,6 @@
package de.kentoj.kencommandapi.api.processing;
public interface CommandExecutor<S> {
void execute(CommandContext<T> ctx);
}

View file

@ -0,0 +1,10 @@
package de.kentoj.kencommandapi.api.processing;
import de.kentoj.kencommandapi.api.structure.argument.CommandArgument;
public interface ParsedArgument<T, V> {
V getValue();
CommandArgument<T, V> getArgument();
}

View file

@ -1,4 +1,4 @@
package de.kencommand.api.structure.argument;
package de.kentoj.kencommandapi.api.structure.argument;
public interface ArgumentType<V> {

View file

@ -1,4 +1,4 @@
package de.kencommand.api.structure.argument;
package de.kentoj.kencommandapi.api.structure.argument;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

View file

@ -1,6 +1,6 @@
package de.kencommand.api.structure.argument;
package de.kentoj.kencommandapi.api.structure.argument;
import de.kencommand.api.processing.CommandContext;
import de.kentoj.kencommandapi.api.processing.CommandContext;
import java.util.Set;

View file

@ -1,7 +1,7 @@
package de.kencommand.api.structure.argument.suggestion;
package de.kentoj.kencommandapi.api.structure.argument.suggestion;
import de.kencommand.api.processing.CommandContext;
import de.kencommand.api.structure.argument.SuggestionProvider;
import de.kentoj.kencommandapi.api.processing.CommandContext;
import de.kentoj.kencommandapi.api.structure.argument.SuggestionProvider;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;

View file

@ -1,8 +1,8 @@
package de.kencommand.api.structure.argument.types;
package de.kentoj.kencommandapi.api.structure.argument.types;
import de.kencommand.api.structure.argument.ArgumentType;
import de.kencommand.api.structure.argument.SuggestionProvider;
import de.kencommand.api.structure.argument.suggestion.NoSuggestionProvider;
import de.kentoj.kencommandapi.api.structure.argument.ArgumentType;
import de.kentoj.kencommandapi.api.structure.argument.SuggestionProvider;
import de.kentoj.kencommandapi.api.structure.argument.suggestion.NoSuggestionProvider;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;

View file

@ -1,6 +1,6 @@
package de.kencommand.api.structure.node;
package de.kentoj.kencommandapi.api.structure.node;
import de.kencommand.api.structure.argument.CommandArgument;
import de.kentoj.kencommandapi.api.structure.argument.CommandArgument;
import java.util.Set;

View file

@ -1,6 +1,6 @@
package de.kencommand.api.structure.node;
package de.kentoj.kencommandapi.api.structure.node;
import de.kencommand.api.processing.CommandExecutor;
import de.kentoj.kencommandapi.api.processing.CommandExecutor;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

View file

@ -1,4 +1,4 @@
package de.kencommand.api.structure.node;
package de.kentoj.kencommandapi.api.structure.node;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

View file

@ -1,14 +1,14 @@
package de.kencommand.impl;
package de.kentoj.kencommandapi.impl;
import de.kencommand.api.KenCommandApi;
import de.kencommand.api.processing.ParsedArgument;
import de.kencommand.api.structure.argument.ArgumentType;
import de.kencommand.api.structure.argument.CommandArgument;
import de.kencommand.api.structure.node.CommandNode;
import de.kencommand.impl.processing.CommandContextImpl;
import de.kencommand.impl.processing.ParsedArgumentImpl;
import de.kencommand.impl.structure.argument.CommandArgumentImpl;
import de.kencommand.impl.structure.node.CommandNodeImpl;
import de.kentoj.kencommandapi.api.KenCommandApi;
import de.kentoj.kencommandapi.api.processing.ParsedArgument;
import de.kentoj.kencommandapi.api.structure.argument.ArgumentType;
import de.kentoj.kencommandapi.api.structure.argument.CommandArgument;
import de.kentoj.kencommandapi.api.structure.node.CommandNode;
import de.kentoj.kencommandapi.impl.processing.CommandContextImpl;
import de.kentoj.kencommandapi.impl.processing.ParsedArgumentImpl;
import de.kentoj.kencommandapi.impl.structure.argument.CommandArgumentImpl;
import de.kentoj.kencommandapi.impl.structure.node.CommandNodeImpl;
import lombok.RequiredArgsConstructor;
import java.util.Arrays;

View file

@ -1,7 +1,7 @@
package de.kencommand.impl.processing;
package de.kentoj.kencommandapi.impl.processing;
import de.kencommand.api.processing.CommandContext;
import de.kencommand.api.processing.ParsedArgument;
import de.kentoj.kencommandapi.api.processing.CommandContext;
import de.kentoj.kencommandapi.api.processing.ParsedArgument;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

View file

@ -0,0 +1,11 @@
package de.kentoj.kencommandapi.impl.processing;
import de.kentoj.kencommandapi.api.processing.ParsedArgument;
import de.kentoj.kencommandapi.api.structure.argument.CommandArgument;
import lombok.Data;
@Data
public class ParsedArgumentImpl<T, V> implements ParsedArgument<T, V> {
final V value;
final CommandArgument<T, V> argument;
}

View file

@ -1,8 +1,8 @@
package de.kencommand.impl.structure.argument;
package de.kentoj.kencommandapi.impl.structure.argument;
import de.kencommand.api.structure.argument.ArgumentType;
import de.kencommand.api.structure.argument.CommandArgument;
import de.kencommand.api.structure.argument.SuggestionProvider;
import de.kentoj.kencommandapi.api.structure.argument.ArgumentType;
import de.kentoj.kencommandapi.api.structure.argument.CommandArgument;
import de.kentoj.kencommandapi.api.structure.argument.SuggestionProvider;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.Setter;

View file

@ -1,9 +1,8 @@
package de.kencommand.impl.structure.node;
package de.kentoj.kencommandapi.impl.structure.node;
import de.kencommand.api.processing.CommandExecutor;
import de.kencommand.api.structure.argument.CommandArgument;
import de.kencommand.api.structure.node.CommandNode;
import de.kencommand.api.structure.node.LiteralNode;
import de.kentoj.kencommandapi.api.processing.CommandExecutor;
import de.kentoj.kencommandapi.api.structure.argument.CommandArgument;
import de.kentoj.kencommandapi.api.structure.node.CommandNode;
import lombok.Getter;
import lombok.Setter;
import org.jetbrains.annotations.NotNull;

View file

@ -1 +1,4 @@
rootProject.name = "KenCommandAPI"
include("kencommandapi-core")
include("kencommandapi-bukkit")

View file

@ -1,14 +0,0 @@
package de.kencommand.api;
import de.kencommand.api.structure.argument.ArgumentType;
import de.kencommand.api.structure.argument.CommandArgument;
import de.kencommand.api.structure.node.CommandNode;
public interface KenCommandApi<T> {
CommandNode<T> createNode(String... name);
<V> CommandArgument<T, V> createArgument(String id, ArgumentType<V> type);
void invoke(CommandNode<T> node, T sender, String[] args);
}

View file

@ -1,6 +0,0 @@
package de.kencommand.api.processing;
public interface CommandExecutor<T> {
void execute(CommandContext<T> ctx);
}

View file

@ -1,10 +0,0 @@
package de.kencommand.api.processing;
import de.kencommand.api.structure.argument.CommandArgument;
public interface ParsedArgument<T, V> {
V getValue();
CommandArgument<T, V> getArgument();
}

View file

@ -1,11 +0,0 @@
package de.kencommand.impl.processing;
import de.kencommand.api.processing.ParsedArgument;
import de.kencommand.api.structure.argument.CommandArgument;
import lombok.Data;
@Data
public class ParsedArgumentImpl<T, V> implements ParsedArgument<T, V> {
final V value;
final CommandArgument<T, V> argument;
}