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