Skip to content

Commit

Permalink
feature: update to cloud v2
Browse files Browse the repository at this point in the history
This is still a W.I.P. as Cloud v2 is nowhere near ready to be released.
  • Loading branch information
Citymonstret committed Jan 25, 2024
1 parent b6a6878 commit c4f2d3b
Show file tree
Hide file tree
Showing 140 changed files with 1,185 additions and 1,248 deletions.
7 changes: 7 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ java {

repositories {
mavenCentral()
maven("https://oss.sonatype.org/content/repositories/snapshots/") {
name = "sonatypeOssSnapshots"
mavenContent {
snapshotsOnly()
}
}
maven { url = uri("https://repo.papermc.io/repository/maven-public/") }
}

Expand Down Expand Up @@ -82,6 +88,7 @@ tasks {
compileJava {
options.compilerArgs.addAll(arrayOf("-Xmaxerrs", "1000"))
options.compilerArgs.add("-Xlint:all")
options.compilerArgs.add("-parameters")
for (disabledLint in arrayOf("processing", "path", "fallthrough", "serial"))
options.compilerArgs.add("-Xlint:$disabledLint")
options.isDeprecation = true
Expand Down
11 changes: 6 additions & 5 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
annotations = "24.1.0"

# Cloud command system
cloud = "1.8.4"
cloud = "2.0.0-beta.1"
cloudMinecraft = "2.0.0-SNAPSHOT"

# Gradle plugins
shadow = "8.1.1"
Expand All @@ -19,10 +20,10 @@ runPaper = "2.2.2"
annotations = { group = "org.jetbrains", name = "annotations", version.ref = "annotations" }

# Cloud command system
cloudcore = { group = "cloud.commandframework", name = "cloud-core", version.ref = "cloud" }
cloudannotations = { group = "cloud.commandframework", name = "cloud-annotations", version.ref = "cloud" }
cloudbukkit = { group = "cloud.commandframework", name = "cloud-bukkit", version.ref = "cloud" }
cloudpaper = { group = "cloud.commandframework", name = "cloud-paper", version.ref = "cloud" }
cloudcore = { group = "org.incendo", name = "cloud-core", version.ref = "cloud" }
cloudannotations = { group = "org.incendo", name = "cloud-annotations", version.ref = "cloudMinecraft" }
cloudbukkit = { group = "org.incendo", name = "cloud-bukkit", version.ref = "cloudMinecraft" }
cloudpaper = { group = "org.incendo", name = "cloud-paper", version.ref = "cloudMinecraft" }

[plugins]
shadow = { id = "com.github.johnrengelman.shadow", version.ref = "shadow" }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.thevoxelbox.voxelsniper.brush.type;

import cloud.commandframework.annotations.Argument;
import cloud.commandframework.annotations.CommandMethod;
import cloud.commandframework.annotations.CommandPermission;
import org.incendo.cloud.annotations.Argument;
import org.incendo.cloud.annotations.Command;
import org.incendo.cloud.annotations.Permission;
import com.fastasyncworldedit.core.configuration.Caption;
import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.math.BlockVector3;
Expand All @@ -18,8 +18,8 @@
import org.jetbrains.annotations.NotNull;

@RequireToolkit
@CommandMethod(value = "brush|b biome|bio")
@CommandPermission("voxelsniper.brush.biome")
@Command(value = "brush|b biome|bio")
@Permission("voxelsniper.brush.biome")
public class BiomeBrush extends AbstractBrush {

private static final BiomeType DEFAULT_BIOME_TYPE = BiomeTypes.PLAINS;
Expand All @@ -31,21 +31,21 @@ public void loadProperties() {
this.biomeType = (BiomeType) getRegistryProperty("default-biome-type", BiomeType.REGISTRY, DEFAULT_BIOME_TYPE);
}

@CommandMethod("")
@Command("")
public void onBrush(
final @NotNull Snipe snipe
) {
super.onBrushCommand(snipe);
}

@CommandMethod("info")
@Command("info")
public void onBrushInfo(
final @NotNull Snipe snipe
) {
super.onBrushInfoCommand(snipe, Caption.of("voxelsniper.brush.biome.info"));
}

@CommandMethod("list")
@Command("list")
public void onBrushList(
final @NotNull Snipe snipe
) {
Expand All @@ -60,7 +60,7 @@ public void onBrushList(
));
}

@CommandMethod("<biome-type>")
@Command("<biome-type>")
public void onBrushBiometype(
final @NotNull Snipe snipe,
final @NotNull @Argument("biome-type") BiomeType biomeType
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.thevoxelbox.voxelsniper.brush.type;

import cloud.commandframework.annotations.CommandMethod;
import cloud.commandframework.annotations.CommandPermission;
import org.incendo.cloud.annotations.Command;
import org.incendo.cloud.annotations.Permission;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.world.block.BlockCategories;
import com.sk89q.worldedit.world.block.BlockType;
Expand All @@ -14,8 +14,8 @@
import org.jetbrains.annotations.NotNull;

@RequireToolkit
@CommandMethod(value = "brush|b block_reset|blockreset|br")
@CommandPermission("voxelsniper.brush.blockreset")
@Command(value = "brush|b block_reset|blockreset|br")
@Permission("voxelsniper.brush.blockreset")
public class BlockResetBrush extends AbstractBrush {

private static final MaterialSet DENIED_UPDATES = MaterialSet.builder()
Expand All @@ -32,7 +32,7 @@ public class BlockResetBrush extends AbstractBrush {
.add(BlockTypes.COMPARATOR)
.build();

@CommandMethod("")
@Command("")
public void onBrush(
final @NotNull Snipe snipe
) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.thevoxelbox.voxelsniper.brush.type;

import cloud.commandframework.annotations.CommandMethod;
import cloud.commandframework.annotations.CommandPermission;
import org.incendo.cloud.annotations.Command;
import org.incendo.cloud.annotations.Permission;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.world.block.BlockCategories;
import com.sk89q.worldedit.world.block.BlockState;
Expand All @@ -27,8 +27,8 @@
* brushes.
*/
@RequireToolkit
@CommandMethod(value = "brush|b block_reset_surface|blockresetsurface|brs")
@CommandPermission("voxelsniper.brush.blockresetsurface")
@Command(value = "brush|b block_reset_surface|blockresetsurface|brs")
@Permission("voxelsniper.brush.blockresetsurface")
public class BlockResetSurfaceBrush extends AbstractBrush {

private static final MaterialSet DENIED_UPDATES = MaterialSet.builder()
Expand All @@ -46,7 +46,7 @@ public class BlockResetSurfaceBrush extends AbstractBrush {
.add(BlockTypes.COMPARATOR)
.build();

@CommandMethod("")
@Command("")
public void onBrush(
final @NotNull Snipe snipe
) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.thevoxelbox.voxelsniper.brush.type;

import cloud.commandframework.annotations.Argument;
import cloud.commandframework.annotations.CommandMethod;
import cloud.commandframework.annotations.CommandPermission;
import cloud.commandframework.annotations.specifier.Liberal;
import org.incendo.cloud.annotations.Argument;
import org.incendo.cloud.annotations.Command;
import org.incendo.cloud.annotations.Permission;
import org.incendo.cloud.annotation.specifier.Liberal;
import com.fastasyncworldedit.core.configuration.Caption;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.world.block.BlockTypes;
Expand All @@ -16,27 +16,27 @@
import org.jetbrains.annotations.NotNull;

@RequireToolkit
@CommandMethod(value = "brush|b clean_snow|cleansnow|cls")
@CommandPermission("voxelsniper.brush.cleansnow")
@Command(value = "brush|b clean_snow|cleansnow|cls")
@Permission("voxelsniper.brush.cleansnow")
public class CleanSnowBrush extends AbstractBrush {

private boolean trueCircle;

@CommandMethod("")
@Command("")
public void onBrush(
final @NotNull Snipe snipe
) {
super.onBrushCommand(snipe);
}

@CommandMethod("info")
@Command("info")
public void onBrushInfo(
final @NotNull Snipe snipe
) {
super.onBrushInfoCommand(snipe, Caption.of("voxelsniper.brush.clean-snow.info"));
}

@CommandMethod("<true-circle>")
@Command("<true-circle>")
public void onBrushTruecircle(
final @NotNull Snipe snipe,
final @Argument("true-circle") @Liberal boolean trueCircle
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.thevoxelbox.voxelsniper.brush.type;

import cloud.commandframework.annotations.Argument;
import cloud.commandframework.annotations.CommandMethod;
import cloud.commandframework.annotations.CommandPermission;
import cloud.commandframework.annotations.specifier.Liberal;
import org.incendo.cloud.annotations.Argument;
import org.incendo.cloud.annotations.Command;
import org.incendo.cloud.annotations.Permission;
import org.incendo.cloud.annotation.specifier.Liberal;
import com.fastasyncworldedit.core.configuration.Caption;
import com.fastasyncworldedit.core.util.TaskManager;
import com.sk89q.worldedit.math.BlockVector3;
Expand All @@ -20,27 +20,27 @@
import org.jetbrains.annotations.NotNull;

@RequireToolkit
@CommandMethod(value = "brush|b comet|meteor|com|met")
@CommandPermission("voxelsniper.brush.comet")
@Command(value = "brush|b comet|meteor|com|met")
@Permission("voxelsniper.brush.comet")
public class CometBrush extends AbstractBrush {

private boolean useBigBalls;

@CommandMethod("")
@Command("")
public void onBrush(
final @NotNull Snipe snipe
) {
super.onBrushCommand(snipe);
}

@CommandMethod("info")
@Command("info")
public void onBrushInfo(
final @NotNull Snipe snipe
) {
super.onBrushInfoCommand(snipe, Caption.of("voxelsniper.brush.comet.info"));
}

@CommandMethod("<use-big-balls>")
@Command("<use-big-balls>")
public void onBrushBigballs(
final @NotNull Snipe snipe,
final @Argument("use-big-balls") @Liberal boolean useBigBalls
Expand All @@ -54,14 +54,14 @@ public void onBrushBigballs(
));
}

@CommandMethod("balls big")
@Command("balls big")
public void onBrushBallsBig(
final @NotNull Snipe snipe
) {
this.onBrushBigballs(snipe, true);
}

@CommandMethod("balls small")
@Command("balls small")
public void onBrushBallsSmall(
final @NotNull Snipe snipe
) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.thevoxelbox.voxelsniper.brush.type;

import cloud.commandframework.annotations.CommandMethod;
import cloud.commandframework.annotations.CommandPermission;
import org.incendo.cloud.annotations.Command;
import org.incendo.cloud.annotations.Permission;
import com.fastasyncworldedit.core.configuration.Caption;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.world.block.BlockState;
Expand All @@ -14,8 +14,8 @@
import org.jetbrains.annotations.NotNull;

@RequireToolkit
@CommandMethod(value = "brush|b copy_pasta|copypasta|cp")
@CommandPermission("voxelsniper.brush.copypasta")
@Command(value = "brush|b copy_pasta|copypasta|cp")
@Permission("voxelsniper.brush.copypasta")
public class CopyPastaBrush extends AbstractBrush {

private static final int BLOCK_LIMIT = 10000;
Expand All @@ -38,21 +38,21 @@ public void loadProperties() {
this.blockLimit = getIntegerProperty("block-limit", BLOCK_LIMIT);
}

@CommandMethod("")
@Command("")
public void onBrush(
final @NotNull Snipe snipe
) {
super.onBrushCommand(snipe);
}

@CommandMethod("info")
@Command("info")
public void onBrushInfo(
final @NotNull Snipe snipe
) {
super.onBrushInfoCommand(snipe, Caption.of("voxelsniper.brush.copy-pasta.info"));
}

@CommandMethod("air")
@Command("air")
public void onBrushAir(
final @NotNull Snipe snipe
) {
Expand All @@ -75,28 +75,28 @@ private void onBrushPivotCommand(Snipe snipe, int pivot) {
));
}

@CommandMethod("0")
@Command("0")
public void onBrush0(
final @NotNull Snipe snipe
) {
this.onBrushPivotCommand(snipe, 0);
}

@CommandMethod("90")
@Command("90")
public void onBrush90(
final @NotNull Snipe snipe
) {
this.onBrushPivotCommand(snipe, 90);
}

@CommandMethod("180")
@Command("180")
public void onBrush180(
final @NotNull Snipe snipe
) {
this.onBrushPivotCommand(snipe, 180);
}

@CommandMethod("270")
@Command("270")
public void onBrush270(
final @NotNull Snipe snipe
) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.thevoxelbox.voxelsniper.brush.type;

import cloud.commandframework.annotations.CommandMethod;
import cloud.commandframework.annotations.CommandPermission;
import org.incendo.cloud.annotations.Command;
import org.incendo.cloud.annotations.Permission;
import com.fastasyncworldedit.core.configuration.Caption;
import com.sk89q.worldedit.function.pattern.Pattern;
import com.sk89q.worldedit.math.BlockVector3;
Expand All @@ -17,11 +17,11 @@
import java.util.List;

@RequireToolkit
@CommandMethod(value = "brush|b dome|do")
@CommandPermission("voxelsniper.brush.dome")
@Command(value = "brush|b dome|do")
@Permission("voxelsniper.brush.dome")
public class DomeBrush extends AbstractBrush {

@CommandMethod("")
@Command("")
public void onBrush(
final @NotNull Snipe snipe
) {
Expand Down
Loading

0 comments on commit c4f2d3b

Please sign in to comment.