An educated guess to fix Git branch

This commit is contained in:
Camotoy 2022-09-18 15:40:44 -04:00
parent f71fa9ccac
commit 44e60b7ad8
No known key found for this signature in database
GPG Key ID: 7EEFB66FE798081F
7 changed files with 18 additions and 6 deletions

View File

@ -4,4 +4,5 @@ dependencies {
exclude(group = "com.google.guava", module = "guava") exclude(group = "com.google.guava", module = "guava")
exclude(group = "org.lanternpowered", module = "lmbda") exclude(group = "org.lanternpowered", module = "lmbda")
} }
compileOnlyApi("org.jetbrains", "annotations", "23.0.0")
} }

View File

@ -25,13 +25,14 @@
package org.geysermc.geyser.api.command; package org.geysermc.geyser.api.command;
import org.checkerframework.checker.nullness.qual.NonNull;
/** /**
* Handles executing a command. * Handles executing a command.
* *
* @param <T> the command source * @param <T> the command source
*/ */
public interface CommandExecutor<T extends CommandSource> { public interface CommandExecutor<T extends CommandSource> {
/** /**
* Executes the given {@link Command} with the given * Executes the given {@link Command} with the given
* {@link CommandSource}. * {@link CommandSource}.
@ -40,5 +41,5 @@ public interface CommandExecutor<T extends CommandSource> {
* @param command the command * @param command the command
* @param args the arguments * @param args the arguments
*/ */
void execute(T source, Command command, String[] args); void execute(@NonNull T source, @NonNull Command command, @NonNull String[] args);
} }

View File

@ -25,6 +25,8 @@
package org.geysermc.geyser.api.command; package org.geysermc.geyser.api.command;
import org.checkerframework.checker.nullness.qual.NonNull;
/** /**
* Represents an instance capable of sending commands. * Represents an instance capable of sending commands.
*/ */
@ -42,7 +44,7 @@ public interface CommandSource {
* *
* @param message the message to send * @param message the message to send
*/ */
void sendMessage(String message); void sendMessage(@NonNull String message);
/** /**
* Sends the given messages to the command source * Sends the given messages to the command source
@ -58,7 +60,7 @@ public interface CommandSource {
/** /**
* If this source is the console. * If this source is the console.
* *
* @return true if this source is the console * @return true if this source is the console
*/ */
boolean isConsole(); boolean isConsole();

View File

@ -25,6 +25,7 @@
package org.geysermc.geyser.api.event; package org.geysermc.geyser.api.event;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.geysermc.geyser.api.GeyserApi; import org.geysermc.geyser.api.GeyserApi;
/** /**
@ -39,7 +40,8 @@ public interface EventRegistrar {
* @param object the object to wrap around * @param object the object to wrap around
* @return an event registrar instance * @return an event registrar instance
*/ */
static EventRegistrar of(Object object) { @NonNull
static EventRegistrar of(@NonNull Object object) {
return GeyserApi.api().provider(EventRegistrar.class, object); return GeyserApi.api().provider(EventRegistrar.class, object);
} }
} }

View File

@ -25,6 +25,8 @@
package org.geysermc.geyser.api.network; package org.geysermc.geyser.api.network;
import org.checkerframework.checker.nullness.qual.NonNull;
/** /**
* The listener that handles connections from Minecraft: * The listener that handles connections from Minecraft:
* Bedrock Edition. * Bedrock Edition.
@ -37,6 +39,7 @@ public interface BedrockListener {
* *
* @return the listening address * @return the listening address
*/ */
@NonNull
String address(); String address();
/** /**

View File

@ -25,6 +25,8 @@
package org.geysermc.geyser.api.network; package org.geysermc.geyser.api.network;
import org.jetbrains.annotations.NotNull;
/** /**
* Represents the Java server that Geyser is connecting to. * Represents the Java server that Geyser is connecting to.
*/ */
@ -63,5 +65,6 @@ public interface RemoteServer {
* *
* @return the auth type required by the remote server * @return the auth type required by the remote server
*/ */
@NotNull
AuthType authType(); AuthType authType();
} }

View File

@ -84,7 +84,7 @@ configure<BlossomExtension> {
val mainFile = "src/main/java/org/geysermc/geyser/GeyserImpl.java" val mainFile = "src/main/java/org/geysermc/geyser/GeyserImpl.java"
// On Jenkins, a detached head is checked out, so indra cannot determine the branch. Fortunately, this environment variable is available. // On Jenkins, a detached head is checked out, so indra cannot determine the branch. Fortunately, this environment variable is available.
val branchName = indra.branchName() ?: System.getenv("GIT_BRANCH") ?: "DEV" val branchName = indra.branchName() ?: System.getenv("BRANCH") ?: "DEV"
val commit = indra.commit() val commit = indra.commit()
val git = indra.git() val git = indra.git()
val gitVersion = "git-${branchName}-${commit?.name?.substring(0, 7) ?: "0000000"}" val gitVersion = "git-${branchName}-${commit?.name?.substring(0, 7) ?: "0000000"}"