Skip to content

Commit

Permalink
Update CommandBuilder api and Meta api. Release 3.0.0-BETA-pre21
Browse files Browse the repository at this point in the history
  • Loading branch information
Rollczi committed Oct 5, 2023
1 parent b9b5982 commit 286a766
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 11 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ Framework Core
<dependency>
<groupId>dev.rollczi</groupId>
<artifactId>litecommands-core</artifactId>
<version>3.0.0-BETA-pre20</version>
<version>3.0.0-BETA-pre21</version>
</dependency>
```

```groovy
implementation 'dev.rollczi:litecommands-core:3.0.0-BETA-pre20'
implementation 'dev.rollczi:litecommands-core:3.0.0-BETA-pre21'
```

### First Simple Command
Expand Down Expand Up @@ -85,12 +85,12 @@ Add this to your dependencies if you want to use ready-made implementation for v
<dependency>
<groupId>dev.rollczi</groupId>
<artifactId>litecommands-velocity</artifactId>
<version>3.0.0-BETA-pre20</version>
<version>3.0.0-BETA-pre21</version>
</dependency>
```

```groovy
implementation 'dev.rollczi:litecommands-velocity:3.0.0-BETA-pre20'
implementation 'dev.rollczi:litecommands-velocity:3.0.0-BETA-pre21'
```

#### Add -parameters to your compiler to use all features of LiteCommands
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/litecommands-publish.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
}

group = "dev.rollczi"
version = "3.0.0-BETA-pre20"
version = "3.0.0-BETA-pre21"

java {
withSourcesJar()
Expand Down
4 changes: 2 additions & 2 deletions examples/bukkit-adventure-platform/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ repositories {
dependencies {
compileOnly("org.spigotmc:spigot-api:1.20.2-R0.1-SNAPSHOT")

// implementation("dev.rollczi:litecommands-bukkit:3.0.0-BETA-pre20") // <-- uncomment in your project
// implementation("dev.rollczi:litecommands-adventure-platform:3.0.0-BETA-pre20") // <-- uncomment in your project
// implementation("dev.rollczi:litecommands-bukkit:3.0.0-BETA-pre21") // <-- uncomment in your project
// implementation("dev.rollczi:litecommands-adventure-platform:3.0.0-BETA-pre21") // <-- uncomment in your project
implementation("net.kyori:adventure-platform-bukkit:4.3.0")
implementation("net.kyori:adventure-text-minimessage:4.14.0")

Expand Down
4 changes: 2 additions & 2 deletions examples/bukkit-chatgpt/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ repositories {
dependencies {
compileOnly("org.spigotmc:spigot-api:1.20.2-R0.1-SNAPSHOT")

// implementation("dev.rollczi:litecommands-bukkit:3.0.0-BETA-pre20") // <-- uncomment in your project
// implementation("dev.rollczi:litecommands-chatgpt:3.0.0-BETA-pre20") // <-- uncomment in your project
// implementation("dev.rollczi:litecommands-bukkit:3.0.0-BETA-pre21") // <-- uncomment in your project
// implementation("dev.rollczi:litecommands-chatgpt:3.0.0-BETA-pre21") // <-- uncomment in your project
implementation(project(":litecommands-bukkit")) // don't use this line in your build.gradle
implementation(project(":litecommands-chatgpt")) // don't use this line in your build.gradle
}
Expand Down
2 changes: 1 addition & 1 deletion examples/bukkit/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ repositories {
dependencies {
compileOnly("org.spigotmc:spigot-api:1.20.2-R0.1-SNAPSHOT")

// implementation("dev.rollczi:litecommands-bukkit:3.0.0-BETA-pre20") // <-- uncomment in your project
// implementation("dev.rollczi:litecommands-bukkit:3.0.0-BETA-pre21") // <-- uncomment in your project
implementation(project(":litecommands-bukkit")) // don't use this line in your build.gradle
}

Expand Down
2 changes: 1 addition & 1 deletion examples/velocity/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ dependencies {
compileOnly("com.velocitypowered:velocity-api:3.2.0-SNAPSHOT")
annotationProcessor("com.velocitypowered:velocity-api:3.2.0-SNAPSHOT")

// implementation("dev.rollczi:litecommands-velocity:3.0.0-BETA-pre20") // <-- uncomment in your project
// implementation("dev.rollczi:litecommands-velocity:3.0.0-BETA-pre21") // <-- uncomment in your project
implementation(project(":litecommands-velocity")) // don't use this line in your build.gradle
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ public interface CommandBuilder<SENDER> extends Scopeable, MetaHolder {
@NotNull
CommandBuilder<SENDER> enable();

@NotNull
CommandBuilder<SENDER> enabled(boolean enabled);

@NotNull
CommandBuilder<SENDER> disable();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@ public boolean hasSimilarNames(CommandBuilder<SENDER> context) {
return this;
}

@Override
public @NotNull CommandBuilder<SENDER> enabled(boolean enabled) {
this.enabled = enabled;
return this;
}

@Override
public @NotNull CommandBuilder<SENDER> disable() {
this.enabled = false;
Expand Down
7 changes: 7 additions & 0 deletions litecommands-core/src/dev/rollczi/litecommands/meta/Meta.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.function.UnaryOperator;

@SuppressWarnings("rawtypes")
public interface Meta {
Expand Down Expand Up @@ -37,6 +38,12 @@ default <E> MetaListEditor<E> listEditor(MetaKey<List<E>> key) {
return new MetaListEditor<>(this.get(key), this, key);
}

default <E> Meta list(MetaKey<List<E>> key, UnaryOperator<MetaListEditor<E>> operator) {
MetaListEditor<E> editor = listEditor(key);

return operator.apply(editor).apply();
}

Meta apply(Meta meta);

Meta copy();
Expand Down

0 comments on commit 286a766

Please sign in to comment.