Tags
Creators
Details
Licensed GPL-3.0-only
Published 3 months ago
Updated 2 days ago
All versions
1.3.0
Release
1.3.0 Feature and major patch releaselast month 8
Compatibility
Minecraft: Java Edition
26.2
26.1.x
1.21.11
Platforms
Paper
Purpur
Changes
(Warning) Breaking changes:
- Class hints have been completely removed in this update because they were not an elegant solution and were made much less useful by the type changes in this update. As well as increasing parsing complexity a lot for a feature designed for a fairly niche scenario.
- The user pattern for non-typed instances was changed to
instance. This was necessary to fix a bug with typed expressions not converting. Additionally concrete types are no longer required to be in proper case (although this is still good practice). Keep in mind it may not immediately error sinceclass instancenow matches asinstance of type 'class'.
Improvements
- Concrete types rework.
TypedInstanceWrapperis no longer a thing. Instances now exist as a direct subclass ofClassInstance.- This will improve performance for typed function arguments as it no longer needs to wrap and unwrap through converters. It should generally be on par with non-typed class arguments.
- As a result of this change, the
[un]typed %classinstance%expression has been removed as it no longer serves a purpose. - An instance's type can now be inferred from the input expressions return type allowing for more accurate parsing if type hints are enabled or the input naturally reports typed class information. This should also make call chains much more reliable.
- Method arguments can now be marked optional by adding a
?to the end of the argument name. For example inpublic example(arg1?: int), 'arg1' will be not be set if not specified by the caller. - Static / non-static methods with the same signature can now co-exist on the same class.
- Static constant fields are now re-evaluated each time the script reloads.
Changes/Bugfixes
- Default value parsing for methods and fields is now delayed until the pre-load stage. This should allow you to reliably reference other classes/functions as default values.
- Significantly cleaned up field & serialization code. Fields no longer have their own signature data, instead it always refers to the class structure. If that field no longer exists on the class it isn't accessible on instances through normal means.
- Optimized method call caching. If a method was already figured out at parse-time it is not re-validated at runtime. Runtime re-validation now only occurs when the class of the given instance is different from the last cached method.
- Changed the
new instancesection logic to support proper section claiming which allows method chaining on newly created instances, useful for builder-like classes. This also applies to any section-expression parsing throughout the addon.set {_item} to new ItemBuilder::build(): item: diamond name: "test"
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.
Maven coordinates:
Version ID:
build.gradle:
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:DL6BwgfK:wljXMhFK"
}
// Legacy Loom dependency
dependencies {
modImplementation "maven.modrinth:DL6BwgfK:wljXMhFK"
}
