@@ -32,7 +32,7 @@ public ResourcePackConverter(List<ResourcePack> resourcePack, String filename) {
3232 this .tmpFilePath = FileUtil .getTemporaryPath (filename );
3333 }
3434
35- public void convert (int packFormat , Integer minFormat , Integer maxFormat , String description ) throws Exception {
35+ public void convert (Integer packFormat , Integer minFormat , Integer maxFormat , String description ) throws Exception {
3636 Set <String > fileList = new HashSet <>();
3737 try (ZipOutputStream zos = new ZipOutputStream (
3838 Files .newOutputStream (tmpFilePath ),
@@ -74,13 +74,13 @@ public void convert(int packFormat, Integer minFormat, Integer maxFormat, String
7474 }
7575 }
7676
77- private byte [] convertPackMeta (InputStream is , int packFormat , Integer minFormat , Integer maxFormat , String description ) {
77+ private byte [] convertPackMeta (InputStream is , Integer packFormat , Integer minFormat , Integer maxFormat , String description ) {
7878 PackMeta meta = GSON .fromJson (new InputStreamReader (is , StandardCharsets .UTF_8 ), PackMeta .class );
79- // 从 pack_format 69 ( 1.21.9) 开始,只用 min_format/max_format,不再使用 pack_format
80- if (packFormat >= 69 ) {
79+ // 1.21.9+ 使用 min_format/max_format,不再使用 pack_format
80+ if (minFormat != null && maxFormat != null ) {
8181 meta .pack .pack_format = null ;
82- meta .pack .min_format = minFormat != null ? minFormat : packFormat ;
83- meta .pack .max_format = maxFormat != null ? maxFormat : packFormat ;
82+ meta .pack .min_format = minFormat ;
83+ meta .pack .max_format = maxFormat ;
8484 } else {
8585 meta .pack .pack_format = packFormat ;
8686 meta .pack .min_format = null ;
0 commit comments