Skip to content

Commit a6492a8

Browse files
committed
Misc. build updates
1 parent 0baa0af commit a6492a8

7 files changed

Lines changed: 18 additions & 16 deletions

File tree

cloud-bukkit/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ dependencies {
99
compileOnly(libs.bukkit)
1010
compileOnly(libs.commodore)
1111
testImplementation(libs.bukkit)
12+
testCompileOnly(libs.brigadier)
1213
javadocLinks(libs.paperApi) {
1314
isTransitive = false
1415
}

cloud-bukkit/src/main/java/org/incendo/cloud/bukkit/parser/selector/SelectorUtils.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,15 +138,15 @@ public Object apply(
138138
private abstract static class SelectorParser<C, T> implements ArgumentParser.FutureArgumentParser<C, T>, SelectorMapper<T>,
139139
SuggestionProvider<C> {
140140

141-
protected static final Supplier<Object> NO_PLAYERS_EXCEPTION_TYPE =
141+
static final Supplier<Object> NO_PLAYERS_EXCEPTION_TYPE =
142142
Suppliers.memoize(() -> findExceptionType("argument.entity.notfound.player"));
143-
protected static final Supplier<Object> NO_ENTITIES_EXCEPTION_TYPE =
143+
static final Supplier<Object> NO_ENTITIES_EXCEPTION_TYPE =
144144
Suppliers.memoize(() -> findExceptionType("argument.entity.notfound.entity"));
145145

146146
private final @Nullable ArgumentParser<C, T> modernParser;
147147

148148
// Hide brigadier references in inner class
149-
protected static final class Thrower {
149+
static final class Thrower {
150150

151151
private final Object type;
152152

@@ -159,14 +159,14 @@ void throwIt() {
159159
}
160160
}
161161

162-
protected SelectorParser(
162+
SelectorParser(
163163
final boolean single,
164164
final boolean playersOnly
165165
) {
166166
this.modernParser = createModernParser(single, playersOnly, this);
167167
}
168168

169-
protected CompletableFuture<ArgumentParseResult<T>> legacyParse(
169+
CompletableFuture<ArgumentParseResult<T>> legacyParse(
170170
final CommandContext<C> commandContext,
171171
final CommandInput commandInput
172172
) {
@@ -176,7 +176,7 @@ protected CompletableFuture<ArgumentParseResult<T>> legacyParse(
176176
));
177177
}
178178

179-
protected @NonNull Iterable<@NonNull Suggestion> legacySuggestions(
179+
@NonNull Iterable<@NonNull Suggestion> legacySuggestions(
180180
final CommandContext<C> commandContext,
181181
final CommandInput input
182182
) {

cloud-bukkit/src/test/java/org/incendo/cloud/bukkit/parser/EnchantmentArgumentTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ static void setupEnchantments() throws Exception {
6666
try {
6767
Enchantment.registerEnchantment(mockEnchantment);
6868
} catch (final Exception ignored) {
69+
// ignore
6970
}
7071
}
7172
}

examples/example-bukkit/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ dependencies {
1212
implementation(libs.cloud.annotations)
1313
implementation(project(":cloud-minecraft-extras"))
1414
implementation(projects.cloudPaperSignedArguments)
15+
compileOnly(libs.brigadier)
1516
/* Extras */
1617
implementation(libs.adventurePlatformBukkit)
1718
implementation(libs.minimessage)

examples/example-bukkit/src/main/java/org/incendo/cloud/examples/bukkit/annotations/feature/BuilderModifierExample.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,10 @@ public GameModePredicate(final @NonNull GameMode requiredGameMode) {
7070

7171
@Override
7272
public boolean test(final @NonNull CommandSender commandSender) {
73-
if (!(commandSender instanceof Player)) {
73+
if (!(commandSender instanceof Player p)) {
7474
return true;
7575
}
76-
return ((Player) commandSender).getGameMode() == this.requiredGameMode;
76+
return p.getGameMode() == this.requiredGameMode;
7777
}
7878
}
7979

examples/example-bukkit/src/main/java/org/incendo/cloud/examples/bukkit/feature/ProcessorExample.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,13 @@ public void accept(final @NonNull CommandPostprocessingContext<CommandSender> co
8282
return;
8383
}
8484
final CommandSender sender = context.commandContext().sender();
85-
if (!(sender instanceof Player)) {
85+
if (!(sender instanceof Player p)) {
8686
return;
8787
}
88-
final Player player = (Player) sender;
89-
if (player.getInventory().getBoots() != null) {
88+
if (p.getInventory().getBoots() != null) {
9089
return;
9190
}
92-
player.sendMessage("You need to wear boots to execute this command!");
91+
p.sendMessage("You need to wear boots to execute this command!");
9392
ConsumerService.interrupt();
9493
}
9594
}

gradle/libs.versions.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[versions]
22
# build logic
3-
cloud-build-logic = "0.0.17"
3+
cloud-build-logic = "0.0.19"
44
checkstyle = "10.12.5"
55
stylecheck = "0.2.1"
6-
ktlint = "0.50.0"
7-
errorprone = "2.31.0"
6+
ktlint = "1.8.0"
7+
errorprone = "2.49.0"
88
run-task = "3.0.2"
99

1010
cloudCore = "2.0.0"
@@ -72,7 +72,7 @@ cloud-buildLogic-rootProject-spotless = { id = "org.incendo.cloud-build-logic.sp
7272
run-paper = { id = "xyz.jpenilla.run-paper", version.ref = "run-task" }
7373
run-velocity = { id = "xyz.jpenilla.run-velocity", version.ref = "run-task" }
7474
run-waterfall = { id = "xyz.jpenilla.run-waterfall", version.ref = "run-task" }
75-
shadow = { id = "com.gradleup.shadow", version = "9.3.0" }
75+
shadow = { id = "com.gradleup.shadow", version = "9.4.1" }
7676

7777
[bundles]
7878
immutables = ["immutables", "immutablesAnnotate"]

0 commit comments

Comments
 (0)