Included content
| Name | |
|---|---|
User Changes:
?. and ? null safe operators.
?. Used on structures. Same as ., but returns null if there's no such field in structure.? Used with anything that can be null. Returns the right operand if left is null or left if not.These operators allow you to quickly check for nulls in your expressions. Let's image a situation like this:
You have a variable struct.x which might not exist and maybe null. Before, you'd have to write something like this:
if(structContainsKey(struct, 'x') && struct.x != null, struct.x, valueElse())'
Now this can be shortened to: struct?.x ? valueElse(). Do note that ? has a very low precedence, so in ambiguous cases you'll have to wrap it in parentheses. e.g. 23 + struct?.x ? 23 -> 23 + (struct?.x ? 23).
Optionals are now unwrapped in expressions.Identifiers are now converted to strings in expressions.Dev Changes:
equals on CustomDataAccessors.LootContext as an argument for the CustomFields#addVirtualField function.Other Changes:
| Name | |
|---|---|
| File | Type | Size | |
|---|---|---|---|
| commander-0.8.0-1.21-build.22-sources.jar | Unknown | 101.63 KiB |
Projects on Modrinth are automatically available through a Maven repository for use with JVM build tools such as Gradle. To learn more about the Modrinth Maven API, click here.
Note: When available, you should use the creator's maven repo instead as it will have transitive dependency information that the Modrinth Maven API does not. You may also end up with duplicate dependencies if you use a mix of Modrinth and non-Modrinth Maven repositories for your dependencies, because the group identifier will be different when served through the Modrinth Maven API.
repositories {
exclusiveContent {
forRepository {
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
}
}
// forRepositories(fg.repository) // Uncomment when using ForgeGradle
filter {
includeGroup "maven.modrinth"
}
}
}
// Standard Gradle dependency
dependencies {
implementation "maven.modrinth:86bUtxWv:BU0JfrKI"
}
// Legacy Loom dependency
dependencies {
modImplementation "maven.modrinth:86bUtxWv:BU0JfrKI"
}