Skip to content

Commit 787d91e

Browse files
committed
Update indra to v4
1 parent 3b276e8 commit 787d91e

File tree

6 files changed

+10
-7
lines changed

6 files changed

+10
-7
lines changed

api/src/main/java/net/draycia/carbon/api/CarbonChat.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@
3030
* The {@link CarbonChat} interface is the gateway to interacting with the majority of the CarbonChat API.
3131
*
3232
* <p>Instances may be obtained through {@link CarbonChatProvider#carbonChat()} once Carbon is loaded.</p>
33+
*
3334
* <p>On most platforms, you should use the provided load order mechanism to ensure your addon loads after
3435
* Carbon.</p>
36+
*
3537
* <p>On Fabric, use the {@code carbonchat} entrypoint (type: {@code Consumer<CarbonChat>}) to have a callback
3638
* when Carbon is loaded.</p>
3739
*

api/src/main/java/net/draycia/carbon/api/users/CarbonPlayer.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ public interface CarbonPlayer extends Audience, Identified {
110110
* Sets the player's nickname.
111111
*
112112
* <p>Setting {@code null} will remove any current nickname.</p>
113+
*
113114
* <p>Won't have any visible effect when Carbon's nickname management is disabled.</p>
114115
*
115116
* @param nickname the new nickname

api/src/main/java/net/draycia/carbon/api/users/UserManager.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ public interface UserManager<C extends CarbonPlayer> {
5151
* Create a new {@link Party} with the specified name.
5252
*
5353
* <p>Parties with no users will not be saved. Use {@link Party#disband()} to discard.</p>
54+
*
5455
* <p>The returned reference will expire after one minute, store {@link Party#id()} rather than the instance and use {@link #party(UUID)} to retrieve.</p>
5556
*
5657
* @param name party name
@@ -63,6 +64,7 @@ public interface UserManager<C extends CarbonPlayer> {
6364
* Look up an existing party by its id.
6465
*
6566
* <p>As parties that have never had a user are not saved, they are not retrievable here.</p>
67+
*
6668
* <p>The returned reference will expire after one minute, do not cache it. The implementation handles caching as is appropriate.</p>
6769
*
6870
* @param id party id

build-logic/src/main/kotlin/extensions.kt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
22
import net.kyori.indra.git.IndraGitExtension
33
import org.apache.tools.ant.filters.ReplaceTokens
4-
import org.eclipse.jgit.lib.Repository
54
import org.gradle.accessors.dm.LibrariesForLibs
65
import org.gradle.api.Project
76
import org.gradle.api.Task
@@ -100,7 +99,7 @@ fun ShadowJar.configureShadowJar() {
10099
}
101100

102101
fun Project.lastCommitHash(): String =
103-
the<IndraGitExtension>().commit()?.name?.substring(0, 7)
102+
the<IndraGitExtension>().commit().orNull?.name?.substring(0, 7)
104103
?: error("Could not determine commit hash")
105104

106105
fun Project.decorateVersion() {
@@ -120,10 +119,7 @@ fun Project.currentBranch(): String {
120119

121120
val indraGit = the<IndraGitExtension>().takeIf { it.isPresent }
122121

123-
val ref = indraGit?.git()?.repository?.exactRef("HEAD")?.target
124-
?: return "detached-head"
125-
126-
return Repository.shortenRefName(ref.name)
122+
return indraGit?.branchName()?.orNull ?: "detached-head"
127123
}
128124

129125
val Project.libs: LibrariesForLibs

common/src/main/java/net/draycia/carbon/common/util/FileUtil.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ public static String hashString(final Path file) throws IOException {
5454
* Lists directory entries in {@code path}.
5555
*
5656
* <p>If {@code path} does not exist, returns an empty list.</p>
57+
*
5758
* <p>If {@code path} exists, but is not a directory, throws {@link IllegalArgumentException}</p>
5859
*
5960
* @param path directory
@@ -69,6 +70,7 @@ public static List<Path> listDirectoryEntries(final Path path) {
6970
* Lists directory entries in {@code path} matching {@code glob}.
7071
*
7172
* <p>If {@code path} does not exist, returns an empty list.</p>
73+
*
7274
* <p>If {@code path} exists, but is not a directory, throws {@link IllegalArgumentException}</p>
7375
*
7476
* @param path directory

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ resource-factory-velocity-convention = { id = "xyz.jpenilla.resource-factory-vel
1010
resource-factory-fabric-convention = { id = "xyz.jpenilla.resource-factory-fabric-convention", version.ref = "resource-factory" }
1111

1212
[versions]
13-
indra = "3.2.0"
13+
indra = "4.0.0"
1414
cloud-build-logic = "0.0.17"
1515
shadow = "9.2.2"
1616
mod-publish-plugin = "1.0.0"

0 commit comments

Comments
 (0)