Skip to content

Commit

Permalink
Fix regression in behavior of NeoFormRuntimeSpecification#getNeoFormV…
Browse files Browse the repository at this point in the history
…ersion (#123)
  • Loading branch information
lukebemish committed Feb 27, 2024
1 parent da5be81 commit 6b4435a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import org.jetbrains.annotations.NotNull;
interface NeoFormSpecification extends Specification {

/**
* The version of NeoForm that shall be used.
* The version of NeoForm that shall be used. Does not include the minecraft version as a prefix, unlike
* {@link Specification#getVersion()}.
*
* @return The NeoForm version.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ private static Optional<DependencyReplacementResult> replaceDependency(Context c
runtime.getSourceJarTask(),
runtime.getRawJarTask(),
runtime.getMinecraftDependenciesConfiguration(),
builder -> builder.setVersion(runtime.getSpecification().getNeoFormVersion()),
builder -> builder.setVersion(runtime.getSpecification().getNeoFormVersion()),
builder -> builder.setVersion(runtime.getSpecification().getVersion()),
builder -> builder.setVersion(runtime.getSpecification().getVersion()),
runtime::setReplacedDependency,
runtime::onRepoWritten,
Sets::newHashSet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ public NeoFormConfigConfigurationSpecV2 getConfig() {
public String getMinecraftVersion() {
return config.getVersion();
}

public String getNeoFormVersion() {
return getVersion();
return getVersion().substring(getVersion().lastIndexOf("-") + 1);
}

public File getNeoFormArchive() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public void runtime(final String neoFormVersion, Directory patches, Directory re
});
// The NeoForm version that's passed into this method can be a version range or '+', but to build userdev and installer profiles safely,
// we need the actual version it was resolved to. Otherwise the NeoForm version used by installer & userdev could change over time.
String neoformDependency = "net.neoforged:neoform:" + neoFormRuntimeDefinition.getSpecification().getNeoFormVersion() + "@zip";
String neoformDependency = "net.neoforged:neoform:" + neoFormRuntimeDefinition.getSpecification().getVersion() + "@zip";

final RuntimeDevRuntimeExtension runtimeDevRuntimeExtension = project.getExtensions().getByType(RuntimeDevRuntimeExtension.class);
final RuntimeDevRuntimeDefinition runtimeDefinition = runtimeDevRuntimeExtension.create(builder -> {
Expand Down

0 comments on commit 6b4435a

Please sign in to comment.