feat: cya later jitpack

This commit is contained in:
mworzala 2024-05-27 20:29:32 -04:00 committed by Matt Worzala
parent c185337cb4
commit 5182f19dd7
3 changed files with 8 additions and 3 deletions

View File

@ -13,7 +13,7 @@ plugins {
version = System.getenv("MINESTOM_VERSION") ?: "dev" version = System.getenv("MINESTOM_VERSION") ?: "dev"
val channel = System.getenv("MINESTOM_CHANNEL") ?: "local" // local, snapshot, release 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 { allprojects {
apply(plugin = "java") apply(plugin = "java")
@ -24,7 +24,6 @@ allprojects {
repositories { repositories {
mavenCentral() mavenCentral()
maven(url = "https://jitpack.io")
} }
configurations.all { configurations.all {

View File

@ -80,6 +80,7 @@ public class Main {
commandManager.register(new WeatherCommand()); commandManager.register(new WeatherCommand());
commandManager.register(new PotionCommand()); commandManager.register(new PotionCommand());
commandManager.register(new CookieCommand()); commandManager.register(new CookieCommand());
commandManager.register(new WorldBorderCommand());
commandManager.setUnknownCommandCallback((sender, command) -> sender.sendMessage(Component.text("Unknown command", NamedTextColor.RED))); commandManager.setUnknownCommandCallback((sender, command) -> sender.sendMessage(Component.text("Unknown command", NamedTextColor.RED)));

View File

@ -20,7 +20,8 @@ import org.jetbrains.annotations.NotNull;
* @param warningTime the length of time the warning indicator * @param warningTime the length of time the warning indicator
* is displayed * is displayed
* @param dimensionTeleportBoundary restricts the distance travelled when entering * @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 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); 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"); 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) @Contract(pure = true)
public @NotNull WorldBorder withDiameter(double diameter) { public @NotNull WorldBorder withDiameter(double diameter) {
return new WorldBorder(diameter, centerX, centerZ, warningDistance, warningTime, dimensionTeleportBoundary); return new WorldBorder(diameter, centerX, centerZ, warningDistance, warningTime, dimensionTeleportBoundary);