Skip to content

Commit c68b58c

Browse files
authored
Bump minimum Minecraft version to 26.1-snapshot-1 (#198)
1 parent 607ae1d commit c68b58c

File tree

3 files changed

+9
-13
lines changed

3 files changed

+9
-13
lines changed

subprojects/gradle-plugin/src/main/java/org/spongepowered/gradle/vanilla/VanillaGradle.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,14 @@ private void applyToProject(final Project project) {
106106
this.createDisplayMinecraftVersions(project.getPlugins().getPlugin(MinecraftRepositoryPlugin.class).service(), project.getTasks());
107107
project.afterEvaluate(p -> {
108108
if (minecraft.targetVersion().isPresent()) {
109+
if (minecraft.targetVersion().get().releaseTime().toInstant().isBefore(Constants.MIN_MC_VERSION_TIMESTAMP)) {
110+
throw new GradleException(String.format("The targeted version '%s' is older than the minimum supported version '%s'.", minecraft.version().get(), Constants.MIN_MC_VERSION_NAME));
111+
}
109112
p.getLogger().lifecycle(String.format("Targeting Minecraft '%s' on a '%s' platform", minecraft.version().get(),
110113
minecraft.platform().get().name()
111114
));
112115
} else {
113-
throw new GradleException("No minecraft version has been set! Did you set the version() property in the 'minecraft' extension");
116+
throw new GradleException("No Minecraft version has been set! Did you set the version() property in the 'minecraft' extension");
114117
}
115118

116119
this.configureIDEIntegrations(

subprojects/gradle-plugin/src/main/java/org/spongepowered/gradle/vanilla/internal/Constants.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333

3434
import java.nio.file.Path;
3535
import java.nio.file.Paths;
36+
import java.time.Instant;
37+
import java.time.format.DateTimeFormatter;
3638
import java.util.Arrays;
3739
import java.util.Collections;
3840
import java.util.HashSet;
@@ -49,8 +51,8 @@ public final class Constants {
4951
public static final String MINECRAFT_RESOURCES_HOST = "resources.download.minecraft.net";
5052
public static final String TASK_GROUP = "vanilla gradle";
5153
public static final int ASM_VERSION = Opcodes.ASM9;
52-
public static final String FIRST_TARGETABLE_RELEASE_TIMESTAMP = "2019-09-04T11:19:34+00:00"; // 19w36a+
53-
public static final String OUT_OF_BAND_RELEASE = "1.14.4"; // Cause it is special
54+
public static final Instant MIN_MC_VERSION_TIMESTAMP = Instant.from(DateTimeFormatter.ISO_DATE_TIME.parse("2025-12-16T12:42:29+00:00"));
55+
public static final String MIN_MC_VERSION_NAME = "26.1-snapshot-1";
5456
public static final String INDENT = " "; // indent to use when writing files
5557

5658
public static final class Directories {

subprojects/gradle-plugin/src/main/java/org/spongepowered/gradle/vanilla/task/DisplayMinecraftVersionsTask.java

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@
3232
import org.spongepowered.gradle.vanilla.internal.model.VersionDescriptor;
3333
import org.spongepowered.gradle.vanilla.internal.repository.MinecraftProviderService;
3434

35-
import java.time.Instant;
36-
import java.time.format.DateTimeFormatter;
37-
import java.util.Date;
3835
import java.util.concurrent.ExecutionException;
3936

4037
public abstract class DisplayMinecraftVersionsTask extends DefaultTask {
@@ -45,17 +42,11 @@ public abstract class DisplayMinecraftVersionsTask extends DefaultTask {
4542
@TaskAction
4643
public void execute() throws ExecutionException, InterruptedException {
4744
// It is ugly to hardcode the bottom limit but if we don't we'll have to download EACH VERSION to know what we can target!
48-
final DateTimeFormatter formatter = DateTimeFormatter.ISO_DATE_TIME;
49-
final Date earliestDate = Date.from(Instant.from(formatter.parse(Constants.FIRST_TARGETABLE_RELEASE_TIMESTAMP)));
50-
5145
for (final VersionDescriptor version : this.getMinecraftProvider().get().versions().availableVersions().get()) {
52-
final Date versionDate = Date.from(version.releaseTime().toInstant());
53-
if (versionDate.before(earliestDate)) {
46+
if (version.releaseTime().toInstant().isBefore(Constants.MIN_MC_VERSION_TIMESTAMP)) {
5447
continue;
5548
}
5649
this.getLogger().lifecycle(version.id());
5750
}
58-
59-
this.getLogger().lifecycle(Constants.OUT_OF_BAND_RELEASE);
6051
}
6152
}

0 commit comments

Comments
 (0)