更新 mod_data.txt (#4040)

This commit is contained in:
Glavo 2025-06-29 04:07:48 +08:00 committed by GitHub
parent 432465ab46
commit ea6eced136
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2860 additions and 675 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,20 @@
/*
* Hello Minecraft! Launcher
* Copyright (C) 2025 huangyuhui <huanghongxun2008@126.com> and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package org.jackhuang.hmcl.gradle.mod;
import com.google.gson.*;
@ -24,6 +41,9 @@ import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* @author Glavo
*/
public abstract class ParseModDataTask extends DefaultTask {
@InputFile
@ -44,15 +64,12 @@ public abstract class ParseModDataTask extends DefaultTask {
Pattern.compile("^/projects/(?<modid>[\\w-]+)(/(.*?))?$"),
Pattern.compile("^/mc-mods/minecraft/(?<modid>[\\w-]+)(/(.*?))?$"),
Pattern.compile("^/legacy/mc-mods/minecraft/(\\d+)-(?<modid>[\\w-]+)"),
Pattern.compile("^//minecraft/mc-mods/(?<modid>eyes-mod)$") // Workaround for Eye Blocks
};
private static String parseCurseforge(String url) {
URI res = URI.create(url);
if (!"http".equals(res.getScheme())
&& !"https".equals(res.getScheme())
&& !"www.curseforge.com".equals(res.getHost())) { // Workaround for DakerACG
if (!"http".equals(res.getScheme()) && !"https".equals(res.getScheme())) {
return "";
}
@ -77,10 +94,10 @@ public abstract class ParseModDataTask extends DefaultTask {
return "";
}
private static final Set<String> skip = new HashSet<>(Arrays.asList(
private static final Set<String> skip = Set.of(
"Minecraft",
"The Building Game"
));
);
@TaskAction
public void run() throws IOException {