diff --git a/build.gradle.kts b/build.gradle.kts index 215fa916c..d09530656 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -13,7 +13,7 @@ plugins { version = System.getenv("MINESTOM_VERSION") ?: "dev" val channel = System.getenv("MINESTOM_CHANNEL") ?: "local" // local, snapshot, release -val shortDescription = "1.20.4 Lightweight Minecraft server" +val shortDescription = "1.20.6 Lightweight Minecraft server" allprojects { apply(plugin = "java") @@ -24,7 +24,6 @@ allprojects { repositories { mavenCentral() - maven(url = "https://jitpack.io") } configurations.all { diff --git a/demo/src/main/java/net/minestom/demo/Main.java b/demo/src/main/java/net/minestom/demo/Main.java index f0b105fe0..39c157b09 100644 --- a/demo/src/main/java/net/minestom/demo/Main.java +++ b/demo/src/main/java/net/minestom/demo/Main.java @@ -80,6 +80,7 @@ public class Main { commandManager.register(new WeatherCommand()); commandManager.register(new PotionCommand()); commandManager.register(new CookieCommand()); + commandManager.register(new WorldBorderCommand()); commandManager.setUnknownCommandCallback((sender, command) -> sender.sendMessage(Component.text("Unknown command", NamedTextColor.RED))); diff --git a/src/main/java/net/minestom/server/instance/WorldBorder.java b/src/main/java/net/minestom/server/instance/WorldBorder.java index 8f4a3ac7e..c848f5fff 100644 --- a/src/main/java/net/minestom/server/instance/WorldBorder.java +++ b/src/main/java/net/minestom/server/instance/WorldBorder.java @@ -20,7 +20,8 @@ import org.jetbrains.annotations.NotNull; * @param warningTime the length of time the warning indicator * is displayed * @param dimensionTeleportBoundary restricts the distance travelled when entering - * this world from another dimension (has no use) + * this world from another dimension (should be at + * least the diameter of the world border) */ public record WorldBorder(double diameter, double centerX, double centerZ, int warningDistance, int warningTime, int dimensionTeleportBoundary) { public static final WorldBorder DEFAULT_BORDER = new WorldBorder(ServerFlag.WORLD_BORDER_SIZE * 2, 0, 0, 5, 15, ServerFlag.WORLD_BORDER_SIZE); @@ -32,6 +33,10 @@ public record WorldBorder(double diameter, double centerX, double centerZ, int w Check.argCondition(diameter < 0, "Diameter should be >= 0"); } + public WorldBorder(double diameter, double centerX, double centerZ, int warningDistance, int warningTime) { + this(diameter, centerX, centerZ, warningDistance, warningTime, ServerFlag.WORLD_BORDER_SIZE); + } + @Contract(pure = true) public @NotNull WorldBorder withDiameter(double diameter) { return new WorldBorder(diameter, centerX, centerZ, warningDistance, warningTime, dimensionTeleportBoundary);