use LiteralMeta instead of permission-less literal-names for subLiterals
This commit is contained in:
parent
f18ce1c429
commit
77ea59cc92
4 changed files with 25 additions and 2 deletions
|
|
@ -23,7 +23,7 @@ public final class DynamicLiteralBuilder<C extends CommandContext<C>> extends Li
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DynamicLiteralBuilder<C> withSubLiteralNames(Supplier<List<LiteralMeta>> names) {
|
public DynamicLiteralBuilder<C> withSubLiteralMetas(Supplier<List<LiteralMeta>> names) {
|
||||||
subLiteralMetaSupplier = names;
|
subLiteralMetaSupplier = names;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,20 @@
|
||||||
package site.lab0x13.scrow.commands.model.literal;
|
package site.lab0x13.scrow.commands.model.literal;
|
||||||
|
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public interface LiteralMeta {
|
public interface LiteralMeta {
|
||||||
|
|
||||||
|
static LiteralMeta of(List<String> names, @Nullable String permission) {
|
||||||
|
return new LiteralMetaImpl(names, permission);
|
||||||
|
}
|
||||||
|
|
||||||
|
static LiteralMeta of(String... names) {
|
||||||
|
return of(Arrays.asList(names), null);
|
||||||
|
}
|
||||||
|
|
||||||
List<String> names();
|
List<String> names();
|
||||||
|
|
||||||
String permission();
|
String permission();
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
package site.lab0x13.scrow.commands.model.literal;
|
||||||
|
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
record LiteralMetaImpl(
|
||||||
|
List<String> names,
|
||||||
|
@Nullable String permission
|
||||||
|
) implements LiteralMeta {
|
||||||
|
}
|
||||||
2
defs.bzl
2
defs.bzl
|
|
@ -1,2 +1,2 @@
|
||||||
GROUP = "site.lab0x13.scrow"
|
GROUP = "site.lab0x13.scrow"
|
||||||
VERSION = "1.3.0"
|
VERSION = "1.3.1"
|
||||||
Loading…
Add table
Add a link
Reference in a new issue