mirror of
https://github.com/Xiao-MoMi/craft-engine.git
synced 2025-12-20 15:39:22 +00:00
修复65版本陷阱
This commit is contained in:
@@ -865,10 +865,12 @@ public abstract class AbstractPackManager implements PackManager {
|
|||||||
}
|
}
|
||||||
for (Revision revision : revisions) {
|
for (Revision revision : revisions) {
|
||||||
JsonObject entry = new JsonObject();
|
JsonObject entry = new JsonObject();
|
||||||
|
if (revision.minPackVersion().major() < 65) {
|
||||||
JsonArray formatsArray = new JsonArray();
|
JsonArray formatsArray = new JsonArray();
|
||||||
entry.add("formats", formatsArray);
|
entry.add("formats", formatsArray);
|
||||||
formatsArray.add(revision.minPackVersion().major());
|
formatsArray.add(revision.minPackVersion().major());
|
||||||
formatsArray.add(revision.maxPackVersion().major());
|
formatsArray.add(revision.maxPackVersion().major());
|
||||||
|
}
|
||||||
entry.add("min_format", revision.minPackVersion().getAsJsonArray());
|
entry.add("min_format", revision.minPackVersion().getAsJsonArray());
|
||||||
entry.add("max_format", revision.maxPackVersion().getAsJsonArray());
|
entry.add("max_format", revision.maxPackVersion().getAsJsonArray());
|
||||||
entry.addProperty("directory", Config.createOverlayFolderName(revision.versionString()));
|
entry.addProperty("directory", Config.createOverlayFolderName(revision.versionString()));
|
||||||
|
|||||||
@@ -165,11 +165,14 @@ public class ResolutionMergePackMcMeta implements Resolution {
|
|||||||
Pair<PackVersion, PackVersion> supportedVersions = getSupportedVersions(entryJson);
|
Pair<PackVersion, PackVersion> supportedVersions = getSupportedVersions(entryJson);
|
||||||
PackVersion min = PackVersion.getHigher(supportedVersions.left(), PackVersion.MIN_OVERLAY_VERSION);
|
PackVersion min = PackVersion.getHigher(supportedVersions.left(), PackVersion.MIN_OVERLAY_VERSION);
|
||||||
PackVersion max = PackVersion.getHigher(supportedVersions.right(), PackVersion.MIN_OVERLAY_VERSION);
|
PackVersion max = PackVersion.getHigher(supportedVersions.right(), PackVersion.MIN_OVERLAY_VERSION);
|
||||||
|
// https://minecraft.wiki/w/Java_Edition_25w31a
|
||||||
|
if (min.major() < 65) {
|
||||||
// 旧版格式支持
|
// 旧版格式支持
|
||||||
JsonArray supportedFormats = new JsonArray();
|
JsonArray supportedFormats = new JsonArray();
|
||||||
supportedFormats.add(min.major());
|
supportedFormats.add(min.major());
|
||||||
supportedFormats.add(max.major());
|
supportedFormats.add(max.major());
|
||||||
entryJson.add("formats", supportedFormats);
|
entryJson.add("formats", supportedFormats);
|
||||||
|
}
|
||||||
// 新版格式支持
|
// 新版格式支持
|
||||||
JsonArray minFormat = new JsonArray();
|
JsonArray minFormat = new JsonArray();
|
||||||
minFormat.add(min.major());
|
minFormat.add(min.major());
|
||||||
|
|||||||
@@ -52,10 +52,12 @@ public class Overlay {
|
|||||||
maxFormat.add(new JsonPrimitive(this.maxVersion.major()));
|
maxFormat.add(new JsonPrimitive(this.maxVersion.major()));
|
||||||
maxFormat.add(new JsonPrimitive(this.maxVersion.minor()));
|
maxFormat.add(new JsonPrimitive(this.maxVersion.minor()));
|
||||||
entry.add("max_format", maxFormat);
|
entry.add("max_format", maxFormat);
|
||||||
|
if (this.minVersion.major() < 65) {
|
||||||
JsonArray formats = new JsonArray();
|
JsonArray formats = new JsonArray();
|
||||||
formats.add(new JsonPrimitive(this.minVersion.major()));
|
formats.add(new JsonPrimitive(this.minVersion.major()));
|
||||||
formats.add(new JsonPrimitive(this.maxVersion.major()));
|
formats.add(new JsonPrimitive(this.maxVersion.major()));
|
||||||
entry.add("formats", formats);
|
entry.add("formats", formats);
|
||||||
|
}
|
||||||
return entry;
|
return entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user